Version: 2.2.2 (using KDE 4.4.1) OS: Linux Installed from: Archlinux Packages In the Media Sources view the bookmarks dont save the status of the "show years" and "show covers" options. Everything else is saved and restored correctly.
commit 70c304a416adf93770eeb586037d06554cf74a84 Author: Nikolaj Hald Nielsen <nhn@kde.org> Date: Mon Mar 15 13:20:53 2010 +0100 When bookmarking a view in the local collection category, also store (and restore when the bookmark is activated) the state of "show cover" and "show year" BUG: 230562 diff --git a/src/amarokurls/NavigationUrlGenerator.cpp b/src/amarokurls/NavigationUrlGenerator.cpp index 5e75a16..e38a947 100644 --- a/src/amarokurls/NavigationUrlGenerator.cpp +++ b/src/amarokurls/NavigationUrlGenerator.cpp @@ -15,6 +15,7 @@ ****************************************************************************************/ #include "NavigationUrlGenerator.h" +#include <amarokconfig.h> #include "AmarokUrl.h" #include "AmarokUrlHandler.h" #include "Debug.h" @@ -103,6 +104,23 @@ AmarokUrl NavigationUrlGenerator::CreateAmarokUrl() url.appendArg( "levels", sortMode ); + //if in the local collection view, also store "show covers" and "show years" + if( url.path().endsWith( "collections", Qt::CaseInsensitive ) ) + { + debug() << "bookmarking in local collection"; + + if( AmarokConfig::showAlbumArt() ) + url.appendArg( "show_cover", "true" ); + else + url.appendArg( "show_cover", "false" ); + + if( AmarokConfig::showYears() ) + url.appendArg( "show_years", "true" ); + else + url.appendArg( "show_years", "false" ); + } + + //come up with a default name for this url.. QString name = The::mainWindow()->browserWidget()->list()->activeCategoryRecursive()->prettyName(); url.setName( name ); diff --git a/src/amarokurls/NavigationUrlRunner.cpp b/src/amarokurls/NavigationUrlRunner.cpp index a5f3b8d..cff35b6 100644 --- a/src/amarokurls/NavigationUrlRunner.cpp +++ b/src/amarokurls/NavigationUrlRunner.cpp @@ -16,6 +16,7 @@ #include "NavigationUrlRunner.h" +#include <amarokconfig.h> #include "Debug.h" #include "AmarokUrlHandler.h" @@ -75,6 +76,28 @@ NavigationUrlRunner::run( AmarokUrl url ) } + + //if we are activating the local collection, check if we need to restore "show cover" and "show year" + //if in the local collection view, also store "show covers" and "show years" + if( url.path().endsWith( "collections", Qt::CaseInsensitive ) ) + { + if ( args.keys().contains( "show_cover" ) ) + { + if( args.value( "show_cover" ).compare( "true", Qt::CaseInsensitive ) == 0 ) + AmarokConfig::setShowAlbumArt( true ); + else if( args.value( "show_cover" ).compare( "false", Qt::CaseInsensitive ) == 0 ) + AmarokConfig::setShowAlbumArt( false ); + } + + if ( args.keys().contains( "show_years" ) ) + { + if( args.value( "show_years" ).compare( "true", Qt::CaseInsensitive ) == 0 ) + AmarokConfig::setShowYears( true ); + else if( args.value( "show_years" ).compare( "false", Qt::CaseInsensitive ) == 0 ) + AmarokConfig::setShowYears( false ); + } + } + if ( args.keys().contains( "filter" ) ) active->setFilter( args.value( "filter" ) );