diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-01-07 23:28:42 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-01-07 23:28:42 +0100 |
commit | b984992fc92b6dd607732d6dad1c533b36f1ba3a (patch) | |
tree | 984c5ede072c2ebb10ad32acb5d5928162feb97f /src | |
parent | Searching through BookmarkModel elements (diff) | |
download | smolbote-b984992fc92b6dd607732d6dad1c533b36f1ba3a.tar.xz |
Added .clang-format
Diffstat (limited to 'src')
-rw-r--r-- | src/browser.cpp | 12 | ||||
-rw-r--r-- | src/browser.h | 2 | ||||
-rw-r--r-- | src/forms/aboutdialog.cpp | 12 | ||||
-rw-r--r-- | src/forms/aboutdialog.h | 3 | ||||
-rw-r--r-- | src/forms/cookiesform.cpp | 9 | ||||
-rw-r--r-- | src/forms/cookiesform.h | 7 | ||||
-rw-r--r-- | src/forms/profileview.cpp | 16 | ||||
-rw-r--r-- | src/forms/profileview.h | 3 | ||||
-rw-r--r-- | src/forms/searchform.cpp | 8 | ||||
-rw-r--r-- | src/forms/searchform.h | 3 | ||||
-rw-r--r-- | src/main.cpp | 12 | ||||
-rw-r--r-- | src/mainwindow.cpp | 26 | ||||
-rw-r--r-- | src/mainwindow.h | 9 | ||||
-rw-r--r-- | src/singleapplication.cpp | 6 | ||||
-rw-r--r-- | src/singleapplication.h | 1 | ||||
-rw-r--r-- | src/webengine/urlinterceptor.cpp | 4 | ||||
-rw-r--r-- | src/webengine/urlinterceptor.h | 3 | ||||
-rw-r--r-- | src/webengine/webengineprofile.cpp | 72 | ||||
-rw-r--r-- | src/webengine/webengineprofile.h | 2 | ||||
-rw-r--r-- | src/webengine/webpage.cpp | 4 | ||||
-rw-r--r-- | src/webengine/webview.cpp | 14 | ||||
-rw-r--r-- | src/webengine/webview.h | 4 | ||||
-rw-r--r-- | src/widgets/loadingbar.cpp | 6 | ||||
-rw-r--r-- | src/widgets/mainwindowmenubar.cpp | 10 | ||||
-rw-r--r-- | src/widgets/mainwindowtabbar.cpp | 12 | ||||
-rw-r--r-- | src/widgets/mainwindowtabbar.h | 6 |
26 files changed, 133 insertions, 133 deletions
diff --git a/src/browser.cpp b/src/browser.cpp index aad80bb..bd1f841 100644 --- a/src/browser.cpp +++ b/src/browser.cpp @@ -7,14 +7,14 @@ */ #include "browser.h" -#include <bookmarks/bookmarkswidget.h> -#include <downloads/downloadswidget.h> -#include "webengine/urlinterceptor.h" #include "mainwindow.h" +#include "webengine/urlinterceptor.h" #include <QDir> +#include <bookmarks/bookmarkswidget.h> +#include <downloads/downloadswidget.h> -Browser::Browser(int &argc, char *argv[]) : - SingleApplication(argc, argv) +Browser::Browser(int &argc, char *argv[]) + : SingleApplication(argc, argv) { setApplicationName("smolbote"); setWindowIcon(QIcon(":/icon.svg")); @@ -43,7 +43,6 @@ void Browser::setConfiguration(std::shared_ptr<Configuration> &config) // set default profile m_defaultProfile = profile(QString::fromStdString(m_config->value<std::string>("browser.profile").value())); - } MainWindow *Browser::createWindow() @@ -124,4 +123,3 @@ QStringList Browser::profiles() const { return m_profiles.keys(); } - diff --git a/src/browser.h b/src/browser.h index a193e61..1383c44 100644 --- a/src/browser.h +++ b/src/browser.h @@ -9,11 +9,11 @@ #ifndef BROWSER_H #define BROWSER_H +#include "settings/configuration.h" #include "singleapplication.h" #include "webengine/webengineprofile.h" #include <QVector> #include <memory> -#include "settings/configuration.h" class MainWindow; class BookmarksWidget; diff --git a/src/forms/aboutdialog.cpp b/src/forms/aboutdialog.cpp index 0744a5f..e5dfc7d 100644 --- a/src/forms/aboutdialog.cpp +++ b/src/forms/aboutdialog.cpp @@ -12,7 +12,7 @@ constexpr const char *getCompiler() { - // clang also defines __GNUC__, so we need to check for clang first +// clang also defines __GNUC__, so we need to check for clang first #if defined(__clang__) return "Clang " __clang_version__; #elif defined(__GNUC__) @@ -31,9 +31,9 @@ inline const QString getLongVersion() #endif } -AboutDialog::AboutDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::AboutDialog) +AboutDialog::AboutDialog(QWidget *parent) + : QDialog(parent) + , ui(new Ui::AboutDialog) { setAttribute(Qt::WA_DeleteOnClose, true); ui->setupUi(this); @@ -44,7 +44,7 @@ AboutDialog::AboutDialog(QWidget *parent) : aboutLabel->setWordWrap(true); aboutLabel->setText(tr("<h2>smolbote %1</h2>" "<p><i>yet another no-frills browser</i></p>") - .arg(qApp->applicationVersion())); + .arg(qApp->applicationVersion())); ui->toolBox->addItem(aboutLabel, tr("About")); QLabel *licenseLabel = new QLabel(this); @@ -72,7 +72,7 @@ AboutDialog::AboutDialog(QWidget *parent) : "<li>Qt %3</li>" "<li>libconfig</li>" "</ul></p>") - .arg(getLongVersion(), getCompiler(), qVersion())); + .arg(getLongVersion(), getCompiler(), qVersion())); ui->toolBox->addItem(libsLabel, tr("Details")); } diff --git a/src/forms/aboutdialog.h b/src/forms/aboutdialog.h index 9f2189e..740df09 100644 --- a/src/forms/aboutdialog.h +++ b/src/forms/aboutdialog.h @@ -11,7 +11,8 @@ #include <QDialog> -namespace Ui { +namespace Ui +{ class AboutDialog; } diff --git a/src/forms/cookiesform.cpp b/src/forms/cookiesform.cpp index 94d1854..cf2bcb8 100644 --- a/src/forms/cookiesform.cpp +++ b/src/forms/cookiesform.cpp @@ -11,16 +11,16 @@ #include <QDateTime> -CookiesForm::CookiesForm(QWebEngineCookieStore *store, QWidget *parent) : - QWidget(parent), - ui(new Ui::CookiesForm) +CookiesForm::CookiesForm(QWebEngineCookieStore *store, QWidget *parent) + : QWidget(parent) + , ui(new Ui::CookiesForm) { setAttribute(Qt::WA_DeleteOnClose, false); ui->setupUi(this); ui->treeWidget->header()->setSectionResizeMode(QHeaderView::ResizeToContents); connect(store, SIGNAL(cookieAdded(QNetworkCookie)), this, SLOT(addCookie(QNetworkCookie))); - connect(ui->treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(showDetails(QTreeWidgetItem*,QTreeWidgetItem*))); + connect(ui->treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(showDetails(QTreeWidgetItem *, QTreeWidgetItem *))); } CookiesForm::~CookiesForm() @@ -57,7 +57,6 @@ void CookiesForm::addCookie(const QNetworkCookie &cookie) item->setData(0, IsSecureRole, cookie.isSecure() ? tr("yes") : tr("no")); item->setData(0, IsSessionCookieRole, cookie.isSessionCookie() ? tr("yes") : tr("no")); item->setData(0, PathRole, cookie.path()); - } void CookiesForm::showDetails(QTreeWidgetItem *current, QTreeWidgetItem *previous) diff --git a/src/forms/cookiesform.h b/src/forms/cookiesform.h index 01c32ff..18c7698 100644 --- a/src/forms/cookiesform.h +++ b/src/forms/cookiesform.h @@ -9,11 +9,12 @@ #ifndef COOKIESFORM_H #define COOKIESFORM_H -#include <QWidget> -#include <QWebEngineCookieStore> #include <QTreeWidgetItem> +#include <QWebEngineCookieStore> +#include <QWidget> -namespace Ui { +namespace Ui +{ class CookiesForm; } diff --git a/src/forms/profileview.cpp b/src/forms/profileview.cpp index 7d3396f..3d85963 100644 --- a/src/forms/profileview.cpp +++ b/src/forms/profileview.cpp @@ -9,20 +9,20 @@ #include "profileview.h" #include "ui_profileview.h" +#include "forms/cookiesform.h" +#include "webengine/webengineprofile.h" +#include <QComboBox> #include <QLineEdit> #include <QPlainTextEdit> -#include <QComboBox> #include <QPushButton> -#include "webengine/webengineprofile.h" -#include "forms/cookiesform.h" #include <QDialogButtonBox> #include <QFormLayout> -ProfileView::ProfileView(WebEngineProfile *profile, QWidget *parent) : - QDialog(parent), - ui(new Ui::ProfileView) +ProfileView::ProfileView(WebEngineProfile *profile, QWidget *parent) + : QDialog(parent) + , ui(new Ui::ProfileView) { ui->setupUi(this); setProfile(profile); @@ -98,7 +98,7 @@ void ProfileView::updateProfile() // http m_profile->setHttpUserAgent(ui->userAgent->toPlainText()); m_profile->setHttpAcceptLanguage(ui->acceptLanguage->toPlainText()); - switch (ui->cacheType->currentIndex()) { + switch(ui->cacheType->currentIndex()) { case 0: m_profile->setHttpCacheType(QWebEngineProfile::MemoryHttpCache); break; @@ -114,7 +114,7 @@ void ProfileView::updateProfile() m_profile->setHttpCacheMaximumSize(ui->cacheSize->text().toInt()); // policy - switch (ui->cookiePolicy->currentIndex()) { + switch(ui->cookiePolicy->currentIndex()) { case 0: m_profile->setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies); break; diff --git a/src/forms/profileview.h b/src/forms/profileview.h index a2e42f2..bf44346 100644 --- a/src/forms/profileview.h +++ b/src/forms/profileview.h @@ -11,7 +11,8 @@ #include <QDialog> -namespace Ui { +namespace Ui +{ class ProfileView; } diff --git a/src/forms/searchform.cpp b/src/forms/searchform.cpp index b12ff80..42e5a1a 100644 --- a/src/forms/searchform.cpp +++ b/src/forms/searchform.cpp @@ -7,14 +7,14 @@ */ #include "searchform.h" -#include "ui_searchform.h" #include "../mainwindow.h" +#include "ui_searchform.h" #include <settings/configuration.h> -SearchForm::SearchForm(MainWindow *parentWindow, QWidget *parent) : - QWidget(parent), - ui(new Ui::SearchForm) +SearchForm::SearchForm(MainWindow *parentWindow, QWidget *parent) + : QWidget(parent) + , ui(new Ui::SearchForm) { Q_CHECK_PTR(parentWindow); diff --git a/src/forms/searchform.h b/src/forms/searchform.h index 646d4d4..85ce11b 100644 --- a/src/forms/searchform.h +++ b/src/forms/searchform.h @@ -11,7 +11,8 @@ #include <QWidget> -namespace Ui { +namespace Ui +{ class SearchForm; } diff --git a/src/main.cpp b/src/main.cpp index b7bd311..57389bf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,15 +6,15 @@ * SPDX-License-Identifier: GPL-3.0 */ -#include <iostream> -#include "version.h" #include "browser.h" +#include "mainwindow.h" +#include "version.h" #include <QCommandLineParser> +#include <QDir> #include <QFile> #include <QFileInfo> -#include <QDir> #include <QStandardPaths> -#include "mainwindow.h" +#include <iostream> // startup time measuring #ifdef QT_DEBUG @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) parser.addVersionOption(); // user config, ~/.config/smolbote/smolbote.cfg or empty if there is none - QCommandLineOption configOption({"c", "config"}, "Set configuration file.", "path"); + QCommandLineOption configOption({ "c", "config" }, "Set configuration file.", "path"); configOption.setDefaultValue(QStandardPaths::locate(QStandardPaths::AppConfigLocation, "smolbote.cfg")); parser.addOption(configOption); @@ -96,7 +96,7 @@ int main(int argc, char *argv[]) QCommandLineOption generateUserConfigOption("generate-user-config", "Generate user configuration and exit."); parser.addOption(generateUserConfigOption); - QCommandLineOption profileOption({"p", "profile"}, "Use this profile.", "PROFILE"); + QCommandLineOption profileOption({ "p", "profile" }, "Use this profile.", "PROFILE"); profileOption.setDefaultValue(""); parser.addOption(profileOption); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b7c4a05..a2b9ff1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -7,10 +7,10 @@ */ #include "mainwindow.h" +#include "forms/aboutdialog.h" #include "ui_mainwindow.h" #include "widgets/mainwindowmenubar.h" #include <QMessageBox> -#include "forms/aboutdialog.h" #include <QDockWidget> @@ -26,13 +26,13 @@ #include "forms/searchform.h" -MainWindow::MainWindow(std::shared_ptr<Configuration> config, QWidget *parent) : - QMainWindow(parent), - ui(new Ui::MainWindow), - tabBar(new MainWindowTabBar(config, this)), - menuBar(new MainWindowMenuBar(config, this)), - m_addressBar(new UrlLineEdit(this)), - m_progressBar(new LoadingBar(this)) +MainWindow::MainWindow(std::shared_ptr<Configuration> config, QWidget *parent) + : QMainWindow(parent) + , ui(new Ui::MainWindow) + , tabBar(new MainWindowTabBar(config, this)) + , menuBar(new MainWindowMenuBar(config, this)) + , m_addressBar(new UrlLineEdit(this)) + , m_progressBar(new LoadingBar(this)) { Q_ASSERT(config); m_config = config; @@ -93,7 +93,7 @@ MainWindow::MainWindow(std::shared_ptr<Configuration> config, QWidget *parent) : url.replace("$term", t); tabBar->currentView()->load(QUrl::fromUserInput(url)); }); - connect(tabBar, SIGNAL(currentTabChanged(WebView*)), this, SLOT(handleTabChanged(WebView*))); + connect(tabBar, SIGNAL(currentTabChanged(WebView *)), this, SLOT(handleTabChanged(WebView *))); // loading bar ui->statusBar->addPermanentWidget(m_progressBar); @@ -124,7 +124,7 @@ MainWindow::~MainWindow() { // Release all dock widgets before deleting so we don't accidentally delete them // Also fixes that annoying crash when closing - QList<QDockWidget*> allDockWidgets = findChildren<QDockWidget*>(); + QList<QDockWidget *> allDockWidgets = findChildren<QDockWidget *>(); for(QDockWidget *w : allDockWidgets) { if(w->widget()) { w->widget()->setParent(nullptr); @@ -137,10 +137,10 @@ MainWindow::~MainWindow() void MainWindow::addTabbedDock(Qt::DockWidgetArea area, QWidget *widget) { // get all dock widgets - QList<QDockWidget*> allDockWidgets = findChildren<QDockWidget*>(); + QList<QDockWidget *> allDockWidgets = findChildren<QDockWidget *>(); // make a list of widgets in the area we want - QVector<QDockWidget*> areaDockWidgets; + QVector<QDockWidget *> areaDockWidgets; for(QDockWidget *w : allDockWidgets) { if(dockWidgetArea(w) == area) { areaDockWidgets.append(w); @@ -176,7 +176,7 @@ void MainWindow::newTab(const QUrl &url) MainWindow *MainWindow::newWindow(const QUrl &url) { - Browser *instance = static_cast<Browser*>(qApp->instance()); + Browser *instance = static_cast<Browser *>(qApp->instance()); return instance->createSession(m_profile->storageName(), true, QStringList(url.toString())); } diff --git a/src/mainwindow.h b/src/mainwindow.h index 2e6f510..c62ebe3 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -9,17 +9,18 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include <QMainWindow> #include "webengine/webengineprofile.h" -#include <QUrl> -#include "widgets/mainwindowtabbar.h" #include "widgets/loadingbar.h" +#include "widgets/mainwindowtabbar.h" +#include <QMainWindow> +#include <QUrl> #include "lib/navigation/navigationbutton.h" #include <memory> -namespace Ui { +namespace Ui +{ class MainWindow; } diff --git a/src/singleapplication.cpp b/src/singleapplication.cpp index 4810d73..eb51d0c 100644 --- a/src/singleapplication.cpp +++ b/src/singleapplication.cpp @@ -7,11 +7,12 @@ */ #include "singleapplication.h" +#include <QDataStream> #include <QLocalServer> #include <QLocalSocket> -#include <QDataStream> -SingleApplication::SingleApplication(int &argc, char **argv) : QApplication(argc, argv) +SingleApplication::SingleApplication(int &argc, char **argv) + : QApplication(argc, argv) { #ifdef Q_OS_UNIX // could be a path such as "/tmp/foo" @@ -65,7 +66,6 @@ bool SingleApplication::bindLocalSocket(const QString &name) } return true; } - } QString SingleApplication::serverName() const diff --git a/src/singleapplication.h b/src/singleapplication.h index a4ecb2e..8ebea12 100644 --- a/src/singleapplication.h +++ b/src/singleapplication.h @@ -17,7 +17,6 @@ class SingleApplication : public QApplication Q_OBJECT public: - explicit SingleApplication(int &argc, char **argv); ~SingleApplication(); diff --git a/src/webengine/urlinterceptor.cpp b/src/webengine/urlinterceptor.cpp index b8d30cd..bb9bb5f 100644 --- a/src/webengine/urlinterceptor.cpp +++ b/src/webengine/urlinterceptor.cpp @@ -10,8 +10,8 @@ #include <QDir> #include <QTextStream> -UrlRequestInterceptor::UrlRequestInterceptor(const QString &path, QObject *parent) : - QWebEngineUrlRequestInterceptor(parent) +UrlRequestInterceptor::UrlRequestInterceptor(const QString &path, QObject *parent) + : QWebEngineUrlRequestInterceptor(parent) { #ifdef QT_DEBUG qDebug("Reading request blocklist: %s", qUtf8Printable(path)); diff --git a/src/webengine/urlinterceptor.h b/src/webengine/urlinterceptor.h index af0bf35..24936c3 100644 --- a/src/webengine/urlinterceptor.h +++ b/src/webengine/urlinterceptor.h @@ -15,7 +15,6 @@ class UrlRequestInterceptor : public QWebEngineUrlRequestInterceptor { Q_OBJECT public: - struct HostRule { bool isBlocking; }; @@ -29,7 +28,7 @@ public slots: int parseHostfile(const QString &filename); private: - QHash<QString, HostRule*> m_rules; + QHash<QString, HostRule *> m_rules; }; #endif // URLREQUESTINTERCEPTOR_H diff --git a/src/webengine/webengineprofile.cpp b/src/webengine/webengineprofile.cpp index 2d98b3d..78f0b9a 100644 --- a/src/webengine/webengineprofile.cpp +++ b/src/webengine/webengineprofile.cpp @@ -7,12 +7,12 @@ */ #include "webengineprofile.h" +#include <QFileInfo> #include <QSettings> #include <QWebEngineSettings> -#include <QFileInfo> -WebEngineProfile::WebEngineProfile(QObject *parent) : - QWebEngineProfile(parent) +WebEngineProfile::WebEngineProfile(QObject *parent) + : QWebEngineProfile(parent) { m_name = tr("Off-the-record"); @@ -23,8 +23,8 @@ WebEngineProfile::WebEngineProfile(QObject *parent) : // Off-the-record profiles have no persistent path } -WebEngineProfile::WebEngineProfile(const QString &name, const QString &path, QObject *parent) : - QWebEngineProfile(name, parent) +WebEngineProfile::WebEngineProfile(const QString &name, const QString &path, QObject *parent) + : QWebEngineProfile(name, parent) { m_name = name; @@ -78,7 +78,7 @@ void WebEngineProfile::saveProfile() config.beginGroup("http"); config.setValue("userAgent", httpUserAgent()); config.setValue("accept-lang", httpAcceptLanguage()); - switch (httpCacheType()) { + switch(httpCacheType()) { case MemoryHttpCache: config.setValue("cacheType", "memory"); break; @@ -90,10 +90,10 @@ void WebEngineProfile::saveProfile() break; } config.setValue("cacheSize", httpCacheMaximumSize()); - config.endGroup(); // http + config.endGroup(); // http config.beginGroup("policy"); - switch (persistentCookiesPolicy()) { + switch(persistentCookiesPolicy()) { case NoPersistentCookies: config.setValue("cookies", "disabled"); break; @@ -104,7 +104,7 @@ void WebEngineProfile::saveProfile() config.setValue("cookies", "force"); break; } - config.endGroup(); // policy + config.endGroup(); // policy QWebEngineSettings *s = settings(); config.beginGroup("attributes"); @@ -133,7 +133,7 @@ void WebEngineProfile::saveProfile() config.setValue("printElementBackgrounds", s->testAttribute(QWebEngineSettings::PrintElementBackgrounds)); config.setValue("allowRunningInsecureContent", s->testAttribute(QWebEngineSettings::AllowRunningInsecureContent)); #endif - config.endGroup(); // attributes + config.endGroup(); // attributes config.sync(); } @@ -170,7 +170,7 @@ WebEngineProfile *createProfile(const QString &name, const QString &path, QObjec } } profile->setHttpCacheMaximumSize(config.value("cacheSize").toInt()); - config.endGroup(); // http + config.endGroup(); // http config.beginGroup("policy"); { @@ -183,59 +183,59 @@ WebEngineProfile *createProfile(const QString &name, const QString &path, QObjec profile->setPersistentCookiesPolicy(QWebEngineProfile::ForcePersistentCookies); } } - config.endGroup(); // policy + config.endGroup(); // policy config.beginGroup("attributes"); QWebEngineSettings *s = profile->settings(); s->setAttribute(QWebEngineSettings::AutoLoadImages, - config.value("autoLoadImages", s->testAttribute(QWebEngineSettings::AutoLoadImages)).toBool()); + config.value("autoLoadImages", s->testAttribute(QWebEngineSettings::AutoLoadImages)).toBool()); s->setAttribute(QWebEngineSettings::JavascriptEnabled, - config.value("javascriptEnabled", s->testAttribute(QWebEngineSettings::JavascriptEnabled)).toBool()); + config.value("javascriptEnabled", s->testAttribute(QWebEngineSettings::JavascriptEnabled)).toBool()); s->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, - config.value("javascriptCanOpenWindows", s->testAttribute(QWebEngineSettings::JavascriptCanOpenWindows)).toBool()); + config.value("javascriptCanOpenWindows", s->testAttribute(QWebEngineSettings::JavascriptCanOpenWindows)).toBool()); s->setAttribute(QWebEngineSettings::JavascriptCanAccessClipboard, - config.value("javascriptCanAccessClipboard", s->testAttribute(QWebEngineSettings::JavascriptCanAccessClipboard)).toBool()); + config.value("javascriptCanAccessClipboard", s->testAttribute(QWebEngineSettings::JavascriptCanAccessClipboard)).toBool()); s->setAttribute(QWebEngineSettings::LinksIncludedInFocusChain, - config.value("linksIncludedInFocusChain", s->testAttribute(QWebEngineSettings::LinksIncludedInFocusChain)).toBool()); + config.value("linksIncludedInFocusChain", s->testAttribute(QWebEngineSettings::LinksIncludedInFocusChain)).toBool()); s->setAttribute(QWebEngineSettings::LocalStorageEnabled, - config.value("localStorageEnabled", s->testAttribute(QWebEngineSettings::LocalStorageEnabled)).toBool()); + config.value("localStorageEnabled", s->testAttribute(QWebEngineSettings::LocalStorageEnabled)).toBool()); s->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, - config.value("localContentCanAccessRemoteUrls", s->testAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls)).toBool()); + config.value("localContentCanAccessRemoteUrls", s->testAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls)).toBool()); s->setAttribute(QWebEngineSettings::XSSAuditingEnabled, - config.value("xssAuditingEnabled", s->testAttribute(QWebEngineSettings::XSSAuditingEnabled)).toBool()); + config.value("xssAuditingEnabled", s->testAttribute(QWebEngineSettings::XSSAuditingEnabled)).toBool()); s->setAttribute(QWebEngineSettings::SpatialNavigationEnabled, - config.value("spatialNavigationEnabled", s->testAttribute(QWebEngineSettings::SpatialNavigationEnabled)).toBool()); + config.value("spatialNavigationEnabled", s->testAttribute(QWebEngineSettings::SpatialNavigationEnabled)).toBool()); s->setAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls, - config.value("localContentCanAccessFileUrls", s->testAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls)).toBool()); + config.value("localContentCanAccessFileUrls", s->testAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls)).toBool()); s->setAttribute(QWebEngineSettings::HyperlinkAuditingEnabled, - config.value("hyperlinkAuditingEnabled", s->testAttribute(QWebEngineSettings::HyperlinkAuditingEnabled)).toBool()); + config.value("hyperlinkAuditingEnabled", s->testAttribute(QWebEngineSettings::HyperlinkAuditingEnabled)).toBool()); s->setAttribute(QWebEngineSettings::ScrollAnimatorEnabled, - config.value("scrollAnimatorEnabled", s->testAttribute(QWebEngineSettings::ScrollAnimatorEnabled)).toBool()); + config.value("scrollAnimatorEnabled", s->testAttribute(QWebEngineSettings::ScrollAnimatorEnabled)).toBool()); s->setAttribute(QWebEngineSettings::ErrorPageEnabled, - config.value("errorPageEnabled", s->testAttribute(QWebEngineSettings::ErrorPageEnabled)).toBool()); + config.value("errorPageEnabled", s->testAttribute(QWebEngineSettings::ErrorPageEnabled)).toBool()); s->setAttribute(QWebEngineSettings::PluginsEnabled, - config.value("pluginsEnabled", s->testAttribute(QWebEngineSettings::PluginsEnabled)).toBool()); + config.value("pluginsEnabled", s->testAttribute(QWebEngineSettings::PluginsEnabled)).toBool()); s->setAttribute(QWebEngineSettings::FullScreenSupportEnabled, - config.value("fullscreenSupportEnabled", s->testAttribute(QWebEngineSettings::FullScreenSupportEnabled)).toBool()); + config.value("fullscreenSupportEnabled", s->testAttribute(QWebEngineSettings::FullScreenSupportEnabled)).toBool()); s->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, - config.value("screenCaptureEnabled", s->testAttribute(QWebEngineSettings::ScreenCaptureEnabled)).toBool()); + config.value("screenCaptureEnabled", s->testAttribute(QWebEngineSettings::ScreenCaptureEnabled)).toBool()); s->setAttribute(QWebEngineSettings::WebGLEnabled, - config.value("webglEnabled", s->testAttribute(QWebEngineSettings::WebGLEnabled)).toBool()); + config.value("webglEnabled", s->testAttribute(QWebEngineSettings::WebGLEnabled)).toBool()); s->setAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled, - config.value("accelerated2dCanvasEnabled", s->testAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled)).toBool()); + config.value("accelerated2dCanvasEnabled", s->testAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled)).toBool()); s->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, - config.value("autoLoadIconsForPage", s->testAttribute(QWebEngineSettings::AutoLoadIconsForPage)).toBool()); + config.value("autoLoadIconsForPage", s->testAttribute(QWebEngineSettings::AutoLoadIconsForPage)).toBool()); s->setAttribute(QWebEngineSettings::TouchIconsEnabled, - config.value("touchIconsEnabled", s->testAttribute(QWebEngineSettings::TouchIconsEnabled)).toBool()); + config.value("touchIconsEnabled", s->testAttribute(QWebEngineSettings::TouchIconsEnabled)).toBool()); #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) s->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, - config.value("focusOnNavigationEnabled", s->testAttribute(QWebEngineSettings::FocusOnNavigationEnabled)).toBool()); + config.value("focusOnNavigationEnabled", s->testAttribute(QWebEngineSettings::FocusOnNavigationEnabled)).toBool()); s->setAttribute(QWebEngineSettings::PrintElementBackgrounds, - config.value("printElementBackgrounds", s->testAttribute(QWebEngineSettings::PrintElementBackgrounds)).toBool()); + config.value("printElementBackgrounds", s->testAttribute(QWebEngineSettings::PrintElementBackgrounds)).toBool()); s->setAttribute(QWebEngineSettings::AllowRunningInsecureContent, - config.value("allowRunningInsecureContent", s->testAttribute(QWebEngineSettings::AllowRunningInsecureContent)).toBool()); + config.value("allowRunningInsecureContent", s->testAttribute(QWebEngineSettings::AllowRunningInsecureContent)).toBool()); #endif - config.endGroup(); // attributes + config.endGroup(); // attributes } #ifdef QT_DEBUG else { diff --git a/src/webengine/webengineprofile.h b/src/webengine/webengineprofile.h index 63a97a4..bcf21bc 100644 --- a/src/webengine/webengineprofile.h +++ b/src/webengine/webengineprofile.h @@ -9,8 +9,8 @@ #ifndef WEBENGINEPROFILE_H #define WEBENGINEPROFILE_H -#include <QWebEngineProfile> #include <QUrl> +#include <QWebEngineProfile> class WebEngineProfile : public QWebEngineProfile { diff --git a/src/webengine/webpage.cpp b/src/webengine/webpage.cpp index 96ae040..c8ad24b 100644 --- a/src/webengine/webpage.cpp +++ b/src/webengine/webpage.cpp @@ -10,8 +10,8 @@ #include <QWebEngineFullScreenRequest> -WebPage::WebPage(QWebEngineProfile *profile, QObject *parent) : - QWebEnginePage(profile, parent) +WebPage::WebPage(QWebEngineProfile *profile, QObject *parent) + : QWebEnginePage(profile, parent) { connect(this, &WebPage::fullScreenRequested, this, [](QWebEngineFullScreenRequest request) { request.accept(); diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp index ee9b134..ea0ee26 100644 --- a/src/webengine/webview.cpp +++ b/src/webengine/webview.cpp @@ -13,18 +13,18 @@ #include <QClipboard> // zoom widget -#include <QWidgetAction> -#include <QVBoxLayout> #include <QLabel> -#include <QToolButton> #include <QSlider> #include <QStyle> +#include <QToolButton> +#include <QVBoxLayout> +#include <QWidgetAction> // printer support #include <QFileDialog> +#include <QPrintDialog> #include <QPrinter> #include <QPrinterInfo> -#include <QPrintDialog> #include "mainwindow.h" #include <QStatusBar> @@ -32,8 +32,8 @@ // ssl errors #include "lib/navigation/urllineedit.h" -WebView::WebView(MainWindow *parentMainWindow, QWidget *parent) : - QWebEngineView(parent) +WebView::WebView(MainWindow *parentMainWindow, QWidget *parent) + : QWebEngineView(parent) { Q_CHECK_PTR(parentMainWindow); m_parent = parentMainWindow; @@ -140,7 +140,7 @@ void WebView::setPage(WebPage *page) WebView *WebView::createWindow(QWebEnginePage::WebWindowType type) { WebView *view = new WebView(m_parent); - switch (type) { + switch(type) { case QWebEnginePage::WebBrowserWindow: // a complete web browser window m_parent->newWindow()->tabBar->addTab(view); diff --git a/src/webengine/webview.h b/src/webengine/webview.h index 9951630..18a1e02 100644 --- a/src/webengine/webview.h +++ b/src/webengine/webview.h @@ -9,9 +9,9 @@ #ifndef WEBVIEW_H #define WEBVIEW_H -#include <QWebEngineView> -#include <QMenu> #include "webpage.h" +#include <QMenu> +#include <QWebEngineView> class MainWindow; class WebView : public QWebEngineView diff --git a/src/widgets/loadingbar.cpp b/src/widgets/loadingbar.cpp index 5dde427..e72c5bb 100644 --- a/src/widgets/loadingbar.cpp +++ b/src/widgets/loadingbar.cpp @@ -7,11 +7,11 @@ */ #include "loadingbar.h" -#include <QWebEngineView> #include <QTimer> +#include <QWebEngineView> -LoadingBar::LoadingBar(QWidget *parent) : - QProgressBar(parent) +LoadingBar::LoadingBar(QWidget *parent) + : QProgressBar(parent) { setMaximum(100); } diff --git a/src/widgets/mainwindowmenubar.cpp b/src/widgets/mainwindowmenubar.cpp index ada3ad1..c0bea4f 100644 --- a/src/widgets/mainwindowmenubar.cpp +++ b/src/widgets/mainwindowmenubar.cpp @@ -7,17 +7,17 @@ */ #include "mainwindowmenubar.h" -#include <QApplication> -#include <QInputDialog> #include "forms/profileview.h" #include "mainwindow.h" +#include <QApplication> +#include <QInputDialog> #include <settings/configuration.h> #include "browser.h" #include "downloads/downloadswidget.h" -MainWindowMenuBar::MainWindowMenuBar(std::shared_ptr<Configuration> config, MainWindow *parent) : - QMenuBar(parent) +MainWindowMenuBar::MainWindowMenuBar(std::shared_ptr<Configuration> config, MainWindow *parent) + : QMenuBar(parent) { Q_ASSERT(config); Q_CHECK_PTR(parent); @@ -93,5 +93,5 @@ void MainWindowMenuBar::setProfileName(const QString &name) void MainWindowMenuBar::handleLoadProfile(const QString &name, MainWindow *window) { - window->setProfile(static_cast<Browser*>(qApp->instance())->profile(name)); + window->setProfile(static_cast<Browser *>(qApp->instance())->profile(name)); } diff --git a/src/widgets/mainwindowtabbar.cpp b/src/widgets/mainwindowtabbar.cpp index da2cef3..5cf360d 100644 --- a/src/widgets/mainwindowtabbar.cpp +++ b/src/widgets/mainwindowtabbar.cpp @@ -8,13 +8,13 @@ #include "mainwindowtabbar.h" #include <QContextMenuEvent> -#include <settings/configuration.h> #include <QShortcut> +#include <settings/configuration.h> #include "mainwindow.h" -MainWindowTabBar::MainWindowTabBar(const std::shared_ptr<Configuration> &config, MainWindow *parent) : - QTabBar(parent) +MainWindowTabBar::MainWindowTabBar(const std::shared_ptr<Configuration> &config, MainWindow *parent) + : QTabBar(parent) { Q_CHECK_PTR(parent); m_parent = parent; @@ -37,13 +37,13 @@ MainWindowTabBar::MainWindowTabBar(const std::shared_ptr<Configuration> &config, QShortcut *tabLeftShortcut = new QShortcut(parent); tabLeftShortcut->setKey(QKeySequence(QString::fromStdString(config->value<std::string>("browser.shortcuts.tabLeft").value()))); connect(tabLeftShortcut, &QShortcut::activated, [this]() { - this->setCurrentIndex(currentIndex()-1); + this->setCurrentIndex(currentIndex() - 1); }); QShortcut *tabRightShortcut = new QShortcut(parent); tabRightShortcut->setKey(QKeySequence(QString::fromStdString(config->value<std::string>("browser.shortcuts.tabRight").value()))); connect(tabRightShortcut, &QShortcut::activated, [this]() { - this->setCurrentIndex(currentIndex()+1); + this->setCurrentIndex(currentIndex() + 1); }); } @@ -94,7 +94,7 @@ void MainWindowTabBar::contextMenuEvent(QContextMenuEvent *event) } QMenu menu(this); - QAction* closeAction = menu.addAction(tr("Close tab")); + QAction *closeAction = menu.addAction(tr("Close tab")); connect(closeAction, &QAction::triggered, this, [tabIndex, this]() { removeTab(tabIndex); }); diff --git a/src/widgets/mainwindowtabbar.h b/src/widgets/mainwindowtabbar.h index d0ae9cb..845b908 100644 --- a/src/widgets/mainwindowtabbar.h +++ b/src/widgets/mainwindowtabbar.h @@ -9,9 +9,9 @@ #ifndef WEBVIEWTABBAR_H #define WEBVIEWTABBAR_H -#include <QTabBar> -#include "webengine/webview.h" #include "webengine/webengineprofile.h" +#include "webengine/webview.h" +#include <QTabBar> #include <memory> class Configuration; @@ -46,7 +46,7 @@ private slots: private: // store all views in a vector since tabs can only store a QVariant, and that can't easily take a pointer - QVector<WebView*> m_views; + QVector<WebView *> m_views; MainWindow *m_parent; }; |