Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit ad0bd5f6 authored by Daniel Nicoletti's avatar Daniel Nicoletti

More use of initializer lists

parent 57f40f44
......@@ -128,12 +128,9 @@ void NewPrinterNotification::NewPrinter(int status,
title = i18n("The New Printer is Missing Drivers");
}
QStringList attr;
attr << KCUPS_PRINTER_MAKE_AND_MODEL;
// Get the new printer attributes
QPointer<KCupsRequest> request = new KCupsRequest;
request->getPrinterAttributes(name, false, attr);
request->getPrinterAttributes(name, false, { KCUPS_PRINTER_MAKE_AND_MODEL });
request->waitTillFinished();
if (!request) {
return;
......@@ -250,10 +247,10 @@ void NewPrinterNotification::findDriver()
qCDebug(PM_KDED);
// This function will show the PPD browser dialog
// to choose a better PPD to the already added printer
QStringList args;
args << QLatin1String("--change-ppd");
args << sender()->property(PRINTER_NAME).toString();
KToolInvocation::kdeinitExec(QLatin1String("kde-add-printer"), args);
KToolInvocation::kdeinitExec(QLatin1String("kde-add-printer"), {
QLatin1String("--change-ppd"),
sender()->property(PRINTER_NAME).toString()
});
}
void NewPrinterNotification::installDriver()
......@@ -268,11 +265,10 @@ void NewPrinterNotification::setupPrinter()
// This function will show the PPD browser dialog
// to choose a better PPD, queue name, location
// in this case the printer was not added
QStringList args{
QLatin1String("--new-printer-from-device"),
obj->property(PRINTER_NAME).toString() % QLatin1Char('/') % obj->property(DEVICE_ID).toString()
};
KToolInvocation::kdeinitExec(QLatin1String("kde-add-printer"), args);
KToolInvocation::kdeinitExec(QLatin1String("kde-add-printer"), {
QLatin1String("--new-printer-from-device"),
obj->property(PRINTER_NAME).toString() + QLatin1Char('/') + obj->property(DEVICE_ID).toString()
});
}
QStringList NewPrinterNotification::getMissingExecutables(const QString &ppdFileName) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment