diff options
author | Ken Moore <ken@ixsystems.com> | 2017-01-12 11:30:59 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-01-12 11:30:59 -0500 |
commit | b22bb74d65613e4b6bd12eacf99d8e1bd0e7b28d (patch) | |
tree | 3c38808e9d8f73aca93888243c23755c3bacd071 /src-qt5/core | |
parent | Add the ability to show "/media/*" shortcuts on the Lumina desktop. This will... (diff) | |
download | lumina-b22bb74d65613e4b6bd12eacf99d8e1bd0e7b28d.tar.gz lumina-b22bb74d65613e4b6bd12eacf99d8e1bd0e7b28d.tar.bz2 lumina-b22bb74d65613e4b6bd12eacf99d8e1bd0e7b28d.zip |
Add add the option to watch a "/tmp/.autofs_change" file which will prompt for re-reading the /media directory as well.
Diffstat (limited to 'src-qt5/core')
-rw-r--r-- | src-qt5/core/lumina-desktop/LSession.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index 8143f260..3088696f 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -161,7 +161,8 @@ void LSession::setupSession(){ watcherChange( QDir::homePath()+"/Desktop" ); //And watch the /media directory if(QFile::exists("/media")){ watcherChange("/media"); } - + if(!QFile::exists("/tmp/.autofs_change")){ system("touch /tmp/.autofs_change"); } + watcherChange("/tmp/.autofs_change"); //connect internal signals/slots connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(watcherChange(QString)) ); connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(watcherChange(QString)) ); @@ -341,7 +342,7 @@ 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"){ + }else if(changed.toLower() == "/media" || changed == "/tmp/.autofs_change" ){ emit MediaFilesChanged(); }else if(changed.endsWith("favorites.list")){ emit FavoritesChanged(); } //Now ensure this file was not removed from the watcher |