Summary: | automatically change directory if directory doesn't exist anymore | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | p <peter.mueller_1955> |
Component: | File Browser | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | 2.3.0 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Unspecified | ||
Latest Commit: | Version Fixed In: | 2.3.2 |
Description
p
2010-04-13 21:27:22 UTC
commit add8a99a1814d48cbf7148b863ec4e6efa992c99 Author: Rick W. Chen <stuffcorpse@archlinux.us> Date: Fri Jun 11 16:26:54 2010 +1200 Fall back to home path if stored dir in settings has since disappeared BUG:234286 diff --git a/ChangeLog b/ChangeLog index 83acf49..a5094e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,8 @@ VERSION 2.3.2-Beta 1 Patch by Richard Longland <rlongland@hotmail.com>. BUGFIXES: + * Fixed error dialog popup if the stored directory is no longer accessible + when using the file browser. (BR 234286) * Fixed resizing and eliding issues with the file browser breadcrumbs. (BR 231366 comment #5) * Drop file icons in file browser breadcrumbs. (BR 231366) diff --git a/src/browsers/filebrowser/FileBrowser.cpp b/src/browsers/filebrowser/FileBrowser.cpp index d1f6197..59c9815 100644 --- a/src/browsers/filebrowser/FileBrowser.cpp +++ b/src/browsers/filebrowser/FileBrowser.cpp @@ -236,10 +236,13 @@ FileBrowser::readConfig() { DEBUG_BLOCK - KConfigGroup config = Amarok::config( "File Browser" ); - - KUrl currentDirectory = config.readEntry( "Current Directory", QDir::homePath() ); - m_kdirModel->dirLister()->openUrl( currentDirectory ); + debug() << "home path: " << QDir::homePath(); + QDir currentDirectory = Amarok::config( "File Browser" ).readEntry( "Current Directory", + QDir::homePath() ); + // fall back to $HOME if config dir has since disappeared + if( !currentDirectory.exists() ) + currentDirectory = QDir::homePath(); + m_kdirModel->dirLister()->openUrl( KUrl( currentDirectory.path() ) ); m_currentPath = currentDirectory.path(); QFile file( Amarok::saveLocation() + "file_browser_layout" ); |