aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-11-02 11:24:14 -0400
committerKen Moore <ken@ixsystems.com>2017-11-02 11:24:14 -0400
commitd7d0a2508d768583ffbc152e5a06363d7fc17ccb (patch)
tree3267ab98649c5ca466b883c2c90cf7325c5ca3dc /src-qt5/desktop-utils
parentFinish up the /media parsing for LuminaOS-FreeBSD (diff)
downloadlumina-d7d0a2508d768583ffbc152e5a06363d7fc17ccb.tar.gz
lumina-d7d0a2508d768583ffbc152e5a06363d7fc17ccb.tar.bz2
lumina-d7d0a2508d768583ffbc152e5a06363d7fc17ccb.zip
A bit more cleanup on the external device reporting/usage.
Diffstat (limited to 'src-qt5/desktop-utils')
-rw-r--r--src-qt5/desktop-utils/lumina-fm/MainUI.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp
index 692b7562..9ce7b69e 100644
--- a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp
+++ b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp
@@ -349,7 +349,7 @@ void MainUI::RebuildDeviceMenu(){
QStringList devs = LOS::ExternalDevicePaths();
//Output Format: <type>::::<filesystem>::::<path> (6/24/14 - version 0.4.0 )
// <type> = [USB, HDRIVE, SDCARD, DVD, LVM, UNKNOWN]
- qDebug() << "Externally-mounted devices:" << devs;
+ //qDebug() << "Externally-mounted devices:" << devs;
//Now add them to the menu appropriately
for(int i=0; i<devs.length(); i++){
//Skip hidden mount points (usually only for system usage - not user browsing)
@@ -361,6 +361,7 @@ void MainUI::RebuildDeviceMenu(){
if(path == "/"){ label = tr("Root"); }
else{ label = path.section("/",-1).simplified(); }
if(label.startsWith(".") ){ continue; } //don't show hidden mountpoint (not usually user-browsable)
+ if(label.endsWith(".desktop")){ label = label.section(".desktop",0,-2); } //chop the shortcut suffix off the end
//Create entry for this device
if( !fs.simplified().isEmpty()){
//Add filesystem type to the label
@@ -507,13 +508,29 @@ void MainUI::goToDevice(QAction *act){
if(act==ui->actionScan){
RebuildDeviceMenu();
}else{
+ QString action = act->whatsThis();
+ if(action.endsWith(".desktop")){
+ //Find the actual action/directory within this shortcut
+ XDGDesktop xdg(action);
+ if(xdg.type==XDGDesktop::DIR){
+ action = xdg.path; //use the new path
+ }else{
+ //Need to run the full open routine on this shortcut
+ QProcess::startDetached("lumina-open", QStringList() << action);
+ return;
+ }
+ }else if( !QFileInfo(action).isDir() ){
+ //Need to run the full open routine on this file since it is not a directory
+ QProcess::startDetached("lumina-open", QStringList() << action);
+ return;
+ }
DirWidget *dir = FindActiveBrowser();
if(dir!=0){
- dir->ChangeDir(act->whatsThis());
+ dir->ChangeDir(action);
return;
}
//If no current dir could be found - open a new tab/column
- OpenDirs(QStringList() << act->whatsThis() );
+ OpenDirs(QStringList() << action );
}
}
@@ -972,4 +989,3 @@ void MainUI::on_actionOpen_as_Root_triggered()
{
ExternalProcess::launch("qsudo lumina-fm");
}
-
bgstack15