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>
|
#include <QtPrintSupport/QPrinterInfo>
|
||||||
|
|
||||||
|
#if QT_CONFIG(dialogbuttonbox)
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
#endif // QT_CONFIG(dialogbuttonbox)
|
||||||
|
|
||||||
#include <cups/ppd.h>
|
#include <cups/ppd.h>
|
||||||
#ifndef QT_LINUXBASE // LSB merges everything into cups.h
|
#ifndef QT_LINUXBASE // LSB merges everything into cups.h
|
||||||
@ -61,6 +63,7 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
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*/)
|
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
|
// 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();
|
return password.constData();
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(dialogbuttonbox)
|
||||||
|
|
||||||
QCupsPrinterSupport::QCupsPrinterSupport()
|
QCupsPrinterSupport::QCupsPrinterSupport()
|
||||||
: QPlatformPrinterSupport()
|
: QPlatformPrinterSupport()
|
||||||
{
|
{
|
||||||
|
#if QT_CONFIG(dialogbuttonbox)
|
||||||
// Only show password dialog if GUI application
|
// Only show password dialog if GUI application
|
||||||
if (qobject_cast<QGuiApplication*>(QCoreApplication::instance()))
|
if (qobject_cast<QGuiApplication*>(QCoreApplication::instance()))
|
||||||
cupsSetPasswordCB2(getPasswordCB, nullptr /* user_data */ );
|
cupsSetPasswordCB2(getPasswordCB, nullptr /* user_data */ );
|
||||||
|
#endif // QT_CONFIG(dialogbuttonbox)
|
||||||
}
|
}
|
||||||
|
|
||||||
QCupsPrinterSupport::~QCupsPrinterSupport()
|
QCupsPrinterSupport::~QCupsPrinterSupport()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user