aboutsummaryrefslogtreecommitdiff
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
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.
-rw-r--r--src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp4
-rw-r--r--src-qt5/desktop-utils/lumina-fm/MainUI.cpp24
2 files changed, 22 insertions, 6 deletions
diff --git a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
index 6ff144d5..29a58ec9 100644
--- a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
+++ b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp
@@ -66,7 +66,7 @@ QStringList LOS::ExternalDevicePaths(){
for(int i=0; i<list.length(); i++){
//qDebug() << "Found media entry:" << list[i].fileName();
if(list[i].isDir()){
- devs << "UNKNOWN::::directory::::/media/"+list[i].fileName();
+ devs << "UNKNOWN::::::::/media/"+list[i].fileName();
}else if(list[i].fileName().endsWith(".desktop")){
QString type = list[i].fileName().section(".desktop",0,-2);
//Determine the type of hardware device based on the dev node
@@ -75,7 +75,7 @@ QStringList LOS::ExternalDevicePaths(){
else if(type.startsWith("mmsd")){ type = "SDCARD"; }
else if(type.startsWith("cd")||type.startsWith("acd")){ type="DVD"; }
else{ type = "UNKNOWN"; }
- devs << type+"::::unknown::::/media/"+list[i].fileName();
+ devs << type+"::::::::/media/"+list[i].fileName();
}
}
return devs;
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