new data paths for rssguard4

This commit is contained in:
Martin Rotter 2021-02-26 09:20:05 +01:00
parent cf39461001
commit 2c64bb1569
2 changed files with 9 additions and 17 deletions

View File

@ -1,7 +1,7 @@
APP_NAME = "RSS Guard" APP_NAME = "RSS Guard"
APP_LOW_NAME = "rssguard" APP_LOW_NAME = "rssguard"
APP_REVERSE_NAME = "com.github.rssguard" APP_REVERSE_NAME = "com.github.rssguard"
APP_LOW_H_NAME = ".rssguard4" APP_LOW_H_NAME = ".rssguard"
APP_AUTHOR = "Martin Rotter" APP_AUTHOR = "Martin Rotter"
APP_COPYRIGHT = "(C) 2011-2021 $$APP_AUTHOR" APP_COPYRIGHT = "(C) 2011-2021 $$APP_AUTHOR"
APP_VERSION = "4.0.0" APP_VERSION = "4.0.0"

View File

@ -254,13 +254,13 @@ void Application::setMainForm(FormMain* main_form) {
} }
QString Application::configFolder() const { QString Application::configFolder() const {
return IOFactory::getSystemFolder(QStandardPaths::GenericConfigLocation); return IOFactory::getSystemFolder(QStandardPaths::StandardLocation::GenericConfigLocation);
} }
QString Application::userDataAppFolder() const { QString Application::userDataAppFolder() const {
// In "app" folder, we would like to separate all user data into own subfolder, // In "app" folder, we would like to separate all user data into own subfolder,
// therefore stick to "data" folder in this mode. // therefore stick to "data" folder in this mode.
return applicationDirPath() + QDir::separator() + QSL("data"); return applicationDirPath() + QDir::separator() + QSL("data4");
} }
QString Application::userDataFolder() { QString Application::userDataFolder() {
@ -276,34 +276,26 @@ QString Application::userDataFolder() {
} }
QString Application::userDataHomeFolder() const { QString Application::userDataHomeFolder() const {
// Fallback folder.
const QString home_folder = homeFolder() + QDir::separator() + QSL(APP_LOW_H_NAME) + QDir::separator() + QSL("data");
if (QDir().exists(home_folder)) {
return home_folder;
}
else {
#if defined(Q_OS_ANDROID) #if defined(Q_OS_ANDROID)
return IOFactory::getSystemFolder(QStandardPaths::GenericDataLocation) + QDir::separator() + QSL(APP_NAME); return IOFactory::getSystemFolder(QStandardPaths::GenericDataLocation) + QDir::separator() + QSL(APP_NAME) + QSL(" 4");
#else #else
return configFolder() + QDir::separator() + QSL(APP_NAME); return configFolder() + QDir::separator() + QSL(APP_NAME) + QSL(" 4");
#endif #endif
}
} }
QString Application::tempFolder() const { QString Application::tempFolder() const {
return IOFactory::getSystemFolder(QStandardPaths::TempLocation); return IOFactory::getSystemFolder(QStandardPaths::StandardLocation::TempLocation);
} }
QString Application::documentsFolder() const { QString Application::documentsFolder() const {
return IOFactory::getSystemFolder(QStandardPaths::DocumentsLocation); return IOFactory::getSystemFolder(QStandardPaths::StandardLocation::DocumentsLocation);
} }
QString Application::homeFolder() const { QString Application::homeFolder() const {
#if defined(Q_OS_ANDROID) #if defined(Q_OS_ANDROID)
return IOFactory::getSystemFolder(QStandardPaths::GenericDataLocation); return IOFactory::getSystemFolder(QStandardPaths::StandardLocation::GenericDataLocation);
#else #else
return IOFactory::getSystemFolder(QStandardPaths::HomeLocation); return IOFactory::getSystemFolder(QStandardPaths::StandardLocation::HomeLocation);
#endif #endif
} }