From f65c04b37e63526540f9717a63fd305f4c3ac579 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Tue, 12 May 2015 15:06:53 +0200 Subject: WinRT/Winphone: Fix warnings in qtbase Change-Id: I41725bcfeee0124b259e96f1e3a261e30f14350a Reviewed-by: Kai Koehne Reviewed-by: Maurice Kalinowski --- src/corelib/codecs/qwindowscodec.cpp | 2 +- src/corelib/io/qlockfile_win.cpp | 6 +++++- src/corelib/kernel/qeventdispatcher_winrt.cpp | 3 ++- src/network/kernel/qhostinfo_winrt.cpp | 1 - src/widgets/dialogs/qfileinfogatherer.cpp | 2 ++ src/widgets/dialogs/qfilesystemmodel.cpp | 4 +++- src/widgets/styles/qwindowsstyle.cpp | 9 +++++---- 7 files changed, 18 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/corelib/codecs/qwindowscodec.cpp b/src/corelib/codecs/qwindowscodec.cpp index cf427c64b6..0f8c5e1a4e 100644 --- a/src/corelib/codecs/qwindowscodec.cpp +++ b/src/corelib/codecs/qwindowscodec.cpp @@ -172,7 +172,7 @@ QString QWindowsLocalCodec::convertToUnicodeCharByChar(const char *chars, int le } #else QString s; - int size = mbstowcs(NULL, mb, length); + size_t size = mbstowcs(NULL, mb, length); if (size < 0) { Q_ASSERT("Error in CE TextCodec"); return QString(); diff --git a/src/corelib/io/qlockfile_win.cpp b/src/corelib/io/qlockfile_win.cpp index 27a63e126a..4e0d8134ec 100644 --- a/src/corelib/io/qlockfile_win.cpp +++ b/src/corelib/io/qlockfile_win.cpp @@ -142,7 +142,11 @@ bool QLockFilePrivate::isApparentlyStale() const return true; } } -#endif // !Q_OS_WINRT +#else // !Q_OS_WINRT + Q_UNUSED(pid); + Q_UNUSED(hostname); + Q_UNUSED(appname); +#endif // Q_OS_WINRT const qint64 age = QFileInfo(fileName).lastModified().msecsTo(QDateTime::currentDateTime()); return staleLockTime > 0 && age > staleLockTime; } diff --git a/src/corelib/kernel/qeventdispatcher_winrt.cpp b/src/corelib/kernel/qeventdispatcher_winrt.cpp index cc8e961be1..b5cfccd649 100644 --- a/src/corelib/kernel/qeventdispatcher_winrt.cpp +++ b/src/corelib/kernel/qeventdispatcher_winrt.cpp @@ -484,7 +484,8 @@ bool QEventDispatcherWinRT::event(QEvent *e) QEventDispatcherWinRTPrivate::QEventDispatcherWinRTPrivate() { CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); - HRESULT hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_System_Threading_ThreadPoolTimer).Get(), &timerFactory); + HRESULT hr; + hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_System_Threading_ThreadPoolTimer).Get(), &timerFactory); Q_ASSERT_SUCCEEDED(hr); HANDLE interruptHandle = CreateEventEx(NULL, NULL, NULL, SYNCHRONIZE|EVENT_MODIFY_STATE); timerIdToHandle.insert(INTERRUPT_HANDLE, interruptHandle); diff --git a/src/network/kernel/qhostinfo_winrt.cpp b/src/network/kernel/qhostinfo_winrt.cpp index 0e606c2070..1a97fe0e40 100644 --- a/src/network/kernel/qhostinfo_winrt.cpp +++ b/src/network/kernel/qhostinfo_winrt.cpp @@ -35,7 +35,6 @@ #include -#include #include #include #include diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp index df07de7975..7329019a87 100644 --- a/src/widgets/dialogs/qfileinfogatherer.cpp +++ b/src/widgets/dialogs/qfileinfogatherer.cpp @@ -185,6 +185,8 @@ void QFileInfoGatherer::removePath(const QString &path) #ifndef QT_NO_FILESYSTEMWATCHER QMutexLocker locker(&mutex); watcher->removePath(path); +#else + Q_UNUSED(path); #endif } diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 88d327168c..4859231d95 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -653,10 +653,12 @@ int QFileSystemModel::columnCount(const QModelIndex &parent) const */ QVariant QFileSystemModel::myComputer(int role) const { +#ifndef QT_NO_FILESYSTEMWATCHER Q_D(const QFileSystemModel); +#endif switch (role) { case Qt::DisplayRole: - return d->myComputer(); + return QFileSystemModelPrivate::myComputer(); #ifndef QT_NO_FILESYSTEMWATCHER case Qt::DecorationRole: return d->fileInfoGatherer.iconProvider()->icon(QFileIconProvider::Computer); diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index bed2b5c57a..14af5ede39 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -299,8 +299,8 @@ void QWindowsStyle::polish(QPalette &pal) int QWindowsStylePrivate::pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *, const QWidget *widget) { - switch (pm) { #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) + switch (pm) { case QStyle::PM_DockWidgetFrameWidth: # ifndef Q_OS_WINCE return GetSystemMetrics(SM_CXFRAME); @@ -337,13 +337,14 @@ int QWindowsStylePrivate::pixelMetricFromSystemDp(QStyle::PixelMetric pm, const # else return GetSystemMetrics(SM_CYDLGFRAME); # endif -#else - Q_UNUSED(widget) -#endif // Q_OS_WIN default: break; } +#else // Q_OS_WIN && !Q_OS_WINRT + Q_UNUSED(pm); + Q_UNUSED(widget); +#endif return QWindowsStylePrivate::InvalidMetric; } -- cgit v1.2.3