diff options
author | Sasongko Bawono <sasongko262@gmail.com> | 2017-02-26 08:33:25 +0700 |
---|---|---|
committer | Sasongko Bawono <sasongko262@gmail.com> | 2017-02-26 08:33:25 +0700 |
commit | eb7d5a1270d17ecd16912008d8587cc543cafc77 (patch) | |
tree | 64be065a2e3fe58933bb5be6f30cc76a1af33f86 /src-qt5/core/lumina-open/LFileDialog.cpp | |
parent | modified DEPENDENCIES for Slackware (diff) | |
parent | Merge remote-tracking branch 'origin/master' (diff) | |
download | lumina-eb7d5a1270d17ecd16912008d8587cc543cafc77.tar.gz lumina-eb7d5a1270d17ecd16912008d8587cc543cafc77.tar.bz2 lumina-eb7d5a1270d17ecd16912008d8587cc543cafc77.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src-qt5/core/lumina-open/LFileDialog.cpp')
-rw-r--r-- | src-qt5/core/lumina-open/LFileDialog.cpp | 8 |
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 |