From f602d82b542fb41099f6a1eb5a73a0e341e68fa0 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Fri, 10 Dec 2010 13:22:18 +0100 Subject: We should not cache ICO files. Otherwise first .ico file will be cached for this extension and all the other icons will have the same appearance. Reviewed-by: prasanth --- src/gui/itemviews/qfileiconprovider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp index 4748f89..570c0ab 100644 --- a/src/gui/itemviews/qfileiconprovider.cpp +++ b/src/gui/itemviews/qfileiconprovider.cpp @@ -234,7 +234,7 @@ QIcon QFileIconProviderPrivate::getWinIcon(const QFileInfo &fileInfo) const const QString fileExtension = QLatin1Char('.') + fileInfo.suffix().toUpper(); QString key; - if (fileInfo.isFile() && !fileInfo.isExecutable() && !fileInfo.isSymLink()) + if (fileInfo.isFile() && !fileInfo.isExecutable() && !fileInfo.isSymLink() && fileExtension != QLatin1String(".ICO")) key = QLatin1String("qt_") + fileExtension; QPixmap pixmap; -- cgit v0.12 From 275cf4baf5fb4c0fe28c192a1f5c295cb6032549 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 10 Dec 2010 17:01:19 +0100 Subject: QScript tests, sync the tests with the v8 branch --- tests/auto/qscriptvalue/tst_qscriptvalue.cpp | 60 +++++++++++++++++++++++++++- tests/auto/qscriptvalue/tst_qscriptvalue.h | 5 ++- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp index 5a50e49..ec33e81 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp +++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp @@ -1970,7 +1970,7 @@ void tst_QScriptValue::getSetProperty_gettersAndSetters() QCOMPARE(object.property("foo").isUndefined(), true); } -void tst_QScriptValue::getSetProperty_gettersAndSettersThrowError() +void tst_QScriptValue::getSetProperty_gettersAndSettersThrowErrorNative() { // getter/setter that throws an error QScriptEngine eng; @@ -1984,6 +1984,32 @@ void tst_QScriptValue::getSetProperty_gettersAndSettersThrowError() QVERIFY(ret.isError()); QVERIFY(eng.hasUncaughtException()); QVERIFY(ret.strictlyEquals(eng.uncaughtException())); + QCOMPARE(ret.toString(), QLatin1String("Error: get foo")); + eng.evaluate("Object"); // clear exception state... + QVERIFY(!eng.hasUncaughtException()); + object.setProperty("foo", str); + QVERIFY(eng.hasUncaughtException()); + QCOMPARE(eng.uncaughtException().toString(), QLatin1String("Error: set foo")); +} + +void tst_QScriptValue::getSetProperty_gettersAndSettersThrowErrorJS() +{ + // getter/setter that throws an error (from js function) + QScriptEngine eng; + QScriptValue str = QScriptValue(&eng, "bar"); + + eng.evaluate("o = new Object; " + "o.__defineGetter__('foo', function() { throw new Error('get foo') }); " + "o.__defineSetter__('foo', function() { throw new Error('set foo') }); "); + QScriptValue object = eng.evaluate("o"); + QVERIFY(!eng.hasUncaughtException()); + QScriptValue ret = object.property("foo"); + QEXPECT_FAIL("", "Exception thrown from js function are not returned by the JSC port", Continue); + QVERIFY(ret.isError()); + QVERIFY(eng.hasUncaughtException()); + QEXPECT_FAIL("", "Exception thrown from js function are not returned by the JSC port", Continue); + QVERIFY(ret.strictlyEquals(eng.uncaughtException())); + QCOMPARE(eng.uncaughtException().toString(), QLatin1String("Error: get foo")); eng.evaluate("Object"); // clear exception state... QVERIFY(!eng.hasUncaughtException()); object.setProperty("foo", str); @@ -2051,6 +2077,12 @@ void tst_QScriptValue::getSetProperty_gettersAndSettersChange() QVERIFY(!object.property("x").isValid()); object.setProperty("foo", num); QVERIFY(object.property("x").equals(num)); + + eng.globalObject().setProperty("object", object); + QScriptValue res = eng.evaluate("object.x = 89; var a = object.foo; object.foo = 65; a"); + QCOMPARE(res.toInt32(), 89); + QCOMPARE(object.property("x").toInt32(), 65); + QCOMPARE(object.property("foo").toInt32(), 65); } void tst_QScriptValue::getSetProperty_array() @@ -3931,4 +3963,30 @@ void tst_QScriptValue::nestedObjectToVariant() QCOMPARE(o.toVariant(), expected); } +void tst_QScriptValue::propertyFlags_data() +{ + QTest::addColumn("program"); + QTest::addColumn("expected"); + + QTest::newRow("nothing") << "" << 0u; + QTest::newRow("getter") << "o.__defineGetter__('prop', function() { return 'blah' } );\n" << uint(QScriptValue::PropertyGetter); + QTest::newRow("setter") << "o.__defineSetter__('prop', function(a) { this.setted_prop2 = a; } );\n" << uint(QScriptValue::PropertySetter); + QTest::newRow("getterSetter") << "o.__defineGetter__('prop', function() { return 'ploup' } );\n" + "o.__defineSetter__('prop', function(a) { this.setted_prop3 = a; } );\n" << uint(QScriptValue::PropertySetter|QScriptValue::PropertyGetter); + QTest::newRow("nothing2") << "o.prop = 'nothing'" << 0u; +} + +void tst_QScriptValue::propertyFlags() +{ + QFETCH(QString, program); + QFETCH(uint, expected); + QScriptEngine eng; + eng.evaluate("o = new Object;"); + eng.evaluate(program); + QScriptValue o = eng.evaluate("o"); + + QCOMPARE(uint(o.propertyFlags("prop")), expected); +} + + QTEST_MAIN(tst_QScriptValue) diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.h b/tests/auto/qscriptvalue/tst_qscriptvalue.h index 46f5526..6f55bc3 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue.h +++ b/tests/auto/qscriptvalue/tst_qscriptvalue.h @@ -127,7 +127,8 @@ private slots: void getSetProperty_resolveMode(); void getSetProperty_twoEngines(); void getSetProperty_gettersAndSetters(); - void getSetProperty_gettersAndSettersThrowError(); + void getSetProperty_gettersAndSettersThrowErrorNative(); + void getSetProperty_gettersAndSettersThrowErrorJS(); void getSetProperty_gettersAndSettersOnNative(); void getSetProperty_gettersAndSettersOnGlobalObject(); void getSetProperty_gettersAndSettersChange(); @@ -178,6 +179,8 @@ private slots: void objectId(); void nestedObjectToVariant_data(); void nestedObjectToVariant(); + void propertyFlags_data(); + void propertyFlags(); private: -- cgit v0.12 From d5efbf00631022bc81f1a630aa386272937aa34c Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 13 Dec 2010 11:40:07 +0100 Subject: --warnings --- src/gui/kernel/qplatformwindow_qpa.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qplatformwindow_qpa.h b/src/gui/kernel/qplatformwindow_qpa.h index 90bc1cb..4f6fedc 100644 --- a/src/gui/kernel/qplatformwindow_qpa.h +++ b/src/gui/kernel/qplatformwindow_qpa.h @@ -60,7 +60,7 @@ class QPlatformGLContext; class Q_GUI_EXPORT QPlatformWindow { - Q_DECLARE_PRIVATE(QPlatformWindow); + Q_DECLARE_PRIVATE(QPlatformWindow) public: QPlatformWindow(QWidget *tlw); virtual ~QPlatformWindow(); @@ -85,7 +85,7 @@ public: protected: QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QPlatformWindow); + Q_DISABLE_COPY(QPlatformWindow) }; QT_END_NAMESPACE -- cgit v0.12 From 2362debe4e0b9e7d6ba39960a0b039370783cab4 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 13 Dec 2010 16:38:00 +0100 Subject: support app-bundles with whitespace in name based on merge-request 960 by Robin Helgelin --- tools/macdeployqt/shared/shared.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/macdeployqt/shared/shared.cpp b/tools/macdeployqt/shared/shared.cpp index c7d23c0..d974f5d 100644 --- a/tools/macdeployqt/shared/shared.cpp +++ b/tools/macdeployqt/shared/shared.cpp @@ -574,9 +574,13 @@ void createDiskImage(const QString &appBundlePath) } // More dmg options can be found in the hdiutil man page. - QString options = QString("create %1.dmg -srcfolder %1.app -format UDZO -volname %1").arg(appBaseName); + QStringList options = QStringList() + << "create" << dmgName + << "-srcfolder" << appBundlePath + << "-format" << "UDZO" + << "-volname" << appBaseName; QProcess hdutil; - hdutil.start("hdiutil", options.split(' ')); + hdutil.start("hdiutil", options); hdutil.waitForFinished(-1); } -- cgit v0.12 From 7d2cdbd606c70f6fb7c41742b028d1fb227122b0 Mon Sep 17 00:00:00 2001 From: miniak Date: Mon, 13 Dec 2010 16:47:05 +0100 Subject: Fix comctl32 v6 dependency generation in Visual Studio 2005 and higher Merge-request: 2526 Reviewed-by: Joerg Bornemann --- mkspecs/win32-msvc2005/qmake.conf | 6 +++--- mkspecs/win32-msvc2008/qmake.conf | 6 +++--- mkspecs/win32-msvc2010/qmake.conf | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mkspecs/win32-msvc2005/qmake.conf b/mkspecs/win32-msvc2005/qmake.conf index aa58e30..0c79561 100644 --- a/mkspecs/win32-msvc2005/qmake.conf +++ b/mkspecs/win32-msvc2005/qmake.conf @@ -1,7 +1,7 @@ # # qmake configuration for win32-msvc2005 # -# Written for Microsoft VC2005.NET +# Written for Microsoft Visual C++ 2005 # MAKEFILE_GENERATOR = MSVC.NET @@ -53,12 +53,12 @@ QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ $< QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<< QMAKE_LINK = link -QMAKE_LFLAGS = /NOLOGO +QMAKE_LFLAGS = /NOLOGO \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\" QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF QMAKE_LFLAGS_DEBUG = /DEBUG QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE -QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\" +QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS QMAKE_LFLAGS_DLL = /DLL QMAKE_LFLAGS_LTCG = /LTCG diff --git a/mkspecs/win32-msvc2008/qmake.conf b/mkspecs/win32-msvc2008/qmake.conf index ee7b99a..24a0486 100644 --- a/mkspecs/win32-msvc2008/qmake.conf +++ b/mkspecs/win32-msvc2008/qmake.conf @@ -1,7 +1,7 @@ # # qmake configuration for win32-msvc2008 # -# Written for Microsoft VC2005.NET +# Written for Microsoft Visual C++ 2008 # MAKEFILE_GENERATOR = MSVC.NET @@ -55,12 +55,12 @@ QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ $< QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<< QMAKE_LINK = link -QMAKE_LFLAGS = /NOLOGO +QMAKE_LFLAGS = /NOLOGO \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\" QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF QMAKE_LFLAGS_DEBUG = /DEBUG QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE -QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\" +QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS QMAKE_LFLAGS_DLL = /DLL QMAKE_LFLAGS_LTCG = /LTCG diff --git a/mkspecs/win32-msvc2010/qmake.conf b/mkspecs/win32-msvc2010/qmake.conf index 44e460e..c08a74d 100644 --- a/mkspecs/win32-msvc2010/qmake.conf +++ b/mkspecs/win32-msvc2010/qmake.conf @@ -1,7 +1,7 @@ # # qmake configuration for win32-msvc2010 # -# Written for Microsoft VC2005.NET +# Written for Microsoft Visual C++ 2010 # MAKEFILE_GENERATOR = MSBUILD @@ -55,12 +55,12 @@ QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ $< QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<< QMAKE_LINK = link -QMAKE_LFLAGS = /NOLOGO +QMAKE_LFLAGS = /NOLOGO \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\" QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF QMAKE_LFLAGS_DEBUG = /DEBUG QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE -QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\" +QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS QMAKE_LFLAGS_DLL = /DLL QMAKE_LFLAGS_LTCG = /LTCG -- cgit v0.12