aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-02-01 22:21:33 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2017-02-01 22:21:33 +0100
commitf6d6f6ff6570a8d1860fd900f6a8f96ba30acdd0 (patch)
tree575cab29bea0c231852f0782f0df75730c1af71a
parentUpdated license script (diff)
downloadsmolbote-f6d6f6ff6570a8d1860fd900f6a8f96ba30acdd0.tar.xz
AStyle pass
Added style check to pre-commit hook
-rw-r--r--astyle.rc4
-rw-r--r--src/browser.cpp10
-rw-r--r--src/browser.h10
-rw-r--r--src/forms/blockerdialog.cpp10
-rw-r--r--src/forms/blockerdialog.h10
-rw-r--r--src/forms/downloaddialog.cpp10
-rw-r--r--src/forms/downloaddialog.h10
-rw-r--r--src/forms/profiledialog.cpp15
-rw-r--r--src/forms/profiledialog.h10
-rw-r--r--src/main.cpp10
-rw-r--r--src/mainwindow.cpp23
-rw-r--r--src/mainwindow.h10
-rw-r--r--src/settings.cpp10
-rw-r--r--src/settings.h10
-rw-r--r--src/webengine/blockerrule.cpp10
-rw-r--r--src/webengine/blockerrule.h10
-rw-r--r--src/webengine/blockersubscription.cpp10
-rw-r--r--src/webengine/blockersubscription.h10
-rw-r--r--src/webengine/downloaditemform.cpp10
-rw-r--r--src/webengine/downloaditemform.h10
-rw-r--r--src/webengine/urlinterceptor.cpp10
-rw-r--r--src/webengine/urlinterceptor.h10
-rw-r--r--src/webengine/webengineprofile.cpp10
-rw-r--r--src/webengine/webengineprofile.h10
-rw-r--r--src/widgets/urllineedit.cpp10
-rw-r--r--src/widgets/urllineedit.h10
-rw-r--r--src/widgets/webviewtabbar.cpp14
-rw-r--r--src/widgets/webviewtabbar.h10
-rw-r--r--util/header-gpl3.txt10
-rwxr-xr-xutil/pre-commit.py25
30 files changed, 177 insertions, 154 deletions
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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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("<h3>smolbote %1</h3>"
- "<p><i>yet another Qute browser</i></p>"
- "<p>Copyright (C) 2017 Xian Nox</p>"
- "<p>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.</p>")
+ "<p><i>yet another Qute browser</i></p>"
+ "<p>Copyright (C) 2017 Xian Nox</p>"
+ "<p>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.</p>")
.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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
#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 <http://www.gnu.org/licenses/>.
- **
+ **
******************************************************************************/
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 <<astyle --options=astyle.rc --suffix=none src/**/*.cpp src/**/*.h>> to autofix")
# restore stash
os.system("git stash pop -q")
-sys.exit(problems)
+if problems:
+ sys.exit(-1)
+else:
+ sys.exit(0)