summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2016-08-29 10:29:47 +0200
committerLars Knoll <lars.knoll@qt.io>2016-10-11 14:20:34 +0000
commit93b78e7c6135340484569a0310ca3dedceb47f31 (patch)
tree167a7ba83989ad501cccf481dac2083aae87dcef /src
parent369857d29437615e1fda9fb1ab2f94e464d55ca2 (diff)
Fix build with various features disabled
Change-Id: I95cb3cf3434306344af3f4c7556f45dbfa0b08d6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qcoreglobaldata.cpp4
-rw-r--r--src/corelib/kernel/qcoreglobaldata_p.h2
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes.cpp10
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp4
-rw-r--r--src/printsupport/kernel/qplatformprintdevice.cpp4
-rw-r--r--src/widgets/styles/qpixmapstyle.cpp4
6 files changed, 25 insertions, 3 deletions
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<QTextCodec *>::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<QString, QStringList> dirSearchPaths;
QReadWriteLock dirSearchPathsLock;
+#if QT_CONFIG(textcodec)
QList<QTextCodec*> allCodecs;
QAtomicPointer<QTextCodec> 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<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
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<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);
}