diff --git a/src/corelib/kernel/qcoreglobaldata.cpp b/src/corelib/kernel/qcoreglobaldata.cpp index e5fb50715c..e2087b9e64 100644 --- a/src/corelib/kernel/qcoreglobaldata.cpp +++ b/src/corelib/kernel/qcoreglobaldata.cpp @@ -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::const_iterator it = allCodecs.constBegin(); it != allCodecs.constEnd(); ++it) delete *it; +#endif } QCoreGlobalData *QCoreGlobalData::instance() diff --git a/src/corelib/kernel/qcoreglobaldata_p.h b/src/corelib/kernel/qcoreglobaldata_p.h index 32b5becf4f..c3c2f7b4a4 100644 --- a/src/corelib/kernel/qcoreglobaldata_p.h +++ b/src/corelib/kernel/qcoreglobaldata_p.h @@ -71,9 +71,11 @@ struct QCoreGlobalData { QMap dirSearchPaths; QReadWriteLock dirSearchPathsLock; +#if QT_CONFIG(textcodec) QList allCodecs; QAtomicPointer codecForLocale; QTextCodecCache codecCache; +#endif static QCoreGlobalData *instance(); }; diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp index 296c282a47..db264d1b22 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp @@ -238,6 +238,7 @@ static QList 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 diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index d22ea00d8a..ee7bfd6c53 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -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; diff --git a/src/printsupport/kernel/qplatformprintdevice.cpp b/src/printsupport/kernel/qplatformprintdevice.cpp index 9ddef85bf9..eabd7e7295 100644 --- a/src/printsupport/kernel/qplatformprintdevice.cpp +++ b/src/printsupport/kernel/qplatformprintdevice.cpp @@ -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 { diff --git a/src/widgets/styles/qpixmapstyle.cpp b/src/widgets/styles/qpixmapstyle.cpp index a0fff82dc0..ee5fd704dc 100644 --- a/src/widgets/styles/qpixmapstyle.cpp +++ b/src/widgets/styles/qpixmapstyle.cpp @@ -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(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(widget)) QScroller::ungrabGesture(scrollArea->viewport()); +#endif QCommonStyle::unpolish(widget); }