Skip to content
Snippets Groups Projects
Commit 1c041d52 authored by Hugo Hörnquist's avatar Hugo Hörnquist
Browse files

Re-add runes.

parent c1ce72c4
No related branches found
No related tags found
No related merge requests found
admin.desktop 100755 → 100644
File mode changed from 100755 to 100644
...@@ -11,10 +11,9 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets ...@@ -11,10 +11,9 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = stupan-admin TARGET = stupan-admin
TEMPLATE = app TEMPLATE = app
admin.path = /usr/bin target.path = /usr/bin
admin.files = stupan-admin
INSTALLS += admin INSTALLS += target
QMAKE_CXXFLAGS += -Wall -pedantic QMAKE_CXXFLAGS += -Wall -pedantic
......
stupan (1.15-1) jammy; urgency=medium
* Re-implement rune easter egg.
-- Hugo Hörnquist <hugo@lysator.liu.se> Thu, 30 Mar 2023 18:46:03 +0200
stupan (1.14.1-1) una; urgency=medium stupan (1.14.1-1) una; urgency=medium
* debian changelog to better reflect reality. * debian changelog to better reflect reality.
......
...@@ -5,11 +5,19 @@ ...@@ -5,11 +5,19 @@
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
%:
dh $@
#override_dh_auto_install: override_dh_auto_configure:
# dh_auto_install -- prefix=/usr mkdir build
cd build && qmake ../stupan.pro
override_dh_auto_build:
cd build && make
lrelease stupan.pro
#override_dh_install: override_dh_auto_install:
# dh_install --list-missing -X.pyc -X.pyo $(MAKE) -C build install INSTALL_ROOT=$(CURDIR)/debian/stupan
install -d $(CURDIR)/debian/stupan/usr/share/stupan/
install -m 644 -t $(CURDIR)/debian/stupan/usr/share/stupan/ kassa/stupan_dk.qm
%:
dh $@
kassa.desktop 100755 → 100644
File mode changed from 100755 to 100644
...@@ -11,10 +11,9 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets ...@@ -11,10 +11,9 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = stupan-kassa TARGET = stupan-kassa
TEMPLATE = app TEMPLATE = app
kassa.path = /usr/bin target.path = /usr/bin
kassa.files = stupan-kassa
INSTALLS += kassa INSTALLS += target
QMAKE_CXXFLAGS += -Wall -pedantic QMAKE_CXXFLAGS += -Wall -pedantic
...@@ -25,7 +24,7 @@ HEADERS += widget.h ...@@ -25,7 +24,7 @@ HEADERS += widget.h
FORMS += widget.ui FORMS += widget.ui
TRANSLATIONS = stupan_dk.ts TRANSLATIONS += stupan_dk.ts
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../StupanCommon/release/ -lStupanCommon win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../StupanCommon/release/ -lStupanCommon
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../StupanCommon/debug/ -lStupanCommon else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../StupanCommon/debug/ -lStupanCommon
......
#include "widget.h" #include "widget.h"
#include <QApplication> #include <QApplication>
#include <QTranslator> #include <QTranslator>
#include <QCoreApplication>
#include <QVector>
#include "configuration.h"
#include "utils.h"
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
// QLocale::setDefault(QLocale(QLocale::Swedish, QLocale::Sweden)); // QLocale::setDefault(QLocale(QLocale::Swedish, QLocale::Sweden));
QApplication a(argc, argv); QApplication a(argc, argv);
QString locale = QLocale::system().name(); //QString locale = QLocale::languageToString(QLocale::system().language());
//qDebug() << locale;
QTranslator translator; QTranslator translator;
translator.load(QStringLiteral("stupan_") + locale, "/usr/share/stupan"); QDate today = { QDate::currentDate() };
if (6 > today.daysTo(QDate(today.year(), 4, 1))) {
//translator.load(QStringLiteral("stupan_") + "dk", "/usr/share/stupan");
qDebug() << QCoreApplication::applicationDirPath();
QVector<QString> paths = {
QCoreApplication::applicationDirPath(),
"/usr/share/stupan",
};
foreach (auto path, paths) {
qDebug() << "Attempting to load translations from" << path;
if (translator.load("stupan_dk", path)) {
a.installTranslator(&translator); a.installTranslator(&translator);
qDebug() << "Loaded!";
break;
} else {
qDebug() << "Failed loading tranlation";
}
}
}
QString HOME = QString::fromLocal8Bit(getenv("HOME"));
Configuration conf(HOME + "/.stupan/config");
Widget w; Widget w;
w.show(); w.show();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment