cups: Add a QT_CONFIG(dialogbuttonbox) guard
This fixes build with -no-feature-action configuration. The corresponding dialog is added by: 6c5c1a562c cups: Show a dialog when asked for password Change-Id: Ic88bdd62c756749959e66252427b5edc2c3ce7cc Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
38cb72b6fd
commit
5ded4e35db
@ -47,12 +47,14 @@
|
||||
|
||||
#include <QtPrintSupport/QPrinterInfo>
|
||||
|
||||
#if QT_CONFIG(dialogbuttonbox)
|
||||
#include <QGuiApplication>
|
||||
#include <QDialog>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#endif // QT_CONFIG(dialogbuttonbox)
|
||||
|
||||
#include <cups/ppd.h>
|
||||
#ifndef QT_LINUXBASE // LSB merges everything into cups.h
|
||||
@ -61,6 +63,7 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#if QT_CONFIG(dialogbuttonbox)
|
||||
static const char *getPasswordCB(const char */*prompt*/, http_t *http, const char */*method*/, const char *resource, void */*user_data*/)
|
||||
{
|
||||
// cups doesn't free the const char * we return so keep around
|
||||
@ -122,13 +125,16 @@ static const char *getPasswordCB(const char */*prompt*/, http_t *http, const cha
|
||||
|
||||
return password.constData();
|
||||
}
|
||||
#endif // QT_CONFIG(dialogbuttonbox)
|
||||
|
||||
QCupsPrinterSupport::QCupsPrinterSupport()
|
||||
: QPlatformPrinterSupport()
|
||||
{
|
||||
#if QT_CONFIG(dialogbuttonbox)
|
||||
// Only show password dialog if GUI application
|
||||
if (qobject_cast<QGuiApplication*>(QCoreApplication::instance()))
|
||||
cupsSetPasswordCB2(getPasswordCB, nullptr /* user_data */ );
|
||||
#endif // QT_CONFIG(dialogbuttonbox)
|
||||
}
|
||||
|
||||
QCupsPrinterSupport::~QCupsPrinterSupport()
|
||||
|
Loading…
x
Reference in New Issue
Block a user