aboutsummaryrefslogtreecommitdiff
path: root/src-qt5
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-02-06 16:14:43 -0500
committerKen Moore <ken@ixsystems.com>2017-02-06 16:14:43 -0500
commit3fad4b0551e86a2d2595ca734ac3a171772c72fd (patch)
tree455d9ea7365fed0eae1ad271945afe6c6f4e93d1 /src-qt5
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-3fad4b0551e86a2d2595ca734ac3a171772c72fd.tar.gz
lumina-3fad4b0551e86a2d2595ca734ac3a171772c72fd.tar.bz2
lumina-3fad4b0551e86a2d2595ca734ac3a171772c72fd.zip
Clean up how the default application for a mimetype is displayed within the lumina-open file dialog. Now it will always be listed in the preferred applications list, and with the "[default]" tag at the beginning of the name.
Diffstat (limited to 'src-qt5')
-rw-r--r--src-qt5/core/lumina-open/LFileDialog.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src-qt5/core/lumina-open/LFileDialog.cpp b/src-qt5/core/lumina-open/LFileDialog.cpp
index a0fef17c..a400c60b 100644
--- a/src-qt5/core/lumina-open/LFileDialog.cpp
+++ b/src-qt5/core/lumina-open/LFileDialog.cpp
@@ -161,11 +161,13 @@ void LFileDialog::generateAppList(bool shownetwork){
XDGDesktopList applist;
applist.updateList();
PREFAPPS = getPreferredApplications();
- //qDebug() << "Preferred Apps:" << PREFAPPS;
+ qDebug() << "Preferred Apps:" << PREFAPPS;
ui->combo_rec->clear();
//Now get the application mimetype for the file extension (if available)
QStringList mimetypes = LXDG::findAppMimeForFile(filePath, true).split("::::"); //use all mimetypes
mimetypes.removeDuplicates();
+ QString defapp = getDefaultApp(mimetypes.first()); //default application
+ if(!defapp.isEmpty() && !PREFAPPS.contains(defapp) ){ PREFAPPS << defapp; } //ensure this is listed in the preferred apps list
//Now add all the detected applications
QHash< QString, QList<XDGDesktop*> > hash = LXDG::sortDesktopCats( applist.apps(false,true) );
QStringList cat = hash.keys();
@@ -205,7 +207,9 @@ void LFileDialog::generateAppList(bool shownetwork){
for(int i=0; i<PREFAPPS.length(); i++){
XDGDesktop dFile(PREFAPPS[i]);
if( dFile.isValid() ){
- ui->combo_rec->addItem( LXDG::findIcon(dFile.icon, "application-x-desktop"), dFile.name);
+ QString txt = dFile.name;
+ if(PREFAPPS[i] == defapp){ txt.prepend( tr("[default] ") ); }
+ ui->combo_rec->addItem( LXDG::findIcon(dFile.icon, "application-x-desktop"), txt);
if(i==0){ ui->combo_rec->setCurrentIndex(0); } //make sure the first item is selected
}else{
PREFAPPS.removeAt(i); //invalid app
bgstack15