diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/GitRepo.js | 18 | ||||
| -rw-r--r-- | src/forms/blockerdialog.cpp | 2 | ||||
| -rw-r--r-- | src/forms/blockerdialog.h | 2 | ||||
| -rw-r--r-- | src/forms/downloaddialog.cpp | 2 | ||||
| -rw-r--r-- | src/main.cpp | 4 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 5 | ||||
| -rw-r--r-- | src/smolbote.pro | 48 | ||||
| -rw-r--r-- | src/smolbote.qbs | 21 | 
8 files changed, 43 insertions, 59 deletions
| 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", | 
