From 4fdb6a01b35d9cd4dc9e5e4d6682449476d68375 Mon Sep 17 00:00:00 2001 From: mread Date: Thu, 26 Aug 2010 12:20:45 +0100 Subject: fix for memory leak in QSysInfo::s60Version() A CDir was not deleted on several return paths in QSysInfo::s60Version(). This fix uses a QScopedPointer to clean up the CDir no matter what return path is taken. Reviewed-by: Simon Hausmann --- src/corelib/global/qglobal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index af35316..401af85 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1828,6 +1828,7 @@ QSysInfo::S60Version QSysInfo::s60Version() CDir* contents; TInt err = fileFinder.FindWildByDir(qt_S60Filter, qt_S60SystemInstallDir, contents); if (err == KErrNone) { + QScopedPointer contentsDeleter(contents); err = contents->Sort(EDescending|ESortByName); if (err == KErrNone && contents->Count() > 0 && (*contents)[0].iName.Length() >= 12) { TInt major = (*contents)[0].iName[9] - '0'; @@ -1850,7 +1851,6 @@ QSysInfo::S60Version QSysInfo::s60Version() } } } - delete contents; } # ifdef Q_CC_NOKIAX86 -- cgit v0.12 From 26103b69df9bdd32016f3fbab975a26c8a147ea0 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 26 Aug 2010 15:30:59 +0300 Subject: Added support for DEPLOYMENT.pkg_build_version DEPLOYMENT.pkg_build_version can be used to pad the patch version number in Symbian pkg files to allow hot-fix deployments to be done between patch releases. DEPLOYMENT.pkg_build_version accepts only values 0 - 99, as pkg patch version number has limits how large numbers it can accept. The specified number is prefixed with zero if it is single digit and then appended to patch version number. Task-number: QTBUG-13147 Reviewed-by: Janne Koskinen --- qmake/generators/symbian/symbiancommon.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index d124b02..155dbc9 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -275,6 +275,20 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB if (success) applicationVersion = QString("%1,%2,%3").arg(major).arg(minor).arg(patch); + // Append package build version number if it is set + QString pkgBuildVersion = project->first("DEPLOYMENT.pkg_build_version"); + if (!pkgBuildVersion.isEmpty()) { + success = false; + uint build = pkgBuildVersion.toUInt(&success); + if (success && build < 100) { + if (pkgBuildVersion.size() == 1) + pkgBuildVersion.prepend(QLatin1Char('0')); + applicationVersion.append(pkgBuildVersion); + } else { + fprintf(stderr, "Warning: Invalid DEPLOYMENT.pkg_build_version (%s), must be a number between 0 - 99\n", qPrintable(pkgBuildVersion)); + } + } + // Package header QString sisHeader = "; SIS header: name, uid, version\n#{\"%1\"},(%2),%3\n\n"; QString visualTarget = generator->escapeFilePath(project->first("TARGET")); -- cgit v0.12