From f6d6f6ff6570a8d1860fd900f6a8f96ba30acdd0 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Wed, 1 Feb 2017 22:21:33 +0100 Subject: AStyle pass Added style check to pre-commit hook --- astyle.rc | 4 ++++ src/browser.cpp | 10 +++++----- src/browser.h | 10 +++++----- src/forms/blockerdialog.cpp | 10 +++++----- src/forms/blockerdialog.h | 10 +++++----- src/forms/downloaddialog.cpp | 10 +++++----- src/forms/downloaddialog.h | 10 +++++----- src/forms/profiledialog.cpp | 15 ++++++++------- src/forms/profiledialog.h | 10 +++++----- src/main.cpp | 10 +++++----- src/mainwindow.cpp | 23 ++++++++++++----------- src/mainwindow.h | 10 +++++----- src/settings.cpp | 10 +++++----- src/settings.h | 10 +++++----- src/webengine/blockerrule.cpp | 10 +++++----- src/webengine/blockerrule.h | 10 +++++----- src/webengine/blockersubscription.cpp | 10 +++++----- src/webengine/blockersubscription.h | 10 +++++----- src/webengine/downloaditemform.cpp | 10 +++++----- src/webengine/downloaditemform.h | 10 +++++----- src/webengine/urlinterceptor.cpp | 10 +++++----- src/webengine/urlinterceptor.h | 10 +++++----- src/webengine/webengineprofile.cpp | 10 +++++----- src/webengine/webengineprofile.h | 10 +++++----- src/widgets/urllineedit.cpp | 10 +++++----- src/widgets/urllineedit.h | 10 +++++----- src/widgets/webviewtabbar.cpp | 14 +++++++------- src/widgets/webviewtabbar.h | 10 +++++----- util/header-gpl3.txt | 10 +++++----- util/pre-commit.py | 25 +++++++++++++++++++++---- 30 files changed, 177 insertions(+), 154 deletions(-) create mode 100644 astyle.rc diff --git a/astyle.rc b/astyle.rc new file mode 100644 index 0000000..d0f745a --- /dev/null +++ b/astyle.rc @@ -0,0 +1,4 @@ +--style=otbs +--attach-namespaces +--attach-inlines +--indent=spaces=4 diff --git a/src/browser.cpp b/src/browser.cpp index 654c020..4bbfccb 100644 --- a/src/browser.cpp +++ b/src/browser.cpp @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #include "browser.h" diff --git a/src/browser.h b/src/browser.h index 14ef771..2638929 100644 --- a/src/browser.h +++ b/src/browser.h @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #ifndef BROWSER_H diff --git a/src/forms/blockerdialog.cpp b/src/forms/blockerdialog.cpp index 2660d7d..da5fae6 100644 --- a/src/forms/blockerdialog.cpp +++ b/src/forms/blockerdialog.cpp @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #include "blockerdialog.h" diff --git a/src/forms/blockerdialog.h b/src/forms/blockerdialog.h index 9fc77ba..6970795 100644 --- a/src/forms/blockerdialog.h +++ b/src/forms/blockerdialog.h @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #ifndef URLINTERCEPTORDIALOG_H diff --git a/src/forms/downloaddialog.cpp b/src/forms/downloaddialog.cpp index bb92a0f..59756bf 100644 --- a/src/forms/downloaddialog.cpp +++ b/src/forms/downloaddialog.cpp @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #include "downloaddialog.h" diff --git a/src/forms/downloaddialog.h b/src/forms/downloaddialog.h index cadc2b5..a28dd92 100644 --- a/src/forms/downloaddialog.h +++ b/src/forms/downloaddialog.h @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #ifndef DOWNLOADDIALOG_H diff --git a/src/forms/profiledialog.cpp b/src/forms/profiledialog.cpp index a3e7c60..057dc7d 100644 --- a/src/forms/profiledialog.cpp +++ b/src/forms/profiledialog.cpp @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #include "profiledialog.h" @@ -33,10 +33,11 @@ ProfileDialog::ProfileDialog(QWebEngineProfile *profile, QWidget *parent) : _profile = profile; ui->setupUi(this); - if(!_profile->storageName().isEmpty()) + if(!_profile->storageName().isEmpty()) { setWindowTitle(_profile->storageName()); - else + } else { setWindowTitle(tr("Off-the-record")); + } // http ui->userAgent->setPlainText(_profile->httpUserAgent()); diff --git a/src/forms/profiledialog.h b/src/forms/profiledialog.h index 59c2d5a..ab367d8 100644 --- a/src/forms/profiledialog.h +++ b/src/forms/profiledialog.h @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #ifndef PROFILEDIALOG_H diff --git a/src/main.cpp b/src/main.cpp index 5b77ba7..34b93d5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #include "browser.h" diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f3f0860..cc7003d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #include "mainwindow.h" @@ -84,10 +84,11 @@ MainWindow::MainWindow(Browser *instance, QUrl defaultUrl, QWidget *parent) : tabToolBar->addWidget(tabBar); connect(tabBar, SIGNAL(currentTabChanged(QWebEngineView*)), this, SLOT(handleTabChanged(QWebEngineView*))); - if(!defaultUrl.isEmpty()) + if(!defaultUrl.isEmpty()) { createNewTab(defaultUrl); - else + } else { createNewTab(settings.value("defaults/url", QUrl("http://duckduckgo.com")).toUrl()); + } } MainWindow::~MainWindow() @@ -115,10 +116,10 @@ void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::about() { QMessageBox::about(this, tr("About"), tr("

