aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/LDesktop.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-01-12 09:01:36 -0500
committerKen Moore <ken@ixsystems.com>2017-01-12 09:01:36 -0500
commit9855075377ffc2d417855d574f7bce4d1b57d1ec (patch)
tree238746dca85ef958c8f6f923367b434c9e490de4 /src-qt5/core/lumina-desktop/LDesktop.cpp
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-9855075377ffc2d417855d574f7bce4d1b57d1ec.tar.gz
lumina-9855075377ffc2d417855d574f7bce4d1b57d1ec.tar.bz2
lumina-9855075377ffc2d417855d574f7bce4d1b57d1ec.zip
Add the ability to show "/media/*" shortcuts on the Lumina desktop. This will be very useful for systems that auto-create dirs in /media when devices are attached to the system, and mount-on-demand when browsing into that directory (*SPOILERS*).
Diffstat (limited to 'src-qt5/core/lumina-desktop/LDesktop.cpp')
-rw-r--r--src-qt5/core/lumina-desktop/LDesktop.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop/LDesktop.cpp b/src-qt5/core/lumina-desktop/LDesktop.cpp
index de7d086e..d4ebaa7f 100644
--- a/src-qt5/core/lumina-desktop/LDesktop.cpp
+++ b/src-qt5/core/lumina-desktop/LDesktop.cpp
@@ -221,6 +221,7 @@ void LDesktop::InitDesktop(){
connect(QApplication::instance(), SIGNAL(DesktopConfigChanged()), this, SLOT(SettingsChanged()) );
connect(QApplication::instance(), SIGNAL(DesktopFilesChanged()), this, SLOT(UpdateDesktop()) );
+ connect(QApplication::instance(), SIGNAL(MediaFilesChanged()), this, SLOT(UpdateDesktop()) );
connect(QApplication::instance(), SIGNAL(LocaleChanged()), this, SLOT(LocaleChanged()) );
connect(QApplication::instance(), SIGNAL(WorkspaceChanged()), this, SLOT(UpdateBackground()) );
//if(DEBUG){ qDebug() << "Create bgWindow"; }
@@ -373,6 +374,13 @@ void LDesktop::UpdateDesktop(){
filelist << files[i].absoluteFilePath();
}
}
+ //Also show anything available in the /media directory
+ QDir media("/media");
+ QStringList mediadirs = media.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name);
+ for(int i=0; i<mediadirs.length(); i++){
+ filelist << media.absoluteFilePath(mediadirs[i]);
+ }
+ qDebug() << "Found media Dirs:" << mediadirs;
UpdateDesktopPluginArea();
bgDesktop->LoadItems(plugins, filelist);
}
bgstack15