Skip to content

Commit

Permalink
Remove Symbian specific code from QtCore.
Browse files Browse the repository at this point in the history
Change-Id: I131303e28a12dccb96de3de4ca0073b389a9bbae
Reviewed-by: Lars Knoll <[email protected]>
  • Loading branch information
xizzhu authored and Qt by Nokia committed Jan 30, 2012
1 parent 0c29259 commit d3fdc13
Show file tree
Hide file tree
Showing 37 changed files with 63 additions and 1,112 deletions.
5 changes: 0 additions & 5 deletions src/corelib/concurrent/qtconcurrentiteratekernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,11 @@ static qint64 getticks()
return (ts.tv_sec * 1000000000) + ts.tv_nsec;
#else

#ifdef Q_OS_SYMBIAN
return clock();
#else
// no clock_gettime(), fall back to wall time
struct timeval tv;
gettimeofday(&tv, 0);
return (tv.tv_sec * 1000000) + tv.tv_usec;
#endif

#endif
}

#elif defined(Q_OS_WIN)
Expand Down
7 changes: 0 additions & 7 deletions src/corelib/global/qglobal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1369,13 +1369,6 @@ bool qSharedBuild()
Defined on MAC OS (synonym for Darwin).
*/

/*!
\macro Q_OS_SYMBIAN
\relates <QtGlobal>
Defined on Symbian.
*/

/*!
\macro QT_DISABLE_DEPRECATED_BEFORE
\relates <QtGlobal>
Expand Down
17 changes: 1 addition & 16 deletions src/corelib/global/qglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ namespace QT_NAMESPACE {}
The operating system, must be one of: (Q_OS_x)
DARWIN - Darwin OS (synonym for Q_OS_MAC)
SYMBIAN - Symbian
MSDOS - MS-DOS and Windows
OS2 - OS/2
OS2EMX - XFree86 on OS/2 (not PM)
Expand Down Expand Up @@ -191,10 +190,6 @@ namespace QT_NAMESPACE {}
# else
# define Q_OS_DARWIN32
# endif
#elif defined(__SYMBIAN32__) || defined(SYMBIAN)
# define Q_OS_SYMBIAN
# define Q_NO_POSIX_SIGNALS
# define QT_NO_GETIFADDRS
#elif defined(__CYGWIN__)
# define Q_OS_CYGWIN
#elif !defined(SAG_COM) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))
Expand Down Expand Up @@ -342,9 +337,7 @@ namespace QT_NAMESPACE {}
HIGHC - MetaWare High C/C++
PGI - Portland Group C++
GHS - Green Hills Optimizing C++ Compilers
GCCE - GCCE (Symbian GCCE builds)
RVCT - ARM Realview Compiler Suite
NOKIAX86 - Nokia x86 (Symbian WINSCW builds)
CLANG - C++ front-end for the LLVM compiler
Expand Down Expand Up @@ -402,14 +395,6 @@ namespace QT_NAMESPACE {}
#elif defined(__WATCOMC__)
# define Q_CC_WAT

/* Symbian GCCE */
#elif defined(__GCCE__)
# define Q_CC_GCCE
# define QT_VISIBILITY_AVAILABLE
# if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__)
# define QT_HAVE_ARMV6
# endif

/* ARM Realview Compiler Suite
RVCT compiler also defines __EDG__ and __GNUC__ (if --gnu flag is given),
so check for it before that */
Expand Down Expand Up @@ -901,7 +886,7 @@ typedef quint64 qulonglong;
#ifndef QT_POINTER_SIZE
# if defined(Q_OS_WIN64)
# define QT_POINTER_SIZE 8
# elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
# elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
# define QT_POINTER_SIZE 4
# endif
#endif
Expand Down
23 changes: 10 additions & 13 deletions src/corelib/io/qdir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE

