diff options
author | Ken Moore <ken@ixsystems.com> | 2017-01-12 09:01:36 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-01-12 09:01:36 -0500 |
commit | 9855075377ffc2d417855d574f7bce4d1b57d1ec (patch) | |
tree | 238746dca85ef958c8f6f923367b434c9e490de4 /src-qt5/core/lumina-desktop/LSession.cpp | |
parent | Merge branch 'master' of github.com:trueos/lumina (diff) | |
download | lumina-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/LSession.cpp')
-rw-r--r-- | src-qt5/core/lumina-desktop/LSession.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index a4cc12a7..8143f260 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -159,6 +159,8 @@ void LSession::setupSession(){ //Try to watch the localized desktop folder too if(QFile::exists(QDir::homePath()+"/"+tr("Desktop"))){ watcherChange( QDir::homePath()+"/"+tr("Desktop") ); } watcherChange( QDir::homePath()+"/Desktop" ); + //And watch the /media directory + if(QFile::exists("/media")){ watcherChange("/media"); } //connect internal signals/slots connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(watcherChange(QString)) ); @@ -339,6 +341,8 @@ void LSession::watcherChange(QString changed){ desktopFiles = QDir(changed).entryInfoList(QDir::NoDotAndDotDot | QDir::Files | QDir::Dirs ,QDir::Name | QDir::IgnoreCase | QDir::DirsFirst); if(DEBUG){ qDebug() << "New Desktop Files:" << desktopFiles.length(); } emit DesktopFilesChanged(); + }else if(changed.toLower() == "/media"){ + emit MediaFilesChanged(); }else if(changed.endsWith("favorites.list")){ emit FavoritesChanged(); } //Now ensure this file was not removed from the watcher if(!watcher->files().contains(changed) && !watcher->directories().contains(changed)){ |