diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-01-15 15:16:47 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-01-15 15:16:47 +0200 |
commit | 2c1dcabfec0fbdaacf202b9a3a92582c13269f19 (patch) | |
tree | 7380b85d943b54f143d911df2bdf32d02f43e5ba /src | |
parent | Fix if statements in PKGBUILD (diff) | |
download | smolbote-2c1dcabfec0fbdaacf202b9a3a92582c13269f19.tar.xz |
Create default profile when the one set doesn't exist
Diffstat (limited to 'src')
-rw-r--r-- | src/browser.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/browser.cpp b/src/browser.cpp index 09fc2c8..42cde5e 100644 --- a/src/browser.cpp +++ b/src/browser.cpp @@ -195,12 +195,11 @@ void Browser::setup(QVector<QPluginLoader *> plugins) const QString id = conf.value<QString>("profile.default").value(); auto *profile = m_profileManager->profile(id); if(profile == nullptr) { - spdlog::error("Unknown default profile!"); - //profile = qobject_cast<WebProfile *>(loadProfile(id).second); - } else { - spdlog::info("Default profile\t{}{}\t{}", qUtf8Printable(id), profile->isOffTheRecord() ? "*" : "", qUtf8Printable(profile->name())); - WebProfile::setDefaultProfile(profile); + spdlog::error("Unknown default profile, conjuring one up..."); + profile = m_profileManager->add("default", QString(), true); } + spdlog::info("Default profile\t{}{}\t{}", qUtf8Printable(id), profile->isOffTheRecord() ? "*" : "", qUtf8Printable(profile->name())); + WebProfile::setDefaultProfile(profile); } // bookmarks |