summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/printoptions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/printoptions.cpp')
-rw-r--r--desktop-widgets/printoptions.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/desktop-widgets/printoptions.cpp b/desktop-widgets/printoptions.cpp
index 77920f888..b4862e79e 100644
--- a/desktop-widgets/printoptions.cpp
+++ b/desktop-widgets/printoptions.cpp
@@ -53,13 +53,15 @@ void PrintOptions::setupTemplates()
QStringList currList = printOptions->type == print_options::DIVELIST ?
grantlee_templates : grantlee_statistics_templates;
+ // temp. store the template from options, as addItem() updates it via:
+ // on_printTemplate_currentIndexChanged()
+ QString storedTemplate = printOptions->p_template;
qSort(currList);
int current_index = 0;
ui.printTemplate->clear();
Q_FOREACH(const QString& theme, currList) {
- if (theme == printOptions->p_template){
+ if (theme == storedTemplate) // find the stored template in the list
current_index = currList.indexOf(theme);
- }
ui.printTemplate->addItem(theme.split('.')[0], theme);
}
ui.printTemplate->setCurrentIndex(current_index);