aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/printoptions.cpp
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2015-07-27 13:12:59 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-07-28 11:39:30 +0300
commitf8378927b503c51bfaca456e0f511d0e567fafee (patch)
tree987dbb299b4bb5b7369934cd7d149c928e64d886 /qt-ui/printoptions.cpp
parented5afc510ed4d0756aadbadd57d8b58f37857ef1 (diff)
downloadsubsurface-f8378927b503c51bfaca456e0f511d0e567fafee.tar.gz
Printing: choose first template if selected template is not found
If user selected template is not found, we choose the first template as a default choice. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'qt-ui/printoptions.cpp')
-rw-r--r--qt-ui/printoptions.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/qt-ui/printoptions.cpp b/qt-ui/printoptions.cpp
index 916d9d696..b143e49d0 100644
--- a/qt-ui/printoptions.cpp
+++ b/qt-ui/printoptions.cpp
@@ -33,12 +33,13 @@ void PrintOptions::setup()
// insert existing templates in the UI and select the current template
qSort(grantlee_templates);
- int current_index = 0;
+ int current_index = 0, index = 0;
for (QList<QString>::iterator i = grantlee_templates.begin(); i != grantlee_templates.end(); ++i) {
if ((*i).compare(printOptions->p_template) == 0) {
+ current_index = index;
break;
}
- current_index++;
+ index++;
}
ui.printTemplate->clear();
for (QList<QString>::iterator i = grantlee_templates.begin(); i != grantlee_templates.end(); ++i) {