diff options
author | Ken Moore <ken@pcbsd.org> | 2014-11-18 10:54:24 -0500 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2014-11-18 10:54:24 -0500 |
commit | 7dc2becd4bc422da6eb51de94dc8937abd70f5c1 (patch) | |
tree | 43c190a5e1e7c891a9ebb01b55ad2279ef0bcfa6 /lumina-open | |
parent | Finish up the new Mime type default app usage in lumina-config and lumina-ope... (diff) | |
download | lumina-7dc2becd4bc422da6eb51de94dc8937abd70f5c1.tar.gz lumina-7dc2becd4bc422da6eb51de94dc8937abd70f5c1.tar.bz2 lumina-7dc2becd4bc422da6eb51de94dc8937abd70f5c1.zip |
Finish cleaning up the new mime-type application defaults methodology: It seems to be working great now, and cleans up lumina-config a bit as well.
Diffstat (limited to 'lumina-open')
-rw-r--r-- | lumina-open/LFileDialog.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lumina-open/LFileDialog.cpp b/lumina-open/LFileDialog.cpp index dfd70ba2..0f2ab1cf 100644 --- a/lumina-open/LFileDialog.cpp +++ b/lumina-open/LFileDialog.cpp @@ -47,12 +47,17 @@ QString LFileDialog::getDefaultApp(QString extension){ } void LFileDialog::setDefaultApp(QString extension, QString appFile){ - QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath()+"/.lumina"); - if(appFile.isEmpty()){ - QSettings("LuminaDE", "lumina-open").remove("default/"+extension); + if(extension.contains("/")){ + //mime type default: set on the system itself + LXDG::setDefaultAppForMime(extension, appFile); }else{ - QSettings("LuminaDE", "lumina-open").setValue("default/"+extension,appFile); - } + QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath()+"/.lumina"); + if(appFile.isEmpty()){ + QSettings("LuminaDE", "lumina-open").remove("default/"+extension); + }else{ + QSettings("LuminaDE", "lumina-open").setValue("default/"+extension,appFile); + } + } } // ----------- |