diff options
author | Louai Al-Khanji <louai.al-khanji@theqtcompany.com> | 2015-10-15 16:24:54 +0300 |
---|---|---|
committer | Louai Al-Khanji <louai.al-khanji@theqtcompany.com> | 2015-11-21 15:38:39 +0000 |
commit | dbb7817e13bc7f7ccb8f04b00a65eb3dcf8d25f8 (patch) | |
tree | 6b786e700e14bfe100bebd753b7133830231dac4 /src/corelib/io | |
parent | 496823b9a856d649c468d03b64241562807f3c16 (diff) |
Remove remaining support for Blackberry
The platform is no longer supported or actively maintained, and is
in the way for improvements to the Unix event dispatcher and QProcess
implementations.
Change-Id: I3935488ca12e2139ea5f46068d7665a453e20526
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/io.pri | 4 | ||||
-rw-r--r-- | src/corelib/io/qfileselector.cpp | 16 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 10 | ||||
-rw-r--r-- | src/corelib/io/qprocess_p.h | 5 | ||||
-rw-r--r-- | src/corelib/io/qprocess_unix.cpp | 38 | ||||
-rw-r--r-- | src/corelib/io/qsettings.cpp | 23 | ||||
-rw-r--r-- | src/corelib/io/qsettings_p.h | 5 | ||||
-rw-r--r-- | src/corelib/io/qstandardpaths.cpp | 22 | ||||
-rw-r--r-- | src/corelib/io/qstandardpaths_blackberry.cpp | 115 |
9 files changed, 12 insertions, 226 deletions
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri index 7be1e5883e..218fb5b078 100644 --- a/src/corelib/io/io.pri +++ b/src/corelib/io/io.pri @@ -158,10 +158,6 @@ win32 { } else:ios { LIBS += -framework MobileCoreServices } - } else:blackberry { - SOURCES += \ - io/qstandardpaths_blackberry.cpp \ - io/qstorageinfo_unix.cpp } else:android:!android-no-sdk { SOURCES += \ io/qstandardpaths_android.cpp \ diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp index 85d9b0bfcb..32b98e32d8 100644 --- a/src/corelib/io/qfileselector.cpp +++ b/src/corelib/io/qfileselector.cpp @@ -92,8 +92,6 @@ QFileSelectorPrivate::QFileSelectorPrivate() QString defaultsPath = "data/defaults.conf"; #if defined(Q_OS_ANDROID) defaultsPath = "data/android/defaults.conf"; -#elif defined(Q_OS_BLACKBERRY) - defaultsPath = "data/blackberry/defaults.conf"; #elif defined(Q_OS_IOS) defaultsPath = "data/ios/defaults.conf"; #endif @@ -116,7 +114,6 @@ QFileSelectorPrivate::QFileSelectorPrivate() \code data/defaults.conf data/+android/defaults.conf - data/+blackberry/defaults.conf data/+ios/+en_GB/defaults.conf \endcode @@ -127,9 +124,8 @@ QFileSelectorPrivate::QFileSelectorPrivate() \code images/background.png images/+android/+en_GB/background.png - images/+blackberry/+en_GB/background.png \endcode - With those files available, you would select a different file on android and blackberry platforms, + With those files available, you would select a different file on the android platform, but only if the locale was en_GB. QFileSelector will not attempt to select if the base file does not exist. For error handling in @@ -145,8 +141,8 @@ QFileSelectorPrivate::QFileSelectorPrivate() Selectors normally available are \list \li platform, any of the following strings which match the platform the application is running - on (list not exhaustive): android, blackberry, ios, osx, darwin, mac, linux, wince, unix, - windows. On Linux, if it can be determined, the name of the distribution too, like debian, + on (list not exhaustive): android, ios, osx, darwin, mac, linux, wince, unix, windows. + On Linux, if it can be determined, the name of the distribution too, like debian, fedora or opensuse. \li locale, same as QLocale().name(). \endlist @@ -368,8 +364,8 @@ QStringList QFileSelectorPrivate::platformSelectors() # endif #elif defined(Q_OS_UNIX) ret << QStringLiteral("unix"); -# if !defined(Q_OS_ANDROID) && !defined(Q_OS_BLACKBERRY) - // we don't want "linux" for Android or "qnx" for Blackberry here +# if !defined(Q_OS_ANDROID) + // we don't want "linux" for Android ret << QSysInfo::kernelType(); # ifdef Q_OS_MAC ret << QStringLiteral("mac"); // compatibility, since kernelType() is "darwin" @@ -377,7 +373,7 @@ QStringList QFileSelectorPrivate::platformSelectors() # endif QString productName = QSysInfo::productType(); if (productName != QLatin1String("unknown")) - ret << productName; // "opensuse", "fedora", "osx", "ios", "blackberry", "android" + ret << productName; // "opensuse", "fedora", "osx", "ios", "android" #endif return ret; } diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 7bc2293b0d..83d556b639 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -694,16 +694,6 @@ QString QFileSystemEngine::tempPath() { #ifdef QT_UNIX_TEMP_PATH_OVERRIDE return QLatin1String(QT_UNIX_TEMP_PATH_OVERRIDE); -#elif defined(Q_OS_BLACKBERRY) - QString temp = QFile::decodeName(qgetenv("TEMP")); - if (temp.isEmpty()) - temp = QFile::decodeName(qgetenv("TMPDIR")); - - if (temp.isEmpty()) { - qWarning("Neither the TEMP nor the TMPDIR environment variable is set, falling back to /var/tmp."); - temp = QLatin1String("/var/tmp"); - } - return QDir::cleanPath(temp); #else QString temp = QFile::decodeName(qgetenv("TMPDIR")); if (temp.isEmpty()) diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h index d3f251c399..af88d07a7a 100644 --- a/src/corelib/io/qprocess_p.h +++ b/src/corelib/io/qprocess_p.h @@ -385,11 +385,6 @@ public: void cleanup(); void setError(QProcess::ProcessError error, const QString &description = QString()); void setErrorAndEmit(QProcess::ProcessError error, const QString &description = QString()); - -#ifdef Q_OS_BLACKBERRY - QList<QSocketNotifier *> defaultNotifiers() const; -#endif // Q_OS_BLACKBERRY - }; QT_END_NAMESPACE diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 38f7ecd568..472d8699a2 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -839,17 +839,6 @@ bool QProcessPrivate::waitForStarted(int msecs) return startedEmitted; } -#ifdef Q_OS_BLACKBERRY -QList<QSocketNotifier *> QProcessPrivate::defaultNotifiers() const -{ - QList<QSocketNotifier *> notifiers; - notifiers << stdoutChannel.notifier - << stderrChannel.notifier - << stdinChannel.notifier; - return notifiers; -} -#endif // Q_OS_BLACKBERRY - bool QProcessPrivate::waitForReadyRead(int msecs) { #if defined (QPROCESS_DEBUG) @@ -859,10 +848,6 @@ bool QProcessPrivate::waitForReadyRead(int msecs) QElapsedTimer stopWatch; stopWatch.start(); -#ifdef Q_OS_BLACKBERRY - QList<QSocketNotifier *> notifiers = defaultNotifiers(); -#endif - forever { fd_set fdread; fd_set fdwrite; @@ -885,11 +870,8 @@ bool QProcessPrivate::waitForReadyRead(int msecs) add_fd(nfds, stdinChannel.pipe[1], &fdwrite); int timeout = qt_subtract_from_timeout(msecs, stopWatch.elapsed()); -#ifdef Q_OS_BLACKBERRY - int ret = bb_select(notifiers, nfds + 1, &fdread, &fdwrite, timeout); -#else int ret = qt_select_msecs(nfds + 1, &fdread, &fdwrite, timeout); -#endif + if (ret < 0) { break; } @@ -937,10 +919,6 @@ bool QProcessPrivate::waitForBytesWritten(int msecs) QElapsedTimer stopWatch; stopWatch.start(); -#ifdef Q_OS_BLACKBERRY - QList<QSocketNotifier *> notifiers = defaultNotifiers(); -#endif - while (!stdinChannel.buffer.isEmpty()) { fd_set fdread; fd_set fdwrite; @@ -964,11 +942,8 @@ bool QProcessPrivate::waitForBytesWritten(int msecs) add_fd(nfds, stdinChannel.pipe[1], &fdwrite); int timeout = qt_subtract_from_timeout(msecs, stopWatch.elapsed()); -#ifdef Q_OS_BLACKBERRY - int ret = bb_select(notifiers, nfds + 1, &fdread, &fdwrite, timeout); -#else int ret = qt_select_msecs(nfds + 1, &fdread, &fdwrite, timeout); -#endif + if (ret < 0) { break; } @@ -1010,10 +985,6 @@ bool QProcessPrivate::waitForFinished(int msecs) QElapsedTimer stopWatch; stopWatch.start(); -#ifdef Q_OS_BLACKBERRY - QList<QSocketNotifier *> notifiers = defaultNotifiers(); -#endif - forever { fd_set fdread; fd_set fdwrite; @@ -1037,11 +1008,8 @@ bool QProcessPrivate::waitForFinished(int msecs) add_fd(nfds, stdinChannel.pipe[1], &fdwrite); int timeout = qt_subtract_from_timeout(msecs, stopWatch.elapsed()); -#ifdef Q_OS_BLACKBERRY - int ret = bb_select(notifiers, nfds + 1, &fdread, &fdwrite, timeout); -#else int ret = qt_select_msecs(nfds + 1, &fdread, &fdwrite, timeout); -#endif + if (ret < 0) { break; } diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 3460753fbe..efdb86bd7f 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -100,7 +100,7 @@ using namespace ABI::Windows::Storage; #define CSIDL_APPDATA 0x001a // <username>\Application Data #endif -#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_BLACKBERRY) && !defined(Q_OS_ANDROID) +#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) #define Q_XDG_PLATFORM #endif @@ -1073,7 +1073,7 @@ static void initDefaultPaths(QMutexLocker *locker) #else #ifndef QSETTINGS_USE_QSTANDARDPATHS - // Non XDG platforms (OS X, iOS, Blackberry, Android...) have used this code path erroneously + // Non XDG platforms (OS X, iOS, Android...) have used this code path erroneously // for some time now. Moving away from that would require migrating existing settings. QString userPath; QByteArray env = qgetenv("XDG_CONFIG_HOME"); @@ -1140,7 +1140,6 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(QSettings::Format format, org = QLatin1String("Unknown Organization"); } -#if !defined(Q_OS_BLACKBERRY) QString appFile = org + QDir::separator() + application + extension; QString orgFile = org + extension; @@ -1155,13 +1154,6 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(QSettings::Format format, if (!application.isEmpty()) confFiles[F_System | F_Application].reset(QConfFile::fromName(systemPath + appFile, false)); confFiles[F_System | F_Organization].reset(QConfFile::fromName(systemPath + orgFile, false)); -#else - QString confName = getPath(format, QSettings::UserScope) + org; - if (!application.isEmpty()) - confName += QDir::separator() + application; - confName += extension; - confFiles[SandboxConfFile].reset(QConfFile::fromName(confName, true)); -#endif for (i = 0; i < NumConfFiles; ++i) { if (confFiles[i]) { @@ -2249,7 +2241,6 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, stored in the following registry path: \c{HKEY_LOCAL_MACHINE\Software\WOW6432node}. - On BlackBerry only a single file is used (see \l{Platform Limitations}). If the file format is NativeFormat, this is "Settings/MySoft/Star Runner.conf" in the application's home directory. @@ -2277,7 +2268,6 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, %COMMON_APPDATA% path is usually \tt{C:\\Documents and Settings\\All Users\\Application Data}. - On BlackBerry only a single file is used (see \l{Platform Limitations}). If the file format is IniFormat, this is "Settings/MySoft/Star Runner.ini" in the application's home directory. @@ -2382,15 +2372,6 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, 10.8 (Mountain Lion), only root can. However, 10.9 (Mavericks) changes that rule again but only for the native format (plist files). - \li On the BlackBerry platform, applications run in a sandbox. They are not - allowed to read or write outside of this sandbox. This involves the - following limitations: - \list - \li As there is only a single scope the scope is simply ignored, - i.e. there is no difference between SystemScope and UserScope. - \li The \l{Fallback Mechanism} is not applied, i.e. only a single - location is considered. - \li It is advised against setting and using custom file paths. \endlist \endlist diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h index 5a3eb58a58..919485b5c3 100644 --- a/src/corelib/io/qsettings_p.h +++ b/src/corelib/io/qsettings_p.h @@ -236,16 +236,11 @@ public: because their values are respectively 1 and 2. */ enum { -#if !defined(Q_OS_BLACKBERRY) F_Application = 0x0, F_Organization = 0x1, F_User = 0x0, F_System = 0x2, NumConfFiles = 4 -#else - SandboxConfFile = 0, - NumConfFiles = 1 -#endif }; QSettings::Format format; diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp index 0137e859e7..497191fd32 100644 --- a/src/corelib/io/qstandardpaths.cpp +++ b/src/corelib/io/qstandardpaths.cpp @@ -210,66 +210,46 @@ QT_BEGIN_NAMESPACE \endtable \table - \header \li Path type \li Blackberry \li Linux + \header \li Path type \li Linux \row \li DesktopLocation - \li "<APPROOT>/data" \li "~/Desktop" \row \li DocumentsLocation - \li "<APPROOT>/shared/documents" \li "~/Documents" \row \li FontsLocation - \li "/base/usr/fonts" (not writable) \li "~/.fonts" \row \li ApplicationsLocation - \li not supported (directory not readable) \li "~/.local/share/applications", "/usr/local/share/applications", "/usr/share/applications" \row \li MusicLocation - \li "<APPROOT>/shared/music" \li "~/Music" \row \li MoviesLocation - \li "<APPROOT>/shared/videos" \li "~/Videos" \row \li PicturesLocation - \li "<APPROOT>/shared/photos" \li "~/Pictures" \row \li TempLocation - \li "/var/tmp" \li "/tmp" \row \li HomeLocation - \li "<APPROOT>/data" \li "~" \row \li DataLocation - \li "<APPROOT>/data", "<APPROOT>/app/native/assets" \li "~/.local/share/<APPNAME>", "/usr/local/share/<APPNAME>", "/usr/share/<APPNAME>" \row \li CacheLocation - \li "<APPROOT>/data/Cache" \li "~/.cache/<APPNAME>" \row \li GenericDataLocation - \li "<APPROOT>/shared/misc" \li "~/.local/share", "/usr/local/share", "/usr/share" \row \li RuntimeLocation - \li "/var/tmp" \li "/run/user/<USER>" \row \li ConfigLocation - \li "<APPROOT>/data/Settings" \li "~/.config", "/etc/xdg" \row \li GenericConfigLocation - \li "<APPROOT>/data/Settings" \li "~/.config", "/etc/xdg" \row \li DownloadLocation - \li "<APPROOT>/shared/downloads" \li "~/Downloads" \row \li GenericCacheLocation - \li "<APPROOT>/data/Cache" (there is no shared cache) \li "~/.cache" \row \li AppDataLocation - \li "<APPROOT>/data", "<APPROOT>/app/native/assets" \li "~/.local/share/<APPNAME>", "/usr/local/share/<APPNAME>", "/usr/share/<APPNAME>" \row \li AppLocalDataLocation - \li "<APPROOT>/data", "<APPROOT>/app/native/assets" \li "~/.local/share/<APPNAME>", "/usr/local/share/<APPNAME>", "/usr/share/<APPNAME>" \row \li AppConfigLocation - \li "<APPROOT>/data/Settings" \li "~/.config/<APPNAME>", "/etc/xdg/<APPNAME>" \endtable diff --git a/src/corelib/io/qstandardpaths_blackberry.cpp b/src/corelib/io/qstandardpaths_blackberry.cpp deleted file mode 100644 index 4b29ad7ed9..0000000000 --- a/src/corelib/io/qstandardpaths_blackberry.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qstandardpaths.h" -#include <qdir.h> - -#ifndef QT_NO_STANDARDPATHS - -#include <qstring.h> - -QT_BEGIN_NAMESPACE - -static QString testModeInsert() { - if (QStandardPaths::isTestModeEnabled()) - return QStringLiteral("/.qttest"); - else - return QStringLiteral(""); -} - -QString QStandardPaths::writableLocation(StandardLocation type) -{ - QDir sharedDir = QDir::home(); - sharedDir.cd(QLatin1String("../shared")); - - const QString sharedRoot = sharedDir.absolutePath(); - - switch (type) { - case AppDataLocation: - case AppLocalDataLocation: - return QDir::homePath() + testModeInsert(); - case DesktopLocation: - case HomeLocation: - return QDir::homePath(); - case RuntimeLocation: - case TempLocation: - return QDir::tempPath(); - case CacheLocation: - case GenericCacheLocation: - return QDir::homePath() + testModeInsert() + QLatin1String("/Cache"); - case ConfigLocation: - case GenericConfigLocation: - case AppConfigLocation: - return QDir::homePath() + testModeInsert() + QLatin1String("/Settings"); - case GenericDataLocation: - return sharedRoot + testModeInsert() + QLatin1String("/misc"); - case DocumentsLocation: - return sharedRoot + QLatin1String("/documents"); - case PicturesLocation: - return sharedRoot + QLatin1String("/photos"); - case FontsLocation: - // this is not a writable location - return QString(); - case MusicLocation: - return sharedRoot + QLatin1String("/music"); - case MoviesLocation: - return sharedRoot + QLatin1String("/videos"); - case DownloadLocation: - return sharedRoot + QLatin1String("/downloads"); - case ApplicationsLocation: - return QString(); - default: - break; - } - - return QString(); -} - -QStringList QStandardPaths::standardLocations(StandardLocation type) -{ - QStringList dirs; - - if (type == FontsLocation) - return QStringList(QLatin1String("/base/usr/fonts")); - - if (type == AppDataLocation || type == AppLocalDataLocation) - dirs.append(QDir::homePath() + testModeInsert() + QLatin1String("native/assets")); - - const QString localDir = writableLocation(type); - dirs.prepend(localDir); - return dirs; -} - -QT_END_NAMESPACE - -#endif // QT_NO_STANDARDPATHS |