Fix build with various features disabled
Change-Id: I95cb3cf3434306344af3f4c7556f45dbfa0b08d6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
369857d294
commit
93b78e7c61
@ -45,15 +45,19 @@ QT_BEGIN_NAMESPACE
|
||||
Q_GLOBAL_STATIC(QCoreGlobalData, globalInstance)
|
||||
|
||||
QCoreGlobalData::QCoreGlobalData()
|
||||
#if QT_CONFIG(textcodec)
|
||||
: codecForLocale(0)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
QCoreGlobalData::~QCoreGlobalData()
|
||||
{
|
||||
#if QT_CONFIG(textcodec)
|
||||
codecForLocale = 0;
|
||||
for (QList<QTextCodec *>::const_iterator it = allCodecs.constBegin(); it != allCodecs.constEnd(); ++it)
|
||||
delete *it;
|
||||
#endif
|
||||
}
|
||||
|
||||
QCoreGlobalData *QCoreGlobalData::instance()
|
||||
|
@ -71,9 +71,11 @@ struct QCoreGlobalData {
|
||||
QMap<QString, QStringList> dirSearchPaths;
|
||||
QReadWriteLock dirSearchPathsLock;
|
||||
|
||||
#if QT_CONFIG(textcodec)
|
||||
QList<QTextCodec*> allCodecs;
|
||||
QAtomicPointer<QTextCodec> codecForLocale;
|
||||
QTextCodecCache codecCache;
|
||||
#endif
|
||||
|
||||
static QCoreGlobalData *instance();
|
||||
};
|
||||
|
@ -238,6 +238,7 @@ static QList<QSize> availableXdgFileIconSizes()
|
||||
return QIcon::fromTheme(QStringLiteral("inode-directory")).availableSizes();
|
||||
}
|
||||
|
||||
#if QT_CONFIG(mimetype)
|
||||
static QIcon xdgFileIcon(const QFileInfo &fileInfo)
|
||||
{
|
||||
QMimeDatabase mimeDatabase;
|
||||
@ -253,6 +254,7 @@ static QIcon xdgFileIcon(const QFileInfo &fileInfo)
|
||||
const QString &genericIconName = mimeType.genericIconName();
|
||||
return genericIconName.isEmpty() ? QIcon() : QIcon::fromTheme(genericIconName);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_SETTINGS
|
||||
class QKdeThemePrivate : public QPlatformThemePrivate
|
||||
@ -547,7 +549,11 @@ QVariant QKdeTheme::themeHint(QPlatformTheme::ThemeHint hint) const
|
||||
|
||||
QIcon QKdeTheme::fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions) const
|
||||
{
|
||||
#if QT_CONFIG(mimetype)
|
||||
return xdgFileIcon(fileInfo);
|
||||
#else
|
||||
return QIcon();
|
||||
#endif
|
||||
}
|
||||
|
||||
const QPalette *QKdeTheme::palette(Palette type) const
|
||||
@ -708,7 +714,11 @@ QVariant QGnomeTheme::themeHint(QPlatformTheme::ThemeHint hint) const
|
||||
|
||||
QIcon QGnomeTheme::fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions) const
|
||||
{
|
||||
#if QT_CONFIG(mimetype)
|
||||
return xdgFileIcon(fileInfo);
|
||||
#else
|
||||
return QIcon();
|
||||
#endif
|
||||
}
|
||||
|
||||
const QFont *QGnomeTheme::font(Font type) const
|
||||
|
@ -258,7 +258,7 @@ static inline XTextProperty* qstringToXTP(Display *dpy, const QString& s)
|
||||
free_prop = true;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_TEXTCODEC
|
||||
#if QT_CONFIG(textcodec)
|
||||
static const QTextCodec* mapper = QTextCodec::codecForLocale();
|
||||
int errCode = 0;
|
||||
if (mapper) {
|
||||
@ -274,6 +274,7 @@ static inline XTextProperty* qstringToXTP(Display *dpy, const QString& s)
|
||||
mapper = QTextCodec::codecForName("latin1");
|
||||
if (!mapper || !mapper->canEncode(s))
|
||||
return Q_NULLPTR;
|
||||
#endif
|
||||
static QByteArray qcs;
|
||||
qcs = s.toLatin1();
|
||||
tp.value = (uchar*)qcs.data();
|
||||
@ -281,6 +282,7 @@ static inline XTextProperty* qstringToXTP(Display *dpy, const QString& s)
|
||||
tp.format = 8;
|
||||
tp.nitems = qcs.length();
|
||||
free_prop = false;
|
||||
#if QT_CONFIG(textcodec)
|
||||
}
|
||||
#endif
|
||||
return &tp;
|
||||
|
@ -59,7 +59,7 @@ QPlatformPrintDevice::QPlatformPrintDevice()
|
||||
m_haveOutputBins(false),
|
||||
m_haveDuplexModes(false),
|
||||
m_haveColorModes(false)
|
||||
#ifndef QT_NO_MIMETYPES
|
||||
#ifndef QT_NO_MIMETYPE
|
||||
, m_haveMimeTypes(false)
|
||||
#endif
|
||||
{
|
||||
@ -77,7 +77,7 @@ QPlatformPrintDevice::QPlatformPrintDevice(const QString &id)
|
||||
m_haveOutputBins(false),
|
||||
m_haveDuplexModes(false),
|
||||
m_haveColorModes(false)
|
||||
#ifndef QT_NO_MIMETYPES
|
||||
#ifndef QT_NO_MIMETYPE
|
||||
, m_haveMimeTypes(false)
|
||||
#endif
|
||||
{
|
||||
|
@ -187,7 +187,9 @@ void QPixmapStyle::polish(QWidget *widget)
|
||||
view->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
view->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
}
|
||||
#if QT_CONFIG(gestures)
|
||||
QScroller::grabGesture(scrollArea->viewport(), QScroller::LeftMouseButtonGesture);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (qobject_cast<QScrollBar*>(widget))
|
||||
@ -217,8 +219,10 @@ void QPixmapStyle::unpolish(QWidget *widget)
|
||||
if (qstrcmp(widget->metaObject()->className(),"QComboBoxPrivateContainer") == 0)
|
||||
widget->removeEventFilter(this);
|
||||
|
||||
#if QT_CONFIG(gestures)
|
||||
if (QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea*>(widget))
|
||||
QScroller::ungrabGesture(scrollArea->viewport());
|
||||
#endif
|
||||
|
||||
QCommonStyle::unpolish(widget);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user