aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-01-15 15:16:47 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2020-01-15 15:16:47 +0200
commit2c1dcabfec0fbdaacf202b9a3a92582c13269f19 (patch)
tree7380b85d943b54f143d911df2bdf32d02f43e5ba /src
parentFix if statements in PKGBUILD (diff)
downloadsmolbote-2c1dcabfec0fbdaacf202b9a3a92582c13269f19.tar.xz
Create default profile when the one set doesn't exist
Diffstat (limited to 'src')
-rw-r--r--src/browser.cpp9
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