Fixed #77.
This commit is contained in:
parent
a420302a4a
commit
c97e052a1f
@ -2,6 +2,7 @@
|
||||
—————
|
||||
|
||||
Changed:
|
||||
▪ (Linux only) Primary user data/config storage is now undex $HOME/.config. XDG_CONFIG_HOME variable is respected. If old user data is detected, then old user data path is used.
|
||||
▪ RSS Guard now uses "_" character as localization file names separator. (issue #75)
|
||||
▪ Localizations are now placed in "translations" subfolder instead of "l10n" subfolder. (issue #75)
|
||||
|
||||
@ -505,4 +506,4 @@ Added:
|
||||
|
||||
Changed:
|
||||
▪ Added newly-compiled SQL libraries - MariaDB, Postgre SQL.
|
||||
▪ Updated bundled OpenSSL libraries for Windows portable version.
|
||||
▪ Updated bundled OpenSSL libraries for Windows portable version.
|
||||
|
@ -186,6 +186,24 @@ void Application::setMainForm(FormMain *main_form) {
|
||||
m_mainForm = main_form;
|
||||
}
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
QString Application::getXdgConfigHomePath() {
|
||||
// TODO: Return ".config" folder on Linux.
|
||||
// XDG_CONFIG_HOME
|
||||
// Where user-specific configurations should be written (analogous to /etc).
|
||||
// Should default to $HOME/.config.
|
||||
|
||||
const QString xdgConfigHome = qgetenv("XDG_CONFIG_HOME");
|
||||
|
||||
if (xdgConfigHome.isEmpty()) {
|
||||
return qgetenv("HOME") + QDir::separator() + ".config";
|
||||
}
|
||||
else {
|
||||
return xdgConfigHome;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
QString Application::tempFolderPath() {
|
||||
return IOFactory::getSystemFolder(QStandardPaths::TempLocation);
|
||||
}
|
||||
|
@ -84,6 +84,10 @@ class Application : public QtSingleApplication {
|
||||
QString documentsFolderPath();
|
||||
QString homeFolderPath();
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
QString getXdgConfigHomePath();
|
||||
#endif
|
||||
|
||||
void setMainForm(FormMain *main_form);
|
||||
|
||||
void backupDatabaseSettings(bool backup_database, bool backup_settings,
|
||||
|
@ -322,8 +322,21 @@ QString Settings::getAppPathUserFolder() {
|
||||
return qApp->applicationDirPath() + QDir::separator() + QSL("data");
|
||||
}
|
||||
|
||||
|
||||
|
||||
QString Settings::getHomeUserFolder() {
|
||||
#if defined(Q_OS_LINUX)
|
||||
QString home_folder = qApp->homeFolderPath() + QDir::separator() + QString(APP_LOW_H_NAME) + QDir::separator() + QSL("data");
|
||||
|
||||
if (QDir().exists(home_folder)) {
|
||||
return home_folder;
|
||||
}
|
||||
else {
|
||||
return qApp->getXdgConfigHomePath() + QDir::separator() + QString(APP_LOW_NAME);
|
||||
}
|
||||
#else
|
||||
return qApp->homeFolderPath() + QDir::separator() + QString(APP_LOW_H_NAME) + QDir::separator() + QSL("data");
|
||||
#endif
|
||||
}
|
||||
|
||||
Settings *Settings::setupSettings(QObject *parent) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user