smolbote %1

" - "

yet another Qute browser

" - "

Copyright (C) 2017 Xian Nox

" - "

This program comes with ABSOLUTELY NO WARRANTY. " - "This is free software, and you are welcome to redistribute it under the conditions set by the GNU GPLv3.

") + "

yet another Qute browser

" + "

Copyright (C) 2017 Xian Nox

" + "

This program comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are welcome to redistribute it under the conditions set by the GNU GPLv3.

") .arg(qApp->applicationVersion())); } diff --git a/src/mainwindow.h b/src/mainwindow.h index 4a7455a..a9446be 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #ifndef MAINWINDOW_H diff --git a/src/settings.cpp b/src/settings.cpp index ad5cdb0..e4871ad 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #include "settings.h" diff --git a/src/settings.h b/src/settings.h index e073ceb..7167aa1 100644 --- a/src/settings.h +++ b/src/settings.h @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #ifndef SETTINGS_H diff --git a/src/webengine/blockerrule.cpp b/src/webengine/blockerrule.cpp index 6d49fa4..3a35ab6 100644 --- a/src/webengine/blockerrule.cpp +++ b/src/webengine/blockerrule.cpp @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #include "blockerrule.h" diff --git a/src/webengine/blockerrule.h b/src/webengine/blockerrule.h index 1781f84..cf1dc19 100644 --- a/src/webengine/blockerrule.h +++ b/src/webengine/blockerrule.h @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #ifndef ADBLOCKRULE_H diff --git a/src/webengine/blockersubscription.cpp b/src/webengine/blockersubscription.cpp index 9275209..40d3e9f 100644 --- a/src/webengine/blockersubscription.cpp +++ b/src/webengine/blockersubscription.cpp @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #include "blockersubscription.h" diff --git a/src/webengine/blockersubscription.h b/src/webengine/blockersubscription.h index 814c712..b8e3b9a 100644 --- a/src/webengine/blockersubscription.h +++ b/src/webengine/blockersubscription.h @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #ifndef URLINTERCEPTORSUBSCRIPTION_H diff --git a/src/webengine/downloaditemform.cpp b/src/webengine/downloaditemform.cpp index 39661f9..f2928f7 100644 --- a/src/webengine/downloaditemform.cpp +++ b/src/webengine/downloaditemform.cpp @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #include "downloaditemform.h" diff --git a/src/webengine/downloaditemform.h b/src/webengine/downloaditemform.h index 963d7c5..841e8bf 100644 --- a/src/webengine/downloaditemform.h +++ b/src/webengine/downloaditemform.h @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #ifndef DOWNLOADITEMFORM_H diff --git a/src/webengine/urlinterceptor.cpp b/src/webengine/urlinterceptor.cpp index 0b94a76..cc196ba 100644 --- a/src/webengine/urlinterceptor.cpp +++ b/src/webengine/urlinterceptor.cpp @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #include "urlinterceptor.h" diff --git a/src/webengine/urlinterceptor.h b/src/webengine/urlinterceptor.h index e60fd91..0f9fe65 100644 --- a/src/webengine/urlinterceptor.h +++ b/src/webengine/urlinterceptor.h @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #ifndef ADBLOCKINTERCEPTOR_H diff --git a/src/webengine/webengineprofile.cpp b/src/webengine/webengineprofile.cpp index 532250c..826bc44 100644 --- a/src/webengine/webengineprofile.cpp +++ b/src/webengine/webengineprofile.cpp @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #include "webengineprofile.h" diff --git a/src/webengine/webengineprofile.h b/src/webengine/webengineprofile.h index 51fb739..dc07f4b 100644 --- a/src/webengine/webengineprofile.h +++ b/src/webengine/webengineprofile.h @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #ifndef WEBENGINEPROFILE_H diff --git a/src/widgets/urllineedit.cpp b/src/widgets/urllineedit.cpp index b5082f1..5c1f5c4 100644 --- a/src/widgets/urllineedit.cpp +++ b/src/widgets/urllineedit.cpp @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #include "urllineedit.h" diff --git a/src/widgets/urllineedit.h b/src/widgets/urllineedit.h index 3405461..c925c28 100644 --- a/src/widgets/urllineedit.h +++ b/src/widgets/urllineedit.h @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #ifndef URLLINEEDIT_H diff --git a/src/widgets/webviewtabbar.cpp b/src/widgets/webviewtabbar.cpp index a050a76..aef2bd8 100644 --- a/src/widgets/webviewtabbar.cpp +++ b/src/widgets/webviewtabbar.cpp @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #include "webviewtabbar.h" @@ -45,8 +45,8 @@ int WebViewTabBar::addTab(QWebEngineProfile *profile, const QUrl &url) //connect(view, SIGNAL(titleChanged()), this, SLOT(updateTabText())); connect(view, &QWebEngineView::titleChanged, [this, view](const QString &title) { - int index = m_views.indexOf(view); - setTabText(index, title); + int index = m_views.indexOf(view); + setTabText(index, title); }); connect(view, &QWebEngineView::iconChanged, [this, view](const QIcon &icon) { int index = m_views.indexOf(view); diff --git a/src/widgets/webviewtabbar.h b/src/widgets/webviewtabbar.h index 8b32e7a..bf7edb2 100644 --- a/src/widgets/webviewtabbar.h +++ b/src/widgets/webviewtabbar.h @@ -1,21 +1,21 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) 2017 Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ #ifndef WEBVIEWTABBAR_H diff --git a/util/header-gpl3.txt b/util/header-gpl3.txt index 058a0f7..a44bbfe 100644 --- a/util/header-gpl3.txt +++ b/util/header-gpl3.txt @@ -1,20 +1,20 @@ /** LICENSE ******************************************************************** - ** + ** ** smolbote: yet another qute browser ** Copyright (C) $CURRENTYEAR$ Xian Nox - ** + ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. - ** + ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. - ** + ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see . - ** + ** ******************************************************************************/ diff --git a/util/pre-commit.py b/util/pre-commit.py index f8242f6..9282854 100755 --- a/util/pre-commit.py +++ b/util/pre-commit.py @@ -2,18 +2,35 @@ import os import sys +import subprocess import glob import license # stash unstaged files before running test os.system("git stash -q --keep-index") -print("Running pre-commit hook in {0}".format(os.getcwd())) +#print("Running pre-commit hook in {0}".format(os.getcwd())) +problems = False -problems = 0 -problems += license.lint("util/header-gpl3.txt", glob.glob("src/**/*.cpp") + glob.glob("src/**/*.h"), True) +# check license +print("Checking license...") +if license.lint("util/header-gpl3.txt", glob.glob("src/**/*.cpp") + glob.glob("src/**/*.h"), True) > 0: + problems = True + print("Run <<./util/license.py -l util/header-gpl3.txt src/**/*.cpp src/**/*.h>> to autofix") + +# check style +print("Checking style...") +astyle = subprocess.run(['astyle', '--dry-run', '--formatted', '--options=astyle.rc'] + glob.glob("src/**/*.cpp") + glob.glob("src/**/*.h"), stdout=subprocess.PIPE) +if len(astyle.stdout.splitlines()) > 0: + problems = True + for line in astyle.stdout.splitlines(): + print(line.decode('utf-8')) + print("Run <> to autofix") # restore stash os.system("git stash pop -q") -sys.exit(problems) +if problems: + sys.exit(-1) +else: + sys.exit(0) -- cgit v1.2.1