From 74c85b6b70174acd587722d10f431c906310fbda Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Fri, 25 Feb 2011 13:15:53 +0200 Subject: [PATCH] GUI: Select the default application in app list. --- gui/settingsdialog.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp index 467359ae0..ca78c1d9d 100644 --- a/gui/settingsdialog.cpp +++ b/gui/settingsdialog.cpp @@ -272,10 +272,16 @@ void SettingsDialog::PopulateApplicationList() mUI.mListWidget->addItem(name); } - // If list contains items select first item - if (mTempApplications->GetApplicationCount()) - { + // Select default application, or if there is no default app then the + // first item. + if (defapp == -1) mUI.mListWidget->setCurrentRow(0); + else + { + if (mTempApplications->GetApplicationCount() > defapp) + mUI.mListWidget->setCurrentRow(defapp); + else + mUI.mListWidget->setCurrentRow(0); } }