aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2019-11-04 21:55:20 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2019-11-04 21:55:20 +0200
commitd631875b20244cb8eb0523c88cc838808e9ff4b0 (patch)
tree254afb4e16ac0a7db059eb4f568eb5f9c3e92c1d
parentFix gcc compile errors and warnings (diff)
downloadsmolbote-d631875b20244cb8eb0523c88cc838808e9ff4b0.tar.xz
Move lib/webprofile into src/webengine
-rw-r--r--lib/webprofile/meson.build12
-rw-r--r--meson.build1
-rw-r--r--src/browser.cpp10
-rw-r--r--src/mainwindow/mainwindow.cpp4
-rw-r--r--src/mainwindow/menubar.cpp2
-rw-r--r--src/mainwindow/widgets/navigationbar.cpp2
-rw-r--r--src/meson.build7
-rw-r--r--src/session/savesessiondialog.cpp2
-rw-r--r--src/session/session.cpp2
-rw-r--r--src/subwindow/subwindow.cpp2
-rw-r--r--src/subwindow/tabwidget.cpp2
-rw-r--r--src/webengine/webprofile.cpp (renamed from lib/webprofile/webprofile.cpp)0
-rw-r--r--src/webengine/webprofile.h (renamed from lib/webprofile/webprofile.h)0
-rw-r--r--src/webengine/webprofilemanager.cpp (renamed from lib/webprofile/webprofilemanager.cpp)11
-rw-r--r--src/webengine/webprofilemanager.h (renamed from lib/webprofile/webprofilemanager.h)3
15 files changed, 23 insertions, 37 deletions
diff --git a/lib/webprofile/meson.build b/lib/webprofile/meson.build
deleted file mode 100644
index b3836cc..0000000
--- a/lib/webprofile/meson.build
+++ /dev/null
@@ -1,12 +0,0 @@
-webprofile_lib = static_library('webprofile',
- ['webprofilemanager.cpp', 'webprofile.cpp', interfaces_moc,
- mod_qt5.preprocess(moc_headers: ['webprofilemanager.h', 'webprofile.h'], dependencies: dep_qt5)],
- dependencies: dep_qt5,
- include_directories: [include]
-)
-
-dep_webprofile = declare_dependency(
- include_directories: include_directories('.'),
- link_with: webprofile_lib
-)
-
diff --git a/meson.build b/meson.build
index 3894ac1..50e239d 100644
--- a/meson.build
+++ b/meson.build
@@ -87,7 +87,6 @@ subdir('lib/configuration')
subdir('lib/downloads')
subdir('lib/pluginloader')
subdir('lib/urlfilter')
-subdir('lib/webprofile')
subdir('3rd-party/SingleApplication')
subdir('3rd-party/args')
diff --git a/src/browser.cpp b/src/browser.cpp
index d677997..b3039a5 100644
--- a/src/browser.cpp
+++ b/src/browser.cpp
@@ -15,11 +15,11 @@
#include "configuration.h"
#include "downloadswidget.h"
#include "mainwindow/mainwindow.h"
-#include "webprofilemanager.h"
+#include "webengine/webprofilemanager.h"
#include "subwindow/subwindow.h"
#include "util.h"
#include "webengine/urlinterceptor.h"
-#include "webprofile.h"
+#include "webengine/webprofile.h"
#include <QAction>
#include <QDir>
#include <QFileDialog>
@@ -203,11 +203,7 @@ void Browser::setup(QVector<QPluginLoader *> plugins)
// cookie request filter
// load profiles
- ProfileDefault_t p;
- p.search = conf.value<QString>("profile.search").value();
- p.homepage = conf.value<QString>("profile.homepage").value();
- p.newtab = conf.value<QString>("profile.newtab").value();
- m_profileManager = new WebProfileManager(p, this);
+ m_profileManager = new WebProfileManager(this);
for(const QString &profilePath : Util::files(conf.value<QString>("profile.path").value(), { "*.profile" })) {
this->loadProfile(profilePath);
}
diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp
index fa8b23a..292d922 100644
--- a/src/mainwindow/mainwindow.cpp
+++ b/src/mainwindow/mainwindow.cpp
@@ -12,12 +12,12 @@
#include "conf.hpp"
#include "configuration.h"
#include "menubar.h"
-#include "webprofilemanager.h"
+#include "webengine/webprofilemanager.h"
#include "session/session.h"
#include "session/sessiondialog.h"
#include "subwindow/subwindow.h"
#include "webengine/webview.h"
-#include "webprofile.h"
+#include "webengine/webprofile.h"
#include "widgets/dockwidget.h"
#include "widgets/navigationbar.h"
#include "widgets/searchform.h"
diff --git a/src/mainwindow/menubar.cpp b/src/mainwindow/menubar.cpp
index 2ce87f7..54ba102 100644
--- a/src/mainwindow/menubar.cpp
+++ b/src/mainwindow/menubar.cpp
@@ -12,7 +12,7 @@
#include "configuration.h"
#include "downloadswidget.h"
#include "mainwindow.h"
-#include "webprofilemanager.h"
+#include "webengine/webprofilemanager.h"
#include "session/savesessiondialog.h"
#include "session/sessiondialog.h"
#include "subwindow/subwindow.h"
diff --git a/src/mainwindow/widgets/navigationbar.cpp b/src/mainwindow/widgets/navigationbar.cpp
index f57d678..89e1e50 100644
--- a/src/mainwindow/widgets/navigationbar.cpp
+++ b/src/mainwindow/widgets/navigationbar.cpp
@@ -18,7 +18,7 @@
#include <QToolBar>
#include <QToolButton>
#include <QWebEngineHistory>
-#include "webprofile.h"
+#include "webengine/webprofile.h"
NavigationBar::NavigationBar(QWidget *parent)
: QToolBar(parent)
diff --git a/src/meson.build b/src/meson.build
index b263b5f..3494112 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -4,7 +4,7 @@ poi_moc = mod_qt5.preprocess(
'mainwindow/mainwindow.h', 'mainwindow/addressbar.h', 'mainwindow/menubar.h', 'mainwindow/widgets/completer.h', 'mainwindow/widgets/urllineedit.h', 'mainwindow/widgets/dockwidget.h', 'mainwindow/widgets/menusearch.h', 'mainwindow/widgets/navigationbar.h', 'mainwindow/widgets/searchform.h',
'session/savesessiondialog.h', 'session/sessiondialog.h', 'session/sessionform.h',
'subwindow/subwindow.h', 'subwindow/tabwidget.h',
- 'webengine/urlinterceptor.h', 'webengine/webpage.h', 'webengine/webview.h'],
+ 'webengine/urlinterceptor.h', 'webengine/webpage.h', 'webengine/webview.h', 'webengine/webprofilemanager.h', 'webengine/webprofile.h'],
ui_files: ['mainwindow/addressbar.ui', 'mainwindow/widgets/searchform.ui', 'session/savesessiondialog.ui', 'session/sessiondialog.ui', 'session/sessionform.ui'],
qresources: '../data/resources.qrc',
rcc_extra_arguments: ['--format-version=1'],
@@ -14,7 +14,7 @@ poi_moc = mod_qt5.preprocess(
poi = executable(get_option('poiName'), install: true,
cpp_args: ['-DQAPPLICATION_CLASS=QApplication'],
dependencies: [dep_qt5, dep_spdlog, dep_SingleApplication, dep_args, optional_deps,
- dep_about, dep_bookmarks, dep_configuration, dep_downloads, dep_pluginloader, dep_urlfilter, dep_webprofile],
+ dep_about, dep_bookmarks, dep_configuration, dep_downloads, dep_pluginloader, dep_urlfilter],
include_directories: [include],
sources: ['main.cpp', 'builtins.cpp', 'crashhandler.cpp', poi_moc, version_h,
'browser.cpp',
@@ -41,6 +41,9 @@ poi = executable(get_option('poiName'), install: true,
'webengine/urlinterceptor.cpp',
'webengine/webpage.cpp',
'webengine/webview.cpp',
+ 'webengine/webprofile.cpp',
+ 'webengine/webprofilemanager.cpp',
+ interfaces_moc,
'wallet/wallet.cpp', 'wallet/wallet.h']
)
diff --git a/src/session/savesessiondialog.cpp b/src/session/savesessiondialog.cpp
index 9291215..ffc53f7 100644
--- a/src/session/savesessiondialog.cpp
+++ b/src/session/savesessiondialog.cpp
@@ -9,7 +9,7 @@
#include "savesessiondialog.h"
#include "browser.h"
#include "mainwindow/mainwindow.h"
-#include "webprofilemanager.h"
+#include "webengine/webprofilemanager.h"
#include "subwindow/subwindow.h"
#include "ui_savesessiondialog.h"
#include "webengine/webview.h"
diff --git a/src/session/session.cpp b/src/session/session.cpp
index 67cea70..9e6fa7d 100644
--- a/src/session/session.cpp
+++ b/src/session/session.cpp
@@ -10,7 +10,7 @@
#include "../webengine/webview.h"
#include "browser.h"
#include "mainwindow/mainwindow.h"
-#include "webprofilemanager.h"
+#include "webengine/webprofilemanager.h"
#include "subwindow/subwindow.h"
#include "webengine/webview.h"
#include <QJsonArray>
diff --git a/src/subwindow/subwindow.cpp b/src/subwindow/subwindow.cpp
index 869a453..7f2ae05 100644
--- a/src/subwindow/subwindow.cpp
+++ b/src/subwindow/subwindow.cpp
@@ -20,7 +20,7 @@
#include <QTabBar>
#include <QToolButton>
#include "configuration.h"
-#include "webprofile.h"
+#include "webengine/webprofile.h"
SubWindow::SubWindow(QWidget *parent, Qt::WindowFlags flags)
: QMdiSubWindow(parent, flags)
diff --git a/src/subwindow/tabwidget.cpp b/src/subwindow/tabwidget.cpp
index ef15657..d09fffb 100644
--- a/src/subwindow/tabwidget.cpp
+++ b/src/subwindow/tabwidget.cpp
@@ -13,7 +13,7 @@
#include <QContextMenuEvent>
#include <QMenu>
#include <QTabBar>
-#include "webprofile.h"
+#include "webengine/webprofile.h"
#include <QWebEngineHistory>
#include "subwindow.h"
diff --git a/lib/webprofile/webprofile.cpp b/src/webengine/webprofile.cpp
index 843b78e..843b78e 100644
--- a/lib/webprofile/webprofile.cpp
+++ b/src/webengine/webprofile.cpp
diff --git a/lib/webprofile/webprofile.h b/src/webengine/webprofile.h
index 37e3419..37e3419 100644
--- a/lib/webprofile/webprofile.h
+++ b/src/webengine/webprofile.h
diff --git a/lib/webprofile/webprofilemanager.cpp b/src/webengine/webprofilemanager.cpp
index 05808ab..3f3d5ba 100644
--- a/lib/webprofile/webprofilemanager.cpp
+++ b/src/webengine/webprofilemanager.cpp
@@ -10,10 +10,10 @@
#include "webprofile.h"
#include <QFileInfo>
#include <QWebEngineSettings>
+#include "configuration.h"
-WebProfileManager::WebProfileManager(const ProfileDefault_t &profileSection, QObject *parent)
+WebProfileManager::WebProfileManager(QObject *parent)
: QObject(parent)
- , defaults(profileSection)
{
}
@@ -43,6 +43,7 @@ WebProfile *WebProfileManager::profile(const QString &id, const QString &path, b
if(profiles.contains(id))
return profiles.value(id).ptr;
+ Configuration conf;
Profile profile;
if(!path.isEmpty())
@@ -62,17 +63,17 @@ WebProfile *WebProfileManager::profile(const QString &id, const QString &path, b
profile.settings->setValue("name", name);
});
- profile.ptr->setSearch(profile.value("search", defaults.search).toString());
+ profile.ptr->setSearch(profile.value("search", conf.value<QString>("profile.search").value()).toString());
connect(profile.ptr, &WebProfile::searchChanged, profile.settings, [profile](const QString &url) {
profile.settings->setValue("search", url);
});
- profile.ptr->setHomepage(profile.value("homepage", defaults.homepage).toUrl());
+ profile.ptr->setHomepage(profile.value("homepage", conf.value<QString>("profile.homepage").value()).toUrl());
connect(profile.ptr, &WebProfile::homepageChanged, profile.settings, [profile](const QUrl &url) {
profile.settings->setValue("homepage", url);
});
- profile.ptr->setNewtab(profile.value("newtab", defaults.newtab).toUrl());
+ profile.ptr->setNewtab(profile.value("newtab", conf.value<QString>("profile.newtab").value()).toUrl());
connect(profile.ptr, &WebProfile::newtabChanged, profile.settings, [profile](const QUrl &url) {
profile.settings->setValue("newtab", url);
});
diff --git a/lib/webprofile/webprofilemanager.h b/src/webengine/webprofilemanager.h
index 3d86def..3e82936 100644
--- a/lib/webprofile/webprofilemanager.h
+++ b/src/webengine/webprofilemanager.h
@@ -29,7 +29,7 @@ class WebProfileManager : public QObject
{
Q_OBJECT
public:
- explicit WebProfileManager(const ProfileDefault_t &profileSection, QObject *parent);
+ explicit WebProfileManager(QObject *parent);
~WebProfileManager();
/** Create a profile with specified id
@@ -79,7 +79,6 @@ private:
};
QMap<QString, Profile> profiles;
- const ProfileDefault_t defaults;
};
#endif // SMOLBOTE_PROFILEMANAGER_H