diff options
author | Shane Kearns <shane.kearns@sosco.com> | 2009-08-18 07:46:48 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@sosco.com> | 2009-08-18 07:46:48 (GMT) |
commit | 188c14c1fd66cc2bddcf19d753caeaac0241940c (patch) | |
tree | 3ded4f7f0dd8142dc7a00cc300ae21f98c0e8e73 /src | |
parent | 547e737c4fc01fb33cb2eae8d4662b367fccb097 (diff) | |
parent | 3a2d02f3a8f02509023dd398da77f35b9b3ad68f (diff) | |
download | Qt-188c14c1fd66cc2bddcf19d753caeaac0241940c.zip Qt-188c14c1fd66cc2bddcf19d753caeaac0241940c.tar.gz Qt-188c14c1fd66cc2bddcf19d753caeaac0241940c.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/codecs/qtextcodec.cpp | 4 | ||||
-rw-r--r-- | src/corelib/global/qglobal.cpp | 14 | ||||
-rw-r--r-- | src/corelib/global/qglobal.h | 4 | ||||
-rw-r--r-- | src/corelib/io/qfsfileengine_unix.cpp | 7 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 10 | ||||
-rw-r--r-- | src/gui/image/qpixmap.cpp | 27 | ||||
-rw-r--r-- | src/gui/image/qpixmap_s60.cpp | 5 | ||||
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 2 | ||||
-rw-r--r-- | src/gui/styles/qcleanlooksstyle.cpp | 5 | ||||
-rw-r--r-- | src/gui/styles/qplastiquestyle.cpp | 1 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 8 | ||||
-rw-r--r-- | src/gui/styles/qwindowscestyle.cpp | 1 | ||||
-rw-r--r-- | src/gui/styles/qwindowsmobilestyle.cpp | 5 | ||||
-rw-r--r-- | src/gui/styles/qwindowsstyle.cpp | 3 | ||||
-rw-r--r-- | src/gui/styles/qwindowsxpstyle.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/qlineedit_p.cpp | 2 | ||||
-rw-r--r-- | src/network/kernel/qnetworkinterface_symbian.cpp | 26 |
17 files changed, 52 insertions, 74 deletions
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index adfe2ed..4915c39 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -92,10 +92,8 @@ # define QT_NO_SETLOCALE #endif -#if 0 // ### TODO - remove me! // enabling this is not exception safe! -#define Q_DEBUG_TEXTCODEC -#endif +// #define Q_DEBUG_TEXTCODEC QT_BEGIN_NAMESPACE diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 6d88c91..a8c46f5 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1060,7 +1060,7 @@ bool qSharedBuild() */ /*! - \fn QSysInfo::SymVersion QSysInfo::symbianVersion() + \fn QSysInfo::SymbianVersion QSysInfo::symbianVersion() Returns the version of the Symbian operating system on which the application is run (Symbian only). @@ -1129,7 +1129,7 @@ bool qSharedBuild() \value WV_NT_based NT-based version of Windows \value WV_CE_based CE-based version of Windows - \sa MacVersion, SymVersion + \sa MacVersion, SymbianVersion */ /*! @@ -1158,11 +1158,11 @@ bool qSharedBuild() \value MV_LEOPARD Apple codename for MV_10_5 \value MV_SNOWLEOPARD Apple codename for MV_10_6 - \sa WinVersion, SymVersion + \sa WinVersion, SymbianVersion */ /*! - \enum QSysInfo::SymVersion + \enum QSysInfo::SymbianVersion This enum provides symbolic names for the various versions of the Symbian operating system. On Symbian, the @@ -1190,7 +1190,7 @@ bool qSharedBuild() \value SV_S60_5_0 S60 5th Edition \value SV_S60_Unknown An unknown and currently unsupported platform - \sa SymVersion, WinVersion, MacVersion + \sa SymbianVersion, WinVersion, MacVersion */ /*! @@ -1812,7 +1812,7 @@ QSysInfo::S60Version QSysInfo::s60Version() return cachedS60Version = SV_S60_Unknown; # endif } -QSysInfo::SymVersion QSysInfo::symbianVersion() +QSysInfo::SymbianVersion QSysInfo::symbianVersion() { switch (s60Version()) { case SV_S60_3_1: @@ -1831,7 +1831,7 @@ QSysInfo::S60Version QSysInfo::s60Version() return SV_S60_None; } -QSysInfo::SymVersion QSysInfo::symbianVersion() +QSysInfo::SymbianVersion QSysInfo::symbianVersion() { return SV_Unknown; } diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index b4ae2dc..d6ec7dd 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1472,13 +1472,13 @@ public: static const MacVersion MacintoshVersion; #endif #ifdef Q_OS_SYMBIAN - enum SymVersion { + enum SymbianVersion { SV_Unknown = 0x0000, SV_9_2 = 0x0001, SV_9_3 = 0x0002, SV_9_4 = 0x0004 }; - static SymVersion symbianVersion(); + static SymbianVersion symbianVersion(); enum S60Version { SV_S60_None = 0x0000, SV_S60_Unknown = 0x0001, diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 2b7a3f7..620d82f 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -803,20 +803,21 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const if (!(ret & RootFlag) && !d->isSymlink()) if(_q_isSymbianHidden(d->filePath, ret & DirectoryType)) ret |= HiddenFlag; -#endif +#else if (d->filePath == QLatin1String("/")) { ret |= RootFlag; } else { QString baseName = fileName(BaseName); if ((baseName.size() > 1 && baseName.at(0) == QLatin1Char('.') && baseName.at(1) != QLatin1Char('.')) -#if !defined(QWS) && defined(Q_OS_MAC) +# if !defined(QWS) && defined(Q_OS_MAC) || _q_isMacHidden(d->filePath) -#endif +# endif ) { ret |= HiddenFlag; } } +#endif } return ret; } diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 4a4817d..4e9096a 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -96,17 +96,17 @@ QT_BEGIN_NAMESPACE -class QLockedMutexUnlocker +class QMutexUnlocker { public: - inline explicit QLockedMutexUnlocker(QMutex *m) + inline explicit QMutexUnlocker(QMutex *m) : mtx(m) { } - inline ~QLockedMutexUnlocker() { unlock(); } + inline ~QMutexUnlocker() { unlock(); } inline void unlock() { if (mtx) mtx->unlock(); mtx = 0; } private: - Q_DISABLE_COPY(QLockedMutexUnlocker) + Q_DISABLE_COPY(QMutexUnlocker) QMutex *mtx; }; @@ -1106,7 +1106,7 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority) data->postEventList.mutex.lock(); } - QLockedMutexUnlocker locker(&data->postEventList.mutex); + QMutexUnlocker locker(&data->postEventList.mutex); // if this is one of the compressible events, do compression if (receiver->d_func()->postedEvents diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 93077d7..8259c6f 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -854,14 +854,10 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers return false; QPixmap pm; - QT_TRY { - if (data->pixelType() == QPixmapData::BitmapType) - pm = QBitmap::fromImage(image, flags); - else - pm = fromImage(image, flags); - } QT_CATCH (const std::bad_alloc &) { - // swallow bad allocs and leave pm a null pixmap - } + if (data->pixelType() == QPixmapData::BitmapType) + pm = QBitmap::fromImage(image, flags); + else + pm = fromImage(image, flags); if (!pm.isNull()) { *this = pm; QPixmapCache::insert(key, *this); @@ -1993,16 +1989,11 @@ QPixmap QPixmap::fromImage(const QImage &image, Qt::ImageConversionFlags flags) if (image.isNull()) return QPixmap(); - QT_TRY { - QGraphicsSystem* gs = QApplicationPrivate::graphicsSystem(); - QScopedPointer<QPixmapData> data(gs ? gs->createPixmapData(QPixmapData::PixmapType) - : QGraphicsSystem::createDefaultPixmapData(QPixmapData::PixmapType)); - data->fromImage(image, flags); - return QPixmap(data.take()); - } QT_CATCH(const std::bad_alloc &) { - // we're out of memory - return a null Pixmap - return QPixmap(); - } + QGraphicsSystem* gs = QApplicationPrivate::graphicsSystem(); + QScopedPointer<QPixmapData> data(gs ? gs->createPixmapData(QPixmapData::PixmapType) + : QGraphicsSystem::createDefaultPixmapData(QPixmapData::PixmapType)); + data->fromImage(image, flags); + return QPixmap(data.take()); } /*! diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 58b3ee4..ab19924 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -202,10 +202,13 @@ return a null QPixmap. QPixmap QPixmap::fromSymbianCFbsBitmap(CFbsBitmap *bitmap) { + if (!bitmap) + return QPixmap(); + int width = bitmap->SizeInPixels().iWidth; int height = bitmap->SizeInPixels().iHeight; - if (!bitmap || width <= 0 || height <= 0 || bitmap->IsCompressedInRAM()) + if (width <= 0 || height <= 0 || bitmap->IsCompressedInRAM()) return QPixmap(); TDisplayMode displayMode = bitmap->DisplayMode(); diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index d4f8341..833e000 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -102,7 +102,7 @@ void QCoeFepInputContext::reset() void QCoeFepInputContext::ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateEvent aEventType) { - QT_TRAP_THROWING(m_fepState->ReportAknEdStateEventL(QT_EAknCursorPositionChanged)); + QT_TRAP_THROWING(m_fepState->ReportAknEdStateEventL(aEventType)); } void QCoeFepInputContext::update() diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp index fa6aeb2..0a82c9c 100644 --- a/src/gui/styles/qcleanlooksstyle.cpp +++ b/src/gui/styles/qcleanlooksstyle.cpp @@ -84,14 +84,9 @@ enum Direction { // from windows style static const int windowsItemFrame = 2; // menu item frame width -static const int windowsSepHeight = 6; // separator item height static const int windowsItemHMargin = 3; // menu item hor text margin static const int windowsItemVMargin = 8; // menu item ver text margin -static const int windowsArrowHMargin = 6; // arrow horizontal margin -static const int windowsTabSpacing = 12; // space between text and tab -static const int windowsCheckMarkHMargin = 2; // horiz. margins of check mark static const int windowsRightBorder = 15; // right border on windows -static const int windowsCheckMarkWidth = 12; // checkmarks width on windows /* XPM */ static const char * const dock_widget_close_xpm[] = { diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp index 89d4ca5..04559dc 100644 --- a/src/gui/styles/qplastiquestyle.cpp +++ b/src/gui/styles/qplastiquestyle.cpp @@ -98,7 +98,6 @@ static const int windowsItemHMargin = 3; // menu item hor text margin static const int windowsItemVMargin = 2; // menu item ver text margin static const int windowsArrowHMargin = 6; // arrow horizontal margin static const int windowsTabSpacing = 12; // space between text and tab -static const int windowsCheckMarkHMargin = 2; // horiz. margins of check mark static const int windowsRightBorder = 15; // right border on windows static const int windowsCheckMarkWidth = 12; // checkmarks width on windows diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 50eb2e1..0efc5b4 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1636,7 +1636,9 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, if (optionProgressBar->minimum == optionProgressBar->maximum && optionProgressBar->minimum == 0) { // busy indicator - QS60StylePrivate::drawSkinPart(QS60StyleEnums::SP_QgnGrafBarWait, painter, progressRect,flags); + const QS60StylePrivate::SkinElementFlag orientationFlag = optionProgressBar->orientation == Qt::Horizontal ? + QS60StylePrivate::SF_PointNorth : QS60StylePrivate::SF_PointWest; + QS60StylePrivate::drawSkinPart(QS60StyleEnums::SP_QgnGrafBarWait, painter, progressRect, flags | orientationFlag); } else { const qreal progressFactor = (optionProgressBar->minimum == optionProgressBar->maximum) ? 1.0 : (qreal)optionProgressBar->progress / optionProgressBar->maximum; @@ -1871,6 +1873,8 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, //todo: update to horizontal table graphic QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, option->rect, flags | QS60StylePrivate::SF_PointWest); } + } else if (qobject_cast<const QFrame *>(widget)) { + QCommonStyle::drawControl(element, option, painter, widget); } if (option->state & State_HasFocus) drawPrimitive(PE_FrameFocusRect, option, painter, widget); @@ -2783,7 +2787,7 @@ QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon, QS60StyleEnums::SkinParts part; QS60StylePrivate::SkinElementFlags adjustedFlags; if (option) - adjustedFlags = (option->state & State_Enabled) ? + adjustedFlags = (option->state & State_Enabled || option->state == 0) ? QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled; diff --git a/src/gui/styles/qwindowscestyle.cpp b/src/gui/styles/qwindowscestyle.cpp index 49a1254..531b07e 100644 --- a/src/gui/styles/qwindowscestyle.cpp +++ b/src/gui/styles/qwindowscestyle.cpp @@ -56,7 +56,6 @@ QT_BEGIN_NAMESPACE static const int windowsItemFrame = 2; // menu item frame width -static const int windowsSepHeight = 9; // separator item height static const int windowsItemHMargin = 3; // menu item hor text margin static const int windowsItemVMargin = 2; // menu item ver text margin static const int windowsArrowHMargin = 6; // arrow horizontal margin diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp index cad7463..414fc6f 100644 --- a/src/gui/styles/qwindowsmobilestyle.cpp +++ b/src/gui/styles/qwindowsmobilestyle.cpp @@ -83,11 +83,6 @@ extern bool qt_wince_is_windows_mobile_65(); //defined in qguifunctions_wince.cp QT_BEGIN_NAMESPACE static const int windowsItemFrame = 1; // menu item frame width -static const int windowsItemHMargin = 2; // menu item hor text margin -static const int windowsItemVMargin = 2; // menu item ver text margin -static const int windowsArrowHMargin = 6; // arrow horizontal margin -static const int windowsRightBorder = 15; // right border on windows -static const int windowsCheckMarkWidth = 14; // checkmarks width on windows static const int windowsMobileitemViewCheckBoxSize = 13; static const int windowsMobileFrameGroupBoxOffset = 9; diff --git a/src/gui/styles/qwindowsstyle.cpp b/src/gui/styles/qwindowsstyle.cpp index b03653c..e558844 100644 --- a/src/gui/styles/qwindowsstyle.cpp +++ b/src/gui/styles/qwindowsstyle.cpp @@ -121,9 +121,6 @@ static const int windowsSepHeight = 9; // separator item height static const int windowsItemHMargin = 3; // menu item hor text margin static const int windowsItemVMargin = 2; // menu item ver text margin static const int windowsArrowHMargin = 6; // arrow horizontal margin -static const int windowsTabSpacing = 12; // space between text and tab -// Save some space and avoid warning. -//static const int windowsCheckMarkHMargin = 2; // horiz. margins of check mark static const int windowsRightBorder = 15; // right border on windows static const int windowsCheckMarkWidth = 12; // checkmarks width on windows diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp index 5da1e4e..191b71e 100644 --- a/src/gui/styles/qwindowsxpstyle.cpp +++ b/src/gui/styles/qwindowsxpstyle.cpp @@ -125,11 +125,9 @@ static PtrIsThemeBackgroundPartiallyTransparent pIsThemeBackgroundPartiallyTrans // General const values static const int windowsItemFrame = 2; // menu item frame width -static const int windowsSepHeight = 9; // separator item height static const int windowsItemHMargin = 3; // menu item hor text margin static const int windowsItemVMargin = 0; // menu item ver text margin static const int windowsArrowHMargin = 6; // arrow horizontal margin -static const int windowsCheckMarkHMargin = 0; // horiz. margins of check mark static const int windowsRightBorder = 12; // right border on windows // External function calls diff --git a/src/gui/widgets/qlineedit_p.cpp b/src/gui/widgets/qlineedit_p.cpp index 5950d85..d8d0796 100644 --- a/src/gui/widgets/qlineedit_p.cpp +++ b/src/gui/widgets/qlineedit_p.cpp @@ -154,6 +154,8 @@ void QLineEditPrivate::init(const QString& txt) QObject::connect(control, SIGNAL(editFocusChange(bool)), q, SLOT(_q_editFocusChange(bool))); #endif + QObject::connect(control, SIGNAL(cursorPositionChanged(int, int)), + q, SLOT(updateMicroFocus())); // for now, going completely overboard with updates. QObject::connect(control, SIGNAL(selectionChanged()), diff --git a/src/network/kernel/qnetworkinterface_symbian.cpp b/src/network/kernel/qnetworkinterface_symbian.cpp index 717d80d..2ba5350 100644 --- a/src/network/kernel/qnetworkinterface_symbian.cpp +++ b/src/network/kernel/qnetworkinterface_symbian.cpp @@ -43,6 +43,7 @@ #include "qnetworkinterface.h" #include "qnetworkinterface_p.h" +#include "../corelib/kernel/qcore_symbian_p.h" #ifndef QT_NO_NETWORKINTERFACE @@ -66,11 +67,6 @@ static QNetworkInterface::InterfaceFlags convertFlags(const TSoInetInterfaceInfo return flags; } -QString qstringFromDesc(const TDesC& aData) -{ - return QString::fromUtf16(aData.Ptr(), aData.Length()); -} - static QList<QNetworkInterfacePrivate *> interfaceListing() { TInt err(KErrNone); @@ -111,7 +107,7 @@ static QList<QNetworkInterfacePrivate *> interfaceListing() iface = new QNetworkInterfacePrivate; iface->index = ifindex++; interfaces << iface; - iface->name = qstringFromDesc(info.iName); + iface->name = qt_TDesC2QString(info.iName); iface->flags = convertFlags(info); if (/*info.iFeatures&KIfHasHardwareAddr &&*/ info.iHwAddr.Family() != KAFUnspec) { @@ -121,37 +117,37 @@ static QList<QNetworkInterfacePrivate *> interfaceListing() address.Append(_L(":")); } address.UpperCase(); - iface->hardwareAddress = qstringFromDesc(address); + iface->hardwareAddress = qt_TDesC2QString(address); } // Get the address of the interface info.iAddress.Output(address); - entry.setIp(QHostAddress(qstringFromDesc(address))); + entry.setIp(QHostAddress(qt_TDesC2QString(address))); // Get the interface netmask // For some reason netmask is always 0.0.0.0 // info.iNetMask.Output(address); - // entry.setNetmask( QHostAddress( qstringFromDesc( address ) ) ); + // entry.setNetmask( QHostAddress( qt_TDesC2QString( address ) ) ); // Workaround: Let Symbian determine netmask based on IP address class // TODO: Works only for IPv4 - Task: 259128 Implement IPv6 support TInetAddr netmask; netmask.NetMask(info.iAddress); netmask.Output(address); - entry.setNetmask(QHostAddress(qstringFromDesc(address))); + entry.setNetmask(QHostAddress(qt_TDesC2QString(address))); // Get the interface broadcast address if (iface->flags & QNetworkInterface::CanBroadcast) { // For some reason broadcast address is always 0.0.0.0 // info.iBrdAddr.Output(address); - // entry.setBroadcast( QHostAddress( qstringFromDesc( address ) ) ); + // entry.setBroadcast( QHostAddress( qt_TDesC2QString( address ) ) ); // Workaround: Let Symbian determine broadcast address based on IP address // TODO: Works only for IPv4 - Task: 259128 Implement IPv6 support TInetAddr broadcast; broadcast.NetBroadcast(info.iAddress); broadcast.Output(address); - entry.setBroadcast(QHostAddress(qstringFromDesc(address))); + entry.setBroadcast(QHostAddress(qt_TDesC2QString(address))); } // Add new entry to interface address entries @@ -193,12 +189,12 @@ static QList<QNetworkInterfacePrivate *> interfaceListing() // get interface address routeInfo.iIfAddr.Output(address); - QHostAddress ifAddr(qstringFromDesc(address)); + QHostAddress ifAddr(qt_TDesC2QString(address)); if (ifAddr.isNull()) continue; routeInfo.iDstAddr.Output(address); - QHostAddress destination(qstringFromDesc(address)); + QHostAddress destination(qt_TDesC2QString(address)); if (destination.isNull() || destination != ifAddr) continue; @@ -215,7 +211,7 @@ static QList<QNetworkInterfacePrivate *> interfaceListing() continue; } else { routeInfo.iNetMask.Output(address); - QHostAddress netmask(qstringFromDesc(address)); + QHostAddress netmask(qt_TDesC2QString(address)); entry.setNetmask(netmask); // NULL boradcast address for // ::postProcess to have effect |