aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-01-29 11:00:59 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2017-01-29 11:00:59 +0100
commitaffa4b43443a980ff2e80441a9e340801ccc8159 (patch)
treef9d6d359250024160a3720d9bee6c8e45994074f
parentAdded qbs project file (diff)
downloadsmolbote-affa4b43443a980ff2e80441a9e340801ccc8159.tar.xz
Reading version tag from repo
-rw-r--r--BUILDING.md27
-rw-r--r--CONTRIBUTING.md16
-rw-r--r--src/GitRepo.js18
-rw-r--r--src/forms/blockerdialog.cpp2
-rw-r--r--src/forms/blockerdialog.h2
-rw-r--r--src/forms/downloaddialog.cpp2
-rw-r--r--src/main.cpp4
-rw-r--r--src/mainwindow.cpp5
-rw-r--r--src/smolbote.pro48
-rw-r--r--src/smolbote.qbs21
10 files changed, 75 insertions, 70 deletions
diff --git a/BUILDING.md b/BUILDING.md
index dabd1e8..6afad9f 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -1,28 +1,34 @@
## Building
-* (Recommended) Create a build folder and change into it
+### Tools
+* Qt
+* gcc on linux, msvc on windows
+* qbs
+
+### Steps
+
+* Create a build folder
```
-mkdir build && cd build
+[smolbote repo]$ mkdir build
```
-* Generate the Makefile
+* Run qbs
```
-qmake-qt5 ../src/smolbote.pro
-
-* [TODO] Prepare translations
+[smolbote repo]$ qbs build --build-directory build --file src/smolbote.qbs profile:qt5 release
+```
+This installs the files to build/release/install-root.
-* Run make
+* Test run using the specified Qt profile (optional)
```
-make
+[smolbote repo]$ qbs run --build-directory build --file src/smolbote.qbs --products poi profile:qt5 release
```
### Notes
-* Don't do any steps marked [TODO]
* Windows: MSVC compiler is required because of QtWebEngine dependency
* Windows: Passing the -v or -h parameters creates a dialog box instead of
writing the output to stdout. This is Qt behaviour.
-## Deploying
+## Packaging
### Tarball
@@ -53,6 +59,7 @@ sha512sum --check checksum.sha512
```
### Windows
+Collect the required libraries using
```
QT_DIR\QT_VER\msvc2015_64\windeployqt.exe build-PROFILE\release\qtbrowser.exe
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 58ba086..8ccc0e3 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,3 +1,18 @@
+### Versioning
+
+#### Major version
+Changed infrequently and almost entirely out of foppery and whim.
+
+#### Minor version
+Milestone of multiple features.
+
+#### Revision
+Major bugfixes and each new feature should get a revision.
+
+### Branching
+* master - main branch, should be kept up-to-date, and have only working code
+* development - development branch, anything goes there
+
### Folder structure
folder | description
@@ -8,7 +23,6 @@
/src/webengine | QWebEngine* subclasses
/test | test run location, mainly for QtCreator
-
### QtCreator
* In the project Run Settings set the working directory to _$repo/test_, and the
command line arguments to _-c ./config.ini_.
diff --git a/src/GitRepo.js b/src/GitRepo.js
index 57858aa..d7e19a7 100644
--- a/src/GitRepo.js
+++ b/src/GitRepo.js
@@ -1,5 +1,15 @@
-function repoVersion() {
- console.log("testing");
- return "0.0.0";
+var Process = loadExtension("qbs.Process")
+
+function read(workingDirectory) {
+ var git = new Process();
+ git.setWorkingDirectory(workingDirectory);
+
+ var meta = Object.create(null);
+ git.exec("git", ["describe", "--abbrev=0", "--tag"], true);
+ meta.version = git.readLine();
+
+ git.exec("git", ["describe", "--tag"], true);
+ meta.describe = git.readLine();
+
+ return meta;
}
-
diff --git a/src/forms/blockerdialog.cpp b/src/forms/blockerdialog.cpp
index ed2bbae..ee6bdfc 100644
--- a/src/forms/blockerdialog.cpp
+++ b/src/forms/blockerdialog.cpp
@@ -1,7 +1,7 @@
#include "blockerdialog.h"
#include "ui_blockerdialog.h"
-#include "../settings.h"
+#include "settings.h"
#include <QLabel>
BlockerDialog::BlockerDialog(QWidget *parent) :
diff --git a/src/forms/blockerdialog.h b/src/forms/blockerdialog.h
index 98e1a6e..59dce0a 100644
--- a/src/forms/blockerdialog.h
+++ b/src/forms/blockerdialog.h
@@ -2,7 +2,7 @@
#define URLINTERCEPTORDIALOG_H
#include <QDialog>
-#include "../webengine/blockersubscription.h"
+#include "webengine/blockersubscription.h"
namespace Ui {
class UrlInterceptorDialog;
diff --git a/src/forms/downloaddialog.cpp b/src/forms/downloaddialog.cpp
index baf6202..bb92a0f 100644
--- a/src/forms/downloaddialog.cpp
+++ b/src/forms/downloaddialog.cpp
@@ -26,7 +26,7 @@
#include <QFileDialog>
#include <QListWidget>
#include <QLabel>
-#include "../webengine/downloaditemform.h"
+#include "webengine/downloaditemform.h"
DownloadDialog::DownloadDialog(QWidget *parent) :
QDialog(parent),
diff --git a/src/main.cpp b/src/main.cpp
index 2a28439..d6a6fd0 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -27,7 +27,9 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
app.setApplicationName("smolbote");
- app.setApplicationVersion("0.0.0");
+#ifdef VERSION
+ app.setApplicationVersion(VERSION);
+#endif
app.setWindowIcon(QIcon(QLatin1String(":/icon.svg")));
QCommandLineParser parser;
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 8f54b0b..8413b18 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -114,11 +114,12 @@ void MainWindow::closeEvent(QCloseEvent *event)
void MainWindow::about()
{
- QMessageBox::about(this, tr("About"), tr("<h3>smolbote</h3>"
+ 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>"));
+ "This is free software, and you are welcome to redistribute it under the conditions set by the GNU GPLv3.</p>")
+ .arg(qApp->applicationVersion()));
}
void MainWindow::loadProfile(const QString &name)
diff --git a/src/smolbote.pro b/src/smolbote.pro
deleted file mode 100644
index c8be516..0000000
--- a/src/smolbote.pro
+++ /dev/null
@@ -1,48 +0,0 @@
-#-------------------------------------------------
-#
-#
-#
-#-------------------------------------------------
-
-QT += core gui widgets \
- webengine webenginewidgets
-
-TARGET = poi
-TEMPLATE = app
-
-
-SOURCES += main.cpp \
- mainwindow.cpp \
- browser.cpp \
- widgets/webviewtabbar.cpp \
- settings.cpp \
- forms/profiledialog.cpp \
- webengine/webengineprofile.cpp \
- forms/downloaddialog.cpp \
- webengine/downloaditemform.cpp \
- webengine/urlinterceptor.cpp \
- forms/blockerdialog.cpp \
- webengine/blockersubscription.cpp \
- webengine/blockerrule.cpp
-
-HEADERS += mainwindow.h \
- browser.h \
- widgets/webviewtabbar.h \
- settings.h \
- forms/profiledialog.h \
- webengine/webengineprofile.h \
- forms/downloaddialog.h \
- webengine/downloaditemform.h \
- webengine/urlinterceptor.h \
- forms/blockerdialog.h \
- webengine/blockersubscription.h \
- webengine/blockerrule.h
-
-FORMS += mainwindow.ui \
- forms/profiledialog.ui \
- forms/downloaddialog.ui \
- webengine/downloaditemform.ui \
- forms/blockerdialog.ui
-
-RESOURCES += \
- data/resources.qrc
diff --git a/src/smolbote.qbs b/src/smolbote.qbs
index 136ea21..1dd603a 100644
--- a/src/smolbote.qbs
+++ b/src/smolbote.qbs
@@ -6,7 +6,26 @@ Project {
CppApplication {
name: "poi"
- property string version: GitRepo.repoVersion()
+ property string sourceDirectory: parent.sourceDirectory
+
+ Probe {
+ id: git
+ property string version: "1.0.0"
+ property string describe: "1.0.0-0-00000000"
+ configure: {
+ var meta = GitRepo.read(git.parent.sourceDirectory);
+ version = meta.version;
+ describe = meta.describe;
+ found = true;
+ }
+ }
+
+ cpp.includePaths: ['.']
+ Properties {
+ condition: git.found
+ cpp.defines: ['VERSION="'+git.version+'"']
+ }
+
files: [
"browser.cpp",
"browser.h",