diff options
Diffstat (limited to 'libLumina')
-rw-r--r-- | libLumina/LuminaOS-Debian.cpp | 1 | ||||
-rw-r--r-- | libLumina/LuminaOS-DragonFly.cpp | 1 | ||||
-rw-r--r-- | libLumina/LuminaOS-FreeBSD.cpp | 1 | ||||
-rw-r--r-- | libLumina/LuminaOS-Linux.cpp | 1 | ||||
-rw-r--r-- | libLumina/LuminaOS-NetBSD.cpp | 1 | ||||
-rw-r--r-- | libLumina/LuminaOS-OpenBSD.cpp | 1 | ||||
-rw-r--r-- | libLumina/LuminaOS-kFreeBSD.cpp | 1 | ||||
-rw-r--r-- | libLumina/LuminaOS-template.cpp | 1 | ||||
-rw-r--r-- | libLumina/LuminaOS.h | 13 | ||||
-rw-r--r-- | libLumina/LuminaUtils.cpp | 17 | ||||
-rw-r--r-- | libLumina/LuminaUtils.h | 5 | ||||
-rw-r--r-- | libLumina/LuminaXDG.cpp | 3 | ||||
-rw-r--r-- | libLumina/libLumina.pro | 31 |
13 files changed, 34 insertions, 43 deletions
diff --git a/libLumina/LuminaOS-Debian.cpp b/libLumina/LuminaOS-Debian.cpp index 593e3d24..76b6822e 100644 --- a/libLumina/LuminaOS-Debian.cpp +++ b/libLumina/LuminaOS-Debian.cpp @@ -22,7 +22,6 @@ QString LOS::SysPrefix(){ return "/"; } //Prefix for system //OS-specific application shortcuts (*.desktop files) QString LOS::ControlPanelShortcut(){ return ""; } //system control panel QString LOS::AppStoreShortcut(){ return LOS::AppPrefix() + "/share/applications/synaptic.desktop"; } //graphical app/pkg manager -QString LOS::QtConfigShortcut(){ return LOS::AppPrefix() + "/bin/qt5ct"; } //qtconfig binary (NOT *.desktop file) // ==== ExternalDevicePaths() ==== QStringList LOS::ExternalDevicePaths(){ diff --git a/libLumina/LuminaOS-DragonFly.cpp b/libLumina/LuminaOS-DragonFly.cpp index 35ff49ae..fb2c2241 100644 --- a/libLumina/LuminaOS-DragonFly.cpp +++ b/libLumina/LuminaOS-DragonFly.cpp @@ -72,7 +72,6 @@ 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/local/bin/qtconfig-qt4"; } //qtconfig binary (NOT *.desktop file) // ==== ExternalDevicePaths() ==== QStringList LOS::ExternalDevicePaths(){ diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp index 99d20781..310341f6 100644 --- a/libLumina/LuminaOS-FreeBSD.cpp +++ b/libLumina/LuminaOS-FreeBSD.cpp @@ -24,7 +24,6 @@ QString LOS::SysPrefix(){ return "/usr/"; } //Prefix for system //OS-specific application shortcuts (*.desktop files) QString LOS::ControlPanelShortcut(){ return "/usr/local/share/applications/pccontrol.desktop"; } //system control panel QString LOS::AppStoreShortcut(){ return "/usr/local/share/applications/softmanager.desktop"; } //graphical app/pkg manager -QString LOS::QtConfigShortcut(){ return ""; } //qtconfig binary (NOT *.desktop file) // ==== ExternalDevicePaths() ==== QStringList LOS::ExternalDevicePaths(){ diff --git a/libLumina/LuminaOS-Linux.cpp b/libLumina/LuminaOS-Linux.cpp index 1fc98489..7d618b14 100644 --- a/libLumina/LuminaOS-Linux.cpp +++ b/libLumina/LuminaOS-Linux.cpp @@ -22,7 +22,6 @@ 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 LOS::AppPrefix() + "/bin/qtconfig-qt4"; } //qtconfig binary (NOT *.desktop file) // ==== ExternalDevicePaths() ==== QStringList LOS::ExternalDevicePaths(){ diff --git a/libLumina/LuminaOS-NetBSD.cpp b/libLumina/LuminaOS-NetBSD.cpp index f87d7a2a..c3b4b3a2 100644 --- a/libLumina/LuminaOS-NetBSD.cpp +++ b/libLumina/LuminaOS-NetBSD.cpp @@ -18,7 +18,6 @@ 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 ""; } //qtconfig binary (NOT *.desktop file) // ==== ExternalDevicePaths() ==== QStringList LOS::ExternalDevicePaths(){ diff --git a/libLumina/LuminaOS-OpenBSD.cpp b/libLumina/LuminaOS-OpenBSD.cpp index 33159454..fa715480 100644 --- a/libLumina/LuminaOS-OpenBSD.cpp +++ b/libLumina/LuminaOS-OpenBSD.cpp @@ -21,7 +21,6 @@ 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/local/bin/qtconfig4"; } //qtconfig binary (NOT *.desktop file) // ==== ExternalDevicePaths() ==== QStringList LOS::ExternalDevicePaths(){ diff --git a/libLumina/LuminaOS-kFreeBSD.cpp b/libLumina/LuminaOS-kFreeBSD.cpp index d651de4d..da0d6fe7 100644 --- a/libLumina/LuminaOS-kFreeBSD.cpp +++ b/libLumina/LuminaOS-kFreeBSD.cpp @@ -26,7 +26,6 @@ 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) // ==== ExternalDevicePaths() ==== QStringList LOS::ExternalDevicePaths(){ diff --git a/libLumina/LuminaOS-template.cpp b/libLumina/LuminaOS-template.cpp index ec547d1d..073b9092 100644 --- a/libLumina/LuminaOS-template.cpp +++ b/libLumina/LuminaOS-template.cpp @@ -18,7 +18,6 @@ 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 ""; } //qtconfig binary (NOT *.desktop file) // ==== ExternalDevicePaths() ==== QStringList LOS::ExternalDevicePaths(){ diff --git a/libLumina/LuminaOS.h b/libLumina/LuminaOS.h index 5672454b..b211d04a 100644 --- a/libLumina/LuminaOS.h +++ b/libLumina/LuminaOS.h @@ -20,29 +20,20 @@ #include "LuminaUtils.h" -//First try to load the globals.h to set PREFIX -#ifndef PREFIX -#include "global.h" -#endif -//Now use the default value for PREFIX if not set -#ifndef PREFIX -#define PREFIX QString("/usr/local") -#endif - +// NOTE: PREFIX, L_ETCDIR, L_SHAREDIR are defined in the OS-detect.pri project file and passed in class LOS{ public: //Return the name of the OS being used static QString OSName(); //OS-specific prefix(s) - static QString LuminaShare(){ return (PREFIX+"/share/Lumina-DE/"); } //Install dir for Lumina share files + static QString LuminaShare(){ return (L_SHAREDIR+"/Lumina-DE/"); } //Install dir for Lumina share files static QString AppPrefix(); //Prefix for applications (/usr/local/ on FreeBSD) static QString SysPrefix(); //Prefix for system (/usr/ on FreeBSD) //OS-specific application shortcuts (*.desktop files) static QString ControlPanelShortcut(); static QString AppStoreShortcut(); - static QString QtConfigShortcut(); //Scan for mounted external devices static QStringList ExternalDevicePaths(); //Returns: QStringList[<type>::::<filesystem>::::<path>] diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp index 5f7a057e..a4c2792e 100644 --- a/libLumina/LuminaUtils.cpp +++ b/libLumina/LuminaUtils.cpp @@ -49,7 +49,18 @@ inline QStringList ProcessRun(QString cmd, QStringList args){ // LUtils Functions //============= QString LUtils::LuminaDesktopVersion(){ - return "0.8.8-devel"; + QString ver = "0.8.8-devel"; + #ifdef GIT_VERSION + ver.append( QString(" (Git Revision: %1)").arg(GIT_VERSION) ); + #endif + return ver; +} + +QString LUtils::LuminaDesktopBuildDate(){ + #ifdef BUILD_DATE + return BUILD_DATE; + #endif + return ""; } int LUtils::runCmd(QString cmd, QStringList args){ @@ -548,8 +559,8 @@ void LUtils::LoadSystemDefaults(bool skipOS){ if(sysDefaults.isEmpty() && !skipOS){ sysDefaults = LUtils::readFile(LOS::AppPrefix()+"etc/luminaDesktop.conf.dist"); } if(sysDefaults.isEmpty() && !skipOS) { sysDefaults = LUtils::readFile(LOS::SysPrefix()+"etc/luminaDesktop.conf"); } if(sysDefaults.isEmpty() && !skipOS){ sysDefaults = LUtils::readFile(LOS::SysPrefix()+"etc/luminaDesktop.conf.dist"); } - if(sysDefaults.isEmpty() && !skipOS) { sysDefaults = LUtils::readFile("/etc/luminaDesktop.conf"); } - if(sysDefaults.isEmpty() && !skipOS){ sysDefaults = LUtils::readFile("/etc/luminaDesktop.conf.dist"); } + if(sysDefaults.isEmpty() && !skipOS) { sysDefaults = LUtils::readFile(L_ETCDIR+"/luminaDesktop.conf"); } + if(sysDefaults.isEmpty() && !skipOS){ sysDefaults = LUtils::readFile(L_ETCDIR+"/luminaDesktop.conf.dist"); } if(sysDefaults.isEmpty()){ sysDefaults = LUtils::readFile(LOS::LuminaShare()+"luminaDesktop.conf"); } //Find the number of the left-most desktop screen QString screen = "0"; diff --git a/libLumina/LuminaUtils.h b/libLumina/LuminaUtils.h index 7b35b09d..c4395d79 100644 --- a/libLumina/LuminaUtils.h +++ b/libLumina/LuminaUtils.h @@ -26,9 +26,10 @@ class LUtils{ public: - //Get the current version of the Lumina desktop + //Get the current version/build of the Lumina desktop static QString LuminaDesktopVersion(); - + static QString LuminaDesktopBuildDate(); + //Run an external command and return the exit code static int runCmd(QString cmd, QStringList args = QStringList()); //Run an external command and return any text output (one line per entry) diff --git a/libLumina/LuminaXDG.cpp b/libLumina/LuminaXDG.cpp index c46a96a8..a1754b2f 100644 --- a/libLumina/LuminaXDG.cpp +++ b/libLumina/LuminaXDG.cpp @@ -407,7 +407,8 @@ QStringList LXDG::systemApplicationDirs(){ //Returns a list of all the directories where *.desktop files can be found QStringList appDirs = QString(getenv("XDG_DATA_HOME")).split(":"); appDirs << QString(getenv("XDG_DATA_DIRS")).split(":"); - if(appDirs.isEmpty()){ appDirs << "/usr/local/share" << "/usr/share"; } + if(appDirs.isEmpty()){ appDirs << "/usr/local/share" << "/usr/share" << LOS::AppPrefix()+"/share" << LOS::SysPrefix()+"/share" << L_SHAREDIR; } + appDirs.removeDuplicates(); //Now create a valid list QStringList out; for(int i=0; i<appDirs.length(); i++){ diff --git a/libLumina/libLumina.pro b/libLumina/libLumina.pro index a33ec66d..d6de3f06 100644 --- a/libLumina/libLumina.pro +++ b/libLumina/libLumina.pro @@ -3,12 +3,17 @@ include("$${PWD}/../OS-detect.pri") QT += core network greaterThan(QT_MAJOR_VERSION, 4): QT += widgets x11extras multimedia concurrent svg +define +#Setup any special defines (qmake -> C++) +GIT_VERSION=$$system(git describe --always) +!isEmpty(GIT_VERSION){ + DEFINES += GIT_VERSION='"\\\"$${GIT_VERSION}\\\""' +} +DEFINES += BUILD_DATE='"\\\"$$system(date)\\\""' TARGET=LuminaUtils -system(./make-global-h.sh $$PREFIX) - -target.path = $$DESTDIR$$LIBPREFIX +target.path = $${DESTDIR}$${L_LIBDIR} DESTDIR= $$_PRO_FILE_PWD_/ @@ -28,14 +33,8 @@ SOURCES += LuminaXDG.cpp \ LuminaX11.cpp \ LuminaThemes.cpp \ LuminaSingleApplication.cpp -# LuminaOS-FreeBSD.cpp \ -# LuminaOS-DragonFly.cpp \ -# LuminaOS-NetBSD.cpp \ -# LuminaOS-OpenBSD.cpp \ -# LuminaOS-kFreeBSD.cpp -# new OS support can be added here -# check linux distribution and use specific +# Also load the OS template as available for # LuminaOS support functions (or fall back to generic one) exists($${PWD}/LuminaOS-$${LINUX_DISTRO}.cpp){ SOURCES += LuminaOS-$${LINUX_DISTRO}.cpp @@ -45,11 +44,9 @@ exists($${PWD}/LuminaOS-$${LINUX_DISTRO}.cpp){ SOURCES += LuminaOS-template.cpp } -INCLUDEPATH += $$PREFIX/include - LIBS += -lc -lxcb -lxcb-ewmh -lxcb-icccm -lxcb-image -lxcb-composite -lxcb-damage -lxcb-util -lXdamage -include.path=$$PREFIX/include/ +include.path=$${L_INCLUDEDIR} include.files=LuminaXDG.h \ LuminaUtils.h \ LuminaX11.h \ @@ -57,15 +54,13 @@ include.files=LuminaXDG.h \ LuminaOS.h \ LuminaSingleApplication.h -colors.path=$$PREFIX/share/Lumina-DE/colors/ +colors.path=$${L_SHAREDIR}/Lumina-DE/colors colors.files=colors/*.qss.colors -themes.path=$$PREFIX/share/Lumina-DE/themes/ +themes.path=$${L_SHAREDIR}/Lumina-DE/themes/ themes.files=themes/*.qss.template -quickplugins.path=$$PREFIX/share/Lumina-DE/quickplugins/ +quickplugins.path=$${L_SHAREDIR}/Lumina-DE/quickplugins/ quickplugins.files=quickplugins/* INSTALLS += target include colors themes quickplugins - -QMAKE_LIBDIR = $$LIBPREFIX/qt5 $$LIBPREFIX |