mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
ed5afc510e
commit
f8378927b5
1 changed files with 3 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue