diff options
author | Florian Preinstorfer | 2016-05-02 22:28:21 +0200 |
---|---|---|
committer | Florian Preinstorfer | 2016-05-02 22:40:51 +0200 |
commit | d883f2a5d169aea4b53bae26e7c5ae606be737e6 (patch) | |
tree | 7fbac55c22ac48221c26b0c77639a667a58f2b24 | |
download | aur-d883f2a5d169aea4b53bae26e7c5ae606be737e6.tar.gz |
Initial release: 0.16.0502
-rw-r--r-- | .SRCINFO | 25 | ||||
-rw-r--r-- | 0001-Use-QStandardPaths-AppDataLocation-as-base-path.patch | 171 | ||||
-rw-r--r-- | PKGBUILD | 47 | ||||
-rw-r--r-- | qrk.desktop | 10 |
4 files changed, 253 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..33031ae0b85d --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,25 @@ +# Generated by mksrcinfo v8 +# Mon May 2 20:40:38 UTC 2016 +pkgbase = qrk + pkgdesc = A cash register for small companies (mainly for Austrian companies) + pkgver = 0.16.0502 + pkgrel = 1 + url = http://www.ckvsoft.at/ + arch = i686 + arch = x86_64 + license = GPL3 + makedepends = qt5-declarative + depends = qrencode + depends = crypto++ + source = http://downloads.sourceforge.net/project/qrk-registrier-kasse/source/QRK_0.16.0502.source.tar.gz + source = qrk.desktop + source = 0001-Use-QStandardPaths-AppDataLocation-as-base-path.patch + md5sums = a784fe919008cd3dd2da61e3210c82ed + md5sums = 52c990903894fdecd440e2e2914c2f09 + md5sums = 0b8144d154ae8e14ae8ffb99e2292867 + sha256sums = b7874437ed3ce655c0b548b484e28026acf5cb3ab5701553f3a598f99a37d459 + sha256sums = f71882aea62bd7c07e4806f0223d1699170ac89d59036f5fd5add1004eb93cd0 + sha256sums = fa91ac9a0e11af077b5806d5c134b0117ca091cbddce5e972b36d5a604b0ad68 + +pkgname = qrk + diff --git a/0001-Use-QStandardPaths-AppDataLocation-as-base-path.patch b/0001-Use-QStandardPaths-AppDataLocation-as-base-path.patch new file mode 100644 index 000000000000..852c73ba327a --- /dev/null +++ b/0001-Use-QStandardPaths-AppDataLocation-as-base-path.patch @@ -0,0 +1,171 @@ +From 3067930c16c28e5c3fd0e966990e5cfe92b16028 Mon Sep 17 00:00:00 2001 +From: Florian Preinstorfer <nblock@archlinux.us> +Date: Mon, 2 May 2016 22:18:17 +0200 +Subject: [PATCH] Use QStandardPaths::AppDataLocation as base path + +--- + src/backup.cpp | 9 +++++---- + src/database.cpp | 3 ++- + src/main.cpp | 12 +++++++++++- + src/qrkhome.cpp | 9 +++++---- + src/settingsdialog.cpp | 5 ++--- + 5 files changed, 25 insertions(+), 13 deletions(-) + +diff --git a/src/backup.cpp b/src/backup.cpp +index 3e41406..0e2ef01 100644 +--- a/src/backup.cpp ++++ b/src/backup.cpp +@@ -25,14 +25,15 @@ + + #include <QSettings> + #include <QApplication> ++#include <QStandardPaths> + #include <QDebug> + + void Backup::create() + { + + QSettings settings(QSettings::IniFormat, QSettings::UserScope, "QRK", "QRK"); +- QString backupDir = settings.value("backupDirectory", qApp->applicationDirPath()).toString(); +- QString dataDir = qApp->applicationDirPath() + "/data"; ++ QString backupDir = settings.value("backupDirectory", QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)).toString(); ++ QString dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/data"; + + QString infile = QString("%1/%2-QRK.db").arg(dataDir).arg(QDate::currentDate().year()); + +@@ -51,9 +52,9 @@ void Backup::pakLogFile() + { + + QSettings settings(QSettings::IniFormat, QSettings::UserScope, "QRK", "QRK"); +- QString backupDir = settings.value("backupDirectory", qApp->applicationDirPath()).toString(); ++ QString backupDir = settings.value("backupDirectory", QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)).toString(); + +- QString infile = QString("%1/%2-QRK.db").arg(qApp->applicationDirPath() + "/qrk.log"); ++ QString infile = QString("%1/%2-QRK.db").arg(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/qrk.log"); + + QString outfile = QString("%1/qrk_log_%2.zip").arg(backupDir).arg(QDateTime::currentDateTime().toString("yyyyMMdd-hhmmss")); + +diff --git a/src/database.cpp b/src/database.cpp +index b5d324e..bc2bde0 100644 +--- a/src/database.cpp ++++ b/src/database.cpp +@@ -31,6 +31,7 @@ + #include <QSqlError> + #include <QDir> + #include <QDate> ++#include <QStandardPaths> + + Database::Database(QObject *parent) + : QObject(parent) +@@ -492,7 +493,7 @@ bool Database::open(bool dbSelect) + + QDate date = QDate::currentDate(); + +- QString dataDir = qApp->applicationDirPath() + "/data"; ++ QString dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/data"; + QDir dir(dataDir); + if (!dir.exists()) { + dir.mkpath("."); +diff --git a/src/main.cpp b/src/main.cpp +index ac5228c..aa21ddd 100644 +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -31,6 +31,7 @@ + #include "stdio.h" + #include "signal.h" + ++#include <QDir> + #include <QTranslator> + #include <QLibraryInfo> + #include <QApplication> +@@ -38,12 +39,19 @@ + #include <QSharedMemory> + #include <QStyleFactory> + #include <QtPlugin> ++#include <QStandardPaths> + + //-------------------------------------------------------------------------------- + #include <QFile> + #include <QTextStream> + #include <QDebug> + ++void createAppDataLocation() ++{ ++ QDir dir; ++ dir.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)); ++} ++ + void QRKMessageHandler(QtMsgType type, const QMessageLogContext &, const QString & str) + { + QString txt; +@@ -61,7 +69,8 @@ void QRKMessageHandler(QtMsgType type, const QMessageLogContext &, const QString + txt = QString("%1 %2 Fatal: %3").arg(QDateTime::currentDateTime().toString("yyyy.MM.dd hh:mm:ss.zzz")).arg(type).arg(str); + break; + } +- QFile outFile(qApp->applicationDirPath() + "/qrk.log"); ++ QFile outFile(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/qrk.log"); ++ + if (outFile.size() > 20000000) /*20 Mega*/ + Backup::pakLogFile(); + +@@ -90,6 +99,7 @@ int main(int argc, char *argv[]) + { + QApplication app(argc, argv); + QApplication::setStyle(QStyleFactory::create("Fusion")); ++ createAppDataLocation(); + + qInstallMessageHandler(QRKMessageHandler); + +diff --git a/src/qrkhome.cpp b/src/qrkhome.cpp +index 9e00cf6..3635d8c 100644 +--- a/src/qrkhome.cpp ++++ b/src/qrkhome.cpp +@@ -27,6 +27,7 @@ + #include <QMessageBox> + #include <QDesktopWidget> + #include <QSettings> ++#include <QStandardPaths> + + #include <QDebug> + +@@ -126,17 +127,17 @@ void QRKHome::init() + ui->backupDirIconLabel->setPixmap(pixmap); + ui->backupDirLabel->setText(tr("n/a")); + } else { +- ui->backupDirLabel->setText(settings.value("backupDirectory", qApp->applicationDirPath()).toString()); ++ ui->backupDirLabel->setText(settings.value("backupDirectory", QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)).toString()); + } + +- ui->dataDirlabel->setText(qApp->applicationDirPath() + "/data"); ++ ui->dataDirlabel->setText(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/data"); + + ui->lcdNumberDay->display(Database::getDayCounter()); + ui->lcdNumberMonth->display(Database::getMonthCounter()); + ui->lcdNumberYear->display(Database::getYearCounter()); +- ui->serverModeCheckBox->setText(tr("Server Modus (Importverzeichnis: %1)").arg(settings.value("importDirectory", qApp->applicationDirPath() + "/import").toString())); ++ ui->serverModeCheckBox->setText(tr("Server Modus (Importverzeichnis: %1)").arg(settings.value("importDirectory", QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/import").toString())); + +- watcherpath = settings.value("importDirectory", qApp->applicationDirPath() + "/import" ).toString(); ++ watcherpath = settings.value("importDirectory", QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/import" ).toString(); + + watcher.removePaths(watcher.directories()); + if (ui->serverModeCheckBox->isChecked()) { +diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp +index 5c9dbc7..42a77a5 100644 +--- a/src/settingsdialog.cpp ++++ b/src/settingsdialog.cpp +@@ -319,9 +319,8 @@ GeneralTab::GeneralTab(QSettings &settings, QWidget *parent) + + useLogo->setChecked(settings.value("useLogo", false).toBool()); + logoEdit->setText(settings.value("logo", "./logo.png").toString()); +- importDirectoryEdit->setText(settings.value("importDirectory", qApp->applicationDirPath() + "/import").toString()); +- backupDirectoryEdit->setText(settings.value("backupDirectory", qApp->applicationDirPath()).toString()); +- ++ importDirectoryEdit->setText(settings.value("importDirectory", QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/import").toString()); ++ backupDirectoryEdit->setText(settings.value("backupDirectory", QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)).toString()); + } + + void GeneralTab::useLogoCheck_toggled(bool toggled) +-- +2.8.2 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..b21d331ce444 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,47 @@ +# Maintainer: nblock <nblock [/at\] archlinux DOT us> + +pkgname=qrk +_pkgname=QRK +pkgver=0.16.0502 +pkgrel=1 +pkgdesc="A cash register for small companies (mainly for Austrian companies)" +arch=('i686' 'x86_64') +url="http://www.ckvsoft.at/" +license=('GPL3') +makedepends=('qt5-declarative') +depends=('qrencode' + 'crypto++') +source=("http://downloads.sourceforge.net/project/qrk-registrier-kasse/source/${_pkgname}_${pkgver}.source.tar.gz" + "${pkgname}.desktop" + "0001-Use-QStandardPaths-AppDataLocation-as-base-path.patch") + +md5sums=('a784fe919008cd3dd2da61e3210c82ed' + '52c990903894fdecd440e2e2914c2f09' + '0b8144d154ae8e14ae8ffb99e2292867') +sha256sums=('b7874437ed3ce655c0b548b484e28026acf5cb3ab5701553f3a598f99a37d459' + 'f71882aea62bd7c07e4806f0223d1699170ac89d59036f5fd5add1004eb93cd0' + 'fa91ac9a0e11af077b5806d5c134b0117ca091cbddce5e972b36d5a604b0ad68') + +prepare() { + cd "${srcdir}/${_pkgname}_${pkgver}_source" + + patch -Np1 < "${srcdir}/0001-Use-QStandardPaths-AppDataLocation-as-base-path.patch" +} + +build() { + cd "${srcdir}/${_pkgname}_${pkgver}_source" + + qmake-qt5 "${_pkgname}.pro" + make +} + +package() { + cd "${srcdir}/${_pkgname}_${pkgver}_source" + + mkdir -p ${pkgdir}/usr/{bin,share/applications} + install -D -m755 "bin/$_pkgname" "$pkgdir"/usr/bin/$pkgname + install -D -m644 "src/icons/logo.png" "$pkgdir/usr/share/pixmaps/$pkgname.png" + install -D -m644 "$srcdir/$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop" +} + +# vim: set ts=2 sw=2 ft=sh noet: diff --git a/qrk.desktop b/qrk.desktop new file mode 100644 index 000000000000..e58074f9c69c --- /dev/null +++ b/qrk.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=QRK Registrier Kasse +Comment=A cash register for small companies (mainly for Austrian companies) +Exec=qrk +Icon=qrk.png +Path=/tmp +Terminal=false +Type=Application +Categories=Office; +StartupNotify=false |