diff options
author | Frans Englich <frans.englich@nokia.com> | 2009-09-24 16:58:05 (GMT) |
---|---|---|
committer | Frans Englich <frans.englich@nokia.com> | 2009-09-24 16:58:05 (GMT) |
commit | 90996b73d4f2983d6f721c205b5a0957d3a55aff (patch) | |
tree | 1ab4215df101422590c7af368cdd22d4f1dc3786 /src/corelib | |
parent | 9345d47c3945b61a27724508e8b3d0aaf7b57bcf (diff) | |
parent | aabd12223bda6260756ab19430082477d5669c0a (diff) | |
download | Qt-90996b73d4f2983d6f721c205b5a0957d3a55aff.zip Qt-90996b73d4f2983d6f721c205b5a0957d3a55aff.tar.gz Qt-90996b73d4f2983d6f721c205b5a0957d3a55aff.tar.bz2 |
Merge commit 'qt/4.6' into mmfphonon
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/animation/qabstractanimation.cpp | 18 | ||||
-rw-r--r-- | src/corelib/animation/qabstractanimation.h | 2 | ||||
-rw-r--r-- | src/corelib/animation/qparallelanimationgroup.cpp | 2 | ||||
-rw-r--r-- | src/corelib/animation/qparallelanimationgroup.h | 2 | ||||
-rw-r--r-- | src/corelib/animation/qpauseanimation.cpp | 3 | ||||
-rw-r--r-- | src/corelib/animation/qpauseanimation.h | 2 | ||||
-rw-r--r-- | src/corelib/animation/qsequentialanimationgroup.cpp | 16 | ||||
-rw-r--r-- | src/corelib/animation/qsequentialanimationgroup.h | 2 | ||||
-rw-r--r-- | src/corelib/animation/qsequentialanimationgroup_p.h | 2 | ||||
-rw-r--r-- | src/corelib/animation/qvariantanimation.cpp | 3 | ||||
-rw-r--r-- | src/corelib/animation/qvariantanimation.h | 2 | ||||
-rw-r--r-- | src/corelib/codecs/qtextcodec.cpp | 14 | ||||
-rw-r--r-- | src/corelib/global/qglobal.h | 1 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.h | 1 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 21 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_symbian.cpp | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qcore_symbian_p.h | 3 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 14 |
18 files changed, 63 insertions, 47 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 6306882..9027be0 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -81,12 +81,12 @@ QAbstractAnimation provides pure virtual functions used by subclasses to track the progress of the animation: duration() and updateCurrentTime(). The duration() function lets you report a - duration for the animation (as discussed above). The current time - is delivered by the animation framework through calls to - updateCurrentTime(). By reimplementing this function, you can - track the animation progress. Note that neither the interval - between calls nor the number of calls to this function are - defined; though, it will normally be 60 updates per second. + duration for the animation (as discussed above). The animation + framework calls updateCurrentTime() when current time has changed. + By reimplementing this function, you can track the animation + progress. Note that neither the interval between calls nor the + number of calls to this function are defined; though, it will + normally be 60 updates per second. By reimplementing updateState(), you can track the animation's state changes, which is particularly useful for animations that @@ -604,7 +604,7 @@ void QAbstractAnimation::setCurrentTime(int msecs) } } - updateCurrentTime(msecs); + updateCurrentTime(); if (d->currentLoop != oldLoop) emit currentLoopChanged(d->currentLoop); @@ -705,10 +705,10 @@ bool QAbstractAnimation::event(QEvent *event) } /*! - \fn virtual void QAbstractAnimation::updateCurrentTime(int msecs) = 0; + \fn virtual void QAbstractAnimation::updateCurrentTime() = 0; This pure virtual function is called every time the animation's current - time changes. The \a msecs argument is the current time. + time changes. \sa updateState() */ diff --git a/src/corelib/animation/qabstractanimation.h b/src/corelib/animation/qabstractanimation.h index dc0af19..516f5e9 100644 --- a/src/corelib/animation/qabstractanimation.h +++ b/src/corelib/animation/qabstractanimation.h @@ -119,7 +119,7 @@ protected: QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = 0); bool event(QEvent *event); - virtual void updateCurrentTime(int msecs) = 0; + virtual void updateCurrentTime() = 0; virtual void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState); virtual void updateDirection(QAbstractAnimation::Direction direction); diff --git a/src/corelib/animation/qparallelanimationgroup.cpp b/src/corelib/animation/qparallelanimationgroup.cpp index 349090b..82d5224 100644 --- a/src/corelib/animation/qparallelanimationgroup.cpp +++ b/src/corelib/animation/qparallelanimationgroup.cpp @@ -125,7 +125,7 @@ int QParallelAnimationGroup::duration() const /*! \reimp */ -void QParallelAnimationGroup::updateCurrentTime(int) +void QParallelAnimationGroup::updateCurrentTime() { Q_D(QParallelAnimationGroup); if (d->animations.isEmpty()) diff --git a/src/corelib/animation/qparallelanimationgroup.h b/src/corelib/animation/qparallelanimationgroup.h index f013bc7..6afe4a7 100644 --- a/src/corelib/animation/qparallelanimationgroup.h +++ b/src/corelib/animation/qparallelanimationgroup.h @@ -67,7 +67,7 @@ protected: QParallelAnimationGroup(QParallelAnimationGroupPrivate &dd, QObject *parent); bool event(QEvent *event); - void updateCurrentTime(int msecs); + void updateCurrentTime(); void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState); void updateDirection(QAbstractAnimation::Direction direction); diff --git a/src/corelib/animation/qpauseanimation.cpp b/src/corelib/animation/qpauseanimation.cpp index 8bfed08..c382b19 100644 --- a/src/corelib/animation/qpauseanimation.cpp +++ b/src/corelib/animation/qpauseanimation.cpp @@ -141,9 +141,8 @@ bool QPauseAnimation::event(QEvent *e) /*! \reimp */ -void QPauseAnimation::updateCurrentTime(int msecs) +void QPauseAnimation::updateCurrentTime() { - Q_UNUSED(msecs); } diff --git a/src/corelib/animation/qpauseanimation.h b/src/corelib/animation/qpauseanimation.h index 05eb3b3..caac9e9 100644 --- a/src/corelib/animation/qpauseanimation.h +++ b/src/corelib/animation/qpauseanimation.h @@ -68,7 +68,7 @@ public: protected: bool event(QEvent *e); - void updateCurrentTime(int msecs); + void updateCurrentTime(); private: Q_DISABLE_COPY(QPauseAnimation) diff --git a/src/corelib/animation/qsequentialanimationgroup.cpp b/src/corelib/animation/qsequentialanimationgroup.cpp index 53fc4f3..9ad433f 100644 --- a/src/corelib/animation/qsequentialanimationgroup.cpp +++ b/src/corelib/animation/qsequentialanimationgroup.cpp @@ -112,17 +112,13 @@ int QSequentialAnimationGroupPrivate::animationActualTotalDuration(int index) co return ret; } -QSequentialAnimationGroupPrivate::AnimationIndex QSequentialAnimationGroupPrivate::indexForTime(int msecs) const +QSequentialAnimationGroupPrivate::AnimationIndex QSequentialAnimationGroupPrivate::indexForCurrentTime() const { - Q_Q(const QSequentialAnimationGroup); Q_ASSERT(!animations.isEmpty()); AnimationIndex ret; int duration = 0; - // in case duration is -1, currentLoop will always be 0 - ret.timeOffset = currentLoop * q->duration(); - for (int i = 0; i < animations.size(); ++i) { duration = animationActualTotalDuration(i); @@ -131,8 +127,8 @@ QSequentialAnimationGroupPrivate::AnimationIndex QSequentialAnimationGroupPrivat // 2. it ends after msecs // 3. it is the last animation (this can happen in case there is at least 1 uncontrolled animation) // 4. it ends exactly in msecs and the direction is backwards - if (duration == -1 || msecs < (ret.timeOffset + duration) - || (msecs == (ret.timeOffset + duration) && direction == QAbstractAnimation::Backward)) { + if (duration == -1 || currentTime < (ret.timeOffset + duration) + || (currentTime == (ret.timeOffset + duration) && direction == QAbstractAnimation::Backward)) { ret.index = i; return ret; } @@ -338,13 +334,13 @@ int QSequentialAnimationGroup::duration() const /*! \reimp */ -void QSequentialAnimationGroup::updateCurrentTime(int msecs) +void QSequentialAnimationGroup::updateCurrentTime() { Q_D(QSequentialAnimationGroup); if (!d->currentAnimation) return; - const QSequentialAnimationGroupPrivate::AnimationIndex newAnimationIndex = d->indexForTime(msecs); + const QSequentialAnimationGroupPrivate::AnimationIndex newAnimationIndex = d->indexForCurrentTime(); // remove unneeded animations from actualDuration list while (newAnimationIndex.index < d->actualDuration.size()) @@ -363,7 +359,7 @@ void QSequentialAnimationGroup::updateCurrentTime(int msecs) d->setCurrentAnimation(newAnimationIndex.index); - const int newCurrentTime = msecs - newAnimationIndex.timeOffset; + const int newCurrentTime = d->currentTime - newAnimationIndex.timeOffset; if (d->currentAnimation) { d->currentAnimation->setCurrentTime(newCurrentTime); diff --git a/src/corelib/animation/qsequentialanimationgroup.h b/src/corelib/animation/qsequentialanimationgroup.h index e17e103..1c9e4cc 100644 --- a/src/corelib/animation/qsequentialanimationgroup.h +++ b/src/corelib/animation/qsequentialanimationgroup.h @@ -77,7 +77,7 @@ protected: QSequentialAnimationGroup(QSequentialAnimationGroupPrivate &dd, QObject *parent); bool event(QEvent *event); - void updateCurrentTime(int msecs); + void updateCurrentTime(); void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState); void updateDirection(QAbstractAnimation::Direction direction); diff --git a/src/corelib/animation/qsequentialanimationgroup_p.h b/src/corelib/animation/qsequentialanimationgroup_p.h index 2e65cc0..ab41d35 100644 --- a/src/corelib/animation/qsequentialanimationgroup_p.h +++ b/src/corelib/animation/qsequentialanimationgroup_p.h @@ -79,7 +79,7 @@ public: }; int animationActualTotalDuration(int index) const; - AnimationIndex indexForTime(int msecs) const; + AnimationIndex indexForCurrentTime() const; void setCurrentAnimation(int index, bool intermediate = false); void activateCurrentAnimation(bool intermediate = false); diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index c831a34..ae8bf2f 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -656,9 +656,8 @@ QVariant QVariantAnimation::interpolated(const QVariant &from, const QVariant &t /*! \reimp */ -void QVariantAnimation::updateCurrentTime(int msecs) +void QVariantAnimation::updateCurrentTime() { - Q_UNUSED(msecs); d_func()->recalculateCurrentInterval(); } diff --git a/src/corelib/animation/qvariantanimation.h b/src/corelib/animation/qvariantanimation.h index c803150..98c1aec 100644 --- a/src/corelib/animation/qvariantanimation.h +++ b/src/corelib/animation/qvariantanimation.h @@ -102,7 +102,7 @@ protected: QVariantAnimation(QVariantAnimationPrivate &dd, QObject *parent = 0); bool event(QEvent *event); - void updateCurrentTime(int msecs); + void updateCurrentTime(); void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState); virtual void updateCurrentValue(const QVariant &value) = 0; diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 3ef9f7e..4f0e13c 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -1536,12 +1536,14 @@ QTextCodec *QTextCodec::codecForHtml(const QByteArray &ba, QTextCodec *defaultCo if (!c) { QByteArray header = ba.left(512).toLower(); if ((pos = header.indexOf("http-equiv=")) != -1) { - pos = header.indexOf("charset=", pos) + int(strlen("charset=")); - if (pos != -1) { - int pos2 = header.indexOf('\"', pos+1); - QByteArray cs = header.mid(pos, pos2-pos); - // qDebug("found charset: %s", cs.data()); - c = QTextCodec::codecForName(cs); + if ((pos = header.lastIndexOf("meta ", pos)) != -1) { + pos = header.indexOf("charset=", pos) + int(strlen("charset=")); + if (pos != -1) { + int pos2 = header.indexOf('\"', pos+1); + QByteArray cs = header.mid(pos, pos2-pos); + // qDebug("found charset: %s", cs.data()); + c = QTextCodec::codecForName(cs); + } } } } diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index e722268..7fe67ec 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -2391,6 +2391,7 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); #define Q_SYMBIAN_HAS_EXTENDED_BITMAP_TYPE //enabling new graphics resources #define QT_SYMBIAN_SUPPORTS_SGIMAGE +#define QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER #endif diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index c39e602..741c06f 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1430,6 +1430,7 @@ public: ImhUppercaseOnly = 0x40000, ImhLowercaseOnly = 0x80000, ImhDialableCharactersOnly = 0x100000, + ImhEmailCharactersOnly = 0x200000, ImhExclusiveInputMask = 0xffff0000 }; diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index fafbec5..18b4d67 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2451,23 +2451,32 @@ \enum Qt::InputMethodHint \value ImhNone No hints. + + Flags that alter the behavior: + \value ImhHiddenText Characters should be hidden, as is typically used when entering passwords. This is automatically set when setting QLineEdit::echoMode to \c Password. - \value ImhDigitsOnly Only number input is allowed. - \value ImhUppercaseOnly Only upper case letter input is allowed. - \value ImhLowercaseOnly Only lower case letter input is allowed. \value ImhNoAutoUppercase The input method should not try to automatically switch to upper case when a sentence ends. \value ImhPreferNumbers Numbers are preferred (but not required). \value ImhPreferUppercase Upper case letters are preferred (but not required). \value ImhPreferLowercase Lower case letters are preferred (but not required). \value ImhNoPredictiveText Do not use predictive text (i.e. dictionary lookup) while typing. + + Flags that restrict input (exclusive flags): + + \value ImhDigitsOnly Only digits are allowed. + \value ImhFormattedNumbersOnly Only number input is allowed. This includes decimal point and minus sign. + \value ImhUppercaseOnly Only upper case letter input is allowed. + \value ImhLowercaseOnly Only lower case letter input is allowed. \value ImhDialableCharactersOnly Only characters suitable for phone dialling are allowed. + \value ImhEmailCharactersOnly Only characters suitable for email addresses are allowed. + + Masks: - \omitvalue ImhFormattedNumbersOnly - \omitvalue ImhExclusiveInputMask + \value ImhExclusiveInputMask This mask yields nonzero if any of the exclusive flags are used. - \note If several flags ending with \c Only are ORed together, the resulting character set will + \note If several exclusive flags are ORed together, the resulting character set will consist of the union of the specified sets. For instance specifying \c ImhNumbersOnly and \c ImhUppercaseOnly would yield a set consisting of numbers and uppercase letters. diff --git a/src/corelib/io/qfilesystemwatcher_symbian.cpp b/src/corelib/io/qfilesystemwatcher_symbian.cpp index be0e8a9..a07d084 100644 --- a/src/corelib/io/qfilesystemwatcher_symbian.cpp +++ b/src/corelib/io/qfilesystemwatcher_symbian.cpp @@ -106,7 +106,7 @@ void QNotifyChangeEvent::DoCancel() } QSymbianFileSystemWatcherEngine::QSymbianFileSystemWatcherEngine() : - watcherStarted(false) + errorCode(KErrNone), watcherStarted(false) { moveToThread(this); } diff --git a/src/corelib/kernel/qcore_symbian_p.h b/src/corelib/kernel/qcore_symbian_p.h index 5b243dc..56097bc 100644 --- a/src/corelib/kernel/qcore_symbian_p.h +++ b/src/corelib/kernel/qcore_symbian_p.h @@ -138,7 +138,8 @@ enum S60PluginFuncOrdinals S60Plugin_GetTimeFormatSpec = 2, S60Plugin_GetLongDateFormatSpec = 3, S60Plugin_GetShortDateFormatSpec = 4, - S60Plugin_LocalizedDirectoryName = 5 + S60Plugin_LocalizedDirectoryName = 5, + S60Plugin_GetSystemDrive = 6 }; Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal); diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index c575509..61b9ee7 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -111,6 +111,11 @@ private: QMutex *mtx; }; +#ifdef Q_OS_SYMBIAN +typedef TDriveNumber (*SystemDriveFunc)(RFs&); +static SystemDriveFunc PtrGetSystemDrive=0; +#endif + #if defined(Q_WS_WIN) || defined(Q_WS_MAC) extern QString qAppFileName(); #endif @@ -345,7 +350,7 @@ void QCoreApplicationPrivate::checkReceiverThread(QObject *receiver) } #elif defined(Q_OS_SYMBIAN) && defined (QT_NO_DEBUG) // no implementation in release builds, but keep the symbol present -void QCoreApplicationPrivate::checkReceiverThread(QObject *receiver) +void QCoreApplicationPrivate::checkReceiverThread(QObject * /* receiver */) { } #endif @@ -1820,8 +1825,11 @@ QString QCoreApplication::applicationDirPath() } if (err != KErrNone || (driveInfo.iDriveAtt & KDriveAttRom) || (driveInfo.iMediaAtt & KMediaAttWriteProtected)) { - driveChar = fs.GetSystemDriveChar(); - drive = fs.GetSystemDrive(); + if(!PtrGetSystemDrive) + PtrGetSystemDrive = reinterpret_cast<SystemDriveFunc>(qt_resolveS60PluginFunc(S60Plugin_GetSystemDrive)); + Q_ASSERT(PtrGetSystemDrive); + drive = PtrGetSystemDrive(fs); + fs.DriveToChar(drive, driveChar); } qDriveChar = QChar(QLatin1Char(driveChar)).toUpper(); |