diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index 2d89d76b1..177a90437 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -26,6 +26,11 @@ #include #include #include +#if QT_VERSION >= 0x050000 +#include +#else +#include +#endif #include #include "ConfigManager.h" @@ -50,7 +55,11 @@ ConfigManager * ConfigManager::s_instanceOfMe = NULL; ConfigManager::ConfigManager() : m_lmmsRcFile( QDir::home().absolutePath() +"/.lmmsrc.xml" ), - m_workingDir( QDir::home().absolutePath() + "/lmms/"), + #if QT_VERSION >= 0x050000 + m_workingDir( QStandardPaths::writableLocation( QStandardPaths::DocumentsLocation ) + "/lmms/"), + #else + m_workingDir( QDesktopServices::storageLocation( QDesktopServices::DocumentsLocation ) + "/lmms/"), + #endif m_dataDir( "data:/" ), m_artworkDir( defaultArtworkDir() ), m_vstDir( m_workingDir + "vst/" ), @@ -58,6 +67,10 @@ ConfigManager::ConfigManager() : m_sf2Dir( m_workingDir + SF2_PATH ), m_version( defaultVersion() ) { + // Detect < 1.2.0 working directory as a courtesy + if ( QFileInfo( QDir::home().absolutePath() + "/lmms/projects/" ).exists() ) + m_workingDir = QDir::home().absolutePath() + "/lmms/"; + if (! qgetenv("LMMS_DATA_DIR").isEmpty()) QDir::addSearchPath("data", QString::fromLocal8Bit(qgetenv("LMMS_DATA_DIR"))); diff --git a/src/gui/GuiApplication.cpp b/src/gui/GuiApplication.cpp index e82d95b9a..2c577868c 100644 --- a/src/gui/GuiApplication.cpp +++ b/src/gui/GuiApplication.cpp @@ -59,7 +59,7 @@ GuiApplication::GuiApplication() QApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); #endif - // prompt the user to create the LMMS working directory (e.g. ~/lmms) if it doesn't exist + // prompt the user to create the LMMS working directory (e.g. ~/Documents/lmms) if it doesn't exist if ( !ConfigManager::inst()->hasWorkingDir() && QMessageBox::question( NULL, tr( "Working directory" ),