Commit dda9aaba authored by Stefan Brüns's avatar Stefan Brüns
Browse files

Fix Firefox profile location lookup after location has changed

When the profile has initially been looked up, the location is saved to
the global config. Afterwards, the location is never updated even if
the profile has been replaced, due to an inverted exits() check.

Test Plan:
1. Check dbfile in kdeglobals is pointing to a valid profile
2a. Change the dbfile setting - or -
2b. Remove the existing profile and create a new one
3. Restart krunner - it should fix the config entry/use the new profile

Reviewers: #plasma, apol

Reviewed By: apol

Subscribers: plasma-devel

Tags: #plasma

Differential Revision:
parent 08895fd7
......@@ -138,7 +138,7 @@ void Firefox::reloadConfiguration()
KConfigGroup grp = config;
/* This allows the user to specify a profile database */
m_dbFile = grp.readEntry<QString>("dbfile", QLatin1String(""));
if (m_dbFile.isEmpty() || QFile::exists(m_dbFile)) {
if (m_dbFile.isEmpty() || !QFile::exists(m_dbFile)) {
//Try to get the right database file, the default profile is used
KConfig firefoxProfile(QDir::homePath() + "/.mozilla/firefox/profiles.ini",
......@@ -171,6 +171,12 @@ void Firefox::reloadConfiguration()
m_dbFile = profilePath + "/places.sqlite";
grp.writeEntry("dbfile", m_dbFile);
m_dbFile_fav = profilePath + "/favicons.sqlite";
} else {
auto dir = QDir(m_dbFile);
if (dir.cdUp()) {
QString profilePath = dir.absolutePath();
m_dbFile_fav = profilePath + "/favicons.sqlite";
} else {
//qDebug() << "SQLITE driver isn't available";
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment