diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-09-18 17:13:24 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-09-18 17:13:24 +0200 |
commit | d7c51cc1f3e67ad9c167b7afcbf7313181832718 (patch) | |
tree | 1c1b9754060ebfbbf4ad606f39a820b539db1b11 | |
parent | Update vendor.cmake (diff) | |
download | smolbote-d7c51cc1f3e67ad9c167b7afcbf7313181832718.tar.xz |
clang-format pass
-rw-r--r-- | plugins/ConfigurationEditor/configurationeditorplugin.cpp | 10 | ||||
-rw-r--r-- | plugins/ConfigurationEditor/configurationeditorplugin.h | 1 | ||||
-rw-r--r-- | src/mainwindow/mainwindow.cpp | 26 | ||||
-rw-r--r-- | src/mainwindow/mainwindow.h | 3 | ||||
-rw-r--r-- | src/subwindow/subwindow.cpp | 16 | ||||
-rw-r--r-- | src/webengine/urlinterceptor.h | 6 | ||||
-rw-r--r-- | src/webengine/webpage.cpp | 10 | ||||
-rw-r--r-- | src/webengine/webview.cpp | 7 |
8 files changed, 42 insertions, 37 deletions
diff --git a/plugins/ConfigurationEditor/configurationeditorplugin.cpp b/plugins/ConfigurationEditor/configurationeditorplugin.cpp index 0d44a8a..bf8a90d 100644 --- a/plugins/ConfigurationEditor/configurationeditorplugin.cpp +++ b/plugins/ConfigurationEditor/configurationeditorplugin.cpp @@ -1,7 +1,7 @@ #include "configurationeditorplugin.h" -#include <QHash> -#include <QDialog> #include "forms/configurationdialog.h" +#include <QDialog> +#include <QHash> #include <configuration.h> CommandHash_t ConfigurationEditorPlugin::commands() @@ -9,9 +9,9 @@ CommandHash_t ConfigurationEditorPlugin::commands() QHash<QString, std::function<int()>> hash; hash.insert("configure", [this]() -> int { - auto *dlg = createWidget(nullptr); - return dlg->exec(); - }); + auto *dlg = createWidget(nullptr); + return dlg->exec(); + }); return hash; } diff --git a/plugins/ConfigurationEditor/configurationeditorplugin.h b/plugins/ConfigurationEditor/configurationeditorplugin.h index 6bb72ce..5e70ab7 100644 --- a/plugins/ConfigurationEditor/configurationeditorplugin.h +++ b/plugins/ConfigurationEditor/configurationeditorplugin.h @@ -15,7 +15,6 @@ public: // PluginInterface CommandHash_t commands() override; QDialog *createWidget(QWidget *parent = nullptr) override; - }; #endif // CONFIGURATIONEDITOR_PLUGIN_H diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp index 36fd8a6..77b8ad3 100644 --- a/src/mainwindow/mainwindow.cpp +++ b/src/mainwindow/mainwindow.cpp @@ -7,16 +7,18 @@ */ #include "mainwindow.h" -#include "ui_mainwindow.h" #include "addressbar/addressbar.h" #include "browser.h" +#include "session.h" #include "subwindow/subwindow.h" +#include "ui_mainwindow.h" #include "webengine/webview.h" #include "widgets/dockwidget.h" #include "widgets/navigationbar.h" #include "widgets/searchform.h" #include <QApplication> #include <QCloseEvent> +#include <QFileDialog> #include <QJsonArray> #include <QJsonObject> #include <QLineEdit> @@ -24,19 +26,17 @@ #include <QMdiSubWindow> #include <QMenuBar> #include <QMessageBox> +#include <QPrintDialog> +#include <QPrinter> +#include <QPrinterInfo> #include <QShortcut> #include <QStatusBar> #include <QToolBar> #include <QUrl> +#include <QVBoxLayout> #include <configuration/configuration.h> -#include <web/webprofile.h> -#include "session.h" -#include <QFileDialog> -#include <QPrinter> -#include <QPrinterInfo> -#include <QPrintDialog> #include <web/profilemanager.h> -#include <QVBoxLayout> +#include <web/webprofile.h> #ifdef PLASMA_BLUR #include <KWindowEffects> #endif @@ -314,8 +314,8 @@ void MainWindow::createTab(const QUrl &url) auto *w = qobject_cast<SubWindow *>(mdiArea->currentSubWindow()); if(w == nullptr) { //w = createSubWindow(url.toString()); -// w = createSubWindow(WebProfile::defaultProfile()); -// w->addTab(url); + // w = createSubWindow(WebProfile::defaultProfile()); + // w->addTab(url); } else { w->addTab(url); } @@ -381,8 +381,10 @@ void MainWindow::updatePageLoadProfileMenu() return; pageLoadProfileMenu->addActions(profileManager->createProfileMenu([this](WebProfile *profile) { - this->currentView->setProfile(profile); - }, this)->actions()); + this->currentView->setProfile(profile); + }, + this) + ->actions()); } void MainWindow::closeEvent(QCloseEvent *event) diff --git a/src/mainwindow/mainwindow.h b/src/mainwindow/mainwindow.h index 3abeb39..d7a5fb3 100644 --- a/src/mainwindow/mainwindow.h +++ b/src/mainwindow/mainwindow.h @@ -23,7 +23,8 @@ class WebView; class NavigationBar; class WebProfile; -namespace Ui { +namespace Ui +{ class MainWindow; } diff --git a/src/subwindow/subwindow.cpp b/src/subwindow/subwindow.cpp index e4affec..6cbb172 100644 --- a/src/subwindow/subwindow.cpp +++ b/src/subwindow/subwindow.cpp @@ -8,8 +8,8 @@ #include "subwindow.h" #include "browser.h" -#include "webengine/webview.h" #include "tabwidget.h" +#include "webengine/webview.h" #include <QAction> #include <QJsonArray> #include <QJsonDocument> @@ -17,11 +17,11 @@ #include <QMenu> #include <QShortcut> #include <QStyle> +#include <QTabBar> #include <QToolButton> -#include <web/webprofile.h> -#include <web/profilemanager.h> #include <configuration/configuration.h> -#include <QTabBar> +#include <web/profilemanager.h> +#include <web/webprofile.h> SubWindow::SubWindow(const std::unique_ptr<Configuration> &config, QWidget *parent, Qt::WindowFlags flags) : QMdiSubWindow(parent, flags) @@ -51,9 +51,11 @@ SubWindow::SubWindow(const std::unique_ptr<Configuration> &config, QWidget *pare Q_CHECK_PTR(browser); loadProfile_menu->addActions(profileManager->createProfileMenu([this, profileName_action](WebProfile *profile) { - this->setProfile(profile); - profileName_action->setText(tr("Profile: %1").arg(profile->name())); - }, this)->actions()); + this->setProfile(profile); + profileName_action->setText(tr("Profile: %1").arg(profile->name())); + }, + this) + ->actions()); menu->insertSeparator(firstAction); } diff --git a/src/webengine/urlinterceptor.h b/src/webengine/urlinterceptor.h index a4a1b6e..ff47ffe 100644 --- a/src/webengine/urlinterceptor.h +++ b/src/webengine/urlinterceptor.h @@ -9,11 +9,11 @@ #ifndef SMOLBOTE_URLREQUESTINTERCEPTOR_H #define SMOLBOTE_URLREQUESTINTERCEPTOR_H +#include "web/urlfilter/filterrule.h" +#include <QByteArray> +#include <QVector> #include <QWebEngineUrlRequestInterceptor> #include <memory> -#include <QVector> -#include <QByteArray> -#include "web/urlfilter/filterrule.h" typedef std::pair<std::string, std::string> Header; diff --git a/src/webengine/webpage.cpp b/src/webengine/webpage.cpp index ff57ac5..28b426b 100644 --- a/src/webengine/webpage.cpp +++ b/src/webengine/webpage.cpp @@ -7,14 +7,14 @@ */ #include "webpage.h" +#include <QLayout> #include <QMessageBox> -#include <QWebEngineFullScreenRequest> #include <QTimer> -#include <QLayout> +#include <QWebEngineFullScreenRequest> QString tr_terminationStatus(QWebEnginePage::RenderProcessTerminationStatus status) { - switch (status) { + switch(status) { case QWebEnginePage::NormalTerminationStatus: return QObject::tr("The render process terminated normally."); case QWebEnginePage::AbnormalTerminationStatus: @@ -142,8 +142,8 @@ void WebPage::renderProcessCrashed(QWebEnginePage::RenderProcessTerminationStatu QString page = "<html><body><h1>This tab has crashed!</h1>%message%</body></html>"; page.replace(QLatin1String("%message%"), QString("<p>%1<br>Exit code is %2.</p>" - "<p>Press <a href='%3'>here</a> to reload this tab.</p>").arg(tr_terminationStatus(terminationStatus), QString::number(exitCode), - this->url().toEncoded())); + "<p>Press <a href='%3'>here</a> to reload this tab.</p>") + .arg(tr_terminationStatus(terminationStatus), QString::number(exitCode), this->url().toEncoded())); QTimer::singleShot(0, this, [=]() { setHtml(page.toUtf8(), url()); diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp index ee08c34..b613273 100644 --- a/src/webengine/webview.cpp +++ b/src/webengine/webview.cpp @@ -7,10 +7,8 @@ */ #include "webview.h" -#include <web/profilemanager.h> #include "subwindow/subwindow.h" #include "webpage.h" -#include <web/webprofile.h> #include <QContextMenuEvent> #include <QDialog> #include <QMenu> @@ -22,6 +20,8 @@ #include <QWebEngineContextMenuData> #include <QWebEngineHistoryItem> #include <QWidgetAction> +#include <web/profilemanager.h> +#include <web/webprofile.h> inline QAction *historyAction(QWebEngineView *view, const QWebEngineHistoryItem &item) { @@ -247,7 +247,8 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) auto *view = this->createWindow(QWebEnginePage::WebBrowserTab); view->setProfile(profile); view->load(ctxdata.linkUrl()); - }, this); + }, + this); newTabMenu->setTitle(tr("Open link in new tab with profile")); menu->addMenu(newTabMenu); |