summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Harrison <pharrison@mythtv.org>2011-07-17 17:24:18 (GMT)
committer Paul Harrison <pharrison@mythtv.org>2011-07-17 17:24:18 (GMT)
commit6ac5bc0f98fb10f62dfff7e0acdf4cbfff42db4d (patch)
tree9c21e71bdad510ec09ec5c3d109322fe9d02b24d
parent773ecdd2ca787f7a01a609085984b5b80f882307 (diff)
MythMusic: Don't append a '/' if the start directory hasn't been set yet.
This fixes a bug which would start the file scanner running from the '/' directory if the music location hadn't been set. Also don't bother loading the music when going into the settings screens.
-rw-r--r--mythplugins/mythmusic/mythmusic/main.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/mythplugins/mythmusic/mythmusic/main.cpp b/mythplugins/mythmusic/mythmusic/main.cpp
index 63d6711..a8d1660 100644
--- a/mythplugins/mythmusic/mythmusic/main.cpp
+++ b/mythplugins/mythmusic/mythmusic/main.cpp
@@ -186,10 +186,9 @@ static void loadMusic()
}
}
- // Load all available info about songs (once!)
QString startdir = gCoreContext->GetSetting("MusicLocation");
startdir = QDir::cleanPath(startdir);
- if (!startdir.endsWith("/"))
+ if (!startdir.isEmpty() && !startdir.endsWith("/"))
startdir += "/";
Metadata::SetStartdir(startdir);
@@ -621,14 +620,11 @@ int mythplugin_run(void)
int mythplugin_config(void)
{
- //TODO do we need this here?
- loadMusic();
-
gMusicData->paths = gCoreContext->GetSetting("TreeLevels");
gMusicData->startdir = gCoreContext->GetSetting("MusicLocation");
gMusicData->startdir = QDir::cleanPath(gMusicData->startdir);
- if (!gMusicData->startdir.endsWith("/"))
+ if (!gMusicData->startdir.isEmpty() && !gMusicData->startdir.endsWith("/"))
gMusicData->startdir += "/";
Metadata::SetStartdir(gMusicData->startdir);