summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qglobal.cpp19
-rw-r--r--src/corelib/global/qsystemdetection.h1
-rw-r--r--src/corelib/io/qfileselector.cpp4
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp37
-rw-r--r--src/corelib/io/qfilesystementry.cpp2
-rw-r--r--src/corelib/io/qfilesystemiterator_win.cpp4
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp13
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp19
-rw-r--r--src/corelib/kernel/qsharedmemory_win.cpp32
-rw-r--r--src/corelib/tools/tools.pri1
10 files changed, 8 insertions, 124 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 1170fff16a..b34e8ec659 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1339,13 +1339,6 @@ bool qSharedBuild() Q_DECL_NOTHROW
*/
/*!
- \macro Q_OS_WINPHONE
- \relates <QtGlobal>
-
- Defined on Windows Phone 8.
-*/
-
-/*!
\macro Q_OS_CYGWIN
\relates <QtGlobal>
@@ -2622,8 +2615,8 @@ QString QSysInfo::kernelVersion()
\b{FreeBSD note}: this function returns "debian" for Debian/kFreeBSD and
"unknown" otherwise.
- \b{Windows note}: this function returns "winphone" for builds for Windows
- Phone, "winrt" for WinRT builds, and "windows" for normal desktop builds.
+ \b{Windows note}: this function "winrt" for WinRT builds, and "windows"
+ for normal desktop builds.
For other Unix-type systems, this function usually returns "unknown".
@@ -2632,9 +2625,7 @@ QString QSysInfo::kernelVersion()
QString QSysInfo::productType()
{
// similar, but not identical to QFileSelectorPrivate::platformSelectors
-#if defined(Q_OS_WINPHONE)
- return QStringLiteral("winphone");
-#elif defined(Q_OS_WINRT)
+#if defined(Q_OS_WINRT)
return QStringLiteral("winrt");
#elif defined(Q_OS_WIN)
return QStringLiteral("windows");
@@ -2746,9 +2737,7 @@ QString QSysInfo::productVersion()
*/
QString QSysInfo::prettyProductName()
{
-#if defined(Q_OS_WINPHONE)
- return QLatin1String("Windows Phone ") + QLatin1String(osVer_helper());
-#elif defined(Q_OS_ANDROID) || defined(Q_OS_DARWIN) || defined(Q_OS_WIN)
+#if defined(Q_OS_ANDROID) || defined(Q_OS_DARWIN) || defined(Q_OS_WIN)
const auto version = QOperatingSystemVersion::current();
const char *name = osVer_helper(version);
if (name)
diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h
index 3b486b8f6f..3133b4a719 100644
--- a/src/corelib/global/qsystemdetection.h
+++ b/src/corelib/global/qsystemdetection.h
@@ -134,7 +134,6 @@
# define WINAPI_FAMILY_PC_APP WINAPI_FAMILY_APP
# endif
# if defined(WINAPI_FAMILY_PHONE_APP) && WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP
-# define Q_OS_WINPHONE
# define Q_OS_WINRT
# elif WINAPI_FAMILY==WINAPI_FAMILY_PC_APP
# define Q_OS_WINRT
diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp
index 920281cef7..a34af72dfd 100644
--- a/src/corelib/io/qfileselector.cpp
+++ b/src/corelib/io/qfileselector.cpp
@@ -368,14 +368,10 @@ QStringList QFileSelectorPrivate::platformSelectors()
// similar, but not identical to QSysInfo::osType
QStringList ret;
#if defined(Q_OS_WIN)
- // can't fall back to QSysInfo because we need both "winphone" and "winrt" for the Windows Phone case
ret << QStringLiteral("windows");
ret << QSysInfo::kernelType(); // "winnt"
# if defined(Q_OS_WINRT)
ret << QStringLiteral("winrt");
-# if defined(Q_OS_WINPHONE)
- ret << QStringLiteral("winphone");
-# endif
# endif
#elif defined(Q_OS_UNIX)
ret << QStringLiteral("unix");
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index ee54c5fd3a..90708b0473 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -81,11 +81,6 @@ using namespace Microsoft::WRL::Wrappers;
using namespace ABI::Windows::Foundation;
using namespace ABI::Windows::Storage;
using namespace ABI::Windows::ApplicationModel;
-
-#if _MSC_VER < 1900
-#define Q_OS_WINRT_WIN81
-#endif
-
#endif // Q_OS_WINRT
#ifndef SPI_GETPLATFORMTYPE
@@ -157,7 +152,6 @@ QT_BEGIN_NAMESPACE
Q_CORE_EXPORT int qt_ntfs_permission_lookup = 0;
#if defined(Q_OS_WINRT)
-static QString qfsPrivateCurrentDir = QLatin1String("");
// As none of the functions we try to resolve do exist on WinRT
// we use QT_NO_LIBRARY to shorten everything up a little bit.
# ifndef QT_NO_LIBRARY
@@ -503,7 +497,6 @@ QString QFileSystemEngine::nativeAbsoluteFilePath(const QString &path)
{
// can be //server or //server/share
QString absPath;
-#if !defined(Q_OS_WINRT_WIN81)
QVarLengthArray<wchar_t, MAX_PATH> buf(qMax(MAX_PATH, path.size() + 1));
wchar_t *fileName = 0;
DWORD retLen = GetFullPathName((wchar_t*)path.utf16(), buf.size(), buf.data(), &fileName);
@@ -523,12 +516,7 @@ QString QFileSystemEngine::nativeAbsoluteFilePath(const QString &path)
if (absPath.size() < rootPath.size() && rootPath.startsWith(absPath))
absPath = rootPath;
# endif // Q_OS_WINRT
-#else // !Q_OS_WINRT_WIN81
- if (QDir::isRelativePath(path))
- absPath = QDir::toNativeSeparators(QDir::cleanPath(QDir::currentPath() + QLatin1Char('/') + path));
- else
- absPath = QDir::toNativeSeparators(QDir::cleanPath(path));
-#endif // Q_OS_WINRT_WIN81
+
// This is really ugly, but GetFullPathName strips off whitespace at the end.
// If you for instance write ". " in the lineedit of QFileDialog,
// (which is an invalid filename) this function will strip the space off and viola,
@@ -550,14 +538,7 @@ QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry)
else
ret = QDir::fromNativeSeparators(nativeAbsoluteFilePath(entry.filePath()));
} else {
-#ifndef Q_OS_WINRT_WIN81
ret = QDir::cleanPath(QDir::currentPath() + QLatin1Char('/') + entry.filePath());
-#else
- // Some WinRT APIs do not support absolute paths (due to sandboxing).
- // Thus the port uses the executable's directory as its root directory
- // and treats paths relative to that as absolute paths.
- ret = QDir::cleanPath(QDir::current().relativeFilePath(entry.filePath()));
-#endif
}
#ifndef Q_OS_WINRT
@@ -1218,9 +1199,6 @@ QString QFileSystemEngine::tempPath()
ret = QDir::fromNativeSeparators(ret);
}
#else // !Q_OS_WINRT
- // According to http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.applicationdata.temporaryfolder.aspx
- // the API is not available on winphone which should cause one of the functions
- // below to fail
ComPtr<IApplicationDataStatics> applicationDataStatics;
if (FAILED(GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Storage_ApplicationData).Get(), &applicationDataStatics)))
return ret;
@@ -1252,20 +1230,14 @@ bool QFileSystemEngine::setCurrentPath(const QFileSystemEntry &entry)
if(!(meta.exists() && meta.isDirectory()))
return false;
-#if !defined(Q_OS_WINRT_WIN81)
//TODO: this should really be using nativeFilePath(), but that returns a path in long format \\?\c:\foo
//which causes many problems later on when it's returned through currentPath()
return ::SetCurrentDirectory(reinterpret_cast<const wchar_t*>(QDir::toNativeSeparators(entry.filePath()).utf16())) != 0;
-#else
- qfsPrivateCurrentDir = entry.filePath();
- return true;
-#endif
}
QFileSystemEntry QFileSystemEngine::currentPath()
{
QString ret;
-#if !defined(Q_OS_WINRT_WIN81)
DWORD size = 0;
wchar_t currentName[PATH_MAX];
size = ::GetCurrentDirectory(PATH_MAX, currentName);
@@ -1281,13 +1253,6 @@ QFileSystemEntry QFileSystemEngine::currentPath()
}
if (ret.length() >= 2 && ret[1] == QLatin1Char(':'))
ret[0] = ret.at(0).toUpper(); // Force uppercase drive letters.
-#else // !Q_OS_WINRT_WIN81
- //TODO - a race condition exists when using currentPath / setCurrentPath from multiple threads
- if (qfsPrivateCurrentDir.isEmpty())
- qfsPrivateCurrentDir = QDir::rootPath();
-
- ret = qfsPrivateCurrentDir;
-#endif // Q_OS_WINRT_WIN81
return QFileSystemEntry(ret, QFileSystemEntry::FromNativePath());
}
diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp
index 2e92f8fbba..de4c852068 100644
--- a/src/corelib/io/qfilesystementry.cpp
+++ b/src/corelib/io/qfilesystementry.cpp
@@ -175,10 +175,8 @@ void QFileSystemEntry::resolveNativeFilePath() const
// WinRT/MSVC2015 allows a maximum of 256 characters for a filepath
// unless //?/ is prepended which extends the rule to have a maximum
// of 256 characters in the filename plus the preprending path
-#if _MSC_VER >= 1900
m_nativeFilePath.prepend("\\\\?\\");
#endif
-#endif
}
}
diff --git a/src/corelib/io/qfilesystemiterator_win.cpp b/src/corelib/io/qfilesystemiterator_win.cpp
index 9140118872..2905a8e54e 100644
--- a/src/corelib/io/qfilesystemiterator_win.cpp
+++ b/src/corelib/io/qfilesystemiterator_win.cpp
@@ -69,10 +69,6 @@ QFileSystemIterator::QFileSystemIterator(const QFileSystemEntry &entry, QDir::Fi
nativePath.append(QLatin1Char('\\'));
nativePath.append(QLatin1Char('*'));
// In MSVC2015+ case we prepend //?/ for longer file-name support
-#if defined(Q_OS_WINRT) && _MSC_VER < 1900
- if (nativePath.startsWith(QLatin1Char('\\')))
- nativePath.remove(0, 1);
-#endif
if (!dirPath.endsWith(QLatin1Char('/')))
dirPath.append(QLatin1Char('/'));
if ((filters & (QDir::Dirs|QDir::Drives)) && (!(filters & (QDir::Files))))
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index 117c224318..a7fd50df83 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -850,7 +850,6 @@ QDateTime QFSFileEngine::fileTime(FileTime time) const
uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size,
QFile::MemoryMapFlags flags)
{
-#ifndef Q_OS_WINPHONE
Q_Q(QFSFileEngine);
Q_UNUSED(flags);
if (openMode == QFile::NotOpen) {
@@ -960,18 +959,11 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size,
::CloseHandle(mapHandle);
mapHandle = NULL;
-#else // !Q_OS_WINPHONE
- Q_UNUSED(offset);
- Q_UNUSED(size);
- Q_UNUSED(flags);
- Q_UNIMPLEMENTED();
-#endif // Q_OS_WINPHONE
return 0;
}
bool QFSFileEnginePrivate::unmap(uchar *ptr)
{
-#ifndef Q_OS_WINPHONE
Q_Q(QFSFileEngine);
if (!maps.contains(ptr)) {
q->setError(QFile::PermissionsError, qt_error_string(ERROR_ACCESS_DENIED));
@@ -990,11 +982,6 @@ bool QFSFileEnginePrivate::unmap(uchar *ptr)
}
return true;
-#else // !Q_OS_WINPHONE
- Q_UNUSED(ptr);
- Q_UNIMPLEMENTED();
- return false;
-#endif // Q_OS_WINPHONE
}
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp
index 4057c03b84..856d2a2101 100644
--- a/src/corelib/kernel/qcoreapplication_win.cpp
+++ b/src/corelib/kernel/qcoreapplication_win.cpp
@@ -65,23 +65,6 @@ QT_BEGIN_NAMESPACE
int appCmdShow = 0;
-// GetModuleFileName only exists for MSVC2015 and upwards for WinRT, meaning
-// Windows 10 (Mobile). Hence take the first argument passed to the
-// QCoreApplication contructor for older versions as a fallback on older platforms.
-#if defined(Q_OS_WINRT) && _MSC_VER < 1900
-
-Q_CORE_EXPORT QString qAppFileName()
-{
- return QFileInfo(QCoreApplication::arguments().constFirst()).filePath();
-}
-
-QString QCoreApplicationPrivate::appName() const
-{
- return QFileInfo(QCoreApplication::arguments().constFirst()).baseName();
-}
-
-#else // !(defined(Q_OS_WINRT) && _MSC_VER < 1900)
-
Q_CORE_EXPORT QString qAppFileName() // get application file name
{
// We do MAX_PATH + 2 here, and request with MAX_PATH + 1, so we can handle all paths
@@ -186,8 +169,6 @@ QString QCoreApplicationPrivate::appVersion() const
return applicationVersion;
}
-#endif // !(defined(Q_OS_WINRT) && _MSC_VER < 1900)
-
#ifndef Q_OS_WINRT
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
diff --git a/src/corelib/kernel/qsharedmemory_win.cpp b/src/corelib/kernel/qsharedmemory_win.cpp
index 07d4930332..be42a369c2 100644
--- a/src/corelib/kernel/qsharedmemory_win.cpp
+++ b/src/corelib/kernel/qsharedmemory_win.cpp
@@ -64,11 +64,6 @@ void QSharedMemoryPrivate::setErrorString(QLatin1String function)
errorString = QSharedMemory::tr("%1: already exists").arg(function);
break;
case ERROR_FILE_NOT_FOUND:
-#if defined(Q_OS_WINRT) && _MSC_VER < 1900
- // This happens on WinRT only if no file is present as CreateFileMappingW
- // bails out with this error code
- case ERROR_INVALID_PARAMETER:
-#endif
error = QSharedMemory::NotFound;
errorString = QSharedMemory::tr("%1: doesn't exist").arg(function);
break;
@@ -103,16 +98,9 @@ HANDLE QSharedMemoryPrivate::handle()
errorString = QSharedMemory::tr("%1: unable to make key").arg(function);
return 0;
}
-#if defined(Q_OS_WINPHONE)
- Q_UNIMPLEMENTED();
- hand = 0;
-#elif defined(Q_OS_WINRT)
-#if _MSC_VER >= 1900
+#if defined(Q_OS_WINRT)
hand = OpenFileMappingFromApp(FILE_MAP_ALL_ACCESS, FALSE, reinterpret_cast<PCWSTR>(nativeKey.utf16()));
#else
- hand = CreateFileMappingFromApp(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, (PCWSTR)nativeKey.utf16());
-#endif
-#else
hand = OpenFileMapping(FILE_MAP_ALL_ACCESS, false, (wchar_t*)nativeKey.utf16());
#endif
if (!hand) {
@@ -144,11 +132,7 @@ bool QSharedMemoryPrivate::create(int size)
}
// Create the file mapping.
-#if defined(Q_OS_WINPHONE)
- Q_UNIMPLEMENTED();
- Q_UNUSED(size)
- hand = 0;
-#elif defined(Q_OS_WINRT)
+#if defined(Q_OS_WINRT)
hand = CreateFileMappingFromApp(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, size, (PCWSTR)nativeKey.utf16());
#else
hand = CreateFileMapping(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, size, (wchar_t*)nativeKey.utf16());
@@ -166,12 +150,7 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
{
// Grab a pointer to the memory block
int permissions = (mode == QSharedMemory::ReadOnly ? FILE_MAP_READ : FILE_MAP_ALL_ACCESS);
-#if defined(Q_OS_WINPHONE)
- Q_UNIMPLEMENTED();
- Q_UNUSED(mode)
- Q_UNUSED(permissions)
- memory = 0;
-#elif defined(Q_OS_WINRT)
+#if defined(Q_OS_WINRT)
memory = (void *)MapViewOfFileFromApp(handle(), permissions, 0, 0);
#else
memory = (void *)MapViewOfFile(handle(), permissions, 0, 0, 0);
@@ -199,15 +178,10 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
bool QSharedMemoryPrivate::detach()
{
// umap memory
-#if defined(Q_OS_WINPHONE)
- Q_UNIMPLEMENTED();
- return false;
-#else
if (!UnmapViewOfFile(memory)) {
setErrorString(QLatin1String("QSharedMemory::detach"));
return false;
}
-#endif
memory = 0;
size = 0;
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index ab5997635a..4c215474fa 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -126,7 +126,6 @@ else:unix {
}
else:win32 {
SOURCES += tools/qlocale_win.cpp
- winphone: LIBS_PRIVATE += -lWindowsPhoneGlobalizationUtil
winrt-*-msvc2013: LIBS += advapi32.lib
} else:integrity {
SOURCES += tools/qlocale_unix.cpp