From 7dc2becd4bc422da6eb51de94dc8937abd70f5c1 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 18 Nov 2014 10:54:24 -0500 Subject: 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. --- lumina-open/LFileDialog.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lumina-open/LFileDialog.cpp') 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); + } + } } // ----------- -- cgit