From d70f7819ca9eda61cd7be4e3e572dffca31344fe Mon Sep 17 00:00:00 2001 From: "craig.p.drummond" Date: Mon, 7 Jul 2014 19:06:29 +0000 Subject: [PATCH] Place all XML files in config --- CMakeLists.txt | 15 ++++++--------- ChangeLog | 8 ++++---- config.h.cmake | 1 - ...ltimate_providers.xml => lyrics_providers.xml} | 0 context/ultimatelyrics.cpp | 4 ++-- gui/covers.cpp | 2 +- tags/{fixes.xml => tag_fixes.xml} | 0 7 files changed, 13 insertions(+), 17 deletions(-) rename context/{ultimate_providers.xml => lyrics_providers.xml} (100%) rename tags/{fixes.xml => tag_fixes.xml} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b4a422f8..6d8e25ca0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -665,17 +665,14 @@ if (X11_FOUND) endif (X11_FOUND) if (WIN32) - install(FILES context/ultimate_providers.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/lyrics/) - install(FILES context/weblinks.xml online/podcast_directories.xml scrobbling/scrobblers.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/config/) - install(FILES tags/fixes.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/config/ RENAME tag-fixes.xml) + install(FILES tags/tag-fixes.xml context/lyrics_providers.xml context/weblinks.xml online/podcast_directories.xml scrobbling/scrobblers.xml + DESTINATION ${CMAKE_INSTALL_PREFIX}/config/) elseif (APPLE) - install(FILES context/ultimate_providers.xml DESTINATION ${MACOSX_BUNDLE_RESOURCES}/lyrics/) - install(FILES context/weblinks.xml online/podcast_directories.xml scrobbling/scrobblers.xml DESTINATION ${MACOSX_BUNDLE_RESOURCES}/config/) - install(FILES tags/fixes.xml DESTINATION ${MACOSX_BUNDLE_RESOURCES}/config/ RENAME tag-fixes.xml) + install(FILES tags/tag_fixes.xml context/lyrics_providers.xml context/weblinks.xml online/podcast_directories.xml scrobbling/scrobblers.xml + DESTINATION ${MACOSX_BUNDLE_RESOURCES}/config/) elseif (NOT ENABLE_UBUNTU) - install(FILES context/ultimate_providers.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}/lyrics) - install(FILES context/weblinks.xml online/podcast_directories.xml scrobbling/scrobblers.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}/config/) - install(FILES tags/fixes.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}/config/ RENAME tag-fixes.xml) + install(FILES tags/tag_fixes.xml context/lyrics_providers.xml context/weblinks.xml online/podcast_directories.xml scrobbling/scrobblers.xml + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}/config/) endif (WIN32) if (ENABLE_HTTP_STREAM_PLAYBACK) diff --git a/ChangeLog b/ChangeLog index e7d66e73f..11b40c6a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,9 +22,9 @@ 16. Add support for comments. These are read directly from the song file when the tag-editor is used, and they are NOT saved in Cantata's cache file. Comments are only read if MPD is configured to support the COMMENT field. - 17. Install Cantata's list of lyrics providers to INSTALL/share/cantata/lyrics - 18. Read lyrics providers from each .xml file in ~/.local/share/cantata/lyrics, - and INSTALL/share/cantata/lyrics + 17. Install Cantata's list of lyrics providers to INSTALL/share/cantata/config + 18. Read lyrics providers from each lyrics_*.xml file in + ~/.local/share/cantata/config, and INSTALL/share/cantata/config 19. Attempt to respect menubar usage of current desktop. For Windows and Gnome; menu button is used, and menubar hidden. For Mac and Unity; menubar is used, and menu button is hidden. For KDE Plasma; by default the menu button @@ -76,7 +76,7 @@ Albums, Tracks), so no real need for button. 47. Make shortcut for 'Go Back' action changeable. 48. Don't attempt to find Amarok or Clementine covers. - 49. Don't hard-code artist name fixes, read from $install/tag-fixes.xml + 49. Don't hard-code artist name fixes, read from $install/tag_fixes.xml 50. Remove grouping of multiple-artist albums under 'Various Artists' 51. Change default sidebar shortcuts from 'Alt+' to 'Ctrl+Shift+' so as to avoid clashes with menubar. diff --git a/config.h.cmake b/config.h.cmake index 25d430346..cd0a5c701 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -54,7 +54,6 @@ #define CANTATA_URL "cantata.googlecode.com" #define CANTATA_SYS_CONFIG_DIR Utils::systemDir(QLatin1String("config")) -#define CANTATA_SYS_LYRICS_DIR Utils::systemDir(QLatin1String("lyrics")) #define CANTATA_SYS_ICONS_DIR Utils::systemDir(QLatin1String("icons")) #define CANTATA_SYS_MPD_DIR Utils::systemDir(QLatin1String("mpd")) #define CANTATA_SYS_TRANS_DIR Utils::systemDir(QLatin1String("translations")) diff --git a/context/ultimate_providers.xml b/context/lyrics_providers.xml similarity index 100% rename from context/ultimate_providers.xml rename to context/lyrics_providers.xml diff --git a/context/ultimatelyrics.cpp b/context/ultimatelyrics.cpp index b9e7b92a2..06652fe8e 100644 --- a/context/ultimatelyrics.cpp +++ b/context/ultimatelyrics.cpp @@ -150,14 +150,14 @@ void UltimateLyrics::load() return; } - QStringList dirs=QStringList() << Utils::dataDir("lyrics") << CANTATA_SYS_LYRICS_DIR; + QStringList dirs=QStringList() << Utils::dataDir() << CANTATA_SYS_CONFIG_DIR; QSet providerNames; foreach (const QString &d, dirs) { if (d.isEmpty()) { continue; } - QFileInfoList files=QDir(d).entryInfoList(QStringList() << QLatin1String("*.xml"), QDir::NoDotAndDotDot|QDir::Files); + QFileInfoList files=QDir(d).entryInfoList(QStringList() << QLatin1String("lyrics_*.xml"), QDir::NoDotAndDotDot|QDir::Files); foreach (const QFileInfo &f, files) { QFile file(f.absoluteFilePath()); if (file.open(QIODevice::ReadOnly)) { diff --git a/gui/covers.cpp b/gui/covers.cpp index e1d2a5696..ff0a8957f 100644 --- a/gui/covers.cpp +++ b/gui/covers.cpp @@ -325,7 +325,7 @@ QString Covers::fixArtist(const QString &artist) continue; } - QFile f(dir+QLatin1String("/tag-fixes.xml")); + QFile f(dir+QLatin1String("/tag_fixes.xml")); if (f.open(QIODevice::ReadOnly)) { QXmlStreamReader doc(&f); while (!doc.atEnd()) { diff --git a/tags/fixes.xml b/tags/tag_fixes.xml similarity index 100% rename from tags/fixes.xml rename to tags/tag_fixes.xml