aboutsummaryrefslogtreecommitdiff
path: root/lumina-open/main.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2014-10-08 09:41:17 -0400
committerKen Moore <ken@pcbsd.org>2014-10-08 09:41:17 -0400
commitf1c3841b51d145e88556a658e5506bc3c4849751 (patch)
tree4c8a1da0fd5f4bce16ad7feec6167fb203aee97b /lumina-open/main.cpp
parentMerge pull request #16 from Nanolx/side-work (diff)
downloadlumina-f1c3841b51d145e88556a658e5506bc3c4849751.tar.gz
lumina-f1c3841b51d145e88556a658e5506bc3c4849751.tar.bz2
lumina-f1c3841b51d145e88556a658e5506bc3c4849751.zip
Clean up the default filemanager/terminal settings. Put them in the main session file (instead of desktop settings), and also have lumina-config safe it to the lumina-open defaults file directly (in the case of the file manager).
Diffstat (limited to 'lumina-open/main.cpp')
-rw-r--r--lumina-open/main.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/lumina-open/main.cpp b/lumina-open/main.cpp
index eef32589..b0f43a79 100644
--- a/lumina-open/main.cpp
+++ b/lumina-open/main.cpp
@@ -23,7 +23,6 @@
#include <QColor>
#include <QFont>
#include <QTextCodec>
-#include <QSettings>
#include "LFileDialog.h"
@@ -79,17 +78,25 @@ QString cmdFromUser(int argc, char **argv, QString inFile, QString extension, QS
QString defApp = LFileDialog::getDefaultApp(extension);
if(extension=="directory" && defApp.isEmpty() && !showDLG){
//Just use the Lumina File Manager
- return QSettings("LuminaDE", "desktopsettings").value("default-filemanager","lumina-fm").toString();
+ return "lumina-fm";
}else if( !defApp.isEmpty() && !showDLG ){
bool ok = false;
- XDGDesktop DF = LXDG::loadDesktopFile(defApp, ok);
- if(ok){
- QString exec = LXDG::getDesktopExec(DF);
- if(!exec.isEmpty()){
- qDebug() << "[lumina-open] Using default application:" << DF.name << "File:" << inFile;
- if(!DF.path.isEmpty()){ path = DF.path; }
- return exec;
+ if(defApp.endsWith(".desktop")){
+ XDGDesktop DF = LXDG::loadDesktopFile(defApp, ok);
+ if(ok){
+ QString exec = LXDG::getDesktopExec(DF);
+ if(!exec.isEmpty()){
+ qDebug() << "[lumina-open] Using default application:" << DF.name << "File:" << inFile;
+ if(!DF.path.isEmpty()){ path = DF.path; }
+ return exec;
+ }
}
+ }else{
+ //Only binary given
+ if(QFile::exists(defApp)){
+ qDebug() << "[lumina-open] Using default application:" << defApp << "File:" << inFile;
+ return defApp; //just use the binary
+ }
}
//invalid default - reset it and continue on
LFileDialog::setDefaultApp(extension, "");
@@ -139,7 +146,6 @@ QString cmdFromUser(int argc, char **argv, QString inFile, QString extension, QS
void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& path){
//Get the input file
QString inFile;
- QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath()+"/.lumina");
bool showDLG = false; //flag to bypass any default application setting
if(argc > 1){
for(int i=1; i<argc; i++){
bgstack15