| Summary: | Add support for Undo/Redo across sessions | ||
|---|---|---|---|
| Product: | [Applications] amarok | Reporter: | Arend van Beelen jr. <arendjr> |
| Component: | Playlists/Saved Playlists | Assignee: | Amarok Bugs <amarok-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | wishlist | ||
| Priority: | NOR | ||
| Version First Reported In: | 1.4.0 | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Arend van Beelen jr.
2006-07-19 15:14:02 UTC
I agree, this would be a good feature. I'm missing it too. SVN commit 582462 by seb:
Add support for Undo/Redo across sessions
FEATURE: 131072
M +1 -0 ChangeLog
M +10 -6 src/playlist.cpp
--- trunk/extragear/multimedia/amarok/ChangeLog #582461:582462
@@ -4,6 +4,7 @@
VERSION 1.4.4
FEATURES:
+ * Undo/Redo functionality is now available over sessions. (BR 131072)
* Allow the creation of empty playlists in the playlist browser. Available
either from the Add button in the toolbar or the context menu of a
playlist folder. (BR 133543)
--- trunk/extragear/multimedia/amarok/src/playlist.cpp #582461:582462
@@ -371,7 +371,16 @@
connect( ac->action( "favor_tracks" ), SIGNAL( activated( int ) ), SLOT( generateInfo() ) );
connect( ac->action( "random_mode" ), SIGNAL( activated( int ) ), SLOT( generateInfo() ) );
- m_undoButton->setEnabled( false );
+
+ // undostates are written in chronological order, so this is a clever way to get them back in the correct order :)
+ QStringList undos = m_undoDir.entryList( QString("*.xml"), QDir::Files, QDir::Time );
+
+ foreach( undos )
+ m_undoList.append( m_undoDir.absPath() + "/" + (*it) );
+
+ m_undoCounter = m_undoList.count();
+
+ m_undoButton->setEnabled( !m_undoList.isEmpty() );
m_redoButton->setEnabled( false );
engineStateChanged( EngineController::engine()->state() ); //initialise state of UI
@@ -423,11 +432,6 @@
if( AmarokConfig::savePlaylist() ) saveXML( defaultPlaylistPath() );
- //clean undo directory
- QStringList list = m_undoDir.entryList();
- for( QStringList::ConstIterator it = list.constBegin(), end = list.constEnd(); it != end; ++it )
- m_undoDir.remove( *it );
-
//speed up quit a little
safeClear(); //our implementation is slow
Amarok::ToolTip::remove( viewport() );
|