summaryrefslogtreecommitdiffstats
path: root/src/printsupport/kernel/qprinter.cpp
diff options
context:
space:
mode:
authorJohn Layt <jlayt@kde.org>2014-03-21 20:30:01 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-07 19:06:26 +0200
commit398ae00e84433789598a716cd3e6202a2f76f1fd (patch)
tree0cd77fc6bb2afd4b3d395ecd0bfabe20a14c2cc4 /src/printsupport/kernel/qprinter.cpp
parent7eba6d039dfbb9377a4358842fcd7210dc1fdd86 (diff)
QPrinter - Don't use QPrinterInfo::availablePrinters()
The availablePrinters() method can be slow as it gets all info for every printer which may be slow with many network printers. Change-Id: I4bc5ef46ed4867326b60b66371178b84204639ce Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Diffstat (limited to 'src/printsupport/kernel/qprinter.cpp')
-rw-r--r--src/printsupport/kernel/qprinter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index bdc9a98f2e..c758d9f4ea 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -120,9 +120,9 @@ QPrinterInfo QPrinterPrivate::findValidPrinter(const QPrinterInfo &printer)
if (printerToUse.isNull()) {
printerToUse = QPrinterInfo::defaultPrinter();
if (printerToUse.isNull()) {
- QList<QPrinterInfo> availablePrinters = QPrinterInfo::availablePrinters();
- if (!availablePrinters.isEmpty())
- printerToUse = availablePrinters.at(0);
+ QStringList availablePrinterNames = QPrinterInfo::availablePrinterNames();
+ if (!availablePrinterNames.isEmpty())
+ printerToUse = QPrinterInfo::printerInfo(availablePrinterNames.at(0));
}
}
return printerToUse;