summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-26 23:39:07 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-26 23:39:07 (GMT)
commit09293f1d07b019dc7bfe95afb93364cc87774e82 (patch)
tree0bb2e3da34f6ad6898fc079e39e1e94a94da12e2 /src/corelib
parent0274069a9f6f011a97baf283d556b1fec388b672 (diff)
parent22c57db236d7cd72ea6c06dfd22c174d81cd8504 (diff)
downloadQt-09293f1d07b019dc7bfe95afb93364cc87774e82.zip
Qt-09293f1d07b019dc7bfe95afb93364cc87774e82.tar.gz
Qt-09293f1d07b019dc7bfe95afb93364cc87774e82.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: add translator comment save a QFile::encodeName() Don't use QList's begin() and end() where possible. Ensure we stop the name lookups in QAbstractSocket if we abort(). Don't rely on tryStart() to do job control. Improved workaround for new qt documentation, base on dboddie's work. Doc: Fixed typos. Ensure that all qthelp URLs have paths that start with /qdoc/. Doc: Fixed the Declarative documentation set. Tweaked the others.
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp6
-rw-r--r--src/corelib/tools/qlist.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 1415e44..5762d94 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -122,7 +122,7 @@ void QFSFileEnginePrivate::setSymbianError(int symbianError, QFile::FileError de
Returns the stdlib open string corresponding to a QIODevice::OpenMode.
*/
-static inline QByteArray openModeToFopenMode(QIODevice::OpenMode flags, const QString &fileName)
+static inline QByteArray openModeToFopenMode(QIODevice::OpenMode flags, const QByteArray &fileName)
{
QByteArray mode;
if ((flags & QIODevice::ReadOnly) && !(flags & QIODevice::Truncate)) {
@@ -130,7 +130,7 @@ static inline QByteArray openModeToFopenMode(QIODevice::OpenMode flags, const QS
if (flags & QIODevice::WriteOnly) {
QT_STATBUF statBuf;
if (!fileName.isEmpty()
- && QT_STAT(QFile::encodeName(fileName), &statBuf) == 0
+ && QT_STAT(fileName, &statBuf) == 0
&& (statBuf.st_mode & S_IFMT) == S_IFREG) {
mode += '+';
} else {
@@ -254,7 +254,7 @@ bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode)
fh = 0;
} else {
- QByteArray fopenMode = openModeToFopenMode(openMode, filePath);
+ QByteArray fopenMode = openModeToFopenMode(openMode, nativeFilePath.constData());
// Try to open the file in buffered mode.
do {
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index 67f63f3..722744c 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -267,9 +267,9 @@ public:
inline int count() const { return p.size(); }
inline int length() const { return p.size(); } // Same as count()
inline T& first() { Q_ASSERT(!isEmpty()); return *begin(); }
- inline const T& first() const { Q_ASSERT(!isEmpty()); return *begin(); }
+ inline const T& first() const { Q_ASSERT(!isEmpty()); return at(0); }
T& last() { Q_ASSERT(!isEmpty()); return *(--end()); }
- const T& last() const { Q_ASSERT(!isEmpty()); return *(--end()); }
+ const T& last() const { Q_ASSERT(!isEmpty()); return at(count() - 1); }
inline void removeFirst() { Q_ASSERT(!isEmpty()); erase(begin()); }
inline void removeLast() { Q_ASSERT(!isEmpty()); erase(--end()); }
inline bool startsWith(const T &t) const { return !isEmpty() && first() == t; }