From 18eae929ad107a1e10fcb8d8fb7ef8fd9c435af3 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Wed, 16 Jul 2008 21:24:44 +0000 Subject: [PATCH] fixed "Cut"-action on TCOs (closes #2016731) git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1310 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 6 ++++++ include/track.h | 3 +-- src/core/track.cpp | 30 +++++++++++++++--------------- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index c485666fd..904d3487b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-07-16 Tobias Doerffel + + * include/track.h: + * src/core/track.cpp: + fixed "Cut"-action on TCOs (closes #2016731) + 2008-07-12 Tobias Doerffel * src/core/config_mgr.cpp: diff --git a/include/track.h b/include/track.h index 0f92d8b4e..fb3647444 100644 --- a/include/track.h +++ b/include/track.h @@ -118,7 +118,6 @@ protected: protected slots: - void cut( void ); void copy( void ); void paste( void ); void toggleMute( void ); @@ -170,9 +169,9 @@ public: public slots: virtual bool close( void ); + void cut( void ); void remove( void ); - protected: virtual void constructContextMenu( QMenu * ) { diff --git a/src/core/track.cpp b/src/core/track.cpp index 603a9a89b..3f3fc5d65 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -232,20 +232,6 @@ void trackContentObject::redoStep( journalEntry & _je ) -/*! \brief Cut this trackContentObject from its track to the clipboard. - * - * Perform the 'cut' action of the clipboard - copies the track content - * object to the clipboard and then removes it from the track. - */ -void trackContentObject::cut( void ) -{ - copy(); - deleteLater(); -} - - - - /*! \brief Copy this trackContentObject to the clipboard. * * Copies this track content object to the clipboard. @@ -413,6 +399,20 @@ void trackContentObjectView::remove( void ) +/*! \brief Cut this trackContentObjectView from its track to the clipboard. + * + * Perform the 'cut' action of the clipboard - copies the track content + * object to the clipboard and then removes it from the track. + */ +void trackContentObjectView::cut( void ) +{ + m_tco->copy(); + remove(); +} + + + + /*! \brief Updates a trackContentObjectView's length * * If this track content object view has a fixed TCO, then we must @@ -807,7 +807,7 @@ void trackContentObjectView::contextMenuEvent( QContextMenuEvent * _cme ) this, SLOT( remove() ) ); contextMenu.addSeparator(); contextMenu.addAction( embed::getIconPixmap( "edit_cut" ), - tr( "Cut" ), m_tco, SLOT( cut() ) ); + tr( "Cut" ), this, SLOT( cut() ) ); } contextMenu.addAction( embed::getIconPixmap( "edit_copy" ), tr( "Copy" ), m_tco, SLOT( copy() ) );