From a024829184dcde9b6fdaf5ea884fe7e42efdaf29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Thu, 3 Dec 2009 12:18:04 +0200 Subject: QS60Style: Always store changed theme palette When style updates its background brush, it updates QApplication's palette with new background. Also member variable m_backgroundBrush is updated. What is NOT updated is the member variable m_themePalette, which should also contain correct updated palette. This change updates m_themePalette and moves palette updations to occur in one place so that in all use-cases the palettes are modified in a unified way. Task-number: QTBUG-6427 Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index dca78ca..5f7ec69 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -454,9 +454,6 @@ void QS60StylePrivate::setThemePalette(QApplication *app) const Q_UNUSED(app) QPalette widgetPalette = QPalette(Qt::white); setThemePalette(&widgetPalette); - QApplication::setPalette(widgetPalette); //calling QApplication::setPalette clears palette hash - setThemePaletteHash(&widgetPalette); - storeThemePalette(&widgetPalette); } QPalette* QS60StylePrivate::themePalette() @@ -470,8 +467,6 @@ void QS60StylePrivate::setBackgroundTexture(QApplication *app) const QPalette applicationPalette = QApplication::palette(); applicationPalette.setBrush(QPalette::Window, backgroundTexture()); setThemePalette(&applicationPalette); - QApplication::setPalette(applicationPalette); - setThemePaletteHash(&applicationPalette); } void QS60StylePrivate::deleteBackground() @@ -687,6 +682,10 @@ void QS60StylePrivate::setThemePalette(QPalette *palette) const palette->setColor(QPalette::Midlight, palette->color(QPalette::Button).lighter(125)); palette->setColor(QPalette::Mid, palette->color(QPalette::Button).darker(150)); palette->setColor(QPalette::Shadow, Qt::black); + + QApplication::setPalette(*palette); //calling QApplication::setPalette clears palette hash + setThemePaletteHash(palette); + storeThemePalette(palette); } void QS60StylePrivate::deleteThemePalette() -- cgit v0.12 From d672687a3dc79d3b59887986cf4d64cf339d7981 Mon Sep 17 00:00:00 2001 From: Jouni Hiltunen Date: Tue, 24 Nov 2009 16:11:57 +0200 Subject: Unnecessary symbian version checks in sqldrivers.pro Version checks in sqldrivers.pro are not needed. These version checks also fail if symbian version does not match to 3.1 3.2 or 5.0. The included sqlite_symbian.pro checks if the binaries are already present or not. Reviewed-By: Shane Kearns --- src/plugins/sqldrivers/sqldrivers.pro | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/sqldrivers/sqldrivers.pro b/src/plugins/sqldrivers/sqldrivers.pro index 2bd5f2c..83d71e4 100644 --- a/src/plugins/sqldrivers/sqldrivers.pro +++ b/src/plugins/sqldrivers/sqldrivers.pro @@ -10,6 +10,4 @@ contains(sql-plugins, sqlite) : SUBDIRS += sqlite contains(sql-plugins, sqlite2) : SUBDIRS += sqlite2 contains(sql-plugins, ibase) : SUBDIRS += ibase -contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { - symbian:contains(CONFIG, system-sqlite): SUBDIRS += sqlite_symbian - } +symbian:contains(CONFIG, system-sqlite): SUBDIRS += sqlite_symbian -- cgit v0.12 From 14c01d35cd132bb1a5e5725877d28d5f75c086ab Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Thu, 3 Dec 2009 13:50:43 +0200 Subject: Fixed "...QString::QString(const char *)... is deprecated" warning. Task-number: QTBUG-6290 Reviewed-by: TrustMe --- src/gui/kernel/qsoftkeymanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 1acc9b3..30c67f4 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -246,7 +246,7 @@ void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList &softkeys) break; } - int command = (softKeyAction->objectName().contains("_q_menuSoftKeyAction")) + int command = (softKeyAction->objectName().contains(QLatin1String("_q_menuSoftKeyAction"))) ? EAknSoftkeyOptions : s60CommandStart + index; -- cgit v0.12 From 62fac968df5fb3632e458aeacfe5a8ef5cfd32bf Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Fri, 4 Dec 2009 14:23:24 +0200 Subject: Switched S60 QDesktopServices implementation to CDocumentHandler based. RApaLsSession based implementation did not succeed to start music player in some S60 devices to playing mode. The only found solution to this problem was to start using CDocumentHandler based implementation. CDocumentHandler adds a new S60 dependency, but it is needed to make QDesktopServices APIs fully fuonctional. However if Qt is comfigured without S60 we still fallback to RApaLsSession implementation. With CDocumentHandler the files are also opened as embedded, due to the fact that swicthing files in stand-alone mode would require SwEvent capability. Task-number: QTBUG-4699 Reviewed-by: Miikka Heikkinen --- src/gui/util/qdesktopservices_s60.cpp | 72 +++++++++++++++------- .../auto/qdesktopservices/tst_qdesktopservices.cpp | 16 ++++- 2 files changed, 64 insertions(+), 24 deletions(-) diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp index 1890d56..c6932de 100644 --- a/src/gui/util/qdesktopservices_s60.cpp +++ b/src/gui/util/qdesktopservices_s60.cpp @@ -41,7 +41,7 @@ // This flag changes the implementation to use S60 CDcoumentHandler // instead of apparch when opening the files -#undef USE_DOCUMENTHANDLER +#define USE_DOCUMENTHANDLER #include #include @@ -58,12 +58,14 @@ #include // RSendAsMessage #ifdef Q_WS_S60 -# include // PathInfo +# include // PathInfo # ifdef USE_DOCUMENTHANDLER -# include // CDocumentHandler +# include // CDocumentHandler +# include # endif -#elif defined(USE_DOCUMENTHANDLER) -# error CDocumentHandler requires support for S60 +#else +# warning CDocumentHandler requires support for S60 +# undef USE_DOCUMENTHANDLER // Fallback to RApaLsSession based implementation #endif QT_BEGIN_NAMESPACE @@ -95,6 +97,42 @@ private: R* mPtr; }; +#ifdef USE_DOCUMENTHANDLER +class QS60DocumentHandler : public MAknServerAppExitObserver +{ +public: + QS60DocumentHandler() :docHandler(0) {} + + ~QS60DocumentHandler() { + delete docHandler; + } + + CDocumentHandler& documentHandler() { + // In case user calls openUrl twice subsequently, before the first embedded app is closed + // we use the same CDocumentHandler instance. Using same instance makes sure the first + // launched embedded app is closed and latter one gets embedded to our app. + // Using different instance would help only theoretically since user cannot interact with + // several embedded apps at the same time. + if(!docHandler) { + QT_TRAP_THROWING(docHandler = CDocumentHandler::NewL()); + docHandler->SetExitObserver(this); + } + return *docHandler; + } + +private: // From MAknServerAppExitObserver + void HandleServerAppExit(TInt /*aReason*/) { + delete docHandler; + docHandler = 0; + } + +private: + CDocumentHandler* docHandler; +}; +Q_GLOBAL_STATIC(QS60DocumentHandler, qt_s60_documenthandler); +#endif + + static void handleMailtoSchemeLX(const QUrl &url) { // this function has many intermingled leaves and throws. Qt and Symbian objects do not have @@ -264,21 +302,9 @@ static void openDocumentL(const TDesC& aUrl) CleanupStack::PopAndDestroy(); // appArcSession #else // This is an alternative way to launch app associated to MIME type - // CDocumentHandler would support opening apps in embedded mode, - // but our Qt application window group seems to always get switched on top of embedded one - // -> Cannot use menus etc of embedded app -> used - - CDocumentHandler* docHandler = CDocumentHandler::NewLC(); + // CDocumentHandler also supports opening apps in embedded mode. TDataType temp; - //Standalone file opening fails for some file-types at least in S60 3.1 emulator - //For example .txt file fails with KErrAlreadyInUse and music files with KERN-EXEC 0 - //Workaround is to use OpenFileEmbeddedL - //docHandler->OpenFileL(aUrl, temp); - - // Opening file with CDocumentHandler will leave if file does not exist - // Leave is trapped in openDocument and false returned to user. - docHandler->OpenFileEmbeddedL(aUrl, temp); - CleanupStack::PopAndDestroy(docHandler); + qt_s60_documenthandler()->documentHandler().OpenFileEmbeddedL(aUrl, temp); #endif } @@ -349,7 +375,7 @@ QString QDesktopServices::storageLocation(StandardLocation type) case DesktopLocation: qWarning("No desktop concept in Symbian OS"); // But lets still use some feasible default - path.Append(writableDataRoot()); + path.Append(writableDataRoot()); break; case DocumentsLocation: path.Append(writableDataRoot()); @@ -380,7 +406,7 @@ QString QDesktopServices::storageLocation(StandardLocation type) #endif break; case TempLocation: - return QDir::tempPath(); + return QDir::tempPath(); break; case HomeLocation: path.Append(writableDataRoot()); @@ -394,10 +420,10 @@ QString QDesktopServices::storageLocation(StandardLocation type) CEikonEnv::Static()->FsSession().PrivatePath(path); path.Insert(0, writableExeDrive().Name()); path.Append(KCacheSubDir); - break; + break; default: // Lets use feasible default - path.Append(writableDataRoot()); + path.Append(writableDataRoot()); break; } diff --git a/tests/auto/qdesktopservices/tst_qdesktopservices.cpp b/tests/auto/qdesktopservices/tst_qdesktopservices.cpp index 2d9e5dc..c105a97 100644 --- a/tests/auto/qdesktopservices/tst_qdesktopservices.cpp +++ b/tests/auto/qdesktopservices/tst_qdesktopservices.cpp @@ -70,6 +70,7 @@ private slots: void openMailtoUrl(); void openFileUrl_data(); void openFileUrl(); + void openMultipleFileUrls(); #endif void handlers(); void storageLocation_data(); @@ -197,6 +198,7 @@ void tst_qdesktopservices::openMailtoUrl() QFETCH(QUrl, url); QFETCH(bool, result); QCOMPARE(QDesktopServices::openUrl(url), result); + QTest::qWait(5000); } void tst_qdesktopservices::openFileUrl_data() @@ -239,7 +241,19 @@ void tst_qdesktopservices::openFileUrl() QFETCH(QUrl, url); QFETCH(bool, result); QCOMPARE(QDesktopServices::openUrl(url), result); - QTest::qWait(15000); + QTest::qWait(5000); +} + +void tst_qdesktopservices::openMultipleFileUrls() +{ +#ifndef RUN_MANUAL_TESTS + QSKIP("Test disabled -- only for manual purposes", SkipAll); +#endif + + QCOMPARE(QDesktopServices::openUrl(QUrl("file:///c:/data/images/image.bmp")), true); + QCOMPARE(QDesktopServices::openUrl(QUrl("file:///c:/data/images/image.png")), true); + QCOMPARE(QDesktopServices::openUrl(QUrl("file:///c:/data/others/noendofline.txt")), true); + QCOMPARE(QDesktopServices::openUrl(QUrl("file:///c:/data/installs/ErrRd.sisx")), true); } #endif -- cgit v0.12 From fe785ec5fa818b3b31777d22b434621522a532b4 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 4 Dec 2009 15:07:41 +0200 Subject: MMP_RULES overriding qmake variables now warns user Added warning to qmake when it detects MMP_RULES that override MMP statements created by qmake variables. Also harmonized the way << operator is used with #defined strings in symmake.cpp. Task-number: QTBUG-5407 Reviewed-by: Janne Anttila --- qmake/generators/symbian/symmake.cpp | 152 ++++++++++++++++++++++++----------- qmake/generators/symbian/symmake.h | 9 ++- 2 files changed, 111 insertions(+), 50 deletions(-) diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index afaf338..8379ed9 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -77,6 +77,15 @@ #define MMP_LINKEROPTION_CW "LINKEROPTION CW" #define MMP_LINKEROPTION_ARMCC "LINKEROPTION ARMCC" #define MMP_LINKEROPTION_GCCE "LINKEROPTION GCCE" +#define MMP_CAPABILITY "CAPABILITY" +#define MMP_EPOCALLOWDLLDATA "EPOCALLOWDLLDATA" +#define MMP_EPOCHEAPSIZE "EPOCHEAPSIZE" +#define MMP_EPOCSTACKSIZE "EPOCSTACKSIZE" +#define MMP_UID "UID" +#define MMP_VENDORID "VENDORID" +#define MMP_VERSION "VERSION" +#define MMP_START_RESOURCE "START RESOURCE" +#define MMP_END_RESOURCE "END" #define SIS_TARGET "sis" #define OK_SIS_TARGET "ok_sis" @@ -155,7 +164,7 @@ void SymbianMakefileGenerator::writeHeader(QTextStream &t) { t << "// ============================================================================" << endl; t << "// * Makefile for building: " << escapeFilePath(var("TARGET")) << endl; - t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: "; + t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; t << "// * This file is generated by qmake and should not be modified by the" << endl; t << "// * user." << endl; @@ -444,7 +453,7 @@ void SymbianMakefileGenerator::writeCustomDefFile() QTextStream t(&ft); t << "; ==============================================================================" << endl; - t << "; Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: "; + t << "; Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; t << "; This file is generated by qmake and should not be modified by the" << endl; t << "; user." << endl; @@ -646,30 +655,76 @@ void SymbianMakefileGenerator::initMmpVariables() // Check MMP_RULES for singleton keywords that are overridden QStringList overridableMmpKeywords; + QStringList restrictableMmpKeywords; + QStringList restrictedMmpKeywords; + bool inResourceBlock = false; + overridableMmpKeywords << QLatin1String(MMP_TARGETTYPE); + restrictableMmpKeywords << QLatin1String(MMP_TARGET) << QLatin1String(MMP_SECUREID) + << QLatin1String(MMP_OPTION_CW) << QLatin1String(MMP_OPTION_ARMCC) + << QLatin1String(MMP_OPTION_GCCE) << QLatin1String(MMP_LINKEROPTION_CW) + << QLatin1String(MMP_LINKEROPTION_ARMCC) << QLatin1String(MMP_LINKEROPTION_GCCE) + << QLatin1String(MMP_CAPABILITY) << QLatin1String(MMP_EPOCALLOWDLLDATA) + << QLatin1String(MMP_EPOCHEAPSIZE) << QLatin1String(MMP_EPOCSTACKSIZE) + << QLatin1String(MMP_UID) << QLatin1String(MMP_VENDORID) + << QLatin1String(MMP_VERSION); foreach (QString item, project->values("MMP_RULES")) { if (project->values(item).isEmpty()) { - checkOverridability(overridableMmpKeywords, item); + handleMmpRulesOverrides(item, inResourceBlock, restrictedMmpKeywords, + restrictableMmpKeywords, overridableMmpKeywords); } else { foreach (QString itemRow, project->values(item)) { - checkOverridability(overridableMmpKeywords, itemRow); + handleMmpRulesOverrides(itemRow, inResourceBlock, restrictedMmpKeywords, + restrictableMmpKeywords, overridableMmpKeywords); } } } + + if (restrictedMmpKeywords.size()) { + fprintf(stderr, "Warning: Restricted statements detected in MMP_RULES:\n" + " (%s)\n" + " Use corresponding qmake variable(s) instead.\n", + qPrintable(restrictedMmpKeywords.join(", "))); + } } -void SymbianMakefileGenerator::checkOverridability(QStringList &overridableKeywords, QString &checkString) +void SymbianMakefileGenerator::handleMmpRulesOverrides(QString &checkString, + bool &inResourceBlock, + QStringList &restrictedMmpKeywords, + const QStringList &restrictableMmpKeywords, + const QStringList &overridableMmpKeywords) { - // Check if checkString contains overridable keyword and - // add the keyword to overridden keywords list if so. QString simplifiedString = checkString.simplified(); - foreach (QString item, overridableKeywords) { - if (simplifiedString.startsWith(item)) - appendIfnotExist(overriddenMmpKeywords, item); + + if (!inResourceBlock && simplifiedString.startsWith(MMP_START_RESOURCE, Qt::CaseInsensitive)) + inResourceBlock = true; + else if (inResourceBlock && simplifiedString.startsWith(MMP_END_RESOURCE, Qt::CaseInsensitive)) + inResourceBlock = false; + + // Allow restricted and overridable items in RESOURCE blocks as those do not actually + // override anything. + if (!inResourceBlock) { + appendKeywordIfMatchFound(overriddenMmpKeywords, overridableMmpKeywords, simplifiedString); + appendKeywordIfMatchFound(restrictedMmpKeywords, restrictableMmpKeywords, simplifiedString); + } +} + +void SymbianMakefileGenerator::appendKeywordIfMatchFound(QStringList &list, + const QStringList &keywordList, + QString &checkString) +{ + // Check if checkString starts with any supplied keyword and + // add the found keyword to list if it does. + foreach (QString item, keywordList) { + if (checkString.startsWith(QString(item).append(" "), Qt::CaseInsensitive) + || checkString.compare(item, Qt::CaseInsensitive) == 0) { + appendIfnotExist(list, item); + } } } + bool SymbianMakefileGenerator::removeDuplicatedStrings(QStringList &stringList) { QStringList tmpStringList; @@ -690,7 +745,7 @@ bool SymbianMakefileGenerator::removeDuplicatedStrings(QStringList &stringList) void SymbianMakefileGenerator::writeMmpFileHeader(QTextStream &t) { t << "// ==============================================================================" << endl; - t << "// Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: "; + t << "// Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; t << "// This file is generated by qmake and should not be modified by the" << endl; t << "// user." << endl; @@ -775,7 +830,7 @@ void SymbianMakefileGenerator::writeMmpFileMacrosPart(QTextStream& t) void SymbianMakefileGenerator::addMacro(QTextStream& t, const QString& value) { - t << "MACRO" << "\t\t" << value << endl; + t << "MACRO\t\t" << value << endl; } @@ -784,28 +839,28 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) bool skipTargetType = overriddenMmpKeywords.contains(MMP_TARGETTYPE); if (targetType == TypeExe) { - t << MMP_TARGET << "\t\t" << fixedTarget << ".exe" << endl; + t << MMP_TARGET "\t\t" << fixedTarget << ".exe" << endl; if (!skipTargetType) { if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) - t << MMP_TARGETTYPE << "\t\t" << "STDEXE" << endl; + t << MMP_TARGETTYPE "\t\tSTDEXE" << endl; else - t << MMP_TARGETTYPE << "\t\t" << "EXE" << endl; + t << MMP_TARGETTYPE "\t\tEXE" << endl; } } else if (targetType == TypeDll || targetType == TypePlugin) { - t << MMP_TARGET << "\t\t" << fixedTarget << ".dll" << endl; + t << MMP_TARGET "\t\t" << fixedTarget << ".dll" << endl; if (!skipTargetType) { if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) - t << MMP_TARGETTYPE << "\t\t" << "STDDLL" << endl; + t << MMP_TARGETTYPE "\t\tSTDDLL" << endl; else - t << MMP_TARGETTYPE << "\t\t" << "DLL" << endl; + t << MMP_TARGETTYPE "\t\tDLL" << endl; } } else if (targetType == TypeLib) { - t << MMP_TARGET << "\t\t" << fixedTarget << ".lib" << endl; + t << MMP_TARGET "\t\t" << fixedTarget << ".lib" << endl; if (!skipTargetType) { if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) - t << MMP_TARGETTYPE << "\t\t" << "STDLIB" << endl; + t << MMP_TARGETTYPE "\t\tSTDLIB" << endl; else - t << MMP_TARGETTYPE << "\t\t" << "LIB" << endl; + t << MMP_TARGETTYPE "\t\tLIB" << endl; } } else { fprintf(stderr, "Error: Unexpected targettype (%d) in SymbianMakefileGenerator::writeMmpFileTargetPart\n", targetType); @@ -813,30 +868,30 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) t << endl; - t << "UID" << "\t\t" << uid2 << " " << uid3 << endl; + t << MMP_UID "\t\t" << uid2 << " " << uid3 << endl; if (0 != project->values("TARGET.SID").size()) { - t << MMP_SECUREID << "\t\t" << project->values("TARGET.SID").join(" ") << endl; + t << MMP_SECUREID "\t\t" << project->values("TARGET.SID").join(" ") << endl; } else { if (0 == uid3.size()) - t << MMP_SECUREID << "\t\t" << "0" << endl; + t << MMP_SECUREID "\t\t0" << endl; else - t << MMP_SECUREID << "\t\t" << uid3 << endl; + t << MMP_SECUREID "\t\t" << uid3 << endl; } // default value used from mkspecs is 0 if (0 != project->values("TARGET.VID").size()) { - t << "VENDORID" << "\t\t" << project->values("TARGET.VID").join(" ") << endl; + t << MMP_VENDORID "\t\t" << project->values("TARGET.VID").join(" ") << endl; } t << endl; if (0 != project->first("TARGET.EPOCSTACKSIZE").size()) - t << "EPOCSTACKSIZE" << "\t\t" << project->first("TARGET.EPOCSTACKSIZE") << endl; + t << MMP_EPOCSTACKSIZE "\t\t" << project->first("TARGET.EPOCSTACKSIZE") << endl; if (0 != project->values("TARGET.EPOCHEAPSIZE").size()) - t << "EPOCHEAPSIZE" << "\t\t" << project->values("TARGET.EPOCHEAPSIZE").join(" ") << endl; + t << MMP_EPOCHEAPSIZE "\t\t" << project->values("TARGET.EPOCHEAPSIZE").join(" ") << endl; if (0 != project->values("TARGET.EPOCALLOWDLLDATA").size()) - t << "EPOCALLOWDLLDATA" << endl; + t << MMP_EPOCALLOWDLLDATA << endl; if (targetType == TypePlugin && !project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) { // Use custom def file for Qt plugins @@ -865,20 +920,20 @@ void SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringL t << lang << " "; // no endl } t << endl; - t << "START RESOURCE\t\t" << locTarget << endl; + t << MMP_START_RESOURCE "\t\t" << locTarget << endl; t << "HEADER" << endl; t << "TARGETPATH\t\t\t" RESOURCE_DIRECTORY_MMP << endl; - t << "END" << endl << endl; + t << MMP_END_RESOURCE << endl << endl; QString regTarget = fixedTarget; regTarget.append("_reg.rss"); t << "SOURCEPATH\t\t\t." << endl; - t << "START RESOURCE\t\t" << regTarget << endl; + t << MMP_START_RESOURCE "\t\t" << regTarget << endl; if (isForSymbianSbsv2()) t << "DEPENDS " << fixedTarget << ".rsg" << endl; t << "TARGETPATH\t\t" REGISTRATION_RESOURCE_DIRECTORY_HW << endl; - t << "END" << endl << endl; + t << MMP_END_RESOURCE << endl << endl; } } @@ -890,7 +945,7 @@ void SymbianMakefileGenerator::writeMmpFileSystemIncludePart(QTextStream& t) QStringList values = it.value(); for (int i = 0; i < values.size(); ++i) { QString handledPath = values.at(i); - t << "SYSTEMINCLUDE" << "\t\t" << fixPathForMmp(handledPath, current) << endl; + t << "SYSTEMINCLUDE\t\t" << fixPathForMmp(handledPath, current) << endl; } } @@ -946,14 +1001,14 @@ void SymbianMakefileGenerator::writeMmpFileCapabilityPart(QTextStream& t) { if (0 != project->first("TARGET.CAPABILITY").size()) { QStringList &capabilities = project->values("TARGET.CAPABILITY"); - t << "CAPABILITY" << "\t\t"; + t << MMP_CAPABILITY "\t\t"; for (int i = 0; i < capabilities.size(); ++i) { QString cap = capabilities.at(i); t << cap << " "; } } else { - t << "CAPABILITY" << "\t\t" << "None"; + t << MMP_CAPABILITY "\t\tNone"; } t << endl << endl; } @@ -1048,21 +1103,21 @@ void SymbianMakefileGenerator::writeMmpFileCompilerOptionPart(QTextStream& t) if (!gccelink.isEmpty() && gccelink[gccelink.size()-1] == ' ') gccelink.chop(1); - if (!cw.isEmpty() && !overriddenMmpKeywords.contains(MMP_OPTION_CW)) + if (!cw.isEmpty()) t << MMP_OPTION_CW " " << cw << endl; - if (!armcc.isEmpty() && !overriddenMmpKeywords.contains(MMP_OPTION_ARMCC)) + if (!armcc.isEmpty()) t << MMP_OPTION_ARMCC " " << armcc << endl; - if (!gcce.isEmpty() && !overriddenMmpKeywords.contains(MMP_OPTION_GCCE)) + if (!gcce.isEmpty()) t << MMP_OPTION_GCCE " " << gcce << endl; - if (!cwlink.isEmpty() && !overriddenMmpKeywords.contains(MMP_LINKEROPTION_CW)) + if (!cwlink.isEmpty()) t << MMP_LINKEROPTION_CW " " << cwlink << endl; - if (!armlink.isEmpty() && !overriddenMmpKeywords.contains(MMP_LINKEROPTION_ARMCC)) + if (!armlink.isEmpty()) t << MMP_LINKEROPTION_ARMCC " " << armlink << endl; - if (!gccelink.isEmpty() && !overriddenMmpKeywords.contains(MMP_LINKEROPTION_GCCE)) + if (!gccelink.isEmpty()) t << MMP_LINKEROPTION_GCCE " " << gccelink << endl; - t << endl; + t << endl; } void SymbianMakefileGenerator::writeMmpFileBinaryVersionPart(QTextStream& t) @@ -1098,7 +1153,7 @@ void SymbianMakefileGenerator::writeMmpFileBinaryVersionPart(QTextStream& t) mmpVersion = "10.0"; // Default binary version for symbian is 10.0 } - t << "VERSION " << mmpVersion << endl; + t << MMP_VERSION " " << mmpVersion << endl; } void SymbianMakefileGenerator::writeMmpFileRulesPart(QTextStream& t) @@ -1265,7 +1320,7 @@ void SymbianMakefileGenerator::writeRegRssFile(QStringList &userItems) generatedFiles << ft.fileName(); QTextStream t(&ft); t << "// ============================================================================" << endl; - t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: "; + t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; t << "// * This file is generated by qmake and should not be modified by the" << endl; t << "// * user." << endl; @@ -1274,8 +1329,7 @@ void SymbianMakefileGenerator::writeRegRssFile(QStringList &userItems) t << "#include <" << fixedTarget << ".rsg>" << endl; t << "#include " << endl; t << endl; - //t << "#include " << "\n" << endl; - t << "UID2 " << "KUidAppRegistrationResourceFile" << endl; + t << "UID2 KUidAppRegistrationResourceFile" << endl; t << "UID3 " << uid3 << endl << endl; t << "RESOURCE APP_REGISTRATION_INFO" << endl; t << "\t{" << endl; @@ -1300,7 +1354,7 @@ void SymbianMakefileGenerator::writeRssFile(QString &numberOfIcons, QString &ico generatedFiles << ft.fileName(); QTextStream t(&ft); t << "// ============================================================================" << endl; - t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: "; + t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; t << "// * This file is generated by qmake and should not be modified by the" << endl; t << "// * user." << endl; @@ -1346,7 +1400,7 @@ void SymbianMakefileGenerator::writeLocFile(QStringList &symbianLangCodes) generatedFiles << ft.fileName(); QTextStream t(&ft); t << "// ============================================================================" << endl; - t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: "; + t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; t << "// * This file is generated by qmake and should not be modified by the" << endl; t << "// * user." << endl; diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h index 2e78c46..1a20e64 100644 --- a/qmake/generators/symbian/symmake.h +++ b/qmake/generators/symbian/symmake.h @@ -96,7 +96,14 @@ protected: QString generateUID3(); void initMmpVariables(); - void checkOverridability(QStringList &overridableKeywords, QString &checkString); + void handleMmpRulesOverrides(QString &checkString, + bool &inResourceBlock, + QStringList &restrictedMmpKeywords, + const QStringList &restrictableMmpKeywords, + const QStringList &overridableMmpKeywords); + void appendKeywordIfMatchFound(QStringList &list, + const QStringList &keywordList, + QString &checkString); void writeHeader(QTextStream &t); void writeBldInfContent(QTextStream& t, bool addDeploymentExtension, const QString &iconFile); -- cgit v0.12 From 91921c880ea53a096237435ffac571a193f9c5f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 4 Dec 2009 15:34:35 +0200 Subject: QS60Style: Overwrites correct stylehint color values QS60Style overwrites correct theme colors with QCommonStyle values in QS60Style::styleHint(). In that method returned value is initialized as -1 and then if the value is still -1 after switch statement for different stylehints, the stylehint is queried from common style. Problem is that it is also getting RGB values set into return value. White color as HEX is FFFFFF and -1 as HEX is FFFFFF. So, if theme color is white for Group Text title, or for Grid lines, color is asked from QCommonStyle instead. As a fix, in 'default' case ask from QCommonStyle. Also, use RGBA instead of RGB values. Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 5f7ec69..aece73c 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2343,10 +2343,10 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w int retValue = -1; switch (sh) { case SH_Table_GridLineColor: - retValue = QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors,2,0).rgb(); + retValue = int(QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors,2,0).rgba()); break; case SH_GroupBox_TextLabelColor: - retValue = QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors,6,0).rgb(); + retValue = int(QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors,6,0).rgba()); break; case SH_ScrollBar_ScrollWhenPointerLeavesControl: retValue = true; @@ -2402,10 +2402,9 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w retValue = QFormLayout::WrapLongRows; break; default: + retValue = QCommonStyle::styleHint(sh, opt, widget, hret); break; } - if (retValue == -1) - retValue = QCommonStyle::styleHint(sh, opt, widget, hret); return retValue; } -- cgit v0.12 From 63318f834671552add4fd584e5aae80523b5f007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 4 Dec 2009 16:05:34 +0200 Subject: Button and LineEdit/TextEdit theme colors are incorrect QS60Style fetches incorrect color values from theme when using buttons and lineEdits/TextEdits. New values are the same as in native widgets (verified from native widget code). Task-number: QTBUG-6364 Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index aece73c..be4f15a 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -654,7 +654,7 @@ void QS60StylePrivate::setThemePalette(QPalette *palette) const palette->setColor(QPalette::WindowText, s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); palette->setColor(QPalette::ButtonText, - s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); + s60Color(QS60StyleEnums::CL_QsnTextColors, 20, 0)); palette->setColor(QPalette::Text, s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); palette->setColor(QPalette::ToolTipText, @@ -753,13 +753,15 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const QApplication::setPalette(widgetPalette, "QTableView"); widgetPalette = *palette; + widgetPalette.setColor(QPalette::Text, + s60Color(QS60StyleEnums::CL_QsnTextColors, 27, 0)); widgetPalette.setColor(QPalette::HighlightedText, s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); QApplication::setPalette(widgetPalette, "QLineEdit"); widgetPalette = *palette; widgetPalette.setColor(QPalette::Text, - s60Color(QS60StyleEnums::CL_QsnTextColors, 34, 0)); + s60Color(QS60StyleEnums::CL_QsnTextColors, 27, 0)); widgetPalette.setColor(QPalette::HighlightedText, s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); QApplication::setPalette(widgetPalette, "QTextEdit"); -- cgit v0.12 From 91b4a40bd3cc9d004baddd9c19ced07ed37afef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Mon, 7 Dec 2009 11:44:03 +0200 Subject: Remove compilation warning from S60pixelMetrics on ARM Compiling s60pixelMetrics utility for ARMV5 urel gives two warnings: a) unused variable - Solution: removed b) transfer of control bypasses initialization (missing brackets within a switch-case) - Solution: brackets added. Reviewed-by: TrustMe --- util/s60pixelmetrics/pixel_metrics.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/util/s60pixelmetrics/pixel_metrics.cpp b/util/s60pixelmetrics/pixel_metrics.cpp index 9507c67..9ba6c8b 100644 --- a/util/s60pixelmetrics/pixel_metrics.cpp +++ b/util/s60pixelmetrics/pixel_metrics.cpp @@ -812,13 +812,12 @@ TInt PixelMetrics::PixelMetricValue(QStyle::PixelMetric metric) value = PixelMetricMenuValue(metric, mainPaneRect); break; case QStyle::PM_ButtonIconSize: + { //lets use voice recorder icons as a base //Unfortunately S60 graphics don't separate button bevel graphics from the actual icon. //Se we have no means to query the margin from bevel border to "central icon" border. //So, we need to make a estimate... - const TInt varietyForButtons = !landscape ? 0 : 1; - TAknLayoutRect vRMainRect; vRMainRect.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::main_vorec_pane() ); @@ -833,7 +832,7 @@ TInt PixelMetrics::PixelMetricValue(QStyle::PixelMetric metric) // 0.32 is the estimate how much the icon occupies of the button bevel area value = vRButtonCellGraphicsRect.Rect().Width() * 0.32; - + } break; case QStyle::PM_SmallIconSize: { -- cgit v0.12 From 245c9cc07ff1581dd126f213985c3557b2667aca Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 7 Dec 2009 14:05:01 +0200 Subject: Added dimming support for disabled softkeys in Symbian. If QAction::setEnabled(false) is called, the CBA buttons are dimmed to have visual indication about disabled state. Since enabled/disabled state of buttons in QDialogButtonBox is controlled via QPushButton::setEnabled API, and because button box content in Symbian is mapped to sofkkeys we also need to have proxy for button enabled state to forward the information for underlying QAction. Reviewed-by: Sami Merila --- src/gui/kernel/qsoftkeymanager.cpp | 5 ++++- src/gui/widgets/qdialogbuttonbox.cpp | 28 +++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 30c67f4..464a250 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -254,7 +254,10 @@ void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList &softkeys) const int underlineShortCut = QApplication::style()->styleHint(QStyle::SH_UnderlineShortcut); QString iconText = softKeyAction->iconText(); TPtrC text = qt_QString2TPtrC( underlineShortCut ? softKeyAction->text() : iconText); - QT_TRAP_THROWING(nativeContainer->SetCommandL(position, command, text)); + QT_TRAP_THROWING( + nativeContainer->SetCommandL(position, command, text); + nativeContainer->DimCommand(command, !softKeyAction->isEnabled()); + ); } } diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp index 0e859f1..56cf545 100644 --- a/src/gui/widgets/qdialogbuttonbox.cpp +++ b/src/gui/widgets/qdialogbuttonbox.cpp @@ -259,6 +259,30 @@ static const int layouts[2][5][14] = } }; +class QDialogButtonEnabledProxy : public QObject +{ +public: + QDialogButtonEnabledProxy(QObject *parent, QWidget *src, QAction *trg) : QObject(parent), source(src), target(trg) + { + source->installEventFilter(this); + } + ~QDialogButtonEnabledProxy() + { + source->removeEventFilter(this); + } + bool eventFilter(QObject *object, QEvent *event) + { + if (object == source && event->type() == QEvent::EnabledChange) { + target->setEnabled(source->isEnabled()); + } + return false; + }; +private: + QWidget *source; + QAction *target; +}; + + class QDialogButtonBoxPrivate : public QWidgetPrivate { Q_DECLARE_PUBLIC(QDialogButtonBox) @@ -548,7 +572,9 @@ void QDialogButtonBoxPrivate::addButton(QAbstractButton *button, QDialogButtonBo QObject::connect(button, SIGNAL(destroyed()), q, SLOT(_q_handleButtonDestroyed())); buttonLists[role].append(button); #ifdef QT_SOFTKEYS_ENABLED - softKeyActions.insert(button, createSoftKey(button, role)); + QAction *action = createSoftKey(button, role); + softKeyActions.insert(button, action); + new QDialogButtonEnabledProxy(action, button, action); #endif if (doLayout) layoutButtons(); -- cgit v0.12