aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/LSession.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2018-05-21 12:16:14 -0400
committerGitHub <noreply@github.com>2018-05-21 12:16:14 -0400
commit768b334408806fde94b4b283a32e69c23f2d8b2d (patch)
treeb2fdc65a7b17c5d2441b52f49886efcc3fa69fcc /src-qt5/core/lumina-desktop/LSession.cpp
parentMerge pull request #585 from rodlie/bsdtar (diff)
parentdesktop: support /run/media (user removable devices) (diff)
downloadlumina-768b334408806fde94b4b283a32e69c23f2d8b2d.tar.gz
lumina-768b334408806fde94b4b283a32e69c23f2d8b2d.tar.bz2
lumina-768b334408806fde94b4b283a32e69c23f2d8b2d.zip
Merge pull request #584 from rodlie/media
desktop: support /run/media (user removable devices)
Diffstat (limited to 'src-qt5/core/lumina-desktop/LSession.cpp')
-rw-r--r--src-qt5/core/lumina-desktop/LSession.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp
index 1e686e51..ea6e402b 100644
--- a/src-qt5/core/lumina-desktop/LSession.cpp
+++ b/src-qt5/core/lumina-desktop/LSession.cpp
@@ -229,8 +229,10 @@ 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
+ //And watch the /media directory, and /run/media/USERNAME directory
if(QFile::exists("/media")){ watcherChange("/media"); }
+ QString userMedia = QString("/run/media/%1").arg(QDir::homePath().split("/").takeLast());
+ if (QFile::exists(userMedia)) { watcherChange(userMedia); }
if(!QFile::exists("/tmp/.autofs_change")){ system("touch /tmp/.autofs_change"); }
watcherChange("/tmp/.autofs_change");
//connect internal signals/slots
@@ -422,7 +424,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" || changed == "/tmp/.autofs_change" ){
+ }else if(changed.toLower() == "/media" || changed.toLower().startsWith("/run/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
bgstack15