aboutsummaryrefslogtreecommitdiff
path: root/lumina-screenshot
diff options
context:
space:
mode:
authorChristopher Roy Bratusek <nano@jpberlin.de>2014-10-05 20:16:42 +0200
committerChristopher Roy Bratusek <nano@jpberlin.de>2014-10-05 20:16:42 +0200
commitb3ee7109dd5c9cd21b219a758df45e0866936ffb (patch)
treef40cf1c32802d9bb2253352cf4eea2d8418ec79d /lumina-screenshot
parentAdd the template for the new LuminaThemes library class (not integrated into ... (diff)
downloadlumina-b3ee7109dd5c9cd21b219a758df45e0866936ffb.tar.gz
lumina-b3ee7109dd5c9cd21b219a758df45e0866936ffb.tar.bz2
lumina-b3ee7109dd5c9cd21b219a758df45e0866936ffb.zip
add global.h containing PREFIX and make use of it in all sub-modules,
add PREFIX and LIBPREFIX to the qmake .pro files (allows to change prefix and libdir using <qmake PREFIX=/usr LIBDIR=/usr/lib/x86_64-linux-gnu/> or whatever) update debian packaging scripts accordingly
Diffstat (limited to 'lumina-screenshot')
-rw-r--r--lumina-screenshot/lumina-screenshot.pro15
-rw-r--r--lumina-screenshot/main.cpp9
2 files changed, 12 insertions, 12 deletions
diff --git a/lumina-screenshot/lumina-screenshot.pro b/lumina-screenshot/lumina-screenshot.pro
index 7b647386..1681a12b 100644
--- a/lumina-screenshot/lumina-screenshot.pro
+++ b/lumina-screenshot/lumina-screenshot.pro
@@ -2,7 +2,10 @@
QT += core gui
TARGET = lumina-screenshot
-target.path = /usr/local/bin
+isEmpty(PREFIX) {
+ PREFIX = /usr/local
+}
+target.path = $$PREFIX/bin
TEMPLATE = app
@@ -13,9 +16,9 @@ HEADERS += MainUI.h
FORMS += MainUI.ui
-INCLUDEPATH += ../libLumina /usr/local/include
+INCLUDEPATH += ../libLumina $$PREFIX/include
- LIBS += -L../libLumina -lLuminaUtils
+ LIBS += -L../libLumina -lLuminaUtils
freebsd-* {
LIBS += -lQtSolutions_SingleApplication-head
}
@@ -92,10 +95,10 @@ TRANSLATIONS = i18n/lumina-screenshot_af.ts \
i18n/lumina-screenshot_zh_TW.ts \
i18n/lumina-screenshot_zu.ts
-dotrans.path=/usr/local/share/Lumina-DE/i18n/
-dotrans.extra=cd i18n && $${LRELEASE} -nounfinished *.ts && cp *.qm $(INSTALL_ROOT)/usr/local/share/Lumina-DE/i18n/
+dotrans.path=$$PREFIX/share/Lumina-DE/i18n/
+dotrans.extra=cd i18n && $${LRELEASE} -nounfinished *.ts && cp *.qm $(INSTALL_ROOT)$$PREFIX/share/Lumina-DE/i18n/
desktop.files=lumina-screenshot.desktop
-desktop.path=/usr/local/share/applications/
+desktop.path=$$PREFIX/share/applications/
INSTALLS += target dotrans desktop
diff --git a/lumina-screenshot/main.cpp b/lumina-screenshot/main.cpp
index 12258548..40d7242d 100644
--- a/lumina-screenshot/main.cpp
+++ b/lumina-screenshot/main.cpp
@@ -4,10 +4,7 @@
#include <QFile>
#include "MainUI.h"
-
-#ifndef PREFIX
-#define PREFIX QString("/usr/local")
-#endif
+#include "../global.h"
int main(int argc, char ** argv)
{
@@ -16,12 +13,12 @@ int main(int argc, char ** argv)
QTranslator translator;
QLocale mylocale;
QString langCode = mylocale.name();
-
+
if ( ! QFile::exists(PREFIX + "/share/Lumina-DE/i18n/lumina-screenshot_" + langCode + ".qm" ) ) langCode.truncate(langCode.indexOf("_"));
translator.load( QString("lumina-screenshot_") + langCode, PREFIX + "/share/i18n/Lumina-DE/" );
a.installTranslator( &translator );
qDebug() << "Locale:" << langCode;
-
+
MainUI w;
w.show();
bgstack15