From b3ee7109dd5c9cd21b219a758df45e0866936ffb Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sun, 5 Oct 2014 20:16:42 +0200 Subject: 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 or whatever) update debian packaging scripts accordingly --- libLumina/LuminaOS-Linux.cpp | 10 +++++----- libLumina/libLumina.pro | 20 ++++++++++++++------ 2 files changed, 19 insertions(+), 11 deletions(-) (limited to 'libLumina') diff --git a/libLumina/LuminaOS-Linux.cpp b/libLumina/LuminaOS-Linux.cpp index bdd16fac..acece864 100644 --- a/libLumina/LuminaOS-Linux.cpp +++ b/libLumina/LuminaOS-Linux.cpp @@ -20,7 +20,7 @@ QString LOS::SysPrefix(){ return "/usr/"; } //Prefix for system //OS-specific application shortcuts (*.desktop files) QString LOS::ControlPanelShortcut(){ return ""; } //system control panel QString LOS::AppStoreShortcut(){ return ""; } //graphical app/pkg manager -QString LOS::QtConfigShortcut(){ return "/usr/bin/qtconfig-qt4"; } //qtconfig binary (NOT *.desktop file) +QString LOS::QtConfigShortcut(){ return LOS::AppPrefix() + "/bin/qtconfig-qt4"; } //qtconfig binary (NOT *.desktop file) // ==== ExternalDevicePaths() ==== QStringList LOS::ExternalDevicePaths(){ @@ -122,12 +122,12 @@ void LOS::changeAudioVolume(int percentdiff){ //Check if a graphical audio mixer is installed bool LOS::hasMixerUtility(){ - return QFile::exists("/usr/bin/pavucontrol"); + return QFile::exists(LOS::AppPrefix() + "bin/pavucontrol"); } //Launch the graphical audio mixer utility void LOS::startMixerUtility(){ - QProcess::startDetached("/usr/bin/pavucontrol"); + QProcess::startDetached(LOS::AppPrefix() + "bin/pavucontrol"); } //Check for user system permission (shutdown/restart) @@ -150,7 +150,7 @@ bool LOS::hasBattery(){ QString my_status = LUtils::getCmdOutput("acpi -b").join(""); bool no_battery = my_status.contains("No support"); if (no_battery) return false; - return true; + return true; } //Battery Charge Level @@ -173,7 +173,7 @@ int LOS::batteryCharge(){ //Returns: percent charge (0-100), anything outside th // these include "Unknown, Full and No support. // However, it seems just one status is returned when running // on battery and that is "Discharging". So if the value we get -// is NOT Discharging then we assume the batter yis charging. +// is NOT Discharging then we assume the battery is charging. bool LOS::batteryIsCharging(){ QString my_status = LUtils::getCmdOutput("acpi -b").join(""); bool discharging = my_status.contains("Discharging"); diff --git a/libLumina/libLumina.pro b/libLumina/libLumina.pro index 45a310b7..7e2028c7 100644 --- a/libLumina/libLumina.pro +++ b/libLumina/libLumina.pro @@ -2,7 +2,15 @@ QT += core TARGET=LuminaUtils -target.path = /usr/local/lib + +isEmpty(PREFIX) { + PREFIX = /usr/local +} + +isEmtpy(LIBPREFIX) { + LIBPREFIX = $$PREFIX/lib +} +target.path = $$LIBPREFIX DESTDIR= $$_PRO_FILE_PWD_/ @@ -17,7 +25,7 @@ HEADERS += LuminaXDG.h \ SOURCES += LuminaXDG.cpp \ LuminaUtils.cpp \ - LuminaX11.cpp \ + LuminaX11.cpp \ LuminaOS-FreeBSD.cpp \ LuminaOS-DragonFly.cpp \ LuminaOS-OpenBSD.cpp \ @@ -25,16 +33,16 @@ SOURCES += LuminaXDG.cpp \ LuminaOS-kFreeBSD.cpp # new OS support can be added here -INCLUDEPATH += /usr/local/include +INCLUDEPATH += $$PREFIX/include LIBS += -lX11 -lXrender -lXcomposite -include.path=/usr/local/include/ +include.path=$$PREFIX/include/ include.files=LuminaXDG.h \ LuminaUtils.h \ LuminaX11.h \ LuminaOS.h -INSTALLS += target include +INSTALLS += target include -QMAKE_LIBDIR = /usr/local/lib/qt4 /usr/local/lib +QMAKE_LIBDIR = $$LIBPREFIX/qt4 $$LIBPREFIX -- cgit From 580ced71366dce2f7e10a6fac6aa40dd2ab34f89 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sun, 5 Oct 2014 20:29:18 +0200 Subject: fix typo --- libLumina/libLumina.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libLumina') diff --git a/libLumina/libLumina.pro b/libLumina/libLumina.pro index 7e2028c7..72fa6f6c 100644 --- a/libLumina/libLumina.pro +++ b/libLumina/libLumina.pro @@ -7,7 +7,7 @@ isEmpty(PREFIX) { PREFIX = /usr/local } -isEmtpy(LIBPREFIX) { +isEmpty(LIBPREFIX) { LIBPREFIX = $$PREFIX/lib } target.path = $$LIBPREFIX -- cgit