From 4eaf761eba1ed0e9980ce5758a40c17e41510ee2 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 4 Aug 2010 11:22:00 +0300 Subject: Fix package header in cases where VERSION doesn't contain all values Missing minor or patch value from VERSION caused malformed pkg header to be generated. Task-number: QTBUG-12617 Reviewed-by: axis --- qmake/generators/symbian/symbiancommon.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index 3a4bdbc..d124b02 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -252,8 +252,30 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB tw << languageRules.join("\n") << endl; ts << languageRules.join("\n") << endl; - // name of application, UID and version - QString applicationVersion = project->first("VERSION").isEmpty() ? "1,0,0" : project->first("VERSION").replace('.', ','); + // Determine application version. If version has missing component values, + // those will default to zero. + // If VERSION is missing altogether or is invalid, use "1,0,0" + QStringList verNumList = project->first("VERSION").split('.'); + uint major = 0; + uint minor = 0; + uint patch = 0; + bool success = false; + + if (verNumList.size() > 0) { + major = verNumList[0].toUInt(&success); + if (success && verNumList.size() > 1) { + minor = verNumList[1].toUInt(&success); + if (success && verNumList.size() > 2) { + patch = verNumList[2].toUInt(&success); + } + } + } + + QString applicationVersion("1,0,0"); + if (success) + applicationVersion = QString("%1,%2,%3").arg(major).arg(minor).arg(patch); + + // 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 From d444ca3cbc4fc3a923e67755d62d52bd5186f2f0 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 4 Aug 2010 10:53:31 +0200 Subject: Skipped rcomp check on Raptor. This is necessary in the case where Qt is built as part of the platform, where configure will run before all the tools are built. RevBy: Thomas Zander --- configure | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/configure b/configure index c322634..d4d75a7 100755 --- a/configure +++ b/configure @@ -4849,23 +4849,24 @@ case "$XPLATFORM" in *symbian*) exit 1 fi - # the main commands needed to compile; - (cd config.tests/symbian - mkdir -p rcomp - cd rcomp - rm -f rcomp_test.rsg - touch rcomp_test.rpp rcomp_test.rsc rcomp_test.rss - rcomp -u -m045,046,047 -s./rcomp_test.rpp -o./rcomp_test.rsc -h./rcomp_test.rsg -i./rcomp_test.rss 2>&1 > /dev/null - if test ! -f rcomp_test.rsg; then - echo "Finding a working rcomp in your PATH failed." - echo "Fatal error. Make sure you have the epoc tools working and in your PATH"; - exit 1; - fi - ) - - # compile a simple main that uses printf if ! echo $XPLATFORM | grep symbian-sbsv2 > /dev/null; then # Raptor does not support configure tests. + + # the main commands needed to compile; + (cd config.tests/symbian + mkdir -p rcomp + cd rcomp + rm -f rcomp_test.rsg + touch rcomp_test.rpp rcomp_test.rsc rcomp_test.rss + rcomp -u -m045,046,047 -s./rcomp_test.rpp -o./rcomp_test.rsc -h./rcomp_test.rsg -i./rcomp_test.rss 2>&1 > /dev/null + if test ! -f rcomp_test.rsg; then + echo "Finding a working rcomp in your PATH failed." + echo "Fatal error. Make sure you have the epoc tools working and in your PATH"; + exit 1; + fi + ) + + # compile a simple main that uses printf if ! "$symbiantests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/symbian/simple "simple" $L_FLAGS $I_FLAGS $l_FLAGS then echo "Testing your compiler failed. Could not compile a simple application." -- cgit v0.12 From ad1b1fc8c19064601f993010c18adf0a01c5cf92 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Wed, 4 Aug 2010 13:51:34 +0100 Subject: runonphone - catch ctrl-c and terminate remote process before exit Trap SIGINT, SIGTERM, SIGHUP, SIGBREAK, SIGQUIT On receiving one of these signals, we first untrap them (so runonphone can be killed by a 2nd ctrl-c if needed), and send a terminate to the TRK launcher. This will kill the remote process if it's running, then disconnect from TRK cleanly. Task-number: QTBUG-12444 Reviewed-by: axis --- tools/runonphone/main.cpp | 3 + tools/runonphone/ossignalconverter.cpp | 120 +++++++++++++++++++++++++++++++++ tools/runonphone/ossignalconverter.h | 61 +++++++++++++++++ tools/runonphone/ossignalconverter_p.h | 71 +++++++++++++++++++ tools/runonphone/runonphone.pro | 7 +- 5 files changed, 260 insertions(+), 2 deletions(-) create mode 100644 tools/runonphone/ossignalconverter.cpp create mode 100644 tools/runonphone/ossignalconverter.h create mode 100644 tools/runonphone/ossignalconverter_p.h diff --git a/tools/runonphone/main.cpp b/tools/runonphone/main.cpp index 7767e4b..93b087b 100644 --- a/tools/runonphone/main.cpp +++ b/tools/runonphone/main.cpp @@ -51,6 +51,7 @@ #include "trksignalhandler.h" #include "serenum.h" +#include "ossignalconverter.h" void printUsage(QTextStream& outstream, QString exeName) { @@ -235,6 +236,8 @@ int main(int argc, char *argv[]) QObject::connect(&handler, SIGNAL(getRegistersAndCallStack(uint,uint)), launcher.data(), SLOT(getRegistersAndCallStack(uint,uint))); QObject::connect(launcher.data(), SIGNAL(finished()), &handler, SLOT(finished())); + QObject::connect(OsSignalConverter::instance(), SIGNAL(terminate()), launcher.data(), SLOT(terminate()), Qt::QueuedConnection); + QTimer timer; timer.setSingleShot(true); QObject::connect(&timer, SIGNAL(timeout()), &handler, SLOT(timeout())); diff --git a/tools/runonphone/ossignalconverter.cpp b/tools/runonphone/ossignalconverter.cpp new file mode 100644 index 0000000..6554e9f --- /dev/null +++ b/tools/runonphone/ossignalconverter.cpp @@ -0,0 +1,120 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "ossignalconverter_p.h" +#include +#include + +Q_GLOBAL_STATIC(OsSignalConverter, osSignalConverter); + +OsSignalConverter* OsSignalConverter::instance() +{ + return osSignalConverter(); +} + +OsSignalConverter::OsSignalConverter() +: d(new OsSignalConverterPrivate(this)) +{ +}; + +OsSignalConverter::~OsSignalConverter() +{ +} + +OsSignalConverterPrivate::OsSignalConverterPrivate(OsSignalConverter* owner) +: QObject(owner), q(owner), poller(new QTimer(this)) +{ + trap(); + connect(poller, SIGNAL(timeout()), this, SLOT(poll())); + poller->start(1000); +} + +OsSignalConverterPrivate::~OsSignalConverterPrivate() +{ + untrap(); +} + +void OsSignalConverterPrivate::trap() +{ + signal(SIGINT, handler); + signal(SIGTERM, handler); +#ifdef SIGBREAK + signal(SIGBREAK, handler); +#endif +#ifdef SIGHUP + signal(SIGHUP, handler); +#endif +#ifdef SIGQUIT + signal(SIGQUIT, handler); +#endif +} + +void OsSignalConverterPrivate::untrap() +{ + signal(SIGINT, SIG_DFL); + signal(SIGTERM, SIG_DFL); +#ifdef SIGBREAK + signal(SIGBREAK, SIG_DFL); +#endif +#ifdef SIGHUP + signal(SIGHUP, SIG_DFL); +#endif +#ifdef SIGQUIT + signal(SIGQUIT, SIG_DFL); +#endif +} + +void OsSignalConverterPrivate::handler(int sig) +{ + untrap(); //allow 2nd ctrl-c to really kill us + terminateRequest = sig; +} + +void OsSignalConverterPrivate::poll() +{ + if (terminateRequest) { + fprintf(stderr, "\n*** caught signal %d, terminating ***\n", terminateRequest); + poller->stop(); + emit q->terminate(); + } +} + +sig_atomic_t OsSignalConverterPrivate::terminateRequest; diff --git a/tools/runonphone/ossignalconverter.h b/tools/runonphone/ossignalconverter.h new file mode 100644 index 0000000..f53f3c1 --- /dev/null +++ b/tools/runonphone/ossignalconverter.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef OSSIGNALCONVERTER_H +#define OSSIGNALCONVERTER_H +#include + +class OsSignalConverter : public QObject +{ + friend class OsSignalConverterPrivate; + Q_OBJECT +public: + static OsSignalConverter* instance(); + OsSignalConverter(); + ~OsSignalConverter(); +signals: + //emitted when this process is asked to quit, e.g. by SIGINT + void terminate(); +private: + OsSignalConverterPrivate *d; +}; + +#endif // OSSIGNALCONVERTER_H diff --git a/tools/runonphone/ossignalconverter_p.h b/tools/runonphone/ossignalconverter_p.h new file mode 100644 index 0000000..dddc9ca --- /dev/null +++ b/tools/runonphone/ossignalconverter_p.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef OSSIGNALCONVERTER_P_H +#define OSSIGNALCONVERTER_P_H +#include "ossignalconverter.h" +#include + +class QTimer; +class OsSignalConverterPrivate : public QObject +{ + Q_OBJECT +public: + OsSignalConverterPrivate(OsSignalConverter* owner); + ~OsSignalConverterPrivate(); +private: + + static void trap(); + static void untrap(); + static void handler(int signal); + +private slots: + + void poll(); + +private: + + OsSignalConverter* q; + static sig_atomic_t terminateRequest; + QTimer *poller; +}; + +#endif // OSSIGNALCONVERTER_P_H diff --git a/tools/runonphone/runonphone.pro b/tools/runonphone/runonphone.pro index 0c63723..15dff51 100644 --- a/tools/runonphone/runonphone.pro +++ b/tools/runonphone/runonphone.pro @@ -7,10 +7,13 @@ CONFIG -= app_bundle include(symbianutils/symbianutils.pri) SOURCES += main.cpp \ - trksignalhandler.cpp + trksignalhandler.cpp \ + ossignalconverter.cpp HEADERS += trksignalhandler.h \ - serenum.h + serenum.h \ + ossignalconverter.h \ + ossignalconverter_p.h DEFINES += SYMBIANUTILS_INCLUDE_PRI -- cgit v0.12 From 18daa683a389abd42d71fd616e271b74ce749efc Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Thu, 8 Jul 2010 13:49:43 +0200 Subject: Add support for -runtimegraphicssystem configure option It has been requested that we provide a configuration option to specify the default "inner" graphics system that should be used when the runtime graphics system is in use. The argument specified to the option is written to the qconfig.h as QT_DEFAULT_RUNTIME_SYSTEM and this is used to instantiate the default graphics system that will be used by the runtime graphics system. Reviewed-by: Gunnar Sletta --- configure | 28 +++++++++++++++++++++++++++ configure.exe | Bin 1317888 -> 1309696 bytes src/gui/painting/qgraphicssystem_runtime.cpp | 9 ++++++--- tools/configure/configureapp.cpp | 16 +++++++++++---- 4 files changed, 46 insertions(+), 7 deletions(-) diff --git a/configure b/configure index d4d75a7..229611b 100755 --- a/configure +++ b/configure @@ -794,6 +794,7 @@ OPT_VERBOSE=no OPT_HELP= CFG_SILENT=no CFG_GRAPHICS_SYSTEM=default +CFG_RUNTIME_SYSTEM= CFG_ALSA=auto CFG_PULSEAUDIO=auto CFG_COREWLAN=auto @@ -1036,6 +1037,11 @@ while [ "$#" -gt 0 ]; do shift VAL=$1 ;; + -runtimegraphicssystem) + VAR="runtimegraphicssystem" + shift + VAL=$1 + ;; -qtlibinfix) VAR="qtlibinfix" shift @@ -1280,11 +1286,18 @@ while [ "$#" -gt 0 ]; do CFG_GRAPHICS_SYSTEM="openvg" elif [ "$VAL" = "raster" ]; then CFG_GRAPHICS_SYSTEM="raster" + elif [ "$VAL" = "runtime" ]; then + CFG_GRAPHICS_SYSTEM="runtime" else UNKNOWN_OPT=yes fi fi ;; + runtimegraphicssystem) + if [ "$VAL" != "runtime" ]; then + CFG_RUNTIME_SYSTEM="$VAL" + fi + ;; qvfb) # left for commandline compatibility, not documented if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then @@ -3677,6 +3690,8 @@ cat << EOF -graphicssystem Sets an alternate graphics system. Available options are: raster - Software rasterizer opengl - Rendering via OpenGL, Experimental! + openvg - Rendering via OpenVG, Experimental! + EOF fi cat << EOF @@ -6363,6 +6378,11 @@ if [ "$CFG_GRAPHICS_SYSTEM" = "openvg" ] && [ "$CFG_OPENVG" = "no" ]; then CFG_GRAPHICS_SYSTEM=default fi +if [ -n "$CFG_RUNTIME_SYSTEM" -a "$CFG_GRAPHICS_SYSTEM" != "runtime" ] || [ "$CFG_RUNTIME_SYSTEM" = "runtime" ]; then + echo "Argument to -runtimegraphicssystem is invalid so ignoring..." + CFG_RUNTIME_SYSTEM= +fi + if [ "$CFG_PTMALLOC" != "no" ]; then # build ptmalloc, copy .a file to lib/ echo "Building ptmalloc. Please wait..." @@ -7666,6 +7686,7 @@ if [ "$PLATFORM_QWS" != "yes" ]; then [ "$CFG_GRAPHICS_SYSTEM" = "raster" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_RASTER" [ "$CFG_GRAPHICS_SYSTEM" = "opengl" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_OPENGL" [ "$CFG_GRAPHICS_SYSTEM" = "openvg" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_OPENVG" + [ "$CFG_GRAPHICS_SYSTEM" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_RUNTIME" fi # X11/Unix/Mac only configs @@ -7779,6 +7800,13 @@ cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF EOF fi +if [ -n "$CFG_RUNTIME_SYSTEM" ]; then +cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF +#define QT_DEFAULT_RUNTIME_SYSTEM "$CFG_RUNTIME_SYSTEM" + +EOF +fi + # avoid unecessary rebuilds by copying only if qconfig.h has changed if cmp -s "$outpath/src/corelib/global/qconfig.h" "$outpath/src/corelib/global/qconfig.h.new"; then rm -f "$outpath/src/corelib/global/qconfig.h.new" diff --git a/configure.exe b/configure.exe index 6dfd14e48..220e605 100755 Binary files a/configure.exe and b/configure.exe differ diff --git a/src/gui/painting/qgraphicssystem_runtime.cpp b/src/gui/painting/qgraphicssystem_runtime.cpp index 3438137..568f4d7 100644 --- a/src/gui/painting/qgraphicssystem_runtime.cpp +++ b/src/gui/painting/qgraphicssystem_runtime.cpp @@ -346,11 +346,14 @@ QRuntimeGraphicsSystem::QRuntimeGraphicsSystem() QApplicationPrivate::graphics_system_name = QLatin1String("runtime"); QApplicationPrivate::runtime_graphics_system = true; +#ifdef QT_DEFAULT_RUNTIME_SYSTEM + m_graphicsSystemName = QLatin1String(QT_DEFAULT_RUNTIME_SYSTEM); + if (m_graphicsSystemName.isNull()) +#endif + m_graphicsSystemName = QLatin1String("raster"); + #ifdef Q_OS_SYMBIAN - m_graphicsSystemName = QLatin1String("openvg"); m_windowSurfaceDestroyPolicy = DestroyAfterFirstFlush; -#else - m_graphicsSystemName = QLatin1String("raster"); #endif m_graphicsSystem = QGraphicsSystemFactory::create(m_graphicsSystemName); diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index b7de052..14b67a0 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1159,6 +1159,13 @@ void Configure::parseCmdLine() dictionary["GRAPHICS_SYSTEM"] = configCmdLine.at(i); } + else if (configCmdLine.at(i) == "-runtimegraphicssystem") { + ++i; + if (i == argCount) + break; + dictionary["RUNTIME_SYSTEM"] = configCmdLine.at(i); + } + else if (configCmdLine.at(i).indexOf(QRegExp("^-(en|dis)able-")) != -1) { // Scan to see if any specific modules and drivers are enabled or disabled for (QStringList::Iterator module = modules.begin(); module != modules.end(); ++module) { @@ -1624,7 +1631,7 @@ bool Configure::displayHelp() "[-phonon] [-no-phonon-backend] [-phonon-backend]\n" "[-no-multimedia] [-multimedia] [-no-audio-backend] [-audio-backend]\n" "[-no-script] [-script] [-no-scripttools] [-scripttools]\n" - "[-no-webkit] [-webkit] [-graphicssystem raster|opengl|openvg|runtime]\n\n", 0, 7); + "[-no-webkit] [-webkit] [-graphicssystem raster|opengl|openvg]\n\n", 0, 7); desc("Installation options:\n\n"); @@ -1729,9 +1736,7 @@ bool Configure::displayHelp() "Available values for :"); desc("GRAPHICS_SYSTEM", "raster", "", " raster - Software rasterizer", ' '); desc("GRAPHICS_SYSTEM", "opengl", "", " opengl - Using OpenGL acceleration, experimental!", ' '); - desc("GRAPHICS_SYSTEM", "openvg", "", " openvg - Using OpenVG acceleration, experimental!", ' '); - desc("GRAPHICS_SYSTEM", "runtime", "", " runtime - Runtime switching of graphics sytems", ' '); - + desc("GRAPHICS_SYSTEM", "openvg", "", " openvg - Using OpenVG acceleration, experimental!\n", ' '); desc( "-help, -h, -?", "Display this information.\n"); @@ -3025,6 +3030,9 @@ void Configure::generateConfigfiles() tmpStream << endl << "// Compile time features" << endl; tmpStream << "#define QT_ARCH_" << dictionary["ARCHITECTURE"].toUpper() << endl; + if (dictionary["GRAPHICS_SYSTEM"] == "runtime" && dictionary["RUNTIME_SYSTEM"] != "runtime") + tmpStream << "#define QT_DEFAULT_RUNTIME_SYSTEM \"" << dictionary["RUNTIME_SYSTEM"] << "\"" << endl; + QStringList qconfigList; if (dictionary["STL"] == "no") qconfigList += "QT_NO_STL"; if (dictionary["STYLE_WINDOWS"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWS"; -- cgit v0.12