static QString driveSpec(const QString &path)
{
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
#if defined(Q_OS_WIN)
if (path.size() < 2)
return QString();
char c = path.at(0).toAscii();
Expand Down Expand Up @@ -162,7 +162,7 @@ inline void QDirPrivate::setPath(const QString &path)
QString p = QDir::fromNativeSeparators(path);
if (p.endsWith(QLatin1Char('/'))
&& p.length() > 1
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
#if defined(Q_OS_WIN)
&& (!(p.length() == 3 && p.at(1).unicode() == ':' && p.at(0).isLetter()))
#endif
) {
Expand Down Expand Up @@ -736,8 +736,6 @@ QString QDir::relativeFilePath(const QString &fileName) const
if (fileDrive.toLower() != dirDrive.toLower()
|| (file.startsWith(QLatin1String("//"))
&& !dir.startsWith(QLatin1String("//"))))
#elif defined(Q_OS_SYMBIAN)
if (fileDrive.toLower() != dirDrive.toLower())
#else
if (fileDrive != dirDrive)
#endif
Expand All @@ -753,7 +751,7 @@ QString QDir::relativeFilePath(const QString &fileName) const

int i = 0;
while (i < dirElts.size() && i < fileElts.size() &&
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
#if defined(Q_OS_WIN)
dirElts.at(i).toLower() == fileElts.at(i).toLower())
#else
dirElts.at(i) == fileElts.at(i))
Expand Down Expand Up @@ -789,7 +787,7 @@ QString QDir::relativeFilePath(const QString &fileName) const
*/
QString QDir::toNativeSeparators(const QString &pathName)
{
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
#if defined(Q_OS_WIN)
int i = pathName.indexOf(QLatin1Char('/'));
if (i != -1) {
QString n(pathName);
Expand Down Expand Up @@ -822,7 +820,7 @@ QString QDir::toNativeSeparators(const QString &pathName)
*/
QString QDir::fromNativeSeparators(const QString &pathName)
{
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
#if defined(Q_OS_WIN)
int i = pathName.indexOf(QLatin1Char('\\'));
if (i != -1) {
QString n(pathName);
Expand Down Expand Up @@ -1802,7 +1800,7 @@ QFileInfoList QDir::drives()
*/
QChar QDir::separator()
{
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
#if defined(Q_OS_WIN)
return QLatin1Char('\\');
#else
return QLatin1Char('/');
Expand Down Expand Up @@ -1882,7 +1880,7 @@ QString QDir::currentPath()
Under non-Windows operating systems the \c HOME environment
variable is used if it exists, otherwise the path returned by the
rootPath(). On Symbian always the same as the path returned by the rootPath().
rootPath().
\sa home(), currentPath(), rootPath(), tempPath()
*/
Expand Down Expand Up @@ -1937,8 +1935,7 @@ QString QDir::tempPath()
Returns the absolute path of the root directory.
For Unix operating systems this returns "/". For Windows file
systems this normally returns "c:/". On Symbian this typically returns
"c:/data", i.e. the same as native PathInfo::PhoneMemoryRootPath().
systems this normally returns "c:/".
\sa root(), drives(), currentPath(), homePath(), tempPath()
*/
Expand Down Expand Up @@ -2070,7 +2067,7 @@ QString QDir::cleanPath(const QString &path)
levels++;
}
} else if (last != -1 && iwrite - last == 1) {
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
#if defined(Q_OS_WIN)
eaten = (iwrite > 2);
#else
eaten = true;
Expand Down Expand Up @@ -2105,7 +2102,7 @@ QString QDir::cleanPath(const QString &path)
QString ret = (used == len ? name : QString(out, used));
// Strip away last slash except for root directories
if (ret.length() > 1 && ret.endsWith(QLatin1Char('/'))) {
#if defined (Q_OS_WIN) || defined (Q_OS_SYMBIAN)
#if defined (Q_OS_WIN)
if (!(ret.length() == 3 && ret.at(1) == QLatin1Char(':')))
#endif
ret.chop(1);
Expand Down
89 changes: 1 addition & 88 deletions src/corelib/io/qfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ static QByteArray locale_encode(const QString &f)
#if defined(Q_OS_DARWIN)
// Mac always expects UTF-8... and decomposed...
return f.normalized(QString::NormalizationForm_D).toUtf8();
#elif defined(Q_OS_SYMBIAN)
return f.toUtf8();
#else
return f.toLocal8Bit();
#endif
Expand All @@ -78,8 +76,6 @@ static QString locale_decode(const QByteArray &f)
#if defined(Q_OS_DARWIN)
// Mac always gives us UTF-8 and decomposed, we want that composed...
return QString::fromUtf8(f).normalized(QString::NormalizationForm_C);
#elif defined(Q_OS_SYMBIAN)
return QString::fromUtf8(f);
#else
return QString::fromLocal8Bit(f);
#endif
Expand Down Expand Up @@ -134,23 +130,6 @@ QFilePrivate::openExternalFile(int flags, FILE *fh, QFile::FileHandleFlags handl
#endif
}

#ifdef Q_OS_SYMBIAN
bool QFilePrivate::openExternalFile(int flags, const RFile &f, QFile::FileHandleFlags handleFlags)
{
#ifdef QT_NO_FSFILEENGINE
Q_UNUSED(flags);
Q_UNUSED(fh);
return false;
#else
delete fileEngine;
fileEngine = 0;
QFSFileEngine *fe = new QFSFileEngine;
fileEngine = fe;
return fe->open(QIODevice::OpenMode(flags), f, handleFlags);
#endif
}
#endif

inline bool QFilePrivate::ensureFlushed() const
{
// This function ensures that the write buffer has been flushed (const
Expand Down Expand Up @@ -815,9 +794,6 @@ QFile::rename(const QString &oldName, const QString &newName)
\note To create a valid link on Windows, \a linkName must have a \c{.lnk} file extension.
\note On Symbian, no link is created and false is returned if fileName()
currently specifies a directory.
\sa setFileName()
*/

Expand Down Expand Up @@ -1019,14 +995,8 @@ bool QFile::open(OpenMode mode)
return false;
}

#ifdef Q_OS_SYMBIAN
// For symbian, the unbuffered flag is used to control write-behind cache behaviour
if (fileEngine()->open(mode))
#else
// QIODevice provides the buffering, so there's no need to request it from the file engine.
if (fileEngine()->open(mode | QIODevice::Unbuffered))
#endif
{
if (fileEngine()->open(mode | QIODevice::Unbuffered)) {
QIODevice::open(mode);
if (mode & Append)
seek(size());
Expand Down Expand Up @@ -1247,63 +1217,6 @@ bool QFile::open(int fd, OpenMode mode, FileHandleFlags handleFlags)
return false;
}

#ifdef Q_OS_SYMBIAN
/*!
\overload
Opens the existing file object \a f in the given \a mode.
Returns true if successful; otherwise returns false.
When a QFile is opened using this function, behaviour of close() is
controlled by the AutoCloseHandle flag.
If AutoCloseHandle is specified, and this function succeeds,
then calling close() closes the adopted handle.
Otherwise, close() does not actually close the file, but only flushes it.
\warning If the file handle is adopted from another process,
you may not be able to use this QFile with a QFileInfo.
\sa close()
*/
bool QFile::open(const RFile &f, OpenMode mode, FileHandleFlags handleFlags)
{
Q_D(QFile);
if (isOpen()) {
qWarning("QFile::open: File (%s) already open", qPrintable(fileName()));
return false;
}
if (mode & Append)
mode |= WriteOnly;
unsetError();
if ((mode & (ReadOnly | WriteOnly)) == 0) {
qWarning("QFile::open: File access not specified");
return false;
}
if (d->openExternalFile(mode, f, handleFlags)) {
bool ok = QIODevice::open(mode);
if (ok) {
if (mode & Append) {
ok = seek(size());
} else {
qint64 pos = 0;
TInt err;
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
err = static_cast<const RFile64&>(f).Seek(ESeekCurrent, pos);
#else
TInt pos32 = 0;
err = f.Seek(ESeekCurrent, pos32);
pos = pos32;
#endif
ok = ok && (err == KErrNone);
ok = ok && seek(pos);
}
}
return ok;
}
return false;
}
#endif

/*!
Returns the file handle of the file.
Expand Down
6 changes: 0 additions & 6 deletions src/corelib/io/qfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
#include <QtCore/qiodevice.h>
#include <QtCore/qstring.h>
#include <stdio.h>
#ifdef Q_OS_SYMBIAN
#include <f32file.h>
#endif

#ifdef open
#error qfile.h must be included before any header file that defines open
Expand Down Expand Up @@ -150,9 +147,6 @@ class Q_CORE_EXPORT QFile : public QIODevice
bool open(OpenMode flags);
bool open(FILE *f, OpenMode flags);
bool open(int fd, OpenMode flags);
#ifdef Q_OS_SYMBIAN
bool open(const RFile &f, OpenMode flags, FileHandleFlags handleFlags = DontCloseHandle);
#endif
bool open(FILE *f, OpenMode ioFlags, FileHandleFlags handleFlags);
bool open(int fd, OpenMode ioFlags, FileHandleFlags handleFlags);
virtual void close();
Expand Down
3 changes: 0 additions & 3 deletions src/corelib/io/qfile_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ class QFilePrivate : public QIODevicePrivate

bool openExternalFile(int flags, int fd, QFile::FileHandleFlags handleFlags);
bool openExternalFile(int flags, FILE *fh, QFile::FileHandleFlags handleFlags);
#ifdef Q_OS_SYMBIAN
bool openExternalFile(int flags, const RFile& f, QFile::FileHandleFlags handleFlags);
#endif

QString fileName;
mutable QAbstractFileEngine *fileEngine;
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/io/qfileinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ bool QFileInfo::isRoot() const
return true;
if (d->fileEngine == 0) {
if (d->fileEntry.isRoot()) {
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
#if defined(Q_OS_WIN)
//the path is a drive root, but the drive may not exist
//for backward compatibility, return true only if the drive exists
if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::ExistsAttribute))
Expand Down
Loading

0 comments on commit d3fdc13

Please sign in to comment.