fix odf printer selection
authorKonrad Rosenbaum <konrad@silmor.de>
Sat, 24 Mar 2012 12:15:19 +0000 (13:15 +0100)
committerKonrad Rosenbaum <konrad@silmor.de>
Sat, 24 Mar 2012 12:15:19 +0000 (13:15 +0100)
src/templates/office.cpp

index 5354a55..398b855 100644 (file)
@@ -17,6 +17,7 @@
 #include <QCheckBox>
 #include <QComboBox>
 #include <QCoreApplication>
+#include <QDebug>
 #include <QFileDialog>
 #include <QFileInfo>
 #include <QGroupBox>
@@ -55,13 +56,13 @@ static void confirmPrinter(QString&prn)
        printer->addItem(QCoreApplication::translate("office","(Default Printer)"));
        QList<QPrinterInfo>aprn=QPrinterInfo::availablePrinters();
        int cprn=0;
-       QString cp=QSettings().value("officePrinter","").toString();
        for(int i=0;i<aprn.size();i++){
                QString s=aprn[i].printerName();
                printer->addItem(s);
-               if(cp==prn)cprn=i+1;
+               if(s==prn)cprn=i+1;
        }
        printer->setCurrentIndex(cprn);
+//     qDebug()<<"printer selection"<<prn<<cprn;
        vl->addSpacing(10);
        vl->addStretch(1);
        QHBoxLayout*hl;