From b9ab21b03dfebc7c5f8b4cbc2fdd2b880c7d9f99 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Thu, 30 Sep 2010 11:34:48 +0300 Subject: QS60Style: Possible NULL pointer use when drawing frame QS60Style::drawControl casts QStyleOption pointer to QStyleOptionFrame, yet never checks if the orginal pointer was NULL or not. The casted pointer is then used to fetch palette information from style option. Thus, this might lead to crash. Reviewed-by: Miikka Heikkinen --- src/gui/styles/qs60style.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index bafc5f3..3a01f3f 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2001,7 +2001,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, case CE_ShapedFrame: if (const QTextEdit *textEdit = qobject_cast(widget)) { const QStyleOptionFrame *frame = qstyleoption_cast(option); - if (QS60StylePrivate::canDrawThemeBackground(frame->palette.base(), widget)) + if (frame && QS60StylePrivate::canDrawThemeBackground(frame->palette.base(), widget)) QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_Editor, painter, option->rect, flags); else QCommonStyle::drawControl(element, option, painter, widget); -- cgit v0.12 From 0725abc4607755833a1eb7cb9e083add48d03a88 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 30 Sep 2010 10:42:21 +0300 Subject: Fix QApplication::desktop()->availableGeometry() for Symbian Since screen geometry changes before client area geometry is changed in Eikon, we need to send two resize events, one for screen area change and one for client area change. Note that the correct way to detect client area change in applications is to connect to QApplication::desktop() signal workAreaResized(int) instead of filtering for resize events meant for QDesktopWidget. Task-number: QTBUG-14058 Reviewed-by: Jason Barron --- src/gui/kernel/qapplication_s60.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 2be3ed3..1127c84 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -673,6 +673,9 @@ void QSymbianControl::HandleStatusPaneSizeChange() { QS60MainAppUi *s60AppUi = static_cast(S60->appUi()); s60AppUi->HandleStatusPaneSizeChange(); + // Send resize event to trigger desktopwidget workAreaResized signal + QResizeEvent e(qt_desktopWidget->size(), qt_desktopWidget->size()); + QApplication::sendEvent(qt_desktopWidget, &e); } #endif -- cgit v0.12 From 6d5309c2fbdbf15948b430de103f393c5af5b7cd Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 30 Sep 2010 16:11:43 +0300 Subject: Added support for unsigned smart installer package creation in Symbian Make target "unsigned_installer_sis" can now be used to create unsigned smart installer sis. The contained application sis will also be unsigned. Task-number: QTBUG-13902 Reviewed-by: axis --- bin/createpackage.pl | 27 +++++++++++++++++++++++++-- doc/src/platforms/symbian-introduction.qdoc | 2 ++ mkspecs/features/symbian/sis_targets.prf | 24 ++++++++++++++++++++++-- 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/bin/createpackage.pl b/bin/createpackage.pl index 85be5d3..41ba2e3 100755 --- a/bin/createpackage.pl +++ b/bin/createpackage.pl @@ -148,6 +148,10 @@ my $certfilepath = abs_path(dirname($certfile)); my $templatepkg = $ARGV[0]; my $targetplatform = lc $ARGV[1]; +if ($targetplatform eq "") { + $targetplatform = "-"; +} + my @tmpvalues = split('-', $targetplatform); my $target; $target = $tmpvalues[0] or $target = ""; @@ -179,11 +183,11 @@ $passphrase = $ARGV[4] or $passphrase = ""; my $pkgoutputbasename = $templatepkg; my $preservePkgOutput = ""; $pkgoutputbasename =~ s/_template/_$targetplatform/g; +$pkgoutputbasename =~ s/_installer\.pkg/_installer___temp\.pkg/g; if ($pkgoutputbasename eq $templatepkg) { $preservePkgOutput = "1"; } $pkgoutputbasename =~ s/\.pkg//g; -$pkgoutputbasename = $pkgoutputbasename; # Store output file names to variables my $pkgoutput = $pkgoutputbasename.".pkg"; @@ -191,6 +195,7 @@ my $sisoutputbasename; if ($signed_sis_name eq "") { $sisoutputbasename = $pkgoutputbasename; $sisoutputbasename =~ s/_$targetplatform//g; + $sisoutputbasename =~ s/_installer___temp/_installer/g; $signed_sis_name = $sisoutputbasename.".sis"; } else { $sisoutputbasename = $signed_sis_name; @@ -201,6 +206,16 @@ if ($signed_sis_name eq "") { } } +my $installer_unsigned_app_sis_name = ""; +my $installer_app_sis_name = ""; + +if ($templatepkg =~ m/_installer\.pkg$/i && $onlyUnsigned) { + $installer_unsigned_app_sis_name = $templatepkg; + $installer_unsigned_app_sis_name =~ s/_installer.pkg$/_unsigned.sis/i; + $installer_app_sis_name = $installer_unsigned_app_sis_name; + $installer_app_sis_name =~ s/_unsigned.sis$/.sis/; +} + my $unsigned_sis_name = $sisoutputbasename."_unsigned.sis"; my $stub_sis_name = $sisoutputbasename.".sis"; @@ -271,7 +286,9 @@ if (length($certfile)) { # Remove any existing .sis packages unlink $unsigned_sis_name; -unlink $signed_sis_name; +if (!$onlyUnsigned) { + unlink $signed_sis_name; +} if (!$preservePkgOutput) { unlink $pkgoutput; } @@ -296,6 +313,10 @@ if (m/\$\(PLATFORM\)/) { s/\$\(PLATFORM\)/$platform/gm; s/\$\(TARGET\)/$target/gm; +if ($installer_unsigned_app_sis_name ne "") { + s/$installer_app_sis_name\"/$installer_unsigned_app_sis_name\"/; +} + #write the output open( OUTPUT, ">$pkgoutput" ) or die "ERROR: '$pkgoutput' $!"; print OUTPUT $_; @@ -347,6 +368,7 @@ if($stub) { if (!$preservePkgOutput) { unlink $pkgoutput; } + print ("\n"); exit; } @@ -388,6 +410,7 @@ if($stub) { # Lets leave the generated PKG for problem solving purposes print ("\nSIS creation failed!\n"); } + print ("\n"); } #end of file diff --git a/doc/src/platforms/symbian-introduction.qdoc b/doc/src/platforms/symbian-introduction.qdoc index fafe007..9bf5c72 100644 --- a/doc/src/platforms/symbian-introduction.qdoc +++ b/doc/src/platforms/symbian-introduction.qdoc @@ -144,6 +144,8 @@ Smart installer will attempt to download missing dependencies in addition to just installing the application. + \row \o \c unsigned_installer_sis \o Create unsigned \l{Smart Installer}{smart installer} + \c .sis file for project. \row \o \c stub_sis \o Create a stub sis to allow upgradability of projects that are deployed in ROM \endtable diff --git a/mkspecs/features/symbian/sis_targets.prf b/mkspecs/features/symbian/sis_targets.prf index 673127e..b145263 100644 --- a/mkspecs/features/symbian/sis_targets.prf +++ b/mkspecs/features/symbian/sis_targets.prf @@ -73,6 +73,17 @@ equals(GENERATE_SIS_TARGETS, true) { ok_installer_sis_target.commands = createpackage.bat $(QT_SIS_OPTIONS) $${baseTarget}_installer.pkg - \ $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) + unsigned_installer_sis_target.target = unsigned_installer_sis + unsigned_installer_sis_target.commands = $(if $(wildcard $${baseTarget}_installer.pkg), \ + $(MAKE) -f $(MAKEFILE) ok_unsigned_installer_sis \ + , \ + $(MAKE) -f $(MAKEFILE) fail_sis_nopkg \ + ) + unsigned_installer_sis_target.depends = unsigned_sis + + ok_unsigned_installer_sis_target.target = ok_unsigned_installer_sis + ok_unsigned_installer_sis_target.commands = createpackage $(QT_SIS_OPTIONS) -o $${baseTarget}_installer.pkg + fail_sis_nopkg_target.target = fail_sis_nopkg fail_sis_nopkg_target.commands = "$(error PKG file does not exist, 'sis' and 'installer_sis' target are only supported for executables or projects with DEPLOYMENT statement)" @@ -105,6 +116,8 @@ equals(GENERATE_SIS_TARGETS, true) { target_sis_target \ installer_sis_target \ ok_installer_sis_target \ + unsigned_installer_sis_target \ + ok_unsigned_installer_sis_target \ fail_sis_nopkg_target \ fail_sis_nocache_target \ stub_sis_target \ @@ -156,15 +169,22 @@ equals(GENERATE_SIS_TARGETS, true) { $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) installer_sis_target.depends = sis + unsigned_installer_sis_target.target = unsigned_installer_sis + unsigned_installer_sis_target.commands = $$QMAKE_CREATEPACKAGE $(QT_SIS_OPTIONS) -o $${baseTarget}_installer.pkg + unsigned_installer_sis_target.depends = unsigned_sis + !isEmpty(sis_destdir):!equals(sis_destdir, "."):!equals(sis_destdir, "./") { sis_target.commands += && $$QMAKE_MOVE $${baseTarget}.sis $$sis_destdir - installer_sis_target.commands += && $$QMAKE_MOVE $${baseTarget}.sis $$sis_destdir + unsigned_sis_target.commands += && $$QMAKE_MOVE $${baseTarget}_unsigned.sis $$sis_destdir + installer_sis_target.commands += && $$QMAKE_MOVE $${baseTarget}_installer.sis $$sis_destdir + unsigned_installer_sis_target.commands += && $$QMAKE_MOVE $${baseTarget}_unsigned_installer.sis $$sis_destdir } QMAKE_EXTRA_TARGETS += sis_target \ unsigned_sis_target \ target_sis_target \ - installer_sis_target + installer_sis_target \ + unsigned_installer_sis_target QMAKE_DISTCLEAN += $${sis_destdir}/$${baseTarget}.sis } -- cgit v0.12