From 3e743c9d1f5b0087183d3271b8856ec0c8c3e92e Mon Sep 17 00:00:00 2001 From: nowrep Date: Thu, 21 Feb 2013 11:05:00 +0100 Subject: [PATCH] Moved config directory info ~/.config/qupzilla See #774 --- CHANGELOG | 1 + src/lib/app/mainapplication.cpp | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 6da081ab1..2b3bd8cc8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -21,6 +21,7 @@ Version 1.4.0 * don't steal Ctrl+B/U/I shortcuts from page * disabled by default opacity effect on tab previews - see BUILDING * improved showing navigation toolbar in fullscreen + * moved config directory into ~/.config/qupzilla * fixed opening browser with url with ampersand (%26) as command line argument * fixed scrolling to anchor in background tabs * fixed parsing UTF-8 filenames in Content-Disposition header diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index b3a478596..eb00c1238 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -128,7 +128,15 @@ MainApplication::MainApplication(int &argc, char** argv) #ifdef PORTABLE_BUILD PROFILEDIR = DATADIR + "profiles/"; #else - PROFILEDIR = QDir::homePath() + "/.qupzilla/"; + bool confPathExists = QDir(QDir::homePath() + "/.config/qupzilla").exists(); + bool homePathExists = QDir(QDir::homePath() + "/.qupzilla").exists(); + + if (homePathExists && !confPathExists) { + PROFILEDIR = QDir::homePath() + "/.qupzilla/"; + } + else { + PROFILEDIR = QDir::homePath() + "/.config/qupzilla/"; + } #endif TRANSLATIONSDIR = DATADIR + "locale/"; @@ -1089,7 +1097,7 @@ bool MainApplication::checkSettingsDir() /* $HOMEDIR | - .qupzilla/ + .config/qupzilla/ | profiles/----------- | | @@ -1113,7 +1121,7 @@ bool MainApplication::checkSettingsDir() dir.mkdir("profiles"); dir.cd("profiles"); - //.qupzilla/profiles + //.config/qupzilla/profiles QFile(PROFILEDIR + "profiles/profiles.ini").remove(); QFile(":data/profiles.ini").copy(PROFILEDIR + "profiles/profiles.ini"); QFile(PROFILEDIR + "profiles/profiles.ini").setPermissions(QFile::ReadUser | QFile::WriteUser); @@ -1121,7 +1129,7 @@ bool MainApplication::checkSettingsDir() dir.mkdir("default"); dir.cd("default"); - //.qupzilla/profiles/default + //.config/qupzilla/profiles/default QFile(PROFILEDIR + "profiles/default/browsedata.db").remove(); QFile(":data/browsedata.db").copy(PROFILEDIR + "profiles/default/browsedata.db"); QFile(PROFILEDIR + "profiles/default/browsedata.db").setPermissions(QFile::ReadUser | QFile::WriteUser);