aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-08-18 14:15:15 -0400
committerKen Moore <ken@ixsystems.com>2017-08-18 14:15:15 -0400
commitddde99fd0aaf1c474a3e4b4a759a850780871903 (patch)
tree4c8ca56b899cea83853706678daf4095fb842f6b /src-qt5/core/libLumina
parentUpdate the x11/lumina meta-port to include a dependency on x11-themes/lumina-... (diff)
downloadlumina-ddde99fd0aaf1c474a3e4b4a759a850780871903.tar.gz
lumina-ddde99fd0aaf1c474a3e4b4a759a850780871903.tar.bz2
lumina-ddde99fd0aaf1c474a3e4b4a759a850780871903.zip
Add the ability to generate symlinks in the Desktop folder the first time Lumina starts up for a user, based on entries in the system's luminaDesktop.conf file.
Diffstat (limited to 'src-qt5/core/libLumina')
-rw-r--r--src-qt5/core/libLumina/LDesktopUtils.cpp10
-rw-r--r--src-qt5/core/libLumina/LDesktopUtils.h4
2 files changed, 12 insertions, 2 deletions
diff --git a/src-qt5/core/libLumina/LDesktopUtils.cpp b/src-qt5/core/libLumina/LDesktopUtils.cpp
index 973763e8..4c87ae22 100644
--- a/src-qt5/core/libLumina/LDesktopUtils.cpp
+++ b/src-qt5/core/libLumina/LDesktopUtils.cpp
@@ -337,6 +337,16 @@ void LDesktopUtils::LoadSystemDefaults(bool skipOS){
else if(var=="favorites_remove"){ qDebug() << " - Removing:"; LDesktopUtils::removeFavorite(val); }
}
+ tmp = sysDefaults.filter("desktoplinks_");
+ QString desktopFolder = QDir::homePath()+"/Desktop/"; //need to make this translatable and dynamic later
+ for(int i=0; i<tmp.length(); i++){
+ if(tmp[i].startsWith("#") || !tmp[i].contains("=") ){ continue; }
+ QString var = tmp[i].section("=",0,0).toLower().simplified();
+ QString val = tmp[i].section("=",1,1).section("#",0,0).simplified();
+ val = LUtils::AppToAbsolute(val); //turn any relative files into absolute
+ if(var=="desktoplinks_add" && QFile::exists(val) && !QFile::exists(desktopFolder+val.section("/",-1)) ){ QFile::link(val, desktopFolder+val.section("/",-1)); }
+ }
+
// -- QUICKLAUNCH --
tmp = sysDefaults.filter("quicklaunch_");
if(tmp.isEmpty()){ tmp = sysDefaults.filter("quicklaunch."); }
diff --git a/src-qt5/core/libLumina/LDesktopUtils.h b/src-qt5/core/libLumina/LDesktopUtils.h
index b21bc78a..a9b44c67 100644
--- a/src-qt5/core/libLumina/LDesktopUtils.h
+++ b/src-qt5/core/libLumina/LDesktopUtils.h
@@ -30,7 +30,7 @@ public:
static QString findQuickPluginFile(QString ID);
static QStringList listQuickPlugins(); //List of valid ID's
static QStringList infoQuickPlugin(QString ID); //Returns: [Name, Description, Icon]
-
+
//Various functions for the favorites sub-system
// Formatting Note: "<name>::::[dir/app/<mimetype>]::::<path>"
// the <name> field might not be used for "app" flagged entries
@@ -40,7 +40,7 @@ public:
static bool addFavorite(QString path, QString name = "");
static void removeFavorite(QString path);
static void upgradeFavorites(int fromoldversionnumber);
-
+
//Load the default setup for the system
static void LoadSystemDefaults(bool skipOS = false);
static bool checkUserFiles(QString lastversion); //returns true if something changed
bgstack15