mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-11 09:24:50 +01:00
Fix C:\data cache directory for portable builds
Lastfm needs a NetworkAccessManager which is created during the initialization of lastfm in main.cpp, it also sets a cache directory. For the portable version, GetConfigPath uses QCoreApplication::applicationDirPath() to get the current directory of Clementine. If no QApplication (or QtSingleApplication in Clementines case) was instantiated, it returns /data on Linux or C:\data on Windows for the cache config path. This commit changes the order so lastfm will be initialized after QtSingleApplication was created and the correct cache config path will be returned. Fixes #5354
This commit is contained in:
parent
1aed6193e7
commit
652f38ac84
12
src/main.cpp
12
src/main.cpp
@ -318,12 +318,6 @@ int main(int argc, char* argv[]) {
|
||||
1);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBLASTFM
|
||||
lastfm::ws::ApiKey = LastFMService::kApiKey;
|
||||
lastfm::ws::SharedSecret = LastFMService::kSecret;
|
||||
lastfm::setNetworkAccessManager(new NetworkAccessManager);
|
||||
#endif
|
||||
|
||||
// Output the version, so when people attach log output to bug reports they
|
||||
// don't have to tell us which version they're using.
|
||||
qLog(Info) << "Clementine" << CLEMENTINE_VERSION_DISPLAY;
|
||||
@ -337,6 +331,12 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
QtSingleApplication a(argc, argv);
|
||||
|
||||
#ifdef HAVE_LIBLASTFM
|
||||
lastfm::ws::ApiKey = LastFMService::kApiKey;
|
||||
lastfm::ws::SharedSecret = LastFMService::kSecret;
|
||||
lastfm::setNetworkAccessManager(new NetworkAccessManager);
|
||||
#endif
|
||||
|
||||
// A bug in Qt means the wheel_scroll_lines setting gets ignored and replaced
|
||||
// with the default value of 3 in QApplicationPrivate::initialize.
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user