diff options
author | Ken Moore <ken@ixsystems.com> | 2018-05-21 12:16:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-21 12:16:14 -0400 |
commit | 768b334408806fde94b4b283a32e69c23f2d8b2d (patch) | |
tree | b2fdc65a7b17c5d2441b52f49886efcc3fa69fcc /src-qt5/core/lumina-desktop/LDesktop.cpp | |
parent | Merge pull request #585 from rodlie/bsdtar (diff) | |
parent | desktop: support /run/media (user removable devices) (diff) | |
download | lumina-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/LDesktop.cpp')
-rw-r--r-- | src-qt5/core/lumina-desktop/LDesktop.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src-qt5/core/lumina-desktop/LDesktop.cpp b/src-qt5/core/lumina-desktop/LDesktop.cpp index a7ab1340..861a1aac 100644 --- a/src-qt5/core/lumina-desktop/LDesktop.cpp +++ b/src-qt5/core/lumina-desktop/LDesktop.cpp @@ -389,15 +389,20 @@ void LDesktop::UpdateDesktop(){ filelist << files[i].absoluteFilePath(); } } - //Also show anything available in the /media directory + //Also show anything available in the /media directory, and /run/media/USERNAME directory if(settings->value(DPREFIX+"generateMediaIcons",true).toBool()){ QDir media("/media"); QStringList mediadirs = media.entryList(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot, QDir::Name); for(int i=0; i<mediadirs.length(); i++){ filelist << media.absoluteFilePath(mediadirs[i]); } + QDir userMedia(QString("/run/media/%1").arg(QDir::homePath().split("/").takeLast())); + QStringList userMediadirs = userMedia.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name); + for(int i=0; i<userMediadirs.length(); i++){ + filelist << userMedia.absoluteFilePath(userMediadirs[i]); + } + //qDebug() << "Found media Dirs:" << mediadirs << userMediadirs; } - //qDebug() << "Found media Dirs:" << mediadirs; UpdateDesktopPluginArea(); bgDesktop->LoadItems(plugins, filelist); } |