diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-05-26 09:56:18 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2009-05-26 09:56:18 (GMT) |
commit | b8baa33fb9a385c5f4462dea73bd5cb3ac239203 (patch) | |
tree | b366701673eec92910ae968d13a19287edcb72ea | |
parent | 5f87463105f534cf357feba50f97c3f31ba7344f (diff) | |
parent | b0b4e58ed417d4fab5f73c0e6f82a2fb6a68f59f (diff) | |
download | Qt-b8baa33fb9a385c5f4462dea73bd5cb3ac239203.zip Qt-b8baa33fb9a385c5f4462dea73bd5cb3ac239203.tar.gz Qt-b8baa33fb9a385c5f4462dea73bd5cb3ac239203.tar.bz2 |
Merge branch 'master' of git@scm.dev.troll.no:qt/qt-s60-public
-rw-r--r-- | src/corelib/io/qfile.cpp | 1 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 31 | ||||
-rw-r--r-- | src/gui/styles/qs60style_p.h | 9 | ||||
-rw-r--r-- | src/gui/styles/qs60style_simulated.cpp | 2 | ||||
-rw-r--r-- | src/gui/styles/qs60style_symbian.cpp | 4 | ||||
-rw-r--r-- | tests/auto/network-settings.h | 19 | ||||
-rw-r--r-- | tests/auto/qlibrary/lib2/lib2.pro | 7 | ||||
-rw-r--r-- | tests/auto/qlibrary/qlibrary.pro | 13 |
8 files changed, 54 insertions, 32 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 4277779..551485d 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -741,7 +741,6 @@ QFile::rename(const QString &newName) error = true; } if(!error) { - in.close(); if (!remove()) { d->setError(QFile::RenameError, tr("Cannot remove source file")); error = true; diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index f8cf885..5026d5c 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -350,14 +350,24 @@ QFont QS60StylePrivate::s60Font( return result; } -//todo: you could pass a reason to clear cache here, so that we could -// deduce whether or not the specific cache needs to be cleared -void QS60StylePrivate::clearCaches() +void QS60StylePrivate::clearCaches(QS60StylePrivate::CacheClearReason reason) { - m_colorCache.clear(); - m_mappedFontsCache.clear(); - QPixmapCache::clear(); - m_backgroundValid = false; + switch(reason){ + case CC_LayoutChange: + // when layout changes, the colors remain in cache + m_mappedFontsCache.clear(); //todo: can font change, when layout changes? + m_backgroundValid = false; + QPixmapCache::clear(); + break; + case CC_ThemeChange: //todo: can font change when theme changes? + case CC_UndefinedChange: + default: + m_colorCache.clear(); + m_mappedFontsCache.clear(); + QPixmapCache::clear(); + m_backgroundValid = false; + break; + } } // Since S60Style has 'button' and 'tooltip' as a graphic, we don't have any native color which to use @@ -381,7 +391,6 @@ QColor QS60StylePrivate::colorFromFrameGraphics(QS60StylePrivate::SkinFrameEleme const int pixels = frameImage.numBytes()/sizeof(QRgb); const int bytesPerLine = frameImage.bytesPerLine(); Q_ASSERT(bytesPerLine); - const int rows = frameImage.numBytes()/(sizeof(QRgb)*bytesPerLine); int estimatedRed = 0; int estimatedGreen = 0; @@ -761,8 +770,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom const QS60StylePrivate::SkinElementFlags flags = (option->state & State_Enabled) ? QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled; SubControls sub = option->subControls; - Q_D(const QS60Style); - switch (control) { #ifndef QT_NO_SCROLLBAR case CC_ScrollBar: @@ -2413,7 +2420,6 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple //slightly indent text and boxes, so that dialog border does not mess with them. const int horizontalSpacing = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutHorizontalSpacing); - const int bottomMargin = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutBottomMargin); ret.adjust(2,horizontalSpacing-3,0,0); break; case SC_GroupBoxFrame: { @@ -2518,13 +2524,10 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con } } else if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) { const bool checkable = menuItem->checkType != QStyleOptionMenuItem::NotCheckable; - const bool subMenu = menuItem->menuItemType == QStyleOptionMenuItem::SubMenu; int indicatorWidth = checkable ? pixelMetric(PM_ListViewIconSize, opt, widget) : pixelMetric(PM_SmallIconSize, opt, widget); ret = menuItem->rect; - const int verticalSpacing = - QS60StylePrivate::pixelMetric(QStyle::PM_LayoutVerticalSpacing); if (element == SE_ItemViewItemDecoration) { if (menuItem->direction == Qt::RightToLeft) diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 37c6ec7..ba7dca3 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -331,6 +331,13 @@ public: SF_StateDisabled = 0x0020, SF_ColorSkinned = 0x0040, }; + + enum CacheClearReason { + CC_UndefinedChange = 0, + CC_LayoutChange, + CC_ThemeChange + }; + Q_DECLARE_FLAGS(SkinElementFlags, SkinElementFlag) // draws skin element @@ -365,7 +372,7 @@ public: QFont s60Font(QS60StyleEnums::FontCategories fontCategory, int pointSize = -1) const; // clears all style caches (fonts, colors, pixmaps) - void clearCaches(); + void clearCaches(CacheClearReason reason = CC_UndefinedChange); // returns themed background texture static QPixmap backgroundTexture(); diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index f10da2b..65336ae 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -289,7 +289,7 @@ void QS60Style::setS60Theme(const QHash<QString, QPicture> &parts, Q_D(QS60Style); QS60StyleModeSpecifics::m_partPictures = parts; QS60StyleModeSpecifics::m_colors = colors; - d->clearCaches(); + d->clearCaches(QS60StylePrivate::CC_ThemeChange); } QT_END_NAMESPACE diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index 48b759a..3fc4c8c 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -1352,7 +1352,7 @@ void QS60StyleModeSpecifics::colorGroupAndIndex( void QS60Style::handleDynamicLayoutVariantSwitch() { Q_D(QS60Style); - d->clearCaches(); + d->clearCaches(QS60StylePrivate::CC_LayoutChange); #ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED d->setActiveLayout(); #endif // QT_S60STYLE_LAYOUTDATA_SIMULATED @@ -1365,7 +1365,7 @@ void QS60Style::handleDynamicLayoutVariantSwitch() void QS60Style::handleSkinChange() { Q_D(QS60Style); - d->clearCaches(); + d->clearCaches(QS60StylePrivate::CC_ThemeChange); d->setThemePalette(qApp); foreach (QWidget *topLevelWidget, QApplication::allWidgets()){ QEvent e(QEvent::StyleChange); diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h index 88e9fb7..22d8886 100644 --- a/tests/auto/network-settings.h +++ b/tests/auto/network-settings.h @@ -37,7 +37,12 @@ ** ****************************************************************************/ #include <QString> + +/* +#ifdef QT_NETWORK_LIB #include <QtNetwork/QHostInfo> +#endif +*/ #ifdef Q_OS_SYMBIAN #include <sys/socket.h> @@ -48,10 +53,10 @@ #if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) // In emulator we use WINSOCK connectivity by default. Unfortunately winsock // does not work very well with UDP sockets. This defines skips some test -// cases which have known problems. +// cases which have known problems. // NOTE: Prefer to use WINPCAP based connectivity in S60 emulator when running -// network tests. WINPCAP connectivity uses Symbian OS IP stack, +// network tests. WINPCAP connectivity uses Symbian OS IP stack, // correspondingly as HW does. When using WINPCAP disable this define //#define SYMBIAN_WINSOCK_CONNECTIVITY #endif @@ -138,7 +143,7 @@ public: #endif return "10.10.14.172"; } - + static QByteArray expectedReplyIMAP() { #ifdef Q_OS_SYMBIAN @@ -160,7 +165,7 @@ public: QByteArray expected( "* OK [CAPABILITY IMAP4 IMAP4REV1] " ); expected = expected.append(QtNetworkSettings::serverLocalName().toAscii()); expected = expected.append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); - + return expected; } @@ -182,12 +187,12 @@ public: return expected; } } - + static QByteArray expectedReplyFtp() { QByteArray expected( "220 (vsFTPd 2.0.5)\r\n221 Goodbye.\r\n" ); return expected; - } + } #ifdef Q_OS_SYMBIAN static void setDefaultIap() @@ -250,7 +255,7 @@ private: position += QString("=").length(); //create record - QtNetworkSettingsRecord *entry = + QtNetworkSettingsRecord *entry = new QtNetworkSettingsRecord( QString("iap.default"), line.mid(position).trimmed() ); entries.insert(entry->recordName(), entry); break; diff --git a/tests/auto/qlibrary/lib2/lib2.pro b/tests/auto/qlibrary/lib2/lib2.pro index 724077a..436d7ba 100644 --- a/tests/auto/qlibrary/lib2/lib2.pro +++ b/tests/auto/qlibrary/lib2/lib2.pro @@ -27,10 +27,11 @@ unix:!symbian: { symbian-abld: { TARGET.CAPABILITY=ALL -TCB + FIXEDROOT = $$replace(EPOCROOT,/,\\) QMAKE_POST_LINK = \ - copy /Y $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dl2 && \ - copy /Y $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\system.trolltech.test.mylib.dll && \ - IF NOT "$(PLATFORM)==WINSCW" copy /Y $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll ..\tst\mylib.dl2 + copy /Y $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dl2 && \ + copy /Y $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\system.trolltech.test.mylib.dll && \ + IF NOT "$(PLATFORM)==WINSCW" copy /Y $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll ..\tst\mylib.dl2 } symbian-sbsv2: { diff --git a/tests/auto/qlibrary/qlibrary.pro b/tests/auto/qlibrary/qlibrary.pro index 9ba49ee..fd5790b 100644 --- a/tests/auto/qlibrary/qlibrary.pro +++ b/tests/auto/qlibrary/qlibrary.pro @@ -1,9 +1,16 @@ QT -= gui TEMPLATE = subdirs CONFIG += ordered -SUBDIRS = lib \ - lib2 \ - tst + +symbian: { +# Can't build two versions of lib with same name in symbian, so just build one +SUBDIRS = lib2 \ + tst +} else { +SUBDIRS = lib \ + lib2 \ + tst +} TARGET = tst_qlibrary # no special install rule for subdir |