From 7feefe9d5c922481081d31b12e02f42d9e028ef9 Mon Sep 17 00:00:00 2001 From: aqua Date: Wed, 1 May 2024 11:17:07 +0300 Subject: Drop python-kcofiglib build time dependency --- src/browser.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/browser.cpp') diff --git a/src/browser.cpp b/src/browser.cpp index a2ae8c9..74da540 100644 --- a/src/browser.cpp +++ b/src/browser.cpp @@ -40,11 +40,11 @@ Browser::Browser(int &argc, char *argv[], bool allowSecondary) { Configuration conf; - setApplicationName(conf.value("poi.name").value()); - setWindowIcon(QIcon(conf.value("poi.icon").value())); + setApplicationName(conf.value("poi/name").value()); + setWindowIcon(QIcon(conf.value("poi/icon").value())); setApplicationVersion(QVersionNumber::fromString(QLatin1String(poi_Version)).toString()); - if(const auto _translation = conf.value("browser.translation")) { + if(const auto _translation = conf.value("browser/translation")) { auto *translator = new QTranslator(this); if(translator->load(_translation.value())) installTranslator(translator); @@ -52,7 +52,7 @@ Browser::Browser(int &argc, char *argv[], bool allowSecondary) delete translator; } - if(const auto _locale = conf.value("browser.locale")) { + if(const auto _locale = conf.value("browser/locale")) { auto *locale = new QTranslator(this); if(locale->load("qt_" + _locale.value(), QLibraryInfo::location(QLibraryInfo::TranslationsPath))) installTranslator(locale); @@ -60,11 +60,11 @@ Browser::Browser(int &argc, char *argv[], bool allowSecondary) delete locale; } - if(auto iconTheme = conf.value("browser.iconTheme")) { + if(auto iconTheme = conf.value("browser/iconTheme")) { QIcon::setThemeName(iconTheme.value()); } - if(auto stylesheet = conf.value("browser.stylesheet")) { + if(auto stylesheet = conf.value("browser/stylesheet")) { QFile f(stylesheet.value()); if(f.open(QIODevice::ReadOnly)) { setStyleSheet(f.readAll()); @@ -74,11 +74,11 @@ Browser::Browser(int &argc, char *argv[], bool allowSecondary) // load profiles { - const auto profiles = Util::files(conf.value("profile.path").value(), { "*.profile" }); - const auto search = conf.value("profile.search").value(); - const auto homepage = QUrl::fromUserInput(conf.value("profile.homepage").value()); - const auto newtab = QUrl::fromUserInput(conf.value("profile.newtab").value()); - const auto default_id = conf.value("profile.default").value(); + const auto profiles = Util::files(conf.value("profile/path").value(), { "*.profile" }); + const auto search = conf.value("profile/search").value(); + const auto homepage = QUrl::fromUserInput(conf.value("profile/homepage").value()); + const auto newtab = QUrl::fromUserInput(conf.value("profile/newtab").value()); + const auto default_id = conf.value("profile/default").value(); m_profileManager = std::make_unique>(profiles, default_id, search, homepage, newtab); m_profileManager->make_global(); @@ -92,13 +92,13 @@ Browser::Browser(int &argc, char *argv[], bool allowSecondary) } // downloads - m_downloads = std::make_unique(conf.value("downloads.path").value()); + m_downloads = std::make_unique(conf.value("downloads/path").value()); m_profileManager->walk([this](const QString &, WebProfile *profile, QSettings *) { connect(profile, &QWebEngineProfile::downloadRequested, m_downloads.get(), &DownloadsWidget::addDownload); }); // bookmarks - m_bookmarks = std::make_shared(QString::fromStdString(conf.value("bookmarks.path").value())); + m_bookmarks = std::make_shared(QString::fromStdString(conf.value("bookmarks/path").value())); connect(m_bookmarks.get(), &BookmarksWidget::openUrl, this, [this](const QUrl &url) { m_windows.last()->createTab(url); }); -- cgit v1.2.1