diff options
Diffstat (limited to 'src/plugins')
220 files changed, 104 insertions, 19133 deletions
diff --git a/src/plugins/debugger/README b/src/plugins/debugger/README index a3e17e08403..fb11f55a3a4 100644 --- a/src/plugins/debugger/README +++ b/src/plugins/debugger/README @@ -7,8 +7,8 @@ DebuggerManager who is responsible for "doing the work". The DebuggerManager creates all DebuggerEngines, and has zero or one "current" Engine. Engines represent an interface to a "native" debugger. -Right now there are engines for gdb (used for C++ on Linux, Mac, Windows/MinGW, -Maemo and Symbian), for cdb (used for C++ on Windows/MSVC) and "script" (used +Right now there are engines for gdb (used for C++ on Linux, Mac, Windows/MinGW +and Maemo), for cdb (used for C++ on Windows/MSVC) and "script" (used for JavaScript on all platforms). The GdbEngine has different "Adapters" to cope with the variety of environments @@ -28,13 +28,9 @@ for JavaScript on all platforms). RemoteGdbAdapter is used to talk to gdbserver running on Linux. - TrkGdbAdapter is used to talk to Symbian devices using the gdb protocol and - the gdb serial protocol between gdb and the Adapter and the TRK protocol - between the adapter and AppTRK running on the device. - Gdb comes in main two flavours: with or without Python. The Python version is preferred, but it is not available on Mac and on older versions of Linux. - On Windows, Symbian and Maemo we only support the Python version. + On Windows and Maemo we only support the Python version. The non-Python versions use the compiled version of the debugging helpers, that needs to be enabled in the Qt4 Versions dialog, the Python version use @@ -50,24 +46,24 @@ for JavaScript on all platforms). Per platform the situation for C++ debugging looks like: [Helper loading strategy: /i - injected, /p - preload, /- not available] - Symbian Maemo Linux Mac Windows - MinGW MSVC + Maemo Linux Mac Windows + MinGW MSVC -Engine: gdb gdb gdb gdb gdb cdb +Engine: gdb gdb gdb gdb cdb -Python: yes yes yes no no no (not/appl) +Python: yes yes no no no (not/appl) -Adapters: trk remote term term/i term/i term term/i - plain plain/p plain/i plain plain/i - attach attach/i attach/i attach attach/i - remote attach/- remote/- remote +Adapters: remote term term/i term/i term term/i + plain plain/p plain/i plain plain/i + attach attach/i attach/i attach attach/i + remote attach/- remote/- remote Minimum -supported FSF FSF FSF FSF Apple FSF - -version: 7.1 7.1 7.1 6.8 1344 7.2 - (no python) +supported FSF FSF FSF Apple FSF - +version: 7.1 7.1 6.8 1344 7.2 + (no python) -Version FSF FSF FSF (XCode) FSF - -in SDK: 7.2 7.1 7.2 7.2 - (no python) +Version FSF FSF (XCode) FSF - +in SDK: 7.1 7.2 7.2 + (no python) diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index 576a0e0df7a..b0d9094436e 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -13,7 +13,6 @@ QtcPlugin { Depends { name: "ProjectExplorer" } Depends { name: "TextEditor" } Depends { name: "CPlusPlus" } - Depends { name: "symbianutils" } Depends { name: "QmlJS" } Depends { name: "QmlDebug" } Depends { name: "QtcSsh" } @@ -163,8 +162,6 @@ QtcPlugin { "gdb/abstractplaingdbadapter.cpp", "gdb/abstractplaingdbadapter.h", "gdb/attachgdbadapter.h", - "gdb/codagdbadapter.cpp", - "gdb/codagdbadapter.h", "gdb/coregdbadapter.cpp", "gdb/coregdbadapter.h", "gdb/gdbengine.cpp", @@ -182,8 +179,6 @@ QtcPlugin { "gdb/remotegdbserveradapter.h", "gdb/remoteplaingdbadapter.cpp", "gdb/remoteplaingdbadapter.h", - "gdb/symbian.cpp", - "gdb/symbian.h", "gdb/termgdbadapter.h", "gdb/attachgdbadapter.cpp", "gdb/classicgdbengine.cpp", diff --git a/src/plugins/debugger/debugger_dependencies.pri b/src/plugins/debugger/debugger_dependencies.pri index d6cb1671060..732954b7278 100644 --- a/src/plugins/debugger/debugger_dependencies.pri +++ b/src/plugins/debugger/debugger_dependencies.pri @@ -5,6 +5,5 @@ include(../../plugins/projectexplorer/projectexplorer.pri) include(../../plugins/texteditor/texteditor.pri) include(../../libs/cplusplus/cplusplus.pri) include(../../libs/utils/utils.pri) -include(../../libs/symbianutils/symbianutils.pri) include(../../libs/qmljs/qmljs.pri) include(../../libs/ssh/ssh.pri) diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 21390100d19..8000bda8da6 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -179,8 +179,8 @@ \brief Base class of a debugger engine. Note: the Debugger process itself and any helper processes like - gdbserver, the CODA client etc are referred to as 'Engine', - whereas the debugged process is referred to as 'Inferior'. + gdbserver are referred to as 'Engine', whereas the debugged process + is referred to as 'Inferior'. Transitions marked by '---' are done in the individual engines. Transitions marked by '+-+' are done in the base DebuggerEngine. @@ -2465,12 +2465,6 @@ static QString formatStartParameters(DebuggerStartParameters &sp) if (!sp.workingDirectory.isEmpty()) str << "Directory: " << QDir::toNativeSeparators(sp.workingDirectory) << '\n'; - if (sp.executableUid) { - str << "UID: 0x"; - str.setIntegerBase(16); - str << sp.executableUid << '\n'; - str.setIntegerBase(10); - } } QString cmd = sp.debuggerCommand; if (!cmd.isEmpty()) diff --git a/src/plugins/debugger/debuggerstartparameters.h b/src/plugins/debugger/debuggerstartparameters.h index 457e0bf272b..74c7e2d5599 100644 --- a/src/plugins/debugger/debuggerstartparameters.h +++ b/src/plugins/debugger/debuggerstartparameters.h @@ -71,9 +71,6 @@ public: remoteSetupNeeded(false), startMode(NoStartMode), closeMode(KillAtClose), - executableUid(0), - communicationChannel(CommunicationChannelTcpIp), - serverPort(0), testReceiver(0), testCallback(0), testCase(0) @@ -132,12 +129,6 @@ public: DebuggerStartMode startMode; DebuggerCloseMode closeMode; - // For Symbian debugging. - quint32 executableUid; - CommunicationChannel communicationChannel; - QString serverAddress; - quint16 serverPort; - // For QNX debugging QString remoteExecutable; diff --git a/src/plugins/debugger/gdb/classicgdbengine.cpp b/src/plugins/debugger/gdb/classicgdbengine.cpp index b775b6e815b..bc227242aad 100644 --- a/src/plugins/debugger/gdb/classicgdbengine.cpp +++ b/src/plugins/debugger/gdb/classicgdbengine.cpp @@ -1118,8 +1118,8 @@ void GdbEngine::tryLoadDebuggingHelpersClassic() m_debuggingHelperState = DebuggingHelperLoadTried; // Do not use STRINGIFY for RTLD_NOW as we really want to expand that to a number. -#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) - // We are using Python on Windows and Symbian. +#if defined(Q_OS_WIN) + // We are using Python on Windows. QTC_CHECK(false); #elif defined(Q_OS_MAC) QByteArray dlopenLib = startParameters().dumperLibrary.toLocal8Bit(); diff --git a/src/plugins/debugger/gdb/codagdbadapter.cpp b/src/plugins/debugger/gdb/codagdbadapter.cpp deleted file mode 100644 index 47d479a24ad..00000000000 --- a/src/plugins/debugger/gdb/codagdbadapter.cpp +++ /dev/null @@ -1,1652 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "codagdbadapter.h" - -#include "debuggerstartparameters.h" -#include "codadevice.h" -#include "codautils.h" -#include "gdbmi.h" -#include "hostutils.h" - -#include "symbiandevicemanager.h" - -#include "registerhandler.h" -#include "threadshandler.h" -#include "debuggercore.h" -#include "debuggeractions.h" -#include "debuggerstringutils.h" -#include "watchutils.h" -#ifndef STANDALONE_RUNNER -#include "gdbengine.h" -#endif - -#include <utils/qtcassert.h> -#include <utils/savedaction.h> -#include <utils/qtcprocess.h> - -#include <QTimer> -#include <QDir> -#include <QTcpServer> -#include <QTcpSocket> - -#ifndef Q_OS_WIN -# include <sys/types.h> -# include <unistd.h> -#endif - -#define CB(callback) \ - static_cast<GdbEngine::GdbCommandCallback>(&GdbCodaEngine::callback), \ - STRINGIFY(callback) - -enum { debug = 0 }; - -/* Libraries we want to be notified about (pending introduction of a 'notify all' - * setting in CODA, Bug #11842 */ -static const char *librariesC[] = { -"pipelib.ldd", "rpipe.dll", "libc.dll", -"libdl.dll", "libm.dll", "libpthread.dll", -"libssl.dll", "libz.dll", "libzcore.dll", "libstdcpp.dll", -"sqlite3.dll", "phonon_mmf.dll", "QtCore.dll", "QtXml.dll", "QtGui.dll", -"QtNetwork.dll", "QtTest.dll", "QtSql.dll", "QtSvg.dll", "phonon.dll", -"QtScript.dll", "QtXmlPatterns.dll", "QtMultimedia.dll", "qjpeg.dll", -"qgif.dll", "qmng.dll", "qtiff.dll", "qico.dll", "qsvg.dll", -"qcncodecs.dll", "qjpcodecs.dll","qtwcodecs.dll", "qkrcodecs.dll", "qsvgicon.dll", -"qts60plugin_5_0.dll", "QtWebKit.dll"}; - -namespace Debugger { -namespace Internal { - -using namespace Symbian; -using namespace Coda; - -static inline QString startMsg(const Coda::Session &session) -{ - return GdbCodaEngine::tr("Process started, PID: 0x%1, thread id: 0x%2, " - "code segment: 0x%3, data segment: 0x%4.") - .arg(session.pid, 0, 16).arg(session.tid, 0, 16) - .arg(session.codeseg, 0, 16).arg(session.dataseg, 0, 16); -} - -/* -------------- CodaGdbAdapter: - * Startup-sequence: - * - startAdapter connects both sockets/devices - * - In the CODA Locator Event, gdb is started and the engine is notified - * that the adapter has started. - * - Engine calls setupInferior(), which starts the process. - * - Initial CODA module load suspended event is emitted (process is suspended). - * In the event handler, gdb is connected to the remote target. In the - * gdb answer to conntect remote, inferiorStartPrepared() is emitted. - * - Engine sets up breakpoints,etc and calls inferiorStartPhase2(), which - * resumes the suspended CODA process via gdb 'continue'. - * Thread handling (30.06.2010): - * CODA does not report thread creation/termination. So, if we receive - * a stop in a different thread, we store an additional thread in snapshot. - * When continuing in sendContinue(), we delete this thread, since we cannot - * know whether it will exist at the next stop. - * Also note that threads continue running in Symbian even if one crashes. - * TODO: - Maybe thread reporting will be improved in CODA? - * - Stop all threads once one stops? - * - Breakpoints do not trigger in threads other than the main thread. */ - -GdbCodaEngine:: GdbCodaEngine(const DebuggerStartParameters &startParameters) - : GdbEngine(startParameters), - m_running(false), - m_stopReason(0), - m_gdbAckMode(true), - m_uid(0), - m_verbose(0), - m_firstResumableExeLoadedEvent(false), - m_registerRequestPending(false), - m_firstHelloEvent(true) -{ - m_bufferedMemoryRead = true; - // Disable buffering if gdb's dcache is used. - m_bufferedMemoryRead = false; - - m_gdbServer = 0; - m_gdbConnection = 0; - m_snapshot.reset(); -#ifdef Q_OS_WIN - const unsigned long portOffset = winGetCurrentProcessId() % 100; -#else - const uid_t portOffset = getuid(); -#endif - m_gdbServerName = _("127.0.0.1:%1").arg(2222 + portOffset); - - setVerbose(debuggerCore()->boolSetting(VerboseLog) ? 1 : 0); - - connect(debuggerCore()->action(VerboseLog), SIGNAL(valueChanged(QVariant)), - this, SLOT(setVerbose(QVariant))); -} - -void GdbCodaEngine::setupDeviceSignals() -{ - connect(m_codaDevice.data(), SIGNAL(error(QString)), - this, SLOT(codaDeviceError(QString))); - connect(m_codaDevice.data(), SIGNAL(logMessage(QString)), - this, SLOT(codaLogMessage(QString))); - connect(m_codaDevice.data(), SIGNAL(codaEvent(Coda::CodaEvent)), - this, SLOT(codaEvent(Coda::CodaEvent))); - connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(deviceRemoved(SymbianUtils::SymbianDevice)), - this, SLOT(codaDeviceRemoved(SymbianUtils::SymbianDevice))); -} - -GdbCodaEngine::~GdbCodaEngine() -{ - if (m_codaDevice) - SymbianUtils::SymbianDeviceManager::instance()->releaseCodaDevice(m_codaDevice); - - cleanup(); - logMessage(QLatin1String("Shutting down.\n")); -} - -void GdbCodaEngine::setVerbose(const QVariant &value) -{ - setVerbose(value.toInt()); -} - -void GdbCodaEngine::setVerbose(int verbose) -{ - if (debug) - qDebug("CodaGdbAdapter::setVerbose %d", verbose); - m_verbose = verbose; - if (m_codaDevice) - m_codaDevice->setVerbose(m_verbose); -} - -void GdbCodaEngine::codaLogMessage(const QString &msg) -{ - logMessage(_("CODA ") + msg); -} - -void GdbCodaEngine::setGdbServerName(const QString &name) -{ - m_gdbServerName = name; -} - -// Split a TCP address specification '<addr>[:<port>]' -static QPair<QString, unsigned short> splitIpAddressSpec(const QString &addressSpec, unsigned short defaultPort = 0) -{ - const int pos = addressSpec.indexOf(QLatin1Char(':')); - if (pos == -1) - return QPair<QString, unsigned short>(addressSpec, defaultPort); - const QString address = addressSpec.left(pos); - bool ok; - const unsigned short port = addressSpec.mid(pos + 1).toUShort(&ok); - if (!ok) { - qWarning("Invalid IP address specification: '%s', defaulting to port %hu.", qPrintable(addressSpec), defaultPort); - return QPair<QString, unsigned short>(addressSpec, defaultPort); - } - return QPair<QString, unsigned short>(address, port); -} - -void GdbCodaEngine::handleCodaRunControlModuleLoadContextSuspendedEvent(const CodaRunControlModuleLoadContextSuspendedEvent &se) -{ - m_snapshot.resetMemory(); - const ModuleLoadEventInfo &minfo = se.info(); - // Register in session, keep modules and libraries in sync. - const QString moduleName = QString::fromUtf8(minfo.name); - const bool isExe = moduleName.endsWith(_(".exe"), Qt::CaseInsensitive); - // Add to shared library list - if (!isExe) { - if (minfo.loaded) { - m_session.modules.push_back(moduleName); - Coda::Library library; - library.name = minfo.name; - library.codeseg = minfo.codeAddress; - library.dataseg = minfo.dataAddress; - library.pid = RunControlContext::processIdFromTcdfId(se.id()); - m_session.libraries.push_back(library); - // Load local symbol file into gdb provided there is one - if (library.codeseg) { - const QString localSymFileName = - localSymFileForLibrary(library.name, m_symbolFileFolder); - if (!localSymFileName.isEmpty()) { - showMessage(msgLoadLocalSymFile(localSymFileName, - library.name, library.codeseg), LogMisc); - postCommand(symFileLoadCommand( - localSymFileName, library.codeseg, library.dataseg)); - } // has local sym - } // code seg - - } else { - const int index = m_session.modules.indexOf(moduleName); - if (index != -1) { - m_session.modules.removeAt(index); - m_session.libraries.removeAt(index); - } else { - // Might happen with preliminary version of CODA. - qWarning("Received unload for module '%s' for which no load was received.", - qPrintable(moduleName)); - } - - } - } - // Handle resume. - if (se.info().requireResume) { - // If it is the first, resumable load event (.exe), make - // gdb connect to remote target and resume in setupInferior2(), - if (isExe && m_firstResumableExeLoadedEvent) { - m_firstResumableExeLoadedEvent = false; - m_session.codeseg = minfo.codeAddress; - m_session.dataseg = minfo.dataAddress; - logMessage(startMsg(m_session), LogMisc); - - const QByteArray symbolFile = m_symbolFile.toLocal8Bit(); - if (symbolFile.isEmpty()) { - logMessage(_("WARNING: No symbol file available."), LogError); - } else { - // Does not seem to be necessary anymore. - // FIXME: Startup sequence can be streamlined now as we do not - // have to wait for the CODA startup to learn the load address. - //m_engine->postCommand("add-symbol-file \"" + symbolFile + "\" " - // + QByteArray::number(m_session.codeseg)); - postCommand("symbol-file \"" + symbolFile + "\""); - } - foreach (const QByteArray &s, Symbian::gdbStartupSequence()) - postCommand(s); - postCommand("target remote " + gdbServerName().toLatin1(), - CB(handleTargetRemote)); - if (debug) - qDebug() << "Initial module load suspended: " << m_session.toString(); - } else { - // Consecutive module load suspended: (not observed yet): Just continue - m_codaDevice->sendRunControlResumeCommand(CodaCallback(), se.id()); - } - } -} - -void GdbCodaEngine::handleTargetRemote(const GdbResponse &record) -{ - QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state()); - if (record.resultClass == GdbResultDone) { - handleInferiorPrepared(); - if (debug) - qDebug() << "handleTargetRemote" << m_session.toString(); - } else { - QString msg = tr("Connecting to CODA server adapter failed:\n") - + QString::fromLocal8Bit(record.data.findChild("msg").data()); - notifyInferiorSetupFailed(msg); - } -} - -void GdbCodaEngine::codaDeviceRemoved(const SymbianUtils::SymbianDevice &dev) -{ - const DebuggerStartParameters ¶meters = startParameters(); - if (state() != DebuggerNotReady && !m_codaDevice.isNull() && parameters.remoteChannel == dev.portName()) { - const QString message = QString::fromLatin1("Device '%1' has been disconnected.").arg(dev.friendlyName()); - logMessage(message); - handleAdapterCrashed(message); - cleanup(); - } -} - -void GdbCodaEngine::codaEvent(const CodaEvent &e) -{ - if (debug) - qDebug() << e.toString() << m_session.toString() << m_snapshot.toString(); - logMessage(e.toString()); - - switch (e.type()) { - case CodaEvent::LocatorHello: - if (state() == EngineSetupRequested && m_firstHelloEvent) { - m_firstHelloEvent = false; - m_codaDevice->sendLoggingAddListenerCommand(CodaCallback()); - QStringList gdbArgs; - gdbArgs.append(_("--nx")); // Do not read .gdbinit file - startGdb(gdbArgs); // Commands are only accepted after hello - } - break; - case CodaEvent::RunControlModuleLoadSuspended: // A module was loaded - handleCodaRunControlModuleLoadContextSuspendedEvent( - static_cast<const CodaRunControlModuleLoadContextSuspendedEvent &>(e)); - break; - case CodaEvent::RunControlContextAdded: // Thread/process added - foreach (const RunControlContext &rc, - static_cast<const CodaRunControlContextAddedEvent &>(e).contexts()) - if (rc.type() == RunControlContext::Thread) - addThread(rc.threadId()); - break; - case CodaEvent::RunControlContextRemoved: // Thread/process removed - foreach (const QByteArray &id, - static_cast<const CodaRunControlContextRemovedEvent &>(e).ids()) - switch (RunControlContext::typeFromCodaId(id)) { - case RunControlContext::Thread: - m_snapshot.removeThread(RunControlContext::threadIdFromTcdfId(id)); - break; - case RunControlContext::Process: - sendGdbServerMessage("W00", "Process exited"); - break; - } - break; - case CodaEvent::RunControlSuspended: { - // Thread suspended/stopped - const CodaRunControlContextSuspendedEvent &se = - static_cast<const CodaRunControlContextSuspendedEvent &>(e); - const unsigned threadId = RunControlContext::threadIdFromTcdfId(se.id()); - const QString reason = QString::fromUtf8(se.reasonID()); - const QString message = QString::fromUtf8(se.message()) - .replace(_("\n"), _(", ")); - showMessage(_("Thread %1 stopped: '%2': %3"). - arg(threadId).arg(reason, message), LogMisc); - // Stopped in a new thread: Add. - m_snapshot.reset(); - m_session.tid = threadId; - if (m_snapshot.indexOfThread(threadId) == -1) - m_snapshot.addThread(threadId); - m_snapshot.setThreadState(threadId, reason); - // Update registers first, then report stopped. - m_running = false; - m_stopReason = reason.contains(_("exception"), Qt::CaseInsensitive) - || reason.contains(_("panic"), Qt::CaseInsensitive) ? - gdbServerSignalSegfault : gdbServerSignalTrap; - m_codaDevice->sendRegistersGetMRangeCommand( - CodaCallback(this, &GdbCodaEngine::handleAndReportReadRegistersAfterStop), - currentThreadContextId(), 0, - Symbian::RegisterCount); - } - break; - case CodaEvent::LoggingWriteEvent: // TODO: Not tested yet. - showMessage(e.toString() + QLatin1Char('\n'), AppOutput); - break; - default: - break; - } -} - -void GdbCodaEngine::handleGdbStartFailed() -{ - cleanup(); -} - -void GdbCodaEngine::codaDeviceError(const QString &errorString) -{ - logMessage(errorString); - if (state() == EngineSetupRequested) { - handleAdapterStartFailed(errorString); - } else { - handleAdapterCrashed(errorString); - } -} - -void GdbCodaEngine::logMessage(const QString &msg, int channel) -{ - if (m_verbose || channel != LogDebug) - showMessage(msg, channel); - if (debug) - qDebug("%s", qPrintable(msg)); -} - -// -// Gdb -// -void GdbCodaEngine::handleGdbConnection() -{ - logMessage(QLatin1String("HANDLING GDB CONNECTION")); - QTC_CHECK(m_gdbConnection == 0); - m_gdbConnection = m_gdbServer->nextPendingConnection(); - QTC_ASSERT(m_gdbConnection, return); - connect(m_gdbConnection, SIGNAL(disconnected()), - m_gdbConnection, SLOT(deleteLater())); - connect(m_gdbConnection, SIGNAL(readyRead()), - SLOT(readGdbServerCommand())); -} - -static inline QString msgGdbPacket(const QString &p) -{ - return _("gdb: ") + p; -} - -void GdbCodaEngine::readGdbServerCommand() -{ - QTC_ASSERT(m_gdbConnection, return); - QByteArray packet = m_gdbConnection->readAll(); - m_gdbReadBuffer.append(packet); - - logMessage(QLatin1String("gdb: -> ") + currentTime() - + QLatin1Char(' ') + QString::fromLatin1(packet)); - if (packet != m_gdbReadBuffer) - logMessage(_("buffer: ") + QString::fromLatin1(m_gdbReadBuffer)); - - QByteArray &ba = m_gdbReadBuffer; - while (ba.size()) { - char code = ba.at(0); - ba = ba.mid(1); - - if (code == '+') { - //logMessage("ACK"); - continue; - } - - if (code == '-') { - logMessage(QLatin1String("NAK: Retransmission requested"), LogError); - // This seems too harsh. - //emit adapterCrashed("Communication problem encountered."); - continue; - } - - if (code == char(0x03)) { - logMessage(QLatin1String("INTERRUPT RECEIVED")); - interruptInferior(); - continue; - } - - if (code != '$') { - logMessage(QLatin1String("Broken package (2) ") + quoteUnprintableLatin1(ba) - + QLatin1String(Coda::hexNumber(code)), LogError); - continue; - } - - int pos = ba.indexOf('#'); - if (pos == -1) { - logMessage(QLatin1String("Invalid checksum format in ") - + quoteUnprintableLatin1(ba), LogError); - continue; - } - - bool ok = false; - uint checkSum = ba.mid(pos + 1, 2).toUInt(&ok, 16); - if (!ok) { - logMessage(QLatin1String("Invalid checksum format 2 in ") - + quoteUnprintableLatin1(ba), LogError); - return; - } - - //logMessage(QString("Packet checksum: %1").arg(checkSum)); - Coda::byte sum = 0; - for (int i = 0; i < pos; ++i) - sum += ba.at(i); - - if (sum != checkSum) { - logMessage(QString::fromLatin1("ERROR: Packet checksum wrong: %1 %2 in %3"). - arg(checkSum).arg(sum).arg(quoteUnprintableLatin1(ba)), LogError); - } - - QByteArray cmd = ba.left(pos); - ba.remove(0, pos + 3); - handleGdbServerCommand(cmd); - } -} - -bool GdbCodaEngine::sendGdbServerPacket(const QByteArray &packet, bool doFlush) -{ - if (!m_gdbConnection) { - logMessage(_("Cannot write to gdb: No connection (%1)") - .arg(_(packet)), LogError); - return false; - } - if (m_gdbConnection->state() != QAbstractSocket::ConnectedState) { - logMessage(_("Cannot write to gdb: Not connected (%1)") - .arg(_(packet)), LogError); - return false; - } - if (m_gdbConnection->write(packet) == -1) { - logMessage(_("Cannot write to gdb: %1 (%2)") - .arg(m_gdbConnection->errorString()).arg(_(packet)), LogError); - return false; - } - if (doFlush) - m_gdbConnection->flush(); - return true; -} - -void GdbCodaEngine::sendGdbServerAck() -{ - if (!m_gdbAckMode) - return; - logMessage(QLatin1String("gdb: <- +")); - sendGdbServerPacket(QByteArray(1, '+'), false); -} - -void GdbCodaEngine::sendGdbServerMessage(const QByteArray &msg, const QByteArray &logNote) -{ - Coda::byte sum = 0; - for (int i = 0; i != msg.size(); ++i) - sum += msg.at(i); - - char checkSum[30]; - qsnprintf(checkSum, sizeof(checkSum) - 1, "%02x ", sum); - - //logMessage(QString("Packet checksum: %1").arg(sum)); - - QByteArray packet; - packet.append('$'); - packet.append(msg); - packet.append('#'); - packet.append(checkSum); - int pad = qMax(0, 24 - packet.size()); - logMessage(QLatin1String("gdb: <- ") + currentTime() + QLatin1Char(' ') - + QString::fromLatin1(packet) + QString(pad, QLatin1Char(' ')) - + QLatin1String(logNote)); - sendGdbServerPacket(packet, true); -} - -static QByteArray msgStepRangeReceived(unsigned from, unsigned to, bool over) -{ - QByteArray rc = "Stepping range received for step "; - rc += over ? "over" : "into"; - rc += " (0x"; - rc += QByteArray::number(from, 16); - rc += " to 0x"; - rc += QByteArray::number(to, 16); - rc += ')'; - return rc; -} - -void GdbCodaEngine::handleGdbServerCommand(const QByteArray &cmd) -{ - if (debug) - qDebug("handleGdbServerCommand: %s", cmd.constData()); - // http://sourceware.org/gdb/current/onlinedocs/gdb_34.html - if (0) {} - else if (cmd == "!") { - sendGdbServerAck(); - //sendGdbServerMessage("", "extended mode not enabled"); - sendGdbServerMessage("OK", "extended mode enabled"); - } - - else if (cmd.startsWith('?')) { - logMessage(msgGdbPacket(_("Query halted"))); - // Indicate the reason the target halted. - // The reply is the same as for step and continue. - sendGdbServerAck(); - // The command below will trigger fetching a stack trace while - // the process does not seem to be fully functional. Most notably - // the PC points to a 0x9..., which is not in "our" range - //sendGdbServerMessage("T05library:r;", "target halted (library load)"); - //sendGdbServerMessage("S05", "target halted (trap)"); - sendGdbServerMessage("S00", "target halted (trap)"); - //sendGdbServerMessage("O" + QByteArray("Starting...").toHex()); - } - - else if (cmd == "c") { - logMessage(msgGdbPacket(_("Continue"))); - sendGdbServerAck(); - sendContinue(); - } - - else if (cmd.startsWith('C')) { - logMessage(msgGdbPacket(_("Continue with signal"))); - // C sig[;addr] Continue with signal sig (hex signal number) - //Reply: See section D.3 Stop Reply Packets, for the reply specifications. - bool ok = false; - const uint signalNumber = cmd.mid(1).toUInt(&ok, 16); - //TODO: Meaning of the message is not clear. - sendGdbServerAck(); - logMessage(_("Not implemented 'Continue with signal' %1: ").arg(signalNumber), - LogWarning); - sendGdbServerMessage('O' + QByteArray("Console output").toHex()); - sendGdbServerMessage("W81"); // "Process exited with result 1 - sendContinue(); - } - - else if (cmd.startsWith('D')) { - sendGdbServerAck(); - sendGdbServerMessage("OK", "shutting down"); - } - - else if (cmd == "g") { - // Read general registers. - logMessage(msgGdbPacket(_("Read registers"))); - if (m_snapshot.registersValid(m_session.tid)) { - sendGdbServerAck(); - reportRegisters(); - } else { - sendGdbServerAck(); - if (m_codaDevice->registerNames().isEmpty()) { - m_registerRequestPending = true; - } else { - sendRegistersGetMCommand(); - } - } - } - - else if (cmd == "gg") { - // Force re-reading general registers for debugging purpose. - sendGdbServerAck(); - m_snapshot.setRegistersValid(m_session.tid, false); - sendRegistersGetMCommand(); - } - - else if (cmd.startsWith("salstep,")) { - // Receive address range for current line for future use when stepping. - sendGdbServerAck(); - m_snapshot.parseGdbStepRange(cmd, false); - sendGdbServerMessage("", msgStepRangeReceived(m_snapshot.lineFromAddress, - m_snapshot.lineToAddress, m_snapshot.stepOver)); - } - - else if (cmd.startsWith("salnext,")) { - // Receive address range for current line for future use when stepping. - sendGdbServerAck(); - m_snapshot.parseGdbStepRange(cmd, true); - sendGdbServerMessage("", msgStepRangeReceived(m_snapshot.lineFromAddress, - m_snapshot.lineToAddress, m_snapshot.stepOver)); - } - - else if (cmd.startsWith("Hc")) { - sendGdbServerAck(); - gdbSetCurrentThread(cmd, "Set current thread for step & continue "); - } - - else if (cmd.startsWith("Hg")) { - sendGdbServerAck(); - gdbSetCurrentThread(cmd, "Set current thread "); - } - - else if (cmd == "k" || cmd.startsWith("vKill")) { - // Kill inferior process - logMessage(msgGdbPacket(_("kill"))); - sendRunControlTerminateCommand(); - } - - else if (cmd.startsWith('m')) { - logMessage(msgGdbPacket(_("Read memory"))); - // m addr,length - sendGdbServerAck(); - const QPair<quint64, unsigned> addrLength = parseGdbReadMemoryRequest(cmd); - if (addrLength.first && addrLength.second) { - readMemory(addrLength.first, addrLength.second, m_bufferedMemoryRead); - } else { - sendGdbServerMessage("E20", "Error " + cmd); - } - } - - else if (cmd.startsWith('X')) { // Write memory - const int dataPos = cmd.indexOf(':'); - if (dataPos == -1) { - sendGdbServerMessage("E20", "Error (colon expected) " + cmd); - return; - } - const QPair<quint64, unsigned> addrLength = - parseGdbReadMemoryRequest(cmd.left(dataPos)); - if (addrLength.first == 0) { - sendGdbServerMessage("E20", "Error (address = 0) " + cmd); - return; - } - // Requests with len=0 are apparently used to probe writing. - if (addrLength.second == 0) { - sendGdbServerMessage("OK", "Probe memory write at 0x" - + QByteArray::number(addrLength.first, 16)); - return; - } - // Data appear to be plain binary. - const QByteArray data = cmd.mid(dataPos + 1); - if (addrLength.second != unsigned(data.size())) { - sendGdbServerMessage("E20", "Data length mismatch " + cmd); - return; - } - logMessage(_("Writing %1 bytes from 0x%2: %3"). - arg(addrLength.second).arg(addrLength.first, 0, 16). - arg(QString::fromLatin1(data.toHex()))); - m_codaDevice->sendMemorySetCommand( - CodaCallback(this, &GdbCodaEngine::handleWriteMemory), - m_codaProcessId, addrLength.first, data); - } - - else if (cmd.startsWith('p')) { - logMessage(msgGdbPacket(_("read register"))); - // 0xf == current instruction pointer? - //sendGdbServerMessage("0000", "current IP"); - sendGdbServerAck(); - bool ok = false; - const uint registerNumber = cmd.mid(1).toUInt(&ok, 16); - const int threadIndex = m_snapshot.indexOfThread(m_session.tid); - QTC_ASSERT(threadIndex != -1, return); - const Symbian::Thread &thread = m_snapshot.threadInfo.at(threadIndex); - if (thread.registerValid) { - sendGdbServerMessage(thread.gdbReportSingleRegister(registerNumber), - thread.gdbSingleRegisterLogMessage(registerNumber)); - } else { - //qDebug() << "Fetching single register"; - m_codaDevice->sendRegistersGetMRangeCommand( - CodaCallback(this, &GdbCodaEngine::handleAndReportReadRegister), - currentThreadContextId(), registerNumber, 1); - } - } - - else if (cmd.startsWith('P')) { - logMessage(msgGdbPacket(_("write register"))); - // $Pe=70f96678#d3 - sendGdbServerAck(); - const QPair<uint, uint> regnumValue = parseGdbWriteRegisterWriteRequest(cmd); - // FIXME: Assume all goes well. - m_snapshot.setRegisterValue(m_session.tid, regnumValue.first, regnumValue.second); - logMessage(_("Setting register #%1 to 0x%2").arg(regnumValue.first) - .arg(regnumValue.second, 0, 16)); - QByteArray registerValue; - Coda::appendInt(®isterValue, Coda::BigEndian); // Registers are big endian - m_codaDevice->sendRegistersSetCommand( - CodaCallback(this, &GdbCodaEngine::handleWriteRegister), - currentThreadContextId(), regnumValue.first, registerValue, - QVariant(regnumValue.first)); - // Note that App CODA refuses to write registers 13 and 14 - } - - else if (cmd == "qAttached") { - //$qAttached#8f - // 1: attached to an existing process - // 0: created a new process - sendGdbServerAck(); - sendGdbServerMessage(QByteArray(1, '0'), "new process created"); - } - - else if (cmd.startsWith("qC")) { - logMessage(msgGdbPacket(_("query thread id"))); - // Return the current thread ID - //$qC#b4 - sendGdbServerAck(); - sendGdbServerMessage("QC" + QByteArray::number(m_session.tid, 16)); - } - - else if (cmd.startsWith("qSupported")) { - //$qSupported#37 - //$qSupported:multiprocess+#c6 - //logMessage("Handling 'qSupported'"); - sendGdbServerAck(); - sendGdbServerMessage(Symbian::gdbQSupported); - } - - // Tracepoint handling as of gdb 7.2 onwards. - else if (cmd == "qTStatus") { // Tracepoints - sendGdbServerAck(); - sendGdbServerMessage("T0;tnotrun:0", "No trace experiment running"); - } - // Trace variables as of gdb 7.2 onwards. - else if (cmd == "qTfV" || cmd == "qTsP" || cmd == "qTfP") { - sendGdbServerAck(); - sendGdbServerMessage("l", "No trace points"); - } - - else if (cmd.startsWith("qThreadExtraInfo")) { - // $qThreadExtraInfo,1f9#55 - sendGdbServerAck(); - sendGdbServerMessage(m_snapshot.gdbQThreadExtraInfo(cmd)); - } - - else if (cmd == "qfDllInfo") { - // That's the _first_ query package. - // Happens with gdb 6.4.50.20060226-cvs / CodeSourcery. - // Never made it into FSF gdb that got qXfer:libraries:read instead. - // http://sourceware.org/ml/gdb/2007-05/msg00038.html - // Name=hexname,TextSeg=textaddr[,DataSeg=dataaddr] - sendGdbServerAck(); - sendGdbServerMessage(m_session.gdbQsDllInfo(), - "library information transfer finished"); - } - - else if (cmd == "qsDllInfo") { - // That's a following query package. - sendGdbServerAck(); - sendGdbServerMessage(QByteArray(1, 'l'), - "library information transfer finished"); - } - - else if (cmd == "qPacketInfo") { - // Happens with gdb 6.4.50.20060226-cvs / CodeSourcery. - // Deprecated by qSupported? - sendGdbServerAck(); - sendGdbServerMessage("", "FIXME: nothing?"); - } - - else if (cmd == "qOffsets") { - sendGdbServerAck(); - QByteArray answer = "TextSeg="; - answer.append(QByteArray::number(m_session.codeseg, 16)); - answer.append(";DataSeg="); - answer.append(QByteArray::number(m_session.dataseg, 16)); - sendGdbServerMessage(answer); - } - - else if (cmd == "qSymbol::") { - if (m_verbose) - logMessage(msgGdbPacket(_("notify can handle symbol lookup"))); - // Notify the target that GDB is prepared to serve symbol lookup requests. - sendGdbServerAck(); - if (1) - sendGdbServerMessage("OK", "no further symbols needed"); - else - sendGdbServerMessage("qSymbol:" + QByteArray("_Z7E32Mainv").toHex(), - "ask for more"); - } - - else if (cmd.startsWith("qXfer:features:read:target.xml:")) { - // $qXfer:features:read:target.xml:0,7ca#46...Ack - sendGdbServerAck(); - sendGdbServerMessage(Symbian::gdbArchitectureXml); - } - - else if (cmd == "qfThreadInfo") { - // That's the _first_ query package. - sendGdbServerAck(); - sendGdbServerMessage(m_snapshot.gdbQsThreadInfo(), - "thread information transferred"); - } - - else if (cmd == "qsThreadInfo") { - // That's a following query package - sendGdbServerAck(); - sendGdbServerMessage(QByteArray(1, 'l'), - "thread information transfer finished"); - } - - else if (cmd.startsWith("qXfer:libraries:read")) { - sendGdbServerAck(); - sendGdbServerMessage(m_session.gdbLibraryList(), - "library information transferred"); - } - - else if (cmd == "QStartNoAckMode") { - //$qSupported#37 - logMessage(QLatin1String("Handling 'QStartNoAckMode'")); - sendGdbServerAck(); - sendGdbServerMessage("OK", "ack no-ack mode"); - m_gdbAckMode = false; - } - - else if (cmd.startsWith("QPassSignals")) { - // list of signals to pass directly to inferior - // $QPassSignals:e;10;14;17;1a;1b;1c;21;24;25;4c;#8f - // happens only if "QPassSignals+;" is qSupported - sendGdbServerAck(); - // FIXME: use the parameters - sendGdbServerMessage("OK", "passing signals accepted"); - } - - else if (cmd == "s" || cmd.startsWith("vCont;s")) { - const uint pc = m_snapshot.registerValue(m_session.tid, RegisterPC); - logMessage(msgGdbPacket(_("Step range from 0x%1"). - arg(pc, 0, 16))); - sendGdbServerAck(); - m_running = true; - sendStepRange(); - } - - else if (cmd.startsWith('T')) { - // FIXME: Check whether thread is alive. - sendGdbServerAck(); - sendGdbServerMessage("OK"); // pretend all is well - } - - else if (cmd == "vCont?") { - // Actions supported by the vCont packet. - sendGdbServerAck(); - sendGdbServerMessage("vCont;c;C;s;S"); // we don't support vCont. - } - - else if (cmd == "vCont;c") { - // vCont[;action[:thread-id]]...' - sendGdbServerAck(); - m_running = true; - sendContinue(); - } - - else if (cmd.startsWith("Z0,") || cmd.startsWith("Z1,")) { - // Insert breakpoint. - sendGdbServerAck(); - logMessage(msgGdbPacket(_("Insert breakpoint"))); - // $Z0,786a4ccc,4#99 - const QPair<quint64, unsigned> addrLen = parseGdbSetBreakpointRequest(cmd); - if (addrLen.first) { - //qDebug() << "ADDR: " << hexNumber(addr) << " LEN: " << len; - logMessage(_("Inserting breakpoint at 0x%1, %2") - .arg(addrLen.first, 0, 16).arg(addrLen.second)); - // const QByteArray ba = trkBreakpointMessage(addr, len, len == 4); - Coda::Breakpoint bp(addrLen.first); - bp.size = addrLen.second; - bp.setContextId(m_session.pid); - // We use the automatic ids calculated from the location - // address instead of the map in snapshot. - m_codaDevice->sendBreakpointsAddCommand( - CodaCallback(this, &GdbCodaEngine::handleAndReportSetBreakpoint), - bp); - } else { - logMessage(_("MISPARSED BREAKPOINT '") + QLatin1String(cmd) - + QLatin1String("'')") , LogError); - } - } - - else if (cmd.startsWith("z0,") || cmd.startsWith("z1,")) { - // Remove breakpoint. - sendGdbServerAck(); - logMessage(msgGdbPacket(_("Remove breakpoint"))); - // $z0,786a4ccc,4#99 - const int pos = cmd.lastIndexOf(','); - const uint addr = cmd.mid(3, pos - 3).toUInt(0, 16); - m_codaDevice->sendBreakpointsRemoveCommand( - CodaCallback(this, &GdbCodaEngine::handleClearBreakpoint), - Coda::Breakpoint::idFromLocation(addr)); - } - - else if (cmd.startsWith("qPart:") || cmd.startsWith("qXfer:")) { - QByteArray data = cmd.mid(1 + cmd.indexOf(':')); - // "qPart:auxv:read::0,147": Read OS auxiliary data, see info aux. - bool handled = false; - if (data.startsWith("auxv:read::")) { - const int offsetPos = data.lastIndexOf(':') + 1; - const int commaPos = data.lastIndexOf(','); - if (commaPos != -1) { - bool ok1 = false, ok2 = false; - const int offset = data.mid(offsetPos, commaPos - offsetPos) - .toUInt(&ok1, 16); - const int length = data.mid(commaPos + 1).toUInt(&ok2, 16); - if (ok1 && ok2) { - const QString msg = _("Read of OS auxiliary " - "vector (%1, %2) not implemented.").arg(offset).arg(length); - logMessage(msgGdbPacket(msg), LogWarning); - sendGdbServerMessage("E20", msg.toLatin1()); - handled = true; - } - } - } // auxv read - - if (!handled) { - const QString msg = _("FIXME unknown 'XFER'-request: ") - + QString::fromLatin1(cmd); - logMessage(msgGdbPacket(msg), LogWarning); - sendGdbServerMessage("E20", msg.toLatin1()); - } - - } // qPart/qXfer - else { - logMessage(msgGdbPacket(_("FIXME unknown: ") - + QString::fromLatin1(cmd)), LogWarning); - } -} - -void GdbCodaEngine::sendRunControlTerminateCommand() -{ - // Requires id of main thread to terminate. - // Note that calling 'Settings|set|removeExecutable' crashes CODA, - // so, it is apparently not required. - m_codaDevice->sendRunControlTerminateCommand( - CodaCallback(this, &GdbCodaEngine::handleRunControlTerminate), - mainThreadContextId()); -} - -void GdbCodaEngine::handleRunControlTerminate(const CodaCommandResult &) -{ - QString msg = QString::fromLatin1("CODA disconnected"); - const bool emergencyShutdown = m_gdbProc.state() != QProcess::Running - && state() != EngineShutdownOk; - if (emergencyShutdown) - msg += QString::fromLatin1(" (emergency shutdown)"); - logMessage(msg, LogMisc); - if (emergencyShutdown) { - cleanup(); - notifyAdapterShutdownOk(); - } -} - -void GdbCodaEngine::gdbSetCurrentThread(const QByteArray &cmd, const char *why) -{ - // Thread ID from Hg/Hc commands: '-1': All, '0': arbitrary, else hex thread id. - const QByteArray id = cmd.mid(2); - const int threadId = id == "-1" ? -1 : id.toInt(0, 16); - const QByteArray message = QByteArray(why) + QByteArray::number(threadId); - logMessage(msgGdbPacket(_(message))); - // Set thread for subsequent operations (`m', `M', `g', `G', et.al.). - // for 'other operations. 0 - any thread. - //$Hg0#df - m_session.tid = threadId <= 0 ? m_session.mainTid : uint(threadId); - sendGdbServerMessage("OK", message); -} - -void GdbCodaEngine::interruptInferior2() -{ - m_codaDevice->sendRunControlSuspendCommand(CodaCallback(), m_codaProcessId); -} - -void GdbCodaEngine::setupEngine() -{ - m_snapshot.fullReset(); - m_session.reset(); - m_firstResumableExeLoadedEvent = true; - m_codaProcessId.clear(); - m_firstHelloEvent = true; - - // Retrieve parameters. - const DebuggerStartParameters ¶meters = startParameters(); - m_remoteExecutable = parameters.executable; - m_remoteArguments = Utils::QtcProcess::splitArgs(parameters.processArgs); - m_symbolFile = parameters.symbolFileName; - if (!m_symbolFile.isEmpty()) - m_symbolFileFolder = QFileInfo(m_symbolFile).absolutePath(); - - QSharedPointer<QTcpSocket> codaSocket; - if (parameters.communicationChannel == - DebuggerStartParameters::CommunicationChannelTcpIp) { - m_codaDevice = QSharedPointer<CodaDevice>(new CodaDevice, &CodaDevice::deleteLater); - setupDeviceSignals(); - codaSocket = QSharedPointer<QTcpSocket>(new QTcpSocket); - m_codaDevice->setDevice(codaSocket); - } else { - m_codaDevice = SymbianUtils::SymbianDeviceManager::instance() - ->getCodaDevice(parameters.remoteChannel); - - const bool ok = !m_codaDevice.isNull() && m_codaDevice->device()->isOpen(); - if (!ok) { - const QString reason = m_codaDevice.isNull() ? - tr("Could not obtain device.") : - m_codaDevice->device()->errorString(); - const QString msg = QString::fromLatin1("Could not open serial device '%1': %2") - .arg(parameters.remoteChannel, reason); - logMessage(msg, LogError); - handleAdapterStartFailed(msg); - return; - } - setupDeviceSignals(); - m_codaDevice->setVerbose(m_verbose); - } - - if (debug) - qDebug() << parameters.processArgs; - - m_uid = parameters.executableUid; - QString codaServerAddress = parameters.serverAddress; - unsigned short codaServerPort = parameters.serverPort; - -// m_remoteArguments.clear(); FIXME: Should this be here? - - // Unixish gdbs accept only forward slashes - m_symbolFile.replace(QLatin1Char('\\'), QLatin1Char('/')); - // Start - QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state()); - showMessage(_("TRYING TO START ADAPTER")); - logMessage(_("### Starting CodaGdbAdapter")); - - QTC_ASSERT(m_gdbServer == 0, delete m_gdbServer); - QTC_ASSERT(m_gdbConnection == 0, m_gdbConnection = 0); - m_gdbServer = new QTcpServer(this); - - const QPair<QString, unsigned short> address = splitIpAddressSpec(m_gdbServerName); - if (!m_gdbServer->listen(QHostAddress(address.first), address.second)) { - QString msg = QString::fromLatin1("Unable to start the gdb server at %1: %2.") - .arg(m_gdbServerName).arg(m_gdbServer->errorString()); - logMessage(msg, LogError); - handleAdapterStartFailed(msg); - return; - } - - logMessage(QString::fromLatin1("Gdb server running on %1.\nLittle endian assumed.") - .arg(m_gdbServerName)); - - connect(m_gdbServer, SIGNAL(newConnection()), - this, SLOT(handleGdbConnection())); - - if (parameters.communicationChannel == - DebuggerStartParameters::CommunicationChannelTcpIp) { - logMessage(_("Connecting to CODA on %1:%2") - .arg(codaServerAddress).arg(codaServerPort)); - codaSocket->connectToHost(codaServerAddress, codaServerPort); - } else { - m_codaDevice->sendSerialPing(false); - } -} - -void GdbCodaEngine::setupInferior() -{ - QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state()); - - // Compile additional libraries. - QStringList libraries; - const unsigned libraryCount = sizeof(librariesC)/sizeof(char *); - for (unsigned i = 0; i < libraryCount; ++i) - libraries.push_back(QString::fromLatin1(librariesC[i])); - - m_codaDevice->sendProcessStartCommand( - CodaCallback(this, &GdbCodaEngine::handleCreateProcess), - m_remoteExecutable, m_uid, m_remoteArguments, - QString(), true, libraries); -} - -void GdbCodaEngine::addThread(unsigned id) -{ - showMessage(QString::fromLatin1("Thread %1 reported").arg(id), LogMisc); - // Make thread known, register as main if it is the first one. - if (m_snapshot.indexOfThread(id) == -1) { - m_snapshot.addThread(id); - if (m_session.tid == 0) { - m_session.tid = id; - if (m_session.mainTid == 0) - m_session.mainTid = id; - } - // We cannot retrieve register values unless the registers of that - // thread have been retrieved (CODA oddity). - const QByteArray contextId = RunControlContext::codaId(m_session.pid, id); - m_codaDevice->sendRegistersGetChildrenCommand( - CodaCallback(this, &GdbCodaEngine::handleRegisterChildren), - contextId, QVariant(contextId)); - } -} - -void GdbCodaEngine::handleCreateProcess(const CodaCommandResult &result) -{ - if (debug) - qDebug() << "ProcessCreated: " << result.toString(); - if (!result) { - const QString errorMessage = result.errorString(); - logMessage(_("Failed to start process: %1").arg(errorMessage), LogError); - notifyInferiorSetupFailed(result.errorString()); - return; - } - QTC_ASSERT(!result.values.isEmpty(), return); - - RunControlContext ctx; - ctx.parse(result.values.front()); - logMessage(ctx.toString()); - - m_session.pid = ctx.processId(); - m_codaProcessId = RunControlContext::codaId(m_session.pid); - if (const unsigned threadId = ctx.threadId()) - addThread(threadId); - // See ModuleLoadSuspendedEvent for the rest. - m_session.codeseg = 0; - m_session.dataseg = 0; -} - -void GdbCodaEngine::runEngine() -{ - QTC_ASSERT(state() == EngineRunRequested, qDebug() << state()); - notifyEngineRunAndInferiorStopOk(); - // Trigger the initial "continue" manually. - continueInferiorInternal(); -} - -// -// AbstractGdbAdapter interface implementation -// - -void GdbCodaEngine::write(const QByteArray &data) -{ - // Write magic packets directly to TRK. - if (data.startsWith("@#")) { - QByteArray data1 = data.mid(2); - if (data1.endsWith(char(10))) - data1.chop(1); - if (data1.endsWith(char(13))) - data1.chop(1); - if (data1.endsWith(' ')) - data1.chop(1); - bool ok; - const uint addr = data1.toUInt(&ok, 0); - logMessage(_("Direct step (@#) 0x%1: not implemented").arg(addr, 0, 16), - LogError); - // directStep(addr); - return; - } - if (data.startsWith("@$")) { - QByteArray ba = QByteArray::fromHex(data.mid(2)); - qDebug() << "Writing: " << quoteUnprintableLatin1(ba); - // if (ba.size() >= 1) - // sendMessage(ba.at(0), TrkCB(handleDirectTrk), ba.mid(1)); - return; - } - if (data.startsWith("@@")) { - logMessage(_("Direct write (@@): not implemented"), LogError); - return; - } - m_gdbProc.write(data); -} - -void GdbCodaEngine::cleanup() -{ - delete m_gdbServer; - m_gdbServer = 0; - if (m_codaDevice) { - // Ensure process is stopped after being suspended. - // This cannot be used when the object is deleted - // as the responce will return to a not existing object - sendRunControlTerminateCommand(); - disconnect(m_codaDevice.data(), 0, this, 0); - SymbianUtils::SymbianDeviceManager::instance()->releaseCodaDevice(m_codaDevice); - } -} - -void GdbCodaEngine::shutdownEngine() -{ - if (m_gdbProc.state() == QProcess::Running) { - cleanup(); - notifyAdapterShutdownOk(); - } else { - // Something is wrong, gdb crashed. Kill debuggee (see handleDeleteProcess2) - if (m_codaDevice && m_codaDevice->device()->isOpen()) { - logMessage(QLatin1String("Emergency shutdown of CODA"), LogError); - sendRunControlTerminateCommand(); - } - } -} - -void GdbCodaEngine::codaReloadRegisters() -{ - // Take advantage of direct access to cached register values. - m_snapshot.syncRegisters(m_session.tid, registerHandler()); -} - -void GdbCodaEngine::codaReloadThreads() -{ - m_snapshot.syncThreads(threadsHandler()); -} - -void GdbCodaEngine::handleWriteRegister(const CodaCommandResult &result) -{ - const int registerNumber = result.cookie.toInt(); - if (result) { - sendGdbServerMessage("OK"); - } else { - logMessage(_("ERROR writing register #%1: %2") - .arg(registerNumber).arg(result.errorString()), LogError); - sendGdbServerMessage("E01"); - } -} - -void GdbCodaEngine::sendRegistersGetMCommand() -{ - // Send off a register command, which requires the names to be present. - QTC_ASSERT(!m_codaDevice->registerNames().isEmpty(), return); - - m_codaDevice->sendRegistersGetMRangeCommand( - CodaCallback(this, &GdbCodaEngine::handleAndReportReadRegisters), - currentThreadContextId(), 0, - Symbian::RegisterCount); -} - -void GdbCodaEngine::reportRegisters() -{ - const int threadIndex = m_snapshot.indexOfThread(m_session.tid); - QTC_ASSERT(threadIndex != -1, return); - const Symbian::Thread &thread = m_snapshot.threadInfo.at(threadIndex); - sendGdbServerMessage(thread.gdbReportRegisters(), - thread.gdbRegisterLogMessage(m_verbose)); -} - -void GdbCodaEngine::handleRegisterChildren(const CodaCommandResult &result) -{ - QTC_ASSERT(m_codaDevice, return); - const QByteArray contextId = result.cookie.toByteArray(); - if (!result) { - logMessage(QLatin1String("Error retrieving register children of ") - + result.cookie.toString() + QLatin1String(": ") - + result.errorString(), LogError); - return; - } - // Parse out registers. - // If this is a single 'pid.tid.rGPR' parent entry, recurse to get the actual - // registers, ('pid.tid.rGPR.R0'..). At least 'pid.tid.rGPR' must have been - // retrieved to be able to access the register contents. - QVector<QByteArray> registerNames = CodaDevice::parseRegisterGetChildren(result); - if (registerNames.size() == 1) { - m_codaDevice->sendRegistersGetChildrenCommand( - CodaCallback(this, &GdbCodaEngine::handleRegisterChildren), - registerNames.front(), result.cookie); - return; - } - // First thread: Set base names in device. - if (!m_codaDevice->registerNames().isEmpty()) - return; - // Make sure we get all registers - const int registerCount = registerNames.size(); - if (registerCount != Symbian::RegisterCount) { - logMessage(_("Invalid number of registers received, expected %1, got %2"). - arg(Symbian::RegisterCount).arg(registerCount), LogError); - return; - } - // Set up register names (strip thread context "pid.tid"+'.') - QString msg = _("Retrieved %1 register names: ").arg(registerCount); - const int contextLength = contextId.size() + 1; - for (int i = 0; i < registerCount; i++) { - registerNames[i].remove(0, contextLength); - if (i) - msg += QLatin1Char(','); - msg += QString::fromLatin1(registerNames[i]); - } - logMessage(msg); - m_codaDevice->setRegisterNames(registerNames); - if (m_registerRequestPending) { // Request already pending? - logMessage(_("Resuming registers request after receiving register names...")); - sendRegistersGetMCommand(); - } -} - -void GdbCodaEngine::handleReadRegisters(const CodaCommandResult &result) -{ - // Check for errors. - if (!result) { - logMessage(QLatin1String("ERROR: ") + result.errorString(), LogError); - return; - } - if (result.values.isEmpty() || result.values.front().type() != Json::JsonValue::String) { - logMessage(_("Format error in register message: ") + result.toString(), - LogError); - return; - } - - unsigned i = result.cookie.toUInt(); - // TODO: When reading 8-byte floating-point registers is supported, thread - // registers won't be an array of uints. - uint *registers = m_snapshot.registers(m_session.tid); - QTC_ASSERT(registers, return); - - QByteArray bigEndianRaw = QByteArray::fromBase64(result.values.front().data()); - // TODO: When reading 8-byte floating-point registers is supported, will - // need to know the list of registers and lengths of each register. - for (int j = 0; j < bigEndianRaw.size(); j += 4) { - registers[i++] = ((bigEndianRaw.at(j ) & 0xff) << 24) + - ((bigEndianRaw.at(j + 1) & 0xff) << 16) + - ((bigEndianRaw.at(j + 2) & 0xff) << 8) + - (bigEndianRaw.at(j + 3) & 0xff); - } - - m_snapshot.setRegistersValid(m_session.tid, true); - if (debug) - qDebug() << "handleReadRegisters: " << m_snapshot.toString(); -} - -void GdbCodaEngine::handleAndReportReadRegisters(const CodaCommandResult &result) -{ - handleReadRegisters(result); - reportRegisters(); -} - -void GdbCodaEngine::handleAndReportReadRegister(const CodaCommandResult &result) -{ - handleReadRegisters(result); - const uint registerNumber = result.cookie.toUInt(); - const int threadIndex = m_snapshot.indexOfThread(m_session.tid); - QTC_ASSERT(threadIndex != -1, return); - const Symbian::Thread &thread = m_snapshot.threadInfo.at(threadIndex); - sendGdbServerMessage(thread.gdbReportSingleRegister(registerNumber), - thread.gdbSingleRegisterLogMessage(registerNumber)); -} - -QByteArray GdbCodaEngine::stopMessage() const -{ - QByteArray logMsg = "Stopped with registers in thread 0x"; - logMsg += QByteArray::number(m_session.tid, 16); - if (m_session.tid == m_session.mainTid) - logMsg += " [main]"; - const int idx = m_snapshot.indexOfThread(m_session.tid); - if (idx == -1) - return logMsg; - const Symbian::Thread &thread = m_snapshot.threadInfo.at(idx); - logMsg += ", at 0x"; - logMsg += QByteArray::number(thread.registers[Symbian::RegisterPC], 16); - logMsg += ", (loaded at 0x"; - logMsg += QByteArray::number(m_session.codeseg, 16); - logMsg += ", offset 0x"; - logMsg += QByteArray::number(thread.registers[Symbian::RegisterPC] - m_session.codeseg, 16); - logMsg += "), Register contents: "; - logMsg += thread.registerContentsLogMessage(); - return logMsg; -} - -void GdbCodaEngine::handleAndReportReadRegistersAfterStop(const CodaCommandResult &result) -{ - handleReadRegisters(result); - handleReadRegisters(result); - const bool reportThread = m_session.tid != m_session.mainTid; - sendGdbServerMessage(m_snapshot.gdbStopMessage(m_session.tid, - m_stopReason, reportThread), stopMessage()); -} - -void GdbCodaEngine::handleAndReportSetBreakpoint(const CodaCommandResult &result) -{ - if (result) { - sendGdbServerMessage("OK"); - } else { - logMessage(_("Error setting breakpoint: ") + result.errorString(), LogError); - sendGdbServerMessage("E21"); - } -} - -void GdbCodaEngine::handleClearBreakpoint(const CodaCommandResult &result) -{ - logMessage(QLatin1String("CLEAR BREAKPOINT ")); - if (!result) - logMessage(QLatin1String("Error clearing breakpoint: ") + - result.errorString(), LogError); - sendGdbServerMessage("OK"); -} - -void GdbCodaEngine::readMemory(uint addr, uint len, bool buffered) -{ - Q_ASSERT(len < (2 << 16)); - - // We try to get medium-sized chunks of data from the device - if (m_verbose > 2) - logMessage(_("readMemory %1 bytes from 0x%2 blocksize=%3") - .arg(len).arg(addr, 0, 16).arg(MemoryChunkSize)); - - m_snapshot.wantedMemory = MemoryRange(addr, addr + len); - tryAnswerGdbMemoryRequest(buffered); -} - -static QString msgMemoryReadError(uint addr, uint len = 0) -{ - const QString lenS = len ? QString::number(len) : _("<unknown>"); - return _("Memory read error at: 0x%1 %2").arg(addr, 0, 16).arg(lenS); -} - -void GdbCodaEngine::sendMemoryGetCommand(const MemoryRange &range, bool buffered) -{ - const QVariant cookie = QVariant::fromValue(range); - const CodaCallback cb = buffered ? - CodaCallback(this, &GdbCodaEngine::handleReadMemoryBuffered) : - CodaCallback(this, &GdbCodaEngine::handleReadMemoryUnbuffered); - m_codaDevice->sendMemoryGetCommand(cb, currentThreadContextId(), range.from, range.size(), cookie); -} - -void GdbCodaEngine::handleReadMemoryBuffered(const CodaCommandResult &result) -{ - QTC_ASSERT(qVariantCanConvert<MemoryRange>(result.cookie), return); - - const QByteArray memory = CodaDevice::parseMemoryGet(result); - const MemoryRange range = result.cookie.value<MemoryRange>(); - - const bool error = !result; - const bool insufficient = unsigned(memory.size()) != range.size(); - if (error || insufficient) { - QString msg = error ? - _("Error reading memory: %1").arg(result.errorString()) : - _("Error reading memory (got %1 of %2): %3") - .arg(memory.size()).arg(range.size()) - .arg(msgMemoryReadError(range.from, range.size())); - msg += QString::fromLatin1("\n(Retrying unbuffered...)"); - logMessage(msg, LogError); - // FIXME: This does not handle large requests properly. - sendMemoryGetCommand(range, false); - return; - } - - m_snapshot.insertMemory(range, memory); - tryAnswerGdbMemoryRequest(true); -} - -void GdbCodaEngine::handleReadMemoryUnbuffered(const CodaCommandResult &result) -{ - QTC_ASSERT(qVariantCanConvert<MemoryRange>(result.cookie), return); - - const QByteArray memory = CodaDevice::parseMemoryGet(result); - const MemoryRange range = result.cookie.value<MemoryRange>(); - - const bool error = !result; - const bool insufficient = unsigned(memory.size()) != range.size(); - if (error || insufficient) { - QString msg = error ? - _("Error reading memory: %1").arg(result.errorString()) : - _("Error reading memory (got %1 of %2): %3") - .arg(memory.size()).arg(range.size()) - .arg(msgMemoryReadError(range.from, range.size())); - logMessage(msg, LogError); - sendGdbServerMessage(QByteArray("E20"), - msgMemoryReadError(32, range.from).toLatin1()); - return; - } - m_snapshot.insertMemory(range, memory); - tryAnswerGdbMemoryRequest(false); -} - -void GdbCodaEngine::tryAnswerGdbMemoryRequest(bool buffered) -{ - //logMessage("TRYING TO ANSWER MEMORY REQUEST "); - MemoryRange wanted = m_snapshot.wantedMemory; - MemoryRange needed = m_snapshot.wantedMemory; - MEMORY_DEBUG("WANTED: " << wanted); - Snapshot::Memory::const_iterator it = m_snapshot.memory.begin(); - Snapshot::Memory::const_iterator et = m_snapshot.memory.end(); - for ( ; it != et; ++it) { - MEMORY_DEBUG(" NEEDED STEP: " << needed); - needed -= it.key(); - } - MEMORY_DEBUG("NEEDED FINAL: " << needed); - - if (needed.to == 0) { - // FIXME: need to combine chunks first. - - // All fine. Send package to gdb. - it = m_snapshot.memory.begin(); - et = m_snapshot.memory.end(); - for ( ; it != et; ++it) { - if (it.key().from <= wanted.from && wanted.to <= it.key().to) { - int offset = wanted.from - it.key().from; - int len = wanted.to - wanted.from; - QByteArray ba = it.value().mid(offset, len); - sendGdbServerMessage(ba.toHex(), m_snapshot.memoryReadLogMessage - (wanted.from, m_session.tid, m_verbose, ba)); - return; - } - } - // Happens when chunks are not combined - QTC_CHECK(false); - showMessage(QLatin1String("CHUNKS NOT COMBINED")); -# ifdef MEMORY_DEBUG - qDebug() << "CHUNKS NOT COMBINED"; - it = m_snapshot.memory.begin(); - et = m_snapshot.memory.end(); - for ( ; it != et; ++it) - qDebug() << Coda::hexNumber(it.key().from) << Coda::hexNumber(it.key().to); - qDebug() << "WANTED" << wanted.from << wanted.to; -# endif - sendGdbServerMessage("E22", ""); - return; - } - - MEMORY_DEBUG("NEEDED AND UNSATISFIED: " << needed); - if (buffered) { - uint blockaddr = (needed.from / MemoryChunkSize) * MemoryChunkSize; - logMessage(_("Requesting buffered memory %1 bytes from 0x%2") - .arg(MemoryChunkSize).arg(blockaddr, 0, 16)); - MemoryRange range(blockaddr, blockaddr + MemoryChunkSize); - MEMORY_DEBUG(" FETCH BUFFERED MEMORY : " << range); - sendMemoryGetCommand(range, true); - } else { // Unbuffered, direct requests - int len = needed.to - needed.from; - logMessage(_("Requesting unbuffered memory %1 bytes from 0x%2") - .arg(len).arg(needed.from, 0, 16)); - sendMemoryGetCommand(needed, false); - MEMORY_DEBUG(" FETCH UNBUFFERED MEMORY : " << needed); - } -} - -void GdbCodaEngine::handleWriteMemory(const CodaCommandResult &result) -{ - if (result) { - sendGdbServerMessage("OK", "Write memory"); - } else { - logMessage(_("Error writing memory: ") + result.errorString(), LogError); - sendGdbServerMessage("E21"); - } -} - -QByteArray GdbCodaEngine::mainThreadContextId() const -{ - return RunControlContext::codaId(m_session.pid, m_session.mainTid); -} - -QByteArray GdbCodaEngine::currentThreadContextId() const -{ - return RunControlContext::codaId(m_session.pid, m_session.tid); -} - -void GdbCodaEngine::sendContinue() -{ - // Remove all but main thread as we do not know whether they will exist - // at the next stop. - if (m_snapshot.threadInfo.size() > 1) - m_snapshot.threadInfo.remove(1, m_snapshot.threadInfo.size() - 1); - m_codaDevice->sendRunControlResumeCommand(CodaCallback(), m_codaProcessId); -} - -void GdbCodaEngine::sendStepRange() -{ - uint from = m_snapshot.lineFromAddress; - uint to = m_snapshot.lineToAddress; - const uint pc = m_snapshot.registerValue(m_session.tid, RegisterPC); - if (from <= pc && pc <= to) { - const QString msg = _("Step in 0x%1 .. 0x%2 instead of 0x%3..."). - arg(from, 0, 16).arg(to, 0, 16).arg(pc, 0, 16); - showMessage(msg); - } else { - from = pc; - to = pc; - } - // TODO: Step range does not seem to work yet? - const RunControlResumeMode mode = (from == to && to == pc) ? - (m_snapshot.stepOver ? RM_STEP_OVER : RM_STEP_INTO) : - (m_snapshot.stepOver ? RM_STEP_OVER_RANGE : RM_STEP_INTO_RANGE); - - logMessage(_("Stepping from 0x%1 to 0x%2 (current PC=0x%3), mode %4"). - arg(from, 0, 16).arg(to, 0, 16).arg(pc).arg(int(mode))); - m_codaDevice->sendRunControlResumeCommand( - CodaCallback(this, &GdbCodaEngine::handleStep), - currentThreadContextId(), - mode, 1, from, to); -} - -void GdbCodaEngine::handleStep(const CodaCommandResult &result) -{ - if (!result) { // Try fallback with Continue. - logMessage(QString::fromLatin1("Error while stepping: %1 (fallback to 'continue')"). - arg(result.errorString()), LogWarning); - sendContinue(); - // Doing nothing as below does not work as gdb seems to insist on - // making some progress through a 'step'. - //sendMessage(0x12, - // TrkCB(handleAndReportReadRegistersAfterStop), - // trkReadRegistersMessage()); - return; - } - // The gdb server response is triggered later by the Stop Reply packet. - logMessage(QLatin1String("STEP FINISHED ") + currentTime()); -} - -} // namespace Internal -} // namespace Debugger diff --git a/src/plugins/debugger/gdb/codagdbadapter.h b/src/plugins/debugger/gdb/codagdbadapter.h deleted file mode 100644 index d4e6d2df0ac..00000000000 --- a/src/plugins/debugger/gdb/codagdbadapter.h +++ /dev/null @@ -1,204 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef DEBUGGER_CODAGDBADAPTER_H -#define DEBUGGER_CODAGDBADAPTER_H - -#include "gdbengine.h" -#include "localgdbprocess.h" -#include "callback.h" -#include "codautils.h" -#include "symbian.h" - -#include <QPointer> -#include <QSharedPointer> -#include <QStringList> -#include <QHash> - -QT_BEGIN_NAMESPACE -class QTcpServer; -class QTcpSocket; -class QIODevice; -QT_END_NAMESPACE - -namespace Coda { - struct CodaCommandResult; - class CodaDevice; - class CodaEvent; - class CodaRunControlModuleLoadContextSuspendedEvent; -} - -namespace SymbianUtils { -class SymbianDevice; -} - -namespace Debugger { -namespace Internal { - -struct MemoryRange; -struct GdbResult; - -/////////////////////////////////////////////////////////////////////// -// -// CodaGdbAdapter -// -/////////////////////////////////////////////////////////////////////// - -class GdbCodaEngine : public GdbEngine -{ - Q_OBJECT - -public: - typedef Coda::Callback<const GdbResult &> GdbResultCallback; - typedef Coda::Callback<const Coda::CodaCommandResult &> CodaCallback; - typedef Coda::Callback<const GdbResponse &> GdbCallback; - - explicit GdbCodaEngine(const DebuggerStartParameters &startParameters); - ~GdbCodaEngine(); - - void setGdbServerName(const QString &name); - QString gdbServerName() const { return m_gdbServerName; } - - Q_SLOT void setVerbose(const QVariant &value); - void setVerbose(int verbose); - void setBufferedMemoryRead(bool b) { m_bufferedMemoryRead = b; } - - void codaReloadRegisters(); - void codaReloadThreads(); - -signals: - void output(const QString &msg); - -public: - // - // Implementation of GdbProcessBase - // - void start(const QString &program, const QStringList &args, - QIODevice::OpenMode mode = QIODevice::ReadWrite); - void write(const QByteArray &data); - bool isCodaAdapter() const { return true; } - - virtual DumperHandling dumperHandling() const { return DumperNotAvailable; } - -private: - void setupDeviceSignals(); - void setupEngine(); - void handleGdbStartFailed(); - void setupInferior(); - void runEngine(); - void interruptInferior2(); - void shutdownEngine(); - void sendRunControlTerminateCommand(); - void handleRunControlTerminate(const Coda::CodaCommandResult &); - void sendRegistersGetMCommand(); - void handleWriteRegister(const Coda::CodaCommandResult &result); - void reportRegisters(); - void handleReadRegisters(const Coda::CodaCommandResult &result); - void handleRegisterChildren(const Coda::CodaCommandResult &result); - void handleAndReportReadRegisters(const Coda::CodaCommandResult &result); - void handleAndReportReadRegister(const Coda::CodaCommandResult &result); - void handleAndReportReadRegistersAfterStop(const Coda::CodaCommandResult &result); - QByteArray stopMessage() const; - void handleAndReportSetBreakpoint(const Coda::CodaCommandResult &result); - void handleClearBreakpoint(const Coda::CodaCommandResult &result); - void readMemory(uint addr, uint len, bool buffered); - void handleReadMemoryBuffered(const Coda::CodaCommandResult &result); - void handleReadMemoryUnbuffered(const Coda::CodaCommandResult &result); - void handleWriteMemory(const Coda::CodaCommandResult &result); - void tryAnswerGdbMemoryRequest(bool buffered); - inline void sendMemoryGetCommand(const MemoryRange &range, bool buffered); - void addThread(unsigned id); - inline QByteArray mainThreadContextId() const; - inline QByteArray currentThreadContextId() const; - - AbstractGdbProcess *gdbProc() { return &m_gdbProc; } - - void cleanup(); - - void handleTargetRemote(const GdbResponse &response); - - QString m_gdbServerName; // 127.0.0.1:(2222+uid) - bool m_running; - int m_stopReason; - - QSharedPointer<Coda::CodaDevice> m_codaDevice; - - // - // Gdb - // - Q_SLOT void handleGdbConnection(); - Q_SLOT void readGdbServerCommand(); - Q_SLOT void codaDeviceError(const QString &); - Q_SLOT void codaDeviceRemoved(const SymbianUtils::SymbianDevice &dev); - Q_SLOT void codaEvent(const Coda::CodaEvent &knownEvent); - void handleCodaRunControlModuleLoadContextSuspendedEvent(const Coda::CodaRunControlModuleLoadContextSuspendedEvent &e); - inline void sendContinue(); - void sendStepRange(); - void handleStep(const Coda::CodaCommandResult &result); - void handleCreateProcess(const Coda::CodaCommandResult &result); - - void readGdbResponse(); - void handleGdbServerCommand(const QByteArray &cmd); - void sendGdbServerMessage(const QByteArray &msg, - const QByteArray &logNote = QByteArray()); - void sendGdbServerAck(); - bool sendGdbServerPacket(const QByteArray &packet, bool doFlush); - void gdbSetCurrentThread(const QByteArray &cmd, const char *why); - - void logMessage(const QString &msg, int channel = LogDebug); // triggers output() if m_verbose - Q_SLOT void codaLogMessage(const QString &msg); - - QPointer<QTcpServer> m_gdbServer; - QPointer<QTcpSocket> m_gdbConnection; - QByteArray m_gdbReadBuffer; - bool m_gdbAckMode; - - // Debuggee state - Coda::Session m_session; // global-ish data (process id, target information) - Symbian::Snapshot m_snapshot; // local-ish data (memory and registers) - QString m_remoteExecutable; - unsigned m_uid; - QStringList m_remoteArguments; - QString m_symbolFile; - QString m_symbolFileFolder; - int m_verbose; - bool m_bufferedMemoryRead; - bool m_firstResumableExeLoadedEvent; - // gdb wants registers, but we don't have the names yet. Continue in handler for names - bool m_registerRequestPending; - QByteArray m_codaProcessId; - LocalGdbProcess m_gdbProc; - bool m_firstHelloEvent; -}; - -} // namespace Internal -} // namespace Debugger - -#endif // DEBUGGER_CODAGDBADAPTER_H diff --git a/src/plugins/debugger/gdb/gdb.pri b/src/plugins/debugger/gdb/gdb.pri index 3f13fb280b3..b371e63e733 100644 --- a/src/plugins/debugger/gdb/gdb.pri +++ b/src/plugins/debugger/gdb/gdb.pri @@ -7,14 +7,12 @@ HEADERS += \ $$PWD/localplaingdbadapter.h \ $$PWD/termgdbadapter.h \ $$PWD/remotegdbserveradapter.h \ - $$PWD/codagdbadapter.h \ $$PWD/abstractgdbprocess.h \ $$PWD/localgdbprocess.h \ $$PWD/remotegdbprocess.h \ $$PWD/remoteplaingdbadapter.h \ $$PWD/abstractplaingdbadapter.h \ - $$PWD/startgdbserverdialog.h \ - $$PWD/symbian.h + $$PWD/startgdbserverdialog.h SOURCES += \ $$PWD/gdbmi.cpp \ @@ -27,13 +25,11 @@ SOURCES += \ $$PWD/localplaingdbadapter.cpp \ $$PWD/termgdbadapter.cpp \ $$PWD/remotegdbserveradapter.cpp \ - $$PWD/codagdbadapter.cpp \ $$PWD/abstractgdbprocess.cpp \ $$PWD/localgdbprocess.cpp \ $$PWD/remotegdbprocess.cpp \ $$PWD/remoteplaingdbadapter.cpp \ $$PWD/abstractplaingdbadapter.cpp \ - $$PWD/startgdbserverdialog.cpp \ - $$PWD/symbian.cpp + $$PWD/startgdbserverdialog.cpp RESOURCES += $$PWD/gdb.qrc diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 70dfd05ac72..46ac9ed4d01 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -42,7 +42,6 @@ #include "termgdbadapter.h" #include "remotegdbserveradapter.h" #include "remoteplaingdbadapter.h" -#include "codagdbadapter.h" #include "debuggeractions.h" #include "debuggerconstants.h" @@ -1756,9 +1755,7 @@ void GdbEngine::handleStop2() reloadStack(false); // Will trigger register reload. if (supportsThreads()) { - if (isCodaAdapter()) { - codaReloadThreads(); - } else if (m_isMacGdb || m_gdbVersion < 70100) { + if (m_isMacGdb || m_gdbVersion < 70100) { postCommand("-thread-list-ids", Discardable, CB(handleThreadListIds)); } else { // This is only available in gdb 7.1+. @@ -2161,8 +2158,6 @@ void GdbEngine::executeStep() setTokenBarrier(); notifyInferiorRunRequested(); showStatusMessage(tr("Step requested..."), 5000); - if (isCodaAdapter() && stackHandler()->stackSize() > 0) - postCommand("sal step,0x" + QByteArray::number(stackHandler()->topAddress(), 16)); if (isReverseDebugging()) { postCommand("reverse-step", RunRequest, CB(handleExecuteStep)); } else { @@ -2236,8 +2231,6 @@ void GdbEngine::executeNext() setTokenBarrier(); notifyInferiorRunRequested(); showStatusMessage(tr("Step next requested..."), 5000); - if (isCodaAdapter() && stackHandler()->stackSize() > 0) - postCommand("sal next,0x" + QByteArray::number(stackHandler()->topAddress(), 16)); if (isReverseDebugging()) { postCommand("reverse-next", RunRequest, CB(handleExecuteNext)); } else { @@ -3132,8 +3125,6 @@ void GdbEngine::insertBreakpoint(BreakpointModelId id) cmd = "-break-insert -a -f "; } else if (m_isMacGdb) { cmd = "-break-insert -l -1 -f "; - } else if (isCodaAdapter()) { - cmd = "-break-insert -h -f "; } else if (m_gdbVersion >= 70000) { int spec = handler->threadSpec(id); cmd = "-break-insert "; @@ -3521,7 +3512,7 @@ void GdbEngine::reloadStack(bool forceGotoLocation) PENDING_DEBUG("RELOAD STACK"); QByteArray cmd = "-stack-list-frames"; int stackDepth = debuggerCore()->action(MaximalStackDepth)->value().toInt(); - if (stackDepth && !isCodaAdapter()) + if (stackDepth) cmd += " 0 " + QByteArray::number(stackDepth); postCommand(cmd, Discardable, CB(handleStackListFrames), QVariant::fromValue<StackCookie>(StackCookie(false, forceGotoLocation))); @@ -3760,17 +3751,10 @@ void GdbEngine::reloadRegisters() if (!m_registerNamesListed) { postCommand("-data-list-register-names", CB(handleRegisterListNames)); m_registerNamesListed = true; - // FIXME: Maybe better completely re-do this logic in CODA adapter. - if (isCodaAdapter()) - return; } - if (isCodaAdapter()) { - codaReloadRegisters(); - } else { - postCommand("-data-list-register-values r", - Discardable, CB(handleRegisterListValues)); - } + postCommand("-data-list-register-values r", + Discardable, CB(handleRegisterListValues)); } void GdbEngine::setRegisterValue(int nr, const QString &value) @@ -3793,9 +3777,6 @@ void GdbEngine::handleRegisterListNames(const GdbResponse &response) registers.append(Register(item.data())); registerHandler()->setRegisters(registers); - - if (isCodaAdapter()) - codaReloadRegisters(); } void GdbEngine::handleRegisterListValues(const GdbResponse &response) @@ -4199,10 +4180,6 @@ WatchData GdbEngine::localVariable(const GdbMi &item, // pass through the insertData() machinery. if (isIntOrFloatType(data.type) || isPointerType(data.type)) setWatchDataValue(data, item); - if (isSymbianIntType(data.type)) { - setWatchDataValue(data, item); - data.setHasChildren(false); - } } if (!watchHandler()->isExpandedIName(data.iname)) @@ -5310,11 +5287,6 @@ void GdbEngine::write(const QByteArray &data) gdbProc()->write(data); } -bool GdbEngine::isCodaAdapter() const -{ - return false; -} - bool GdbEngine::prepareCommand() { #ifdef Q_OS_WIN @@ -5385,9 +5357,6 @@ void GdbEngine::interruptLocalInferior(qint64 pid) DebuggerEngine *createGdbEngine(const DebuggerStartParameters &sp) { - if (sp.toolChainAbi.os() == Abi::SymbianOS) - return new GdbCodaEngine(sp); - switch (sp.startMode) { case AttachCore: return new GdbCoreEngine(sp); diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 0a4599ec360..18adc7fc17f 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -728,11 +728,6 @@ protected: virtual AbstractGdbProcess *gdbProc() = 0; virtual DumperHandling dumperHandling() const = 0; - // CODA specific stuff - virtual bool isCodaAdapter() const; - virtual void codaReloadRegisters() {} - virtual void codaReloadThreads() {} - protected: bool prepareCommand(); void interruptLocalInferior(qint64 pid); diff --git a/src/plugins/debugger/gdb/pythongdbengine.cpp b/src/plugins/debugger/gdb/pythongdbengine.cpp index e052ca9c738..df6da0ad1fe 100644 --- a/src/plugins/debugger/gdb/pythongdbengine.cpp +++ b/src/plugins/debugger/gdb/pythongdbengine.cpp @@ -199,10 +199,7 @@ void GdbEngine::updateAllPython() postCommand("-stack-list-frames", CB(handleStackListFrames), QVariant::fromValue<StackCookie>(StackCookie(false, true))); stackHandler()->setCurrentIndex(0); - if (isCodaAdapter()) - codaReloadThreads(); - else - postCommand("-thread-info", CB(handleThreadInfo), 0); + postCommand("-thread-info", CB(handleThreadInfo), 0); reloadRegisters(); updateLocals(); } diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp index bae3168c849..6b1058961cb 100644 --- a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp +++ b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp @@ -74,8 +74,7 @@ GdbEngine::DumperHandling GdbRemoteServerEngine::dumperHandling() const { using namespace ProjectExplorer; const Abi abi = startParameters().toolChainAbi; - if (abi.os() == Abi::SymbianOS - || abi.os() == Abi::WindowsOS + if (abi.os() == Abi::WindowsOS || abi.binaryFormat() == Abi::ElfFormat) return DumperLoadedByGdb; return DumperLoadedByGdbPreload; diff --git a/src/plugins/debugger/gdb/symbian.cpp b/src/plugins/debugger/gdb/symbian.cpp deleted file mode 100644 index 914df170665..00000000000 --- a/src/plugins/debugger/gdb/symbian.cpp +++ /dev/null @@ -1,677 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "symbian.h" -#include "registerhandler.h" -#include "threadshandler.h" -#include <codautils.h> - -#include <utils/qtcassert.h> - -#include <QDebug> -#include <QTextStream> -#include <QFileInfo> - -namespace Debugger { -namespace Internal { - -/////////////////////////////////////////////////////////////////////////// -// -// MemoryRange -// -/////////////////////////////////////////////////////////////////////////// - -MemoryRange::MemoryRange(uint f, uint t) - : from(f), to(t) -{ - QTC_ASSERT(f <= t, qDebug() << "F: " << f << " T: " << t); -} - -bool MemoryRange::intersects(const MemoryRange &other) const -{ - Q_UNUSED(other); - QTC_CHECK(false); - return false; // FIXME -} - -void MemoryRange::operator-=(const MemoryRange &other) -{ - if (from == 0 && to == 0) - return; - MEMORY_DEBUG(" SUB: " << *this << " - " << other); - if (other.from <= from && to <= other.to) { - from = to = 0; - return; - } - if (other.from <= from && other.to <= to) { - from = qMax(from, other.to); - return; - } - if (from <= other.from && to <= other.to) { - to = qMin(other.from, to); - return; - } - // This would split the range. - QTC_ASSERT(false, qDebug() << "Memory::operator-() not handled for: " - << *this << " - " << other); -} - -QDebug operator<<(QDebug d, const MemoryRange &range) -{ - return d << QString::fromLatin1("[%1,%2] (size %3) ") - .arg(range.from, 0, 16).arg(range.to, 0, 16).arg(range.size()); -} - -namespace Symbian { - -static const char *registerNames[KnownRegisters] = -{ - "A1", "A2", "A3", "A4", - 0, 0, 0, 0, - 0, 0, 0, "AP", - "IP", "SP", "LR", "PC", - "PSTrk", 0, 0, 0, - 0, 0, 0, 0, - 0, "PSGdb" -}; - -const char *registerName(int i) -{ - return registerNames[i]; -} - -QByteArray dumpRegister(uint n, uint value) -{ - QByteArray ba; - ba += ' '; - if (n < KnownRegisters && registerNames[n]) { - ba += registerNames[n]; - } else { - ba += '#'; - ba += QByteArray::number(n); - } - ba += '='; - ba += Coda::hexxNumber(value); - return ba; -} - -/////////////////////////////////////////////////////////////////////////// -// -// Thread -// -/////////////////////////////////////////////////////////////////////////// - -Thread::Thread(unsigned theId) : id(theId) -{ - resetRegisters(); -} - -void Thread::resetRegisters() -{ - qFill(registers, registers + RegisterCount, uint(0)); - registerValid = false; -} - -QByteArray Thread::gdbReportRegisters() const -{ - QByteArray ba; - for (int i = 0; i < 16; ++i) { - const uint reg = Coda::swapEndian(registers[i]); - ba += Coda::hexNumber(reg, 8); - } - return ba; -} - -QByteArray Thread::registerContentsLogMessage() const -{ - QByteArray logMsg; - for (int i = 0; i < RegisterCount; ++i) { - logMsg += dumpRegister(i, registers[i]); - logMsg += ' '; - } - return logMsg; -} - -QByteArray Thread::gdbRegisterLogMessage(bool verbose) const -{ - QByteArray logMsg = "Register contents: (Thread 0x"; - logMsg += QByteArray::number(id, 16); - logMsg += " ) "; - if (verbose) - logMsg += registerContentsLogMessage(); - return logMsg; -} - -QByteArray Thread::gdbReportSingleRegister(unsigned i) const -{ - if (i == RegisterPSGdb) - i = RegisterPSCoda; - if (i >= RegisterCount) - return QByteArray("0000"); // Unknown - QByteArray ba; - appendInt(&ba, registers[i], Coda::LittleEndian); - return ba.toHex(); -} - -QByteArray Thread::gdbSingleRegisterLogMessage(unsigned i) const -{ - if (i == RegisterPSGdb) - i = RegisterPSCoda; - if (i >= RegisterCount) - return QByteArray("Read single unknown register #") + QByteArray::number(i); - QByteArray logMsg = "Read Register "; - logMsg += dumpRegister(i, registers[i]); - return logMsg; -} - -/////////////////////////////////////////////////////////////////////////// -// -// Snapshot -// -/////////////////////////////////////////////////////////////////////////// - -Snapshot::Snapshot() -{ - reset(); - threadInfo.reserve(10); -} - -void Snapshot::reset() -{ - MEMORY_DEBUG("RESET SNAPSHOT MEMORY INITIALLY: " << memory.size() << " BLOCK LEFT"); - for (Memory::Iterator it = memory.begin(); it != memory.end(); ) { - MEMORY_DEBUG("EXAMINING " << it.key()); - it = memory.erase(it); - } - MEMORY_DEBUG("RESET SNAPSHOT MEMORY FINALLY: " << memory.size() << " BLOCK LEFT"); - - const int threadCount = threadInfo.size(); - for (int i =0; i < threadCount; i++) { - threadInfo[i].resetRegisters(); - threadInfo[i].state.clear(); - } - - wantedMemory = MemoryRange(); - lineFromAddress = 0; - lineToAddress = 0; -} - -void Snapshot::resetMemory() -{ - memory.clear(); - reset(); -} - -void Snapshot::fullReset() -{ - threadInfo.clear(); - resetMemory(); -} - -void Snapshot::insertMemory(const MemoryRange &range, const QByteArray &ba) -{ - QTC_ASSERT(range.size() == uint(ba.size()), - qDebug() << "RANGE: " << range << " BA SIZE: " << ba.size(); return); - - MEMORY_DEBUG("INSERT: " << range); - // Try to combine with existing chunk. - Snapshot::Memory::iterator it = memory.begin(); - Snapshot::Memory::iterator et = memory.end(); - for ( ; it != et; ++it) { - if (range.from == it.key().to) { - MEMORY_DEBUG("COMBINING " << it.key() << " AND " << range); - QByteArray data = *it; - data.append(ba); - const MemoryRange res(it.key().from, range.to); - memory.remove(it.key()); - MEMORY_DEBUG(" TO(1) " << res); - insertMemory(res, data); - return; - } - if (it.key().from == range.to) { - MEMORY_DEBUG("COMBINING " << range << " AND " << it.key()); - QByteArray data = ba; - data.append(*it); - const MemoryRange res(range.from, it.key().to); - memory.remove(it.key()); - MEMORY_DEBUG(" TO(2) " << res); - insertMemory(res, data); - return; - } - } - - // Not combinable, add chunk. - memory.insert(range, ba); -} - -QString Snapshot::toString() const -{ - typedef QMap<MemoryRange, QByteArray>::const_iterator MemCacheConstIt; - QString rc; - QTextStream str(&rc); - foreach(const Thread &thread, threadInfo) { - str << " Thread " << thread.id << ' ' << thread.state - << " Register valid " << thread.registerValid << ' '; - if (thread.registerValid) { - for (int i = 0; i < RegisterCount; i++) { - if (i) - str << ", "; - str << " R" << i << "=0x"; - str.setIntegerBase(16); - str << thread.registers[i]; - str.setIntegerBase(10); - } - } - } - str << '\n'; - // For next step. - if (!memory.isEmpty()) { - str.setIntegerBase(16); - str << "Memory:\n"; - const MemCacheConstIt mcend = memory.constEnd(); - for (MemCacheConstIt it = memory.constBegin(); it != mcend; ++it) - str << " 0x" << it.key().from << " - 0x" << it.key().to << '\n'; - } - return rc; -} - -void Snapshot::addThread(uint id) -{ - if (!id || id == uint(-1)) { - qWarning("Cowardly refusing to add thread %d", id); - return; - } - - const int index = indexOfThread(id); - if (index == -1) { - threadInfo.push_back(Thread(id)); - } else { - threadInfo[index].resetRegisters(); - qWarning("Attempt to re-add existing thread %d", id); - } -} - -void Snapshot::removeThread(uint id) -{ - const int index = indexOfThread(id); - if (index != -1) { - threadInfo.remove(index); - } else { - qWarning("Attempt to remove non-existing thread %d", id); - } -} - -int Snapshot::indexOfThread(uint id) const -{ - const int count = threadInfo.size(); - for (int i = 0; i < count; i++) - if (threadInfo.at(i).id == id) - return i; - return -1; -} - -uint *Snapshot::registers(uint threadId) -{ - const int index = indexOfThread(threadId); - QTC_ASSERT(index != -1, { qWarning("No such thread %d", threadId); return 0; } ); - return threadInfo[index].registers; -} - -const uint *Snapshot::registers(uint threadId) const -{ - const int index = indexOfThread(threadId); - QTC_ASSERT(index != -1, return 0; ); - return threadInfo.at(index).registers; -} - -uint Snapshot::registerValue(uint threadId, uint index) -{ - if (const uint *regs = registers(threadId)) - return regs[index]; - return 0; -} - -void Snapshot::setRegisterValue(uint threadId, uint index, uint value) -{ - uint *regs = registers(threadId); - QTC_ASSERT(regs, return; ); - regs[index] = value; -} - -bool Snapshot::registersValid(uint threadId) const -{ - const int index = indexOfThread(threadId); - return index != -1 ? threadInfo.at(index).registerValid : false; -} - -void Snapshot::setRegistersValid(uint threadId, bool e) -{ - const int index = indexOfThread(threadId); - QTC_ASSERT(index != -1, return; ); - threadInfo[index].registerValid = e; -} - -void Snapshot::setThreadState(uint threadId, const QString &state) -{ - const int index = indexOfThread(threadId); - QTC_ASSERT(index != -1, return; ); - threadInfo[index].state = state; -} - -QByteArray Snapshot::gdbQsThreadInfo() const -{ - // FIXME: Limit packet length by using qsThreadInfo packages ('m', ..'l') - QByteArray response(1, 'l'); - const int count = threadInfo.size(); - for (int i = 0; i < count; i++) { - if (i) - response += ','; - response += Coda::hexNumber(threadInfo.at(i).id); - } - return response; -} - -// $qThreadExtraInfo,1f9#55 -QByteArray Snapshot::gdbQThreadExtraInfo(const QByteArray &cmd) const -{ - const int pos = cmd.indexOf(','); - if (pos != 1) { - const uint threadId = cmd.mid(pos + 1).toUInt(0, 16); - const int threadIndex = indexOfThread(threadId); - if (threadIndex != -1 && !threadInfo.at(threadIndex).state.isEmpty()) - return threadInfo.at(threadIndex).state.toAscii().toHex(); - } - return QByteArray("Nothing special").toHex(); -} - -static void gdbAppendRegister(QByteArray *ba, uint regno, uint value) -{ - ba->append(Coda::hexNumber(regno, 2)); - ba->append(':'); - ba->append(Coda::hexNumber(Coda::swapEndian(value), 8)); - ba->append(';'); -} - -QByteArray Snapshot::gdbStopMessage(uint threadId, int signalNumber, bool reportThreadId) const -{ - QByteArray ba = ('T' + Coda::hexNumber(signalNumber, 2)); - if (reportThreadId) { - ba += "thread:"; - ba += Coda::hexNumber(threadId, 3); - ba += ';'; - } - const int threadIndex = indexOfThread(threadId); - QTC_ASSERT(threadIndex != -1, return QByteArray(); ); - const Thread &thread = threadInfo.at(threadIndex); - for (int i = 0; i < 16; ++i) - gdbAppendRegister(&ba, i, thread.registers[i]); - // FIXME: those are not understood by gdb 6.4 - //for (int i = 16; i < 25; ++i) - // appendRegister(&ba, i, 0x0); - gdbAppendRegister(&ba, RegisterPSGdb, thread.registers[RegisterPSCoda]); - return ba; -} - -// Format log message for memory access with some smartness about registers -QByteArray Snapshot::memoryReadLogMessage(uint addr, uint threadId, bool verbose, const QByteArray &ba) const -{ - QByteArray logMsg = "memory contents"; - const uint *regs = registers(threadId); - if (verbose && regs) { - logMsg += " addr: " + Coda::hexxNumber(addr); - // indicate dereferencing of registers - if (ba.size() == 4) { - if (addr == regs[RegisterPC]) { - logMsg += "[PC]"; - } else if (addr == regs[RegisterPSCoda]) { - logMsg += "[PSTrk]"; - } else if (addr == regs[RegisterSP]) { - logMsg += "[SP]"; - } else if (addr == regs[RegisterLR]) { - logMsg += "[LR]"; - } else if (addr > regs[RegisterSP] && - (addr - regs[RegisterSP]) < 10240) { - logMsg += "[SP+"; // Stack area ...stack seems to be top-down - logMsg += QByteArray::number(addr - regs[RegisterSP]); - logMsg += ']'; - } - } - logMsg += " length "; - logMsg += QByteArray::number(ba.size()); - logMsg += " :"; - logMsg += Coda::stringFromArray(ba, ba.size()).toAscii(); - } - return logMsg; -} - -void Snapshot::syncRegisters(uint threadId, RegisterHandler *handler) const -{ - // Take advantage of direct access to cached register values. - const int threadIndex = indexOfThread(threadId); - QTC_ASSERT(threadIndex != -1, return ;); - const Thread &thread = threadInfo.at(threadIndex); - QTC_ASSERT(thread.registerValid, return ;); - - Registers debuggerRegisters = handler->registers(); - QTC_ASSERT(debuggerRegisters.size() >= RegisterPSGdb, - qDebug() << "HAVE: " << debuggerRegisters.size(); return); - - for (int i = 0; i < RegisterCount; ++i) { - const int gdbIndex = i == RegisterPSCoda ? int(RegisterPSGdb) : i; - Register ® = debuggerRegisters[gdbIndex]; - reg.value = Coda::hexxNumber(thread.registers[i]); - } - handler->setAndMarkRegisters(debuggerRegisters); -} - -void Snapshot::parseGdbStepRange(const QByteArray &cmd, bool so) -{ - const int pos = cmd.indexOf(',', 8); - lineFromAddress = cmd.mid(8, pos - 8).toUInt(0, 16); - lineToAddress = cmd.mid(pos + 1).toUInt(0, 16); - stepOver = so; -} - -void Snapshot::syncThreads(ThreadsHandler *handler) const -{ - // Take advantage of direct access to cached register values. - Threads threads; - const unsigned count = threadInfo.size(); - for (unsigned t = 0; t < count; ++t) { - ThreadData thread(t + 1); // Fake gdb thread ids starting from 1 - thread.targetId = QString::number(threadInfo.at(t).id); - thread.state = threadInfo.at(t).state; - threads.append(thread); - } - handler->setThreads(threads); -} - -// Answer to gdb's 'qSupported' query: -// Increase buffer size for qXfer::libraries XML response -const char *gdbQSupported = - "PacketSize=20000;" - "QPassSignals+;" - "QStartNoAckMode+;" - "qXfer:libraries:read+;" - // "qXfer:auxv:read+;" - "qXfer:features:read+;" - "qRelocInsn-"; // Relocate instructions for trace (gdb 7.2+): Not supported. - -// Answer to gdb "qXfer:features:read:target.xml:" request -// "l<target><architecture>symbianelf</architecture></target>" -// "l<target><architecture>arm-none-symbianelf</architecture></target>" - -const char *gdbArchitectureXml = "l<target><architecture>arm</architecture></target>"; - -QVector<QByteArray> gdbStartupSequence() -{ - QVector<QByteArray> s; - s.reserve(10); - s.push_back(QByteArray("set breakpoint always-inserted on")); - s.push_back(QByteArray("set breakpoint auto-hw on")); - s.push_back(QByteArray("set trust-readonly-sections on")); // No difference? - s.push_back(QByteArray("set displaced-stepping on")); // No difference? - s.push_back(QByteArray("set mem inaccessible-by-default")); - s.push_back(QByteArray("mem 0x00400000 0x70000000 cache")); - s.push_back(QByteArray("mem 0x70000000 0x80000000 cache ro")); - // FIXME: replace with stack-cache for newer gdb? - s.push_back(QByteArray("set remotecache on")); // "info dcache" to check - return s; -} - -// Local symbol file handling - -enum { symDebug = 0 }; - -// Build complete file name of a local sym file from DLL -// 'QtCore.dll' to 'c:\\foo\QtCore.dll.sym'. - -static inline QString symFileName(const QString &folder, - const QString &libName) -{ - QString fileName = folder; - fileName.append(QLatin1Char('/')); - fileName.append(libName); - fileName.append(QLatin1String(".sym")); - return fileName; -} - -// Look up in local symbol file matching remote library loaded in -// cache pointed to by environmentname or in standard location -// (next to application.sym file). -QString localSymFileForLibrary(const QByteArray &libName, - // urel/udeb: exe directory - const QString &standardSymDirectory) -{ - // Check - const QByteArray envSymFileCacheDirectory = qgetenv("QTC_SYMBIAN_SYMBOLFILE_CACHE"); - if (envSymFileCacheDirectory.isEmpty() && standardSymDirectory.isEmpty()) - return QString(); - // Base name - int lastSlashPos = libName.lastIndexOf('/'); - if (lastSlashPos == -1) - lastSlashPos = libName.lastIndexOf('\\'); - const QString libBaseName = QString::fromLatin1(lastSlashPos != - 1 ? libName.mid(lastSlashPos + 1) : libName); - // Check environment variable - if (!envSymFileCacheDirectory.isEmpty()) { - const QFileInfo envFi(symFileName(QString::fromLatin1(envSymFileCacheDirectory), libBaseName)); - if (symDebug) - qDebug("SYM-ENV: %s exists %d\n", qPrintable(envFi.absoluteFilePath()), envFi.isFile()); - if (envFi.isFile()) - return envFi.absoluteFilePath(); - } - // Check standard location - if (!standardSymDirectory.isEmpty()) { - const QFileInfo standardFi(symFileName(standardSymDirectory, libBaseName)); - if (symDebug) - qDebug("SYM-STANDARD: %s exists %d\n", qPrintable(standardFi.absoluteFilePath()), standardFi.isFile()); - if (standardFi.isFile()) - return standardFi.absoluteFilePath(); - } - return QString(); -} - -// Return a load command for a local symbol file for a library with address. -QByteArray symFileLoadCommand(const QString &symFileNameIn, - quint64 code, quint64 data) -{ - QByteArray symFileName = symFileNameIn.toLatin1(); - symFileName.replace('\\', '/'); // gdb wants forward slashes - QByteArray command = "add-symbol-file \""; - command += symFileName; - command += "\" 0x"; - command += QByteArray::number(code, 16); - if (data) { - command += " -s .data 0x"; - command += QByteArray::number(data, 16); - } - return command; -} - -QString msgLoadLocalSymFile(const QString &symFileName, - const QByteArray &libName, quint64 code) -{ - return QString::fromLatin1("Loading symbol file '%1' for '%2' at 0x%3"). - arg(symFileName, QString::fromLatin1(libName)). - arg(code, 0, 16); -} - -} // namespace Symbian - -// Generic gdb server helpers: Read address/length off a memory -// command like 'm845,455','X845,455:' -QPair<quint64, unsigned> parseGdbReadMemoryRequest(const QByteArray &cmd) -{ - QPair<quint64, unsigned> rc(0, 0); - const int pos = cmd.indexOf(','); - if (pos == -1) - return rc; - bool ok; - rc.first = cmd.mid(1, pos - 1).toULongLong(&ok, 16); - if (!ok) - return rc; - const int colonPos = cmd.indexOf(':'); - if (colonPos == -1) - rc.second = cmd.mid(pos + 1).toUInt(&ok, 16); - else - rc.second = cmd.mid(pos + 1, colonPos - pos - 1 ).toUInt(&ok, 16); - if (!ok) - rc.first = 0; - return rc; -} - -// Generic gdb server helpers: Parse 'register write' ('P') request -// return register number/value -QPair<uint, uint> parseGdbWriteRegisterWriteRequest(const QByteArray &cmd) -{ - const int pos = cmd.indexOf('='); - const QByteArray regName = cmd.mid(1, pos - 1); - const QByteArray valueName = cmd.mid(pos + 1); - bool ok = false; - const uint registerNumber = regName.toUInt(&ok, 16); - const uint value = Coda::swapEndian(valueName.toUInt(&ok, 16)); - return QPair<uint, uint>(registerNumber, value); -} - -// Generic gdb server helpers: Parse 'set breakpoint' ('Z0') request -// return address/length -QPair<quint64, unsigned> parseGdbSetBreakpointRequest(const QByteArray &cmd) -{ - // $Z0,786a4ccc,4#99 - const int pos = cmd.lastIndexOf(','); - bool ok1 = false; - bool ok2 = false; - const quint64 addr = cmd.mid(3, pos - 3).toULongLong(&ok1, 16); - const uint len = cmd.mid(pos + 1).toUInt(&ok2, 16); - return ok1 && ok2 ? QPair<quint64, unsigned>(addr, len) : QPair<quint64, unsigned>(0, 0); -} - -} // namespace Internal -} // namespace Debugger diff --git a/src/plugins/debugger/gdb/symbian.h b/src/plugins/debugger/gdb/symbian.h deleted file mode 100644 index 76489a418f5..00000000000 --- a/src/plugins/debugger/gdb/symbian.h +++ /dev/null @@ -1,226 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef SYMBIANUTILS_H -#define SYMBIANUTILS_H - -#include <QMap> -#include <QByteArray> -#include <QString> -#include <QMetaType> -#include <QVector> -#include <QPair> - -QT_BEGIN_NAMESPACE -class QDebug; -QT_END_NAMESPACE - -//#define DEBUG_MEMORY 1 -#if DEBUG_MEMORY -# define MEMORY_DEBUG(s) qDebug() << s -#else -# define MEMORY_DEBUG(s) -#endif -#define MEMORY_DEBUGX(s) qDebug() << s - -namespace Debugger { -namespace Internal { -class RegisterHandler; -class ThreadsHandler; -struct GdbResult { - QByteArray data; -}; - -struct MemoryRange -{ - MemoryRange() : from(0), to(0) {} - MemoryRange(uint f, uint t); - void operator-=(const MemoryRange &other); - bool intersects(const MemoryRange &other) const; - quint64 hash() const { return (quint64(from) << 32) + to; } - bool operator==(const MemoryRange &other) const { return hash() == other.hash(); } - bool operator<(const MemoryRange &other) const { return hash() < other.hash(); } - uint size() const { return to - from; } - - uint from; // Inclusive. - uint to; // Exclusive. -}; - -QDebug operator<<(QDebug d, const MemoryRange &range); - -// Signals to be passed to gdb server as stop reason (2 digit hex) -enum GdbServerStopReason { - gdbServerSignalTrap = 5, // Trap/Breakpoint, etc. - gdbServerSignalSegfault = 11 // Segfault -}; - -namespace Symbian { - -enum CodeMode -{ - ArmMode = 0, - ThumbMode -}; - -enum TargetConstants -{ - RegisterCount = 17, - RegisterSP = 13, // Stack Pointer - RegisterLR = 14, // Return address - RegisterPC = 15, // Program counter - RegisterPSGdb = 25, // gdb's view of the world - RegisterPSCoda = 16, // CODA's view of the world - - MemoryChunkSize = 256 -}; - -enum { KnownRegisters = RegisterPSGdb + 1}; - -const char *registerName(int i); -QByteArray dumpRegister(uint n, uint value); - -inline bool isReadOnly(const MemoryRange &mr) -{ - return mr.from >= 0x70000000 && mr.to < 0x80000000; -} - -// Snapshot thread with cached registers -struct Thread { - explicit Thread(unsigned id = 0); - - void resetRegisters(); - // Gdb helpers for reporting values - QByteArray gdbReportRegisters() const; - QByteArray registerContentsLogMessage() const; - QByteArray gdbRegisterLogMessage(bool verbose) const; - QByteArray gdbReportSingleRegister(unsigned i) const; - QByteArray gdbSingleRegisterLogMessage(unsigned i) const; - - uint id; - uint registers[RegisterCount]; - bool registerValid; - QString state; // Stop reason, for qsThreadExtraInfo -}; - -struct Snapshot -{ - Snapshot(); - - void reset(); // Leaves read-only memory cache and threads alive. - void resetMemory(); // Completely clears memory, leaves threads alive. - void fullReset(); // Clear everything. - void insertMemory(const MemoryRange &range, const QByteArray &ba); - QString toString() const; - - // Helpers to format gdb query packets - QByteArray gdbQsThreadInfo() const; - QByteArray gdbQThreadExtraInfo(const QByteArray &cmd) const; - // Format a gdb T05 stop message with thread and register set - QByteArray gdbStopMessage(uint threadId, int signalNumber, bool reportThreadId) const; - // Format a log message for memory access with some smartness about registers - QByteArray memoryReadLogMessage(uint addr, uint threadId, bool verbose, const QByteArray &ba) const; - // Gdb command parse helpers: 'salnext' - void parseGdbStepRange(const QByteArray &cmd, bool stepOver); - - void addThread(uint threadId); - void removeThread(uint threadId); - int indexOfThread(uint threadId) const; - // Access registers by thread - const uint *registers(uint threadId) const; - uint *registers(uint threadId); - uint registerValue(uint threadId, uint index); - void setRegisterValue(uint threadId, uint index, uint value); - bool registersValid(uint threadId) const; - void setRegistersValid(uint threadId, bool e); - void setThreadState(uint threadId, const QString&); - - // Debugger view helpers: Synchronize registers of thread with register handler. - void syncRegisters(uint threadId, RegisterHandler *handler) const; - // Debugger view helpers: Synchronize threads with threads handler. - void syncThreads(ThreadsHandler *handler) const; - - QVector<Thread> threadInfo; - - typedef QMap<MemoryRange, QByteArray> Memory; - Memory memory; - - // Current state. - MemoryRange wantedMemory; - - // For next step. - uint lineFromAddress; - uint lineToAddress; - bool stepOver; -}; - -struct Breakpoint -{ - Breakpoint(uint offset_ = 0) - { - number = 0; - offset = offset_; - mode = ArmMode; - } - uint offset; - ushort number; - CodeMode mode; -}; - -// Gdb helpers -extern const char *gdbQSupported; -extern const char *gdbArchitectureXml; - -QVector<QByteArray> gdbStartupSequence(); - -// Look up in symbol file matching library name in local cache -QString localSymFileForLibrary(const QByteArray &libName, - const QString &standardSymDirectory = QString()); -// Return a load command for a local symbol file for a library -QByteArray symFileLoadCommand(const QString &symFileName, quint64 code, - quint64 data = 0); -// Utility message -QString msgLoadLocalSymFile(const QString &symFileName, - const QByteArray &libName, quint64 code); - -} // namespace Symbian - -// Generic gdb server helpers: read 'm','X' commands. -QPair<quint64, unsigned> parseGdbReadMemoryRequest(const QByteArray &cmd); -// Parse 'register write' ('P') request, return register number/value -QPair<uint, uint> parseGdbWriteRegisterWriteRequest(const QByteArray &cmd); -// Parse 'set breakpoint' ('Z0') request, return address/length -QPair<quint64, unsigned> parseGdbSetBreakpointRequest(const QByteArray &cmd); - -} // namespace Internal -} // namespace Debugger - -Q_DECLARE_METATYPE(Debugger::Internal::MemoryRange) - -#endif // SYMBIANUTILS_H diff --git a/src/plugins/debugger/qml/qmladapter.cpp b/src/plugins/debugger/qml/qmladapter.cpp index 7c72e468dc9..05da501875d 100644 --- a/src/plugins/debugger/qml/qmladapter.cpp +++ b/src/plugins/debugger/qml/qmladapter.cpp @@ -91,19 +91,6 @@ void QmlAdapter::beginConnectionTcp(const QString &address, quint16 port) m_connectionTimer.start(); } -void QmlAdapter::beginConnectionOst(const QString &channel) -{ - if (m_engine.isNull() - || (m_conn && m_conn->state() != QAbstractSocket::UnconnectedState)) - return; - - showConnectionStatusMessage(tr("Connecting to debug server on %1").arg(channel)); - m_conn->connectToOst(channel); - - //A timeout to check the connection state - m_connectionTimer.start(); -} - void QmlAdapter::closeConnection() { if (m_connectionTimer.isActive()) { diff --git a/src/plugins/debugger/qml/qmladapter.h b/src/plugins/debugger/qml/qmladapter.h index 7ed0a385b3e..e8ab370acc4 100644 --- a/src/plugins/debugger/qml/qmladapter.h +++ b/src/plugins/debugger/qml/qmladapter.h @@ -63,7 +63,6 @@ public: virtual ~QmlAdapter(); void beginConnectionTcp(const QString &address, quint16 port); - void beginConnectionOst(const QString &port); void closeConnection(); QmlDebug::QmlDebugConnection *connection() const; diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 0e8c5f3c5bc..9fb7e8167d4 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -419,8 +419,6 @@ void QmlEngine::beginConnection(quint16 port) QTC_ASSERT(state() == EngineRunRequested, return); if (port > 0) { - QTC_CHECK(startParameters().communicationChannel - == DebuggerStartParameters::CommunicationChannelTcpIp); QTC_ASSERT(startParameters().connParams.port == 0 || startParameters().connParams.port == port, qWarning() << "Port " << port << "from application output does not match" @@ -428,16 +426,9 @@ void QmlEngine::beginConnection(quint16 port) m_adapter.beginConnectionTcp(startParameters().qmlServerAddress, port); return; } - if (startParameters().communicationChannel - == DebuggerStartParameters::CommunicationChannelTcpIp) { - // no port from application output, use the one from start parameters ... - m_adapter.beginConnectionTcp(startParameters().qmlServerAddress, - startParameters().qmlServerPort); - } else { - QTC_CHECK(startParameters().communicationChannel - == DebuggerStartParameters::CommunicationChannelUsb); - m_adapter.beginConnectionOst(startParameters().remoteChannel); - } + // no port from application output, use the one from start parameters ... + m_adapter.beginConnectionTcp(startParameters().qmlServerAddress, + startParameters().qmlServerPort); } void QmlEngine::connectionStartupFailed() diff --git a/src/plugins/debugger/watchutils.cpp b/src/plugins/debugger/watchutils.cpp index de26258c3de..2e2fb334579 100644 --- a/src/plugins/debugger/watchutils.cpp +++ b/src/plugins/debugger/watchutils.cpp @@ -514,11 +514,6 @@ QByteArray gdbQuoteTypes(const QByteArray &type) return result; } -bool isSymbianIntType(const QByteArray &type) -{ - return type == "TInt" || type == "TBool"; -} - // Utilities to decode string data returned by the dumper helpers. QString quoteUnprintableLatin1(const QByteArray &ba) diff --git a/src/plugins/debugger/watchutils.h b/src/plugins/debugger/watchutils.h index 28ff1767a9d..ced524a88a6 100644 --- a/src/plugins/debugger/watchutils.h +++ b/src/plugins/debugger/watchutils.h @@ -96,7 +96,6 @@ QByteArray gdbQuoteTypes(const QByteArray &type); bool isFloatType(const QByteArray &type); bool isIntOrFloatType(const QByteArray &type); bool isIntType(const QByteArray &type); -bool isSymbianIntType(const QByteArray &type); QString formatToolTipAddress(quint64 a); diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index 3590c0addd3..2cd816a9125 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -265,10 +265,6 @@ static QList<Abi> abiOf(const QByteArray &data) result.append(macAbiForCpu(type)); pos += 20; } - } else if (data.size() >= 20 - && getUint8(data, 16) == 'E' && getUint8(data, 17) == 'P' - && getUint8(data, 18) == 'O' && getUint8(data, 19) == 'C') { - result.append(Abi(Abi::ArmArchitecture, Abi::SymbianOS, Abi::SymbianDeviceFlavor, Abi::ElfFormat, 32)); } else if (data.size() >= 64){ // Windows PE: values are LE (except for a few exceptions which we will not use here). @@ -312,10 +308,6 @@ Abi::Abi(const Architecture &a, const OS &o, if (m_osFlavor < GenericMacFlavor || m_osFlavor > GenericMacFlavor) m_osFlavor = UnknownFlavor; break; - case ProjectExplorer::Abi::SymbianOS: - if (m_osFlavor < SymbianDeviceFlavor || m_osFlavor > SymbianEmulatorFlavor) - m_osFlavor = UnknownFlavor; - break; case ProjectExplorer::Abi::UnixOS: if (m_osFlavor < GenericUnixFlavor || m_osFlavor > GenericUnixFlavor) m_osFlavor = UnknownFlavor; @@ -360,8 +352,6 @@ Abi::Abi(const QString &abiString) : m_os = BsdOS; else if (abiParts.at(1) == QLatin1String("macos")) m_os = MacOS; - else if (abiParts.at(1) == QLatin1String("symbian")) - m_os = SymbianOS; else if (abiParts.at(1) == QLatin1String("unix")) m_os = UnixOS; else if (abiParts.at(1) == QLatin1String("windows")) @@ -390,10 +380,6 @@ Abi::Abi(const QString &abiString) : m_osFlavor = HarmattanLinuxFlavor; else if (abiParts.at(2) == QLatin1String("generic") && m_os == MacOS) m_osFlavor = GenericMacFlavor; - else if (abiParts.at(2) == QLatin1String("device") && m_os == SymbianOS) - m_osFlavor = SymbianDeviceFlavor; - else if (abiParts.at(2) == QLatin1String("emulator") && m_os == SymbianOS) - m_osFlavor = SymbianEmulatorFlavor; else if (abiParts.at(2) == QLatin1String("generic") && m_os == UnixOS) m_osFlavor = GenericUnixFlavor; else if (abiParts.at(2) == QLatin1String("solaris") && m_os == UnixOS) @@ -541,8 +527,6 @@ QString Abi::toString(const OS &o) return QLatin1String("bsd"); case MacOS: return QLatin1String("macos"); - case SymbianOS: - return QLatin1String("symbian"); case UnixOS: return QLatin1String("unix"); case WindowsOS: @@ -572,10 +556,6 @@ QString Abi::toString(const OSFlavor &of) return QLatin1String("harmattan"); case ProjectExplorer::Abi::GenericMacFlavor: return QLatin1String("generic"); - case ProjectExplorer::Abi::SymbianDeviceFlavor: - return QLatin1String("device"); - case ProjectExplorer::Abi::SymbianEmulatorFlavor: - return QLatin1String("emulator"); case ProjectExplorer::Abi::GenericUnixFlavor: return QLatin1String("generic"); case ProjectExplorer::Abi::SolarisUnixFlavor: @@ -633,8 +613,6 @@ QList<Abi::OSFlavor> Abi::flavorsForOs(const Abi::OS &o) << AndroidLinuxFlavor;; case MacOS: return result << GenericMacFlavor; - case SymbianOS: - return result << SymbianDeviceFlavor << SymbianEmulatorFlavor; case UnixOS: return result << GenericUnixFlavor << SolarisUnixFlavor; case WindowsOS: @@ -813,9 +791,6 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary_data() << QString::fromLatin1("ppc-macos-generic-mach_o-32bit") << QString::fromLatin1("x86-macos-generic-mach_o-64bit")); - QTest::newRow("dynamic QtCore: symbian") - << QString::fromLatin1("%1/dynamic/symbian.dll").arg(prefix) - << (QStringList() << QString::fromLatin1("arm-symbian-device-elf-32bit")); QTest::newRow("dynamic QtCore: win msvc2012 64bit") << QString::fromLatin1("/tmp/win-msvc2012-64bit.dll").arg(prefix) << (QStringList() << QString::fromLatin1("x86-windows-msvc2012-pe-64bit")); diff --git a/src/plugins/projectexplorer/abi.h b/src/plugins/projectexplorer/abi.h index 09c594389c8..eddce19e584 100644 --- a/src/plugins/projectexplorer/abi.h +++ b/src/plugins/projectexplorer/abi.h @@ -60,7 +60,6 @@ public: BsdOS, LinuxOS, MacOS, - SymbianOS, UnixOS, WindowsOS, UnknownOS @@ -81,10 +80,6 @@ public: // Mac GenericMacFlavor, - // Symbian - SymbianDeviceFlavor, - SymbianEmulatorFlavor, - // Unix GenericUnixFlavor, SolarisUnixFlavor, diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index a9a49374625..cdae6badcd4 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -246,11 +246,6 @@ static QList<Abi> guessGccAbi(const QString &m) if (flavor == Abi::UnknownFlavor) flavor = Abi::FreeBsdFlavor; format = Abi::ElfFormat; - } else if (p == QLatin1String("symbianelf")) { - os = Abi::SymbianOS; - flavor = Abi::SymbianDeviceFlavor; - format = Abi::ElfFormat; - width = 32; } else if (p == QLatin1String("mingw32") || p == QLatin1String("win32") || p == QLatin1String("mingw32msvc")) { arch = Abi::X86Architecture; os = Abi::WindowsOS; @@ -1136,9 +1131,6 @@ void ProjectExplorerPlugin::testGccAbiGuessing_data() << QString::fromLatin1("86_64 x86_64 GNU/Linux") << (QStringList() << QLatin1String("x86-linux-generic-elf-64bit") << QLatin1String("x86-linux-generic-elf-32bit")); - QTest::newRow("Symbian 1") - << QString::fromLatin1("arm-none-symbianelf") - << (QStringList() << QLatin1String("arm-symbian-device-elf-32bit")); QTest::newRow("FreeBSD 1") << QString::fromLatin1("i386-portbld-freebsd9.0") << (QStringList() << QLatin1String("x86-bsd-freebsd-elf-32bit")); diff --git a/src/plugins/projectexplorer/images/SymbianEmulator.png b/src/plugins/projectexplorer/images/Simulator.png Binary files differindex 447054bac80..447054bac80 100644 --- a/src/plugins/projectexplorer/images/SymbianEmulator.png +++ b/src/plugins/projectexplorer/images/Simulator.png diff --git a/src/plugins/projectexplorer/images/SymbianDevice.png b/src/plugins/projectexplorer/images/SymbianDevice.png Binary files differdeleted file mode 100644 index 8281bf527be..00000000000 --- a/src/plugins/projectexplorer/images/SymbianDevice.png +++ /dev/null diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index c98494b2a2a..b111138461d 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -241,8 +241,7 @@ QtcPlugin { "images/MaemoDevice.png", "images/ProjectDependencies.png", "images/RunSettings.png", - "images/SymbianDevice.png", - "images/SymbianEmulator.png", + "images/Simulator.png", "images/build.png", "images/build_32.png", "images/build_small.png", diff --git a/src/plugins/projectexplorer/projectexplorer.qrc b/src/plugins/projectexplorer/projectexplorer.qrc index b639e5f16ac..b36371d1069 100644 --- a/src/plugins/projectexplorer/projectexplorer.qrc +++ b/src/plugins/projectexplorer/projectexplorer.qrc @@ -27,8 +27,7 @@ <file>images/EditorSettings.png</file> <file>images/ProjectDependencies.png</file> <file>images/MaemoDevice.png</file> - <file>images/SymbianDevice.png</file> - <file>images/SymbianEmulator.png</file> + <file>images/Simulator.png</file> <file>images/DeviceConnected.png</file> <file>images/DeviceDisconnected.png</file> <file>images/DeviceReadyToUse.png</file> diff --git a/src/plugins/projectexplorer/settingsaccessor.cpp b/src/plugins/projectexplorer/settingsaccessor.cpp index 4dbf42e64fe..9468e9aedbf 100644 --- a/src/plugins/projectexplorer/settingsaccessor.cpp +++ b/src/plugins/projectexplorer/settingsaccessor.cpp @@ -1417,14 +1417,6 @@ QVariantMap Version1Handler::update(Project *project, const QVariantMap &map) QCoreApplication::translate("Qt4ProjectManager::Internal::Qt4Target", "Desktop", "Qt4 Desktop target display name")) - << TargetDescription(QString::fromLatin1("Qt4ProjectManager.Target.S60EmulatorTarget"), - QCoreApplication::translate("Qt4ProjectManager::Internal::Qt4Target", - "Symbian Emulator", - "Qt4 Symbian Emulator target display name")) - << TargetDescription(QString::fromLatin1("Qt4ProjectManager.Target.S60DeviceTarget"), - QCoreApplication::translate("Qt4ProjectManager::Internal::Qt4Target", - "Symbian Device", - "Qt4 Symbian Device target display name")) << TargetDescription(QString::fromLatin1("Qt4ProjectManager.Target.MaemoEmulatorTarget"), QCoreApplication::translate("Qt4ProjectManager::Internal::Qt4Target", "Maemo Emulator", @@ -1559,69 +1551,7 @@ QVariantMap Version3Handler::update(Project *, const QVariantMap &map) continue; } const QVariantMap &originalTarget = it.value().toMap(); - // check for symbian device target - if (originalTarget.value(QLatin1String("ProjectExplorer.ProjectConfiguration.Id")) - != QLatin1String("Qt4ProjectManager.Target.S60DeviceTarget")) { - result.insert(targetKey, originalTarget); - continue; - } - QVariantMap newTarget; - // first iteration: search run configurations, get signing info, remove old signing keys - QString customKeyPath; - QString customSignaturePath; - int signingMode = 0; // SelfSign - QMapIterator<QString, QVariant> targetIt(originalTarget); - while (targetIt.hasNext()) { - targetIt.next(); - const QString &key = targetIt.key(); - if (key.startsWith(QLatin1String("ProjectExplorer.Target.BuildConfiguration."))) { - // build configurations are handled in second iteration - continue; - } - if (!key.startsWith(QLatin1String("ProjectExplorer.Target.RunConfiguration."))) { - newTarget.insert(key, targetIt.value()); - continue; - } - QVariantMap runConfig = targetIt.value().toMap(); - if (runConfig.value(QLatin1String("ProjectExplorer.ProjectConfiguration.Id")) - != QLatin1String("Qt4ProjectManager.S60DeviceRunConfiguration")) { - newTarget.insert(key, runConfig); - continue; - } - // get signing info - customKeyPath = runConfig.value(QLatin1String("Qt4ProjectManager.S60DeviceRunConfiguration.CustomKeyPath")).toString(); - customSignaturePath = runConfig.value(QLatin1String("Qt4ProjectManager.S60DeviceRunConfiguration.CustomSignaturePath")).toString(); - signingMode = runConfig.value(QLatin1String("Qt4ProjectManager.S60DeviceRunConfiguration.SigningMode")).toInt(); - // remove old signing keys - runConfig.remove(QLatin1String("Qt4ProjectManager.S60DeviceRunConfiguration.CustomKeyPath")); - runConfig.remove(QLatin1String("Qt4ProjectManager.S60DeviceRunConfiguration.CustomSignaturePath")); - runConfig.remove(QLatin1String("Qt4ProjectManager.S60DeviceRunConfiguration.SigningMode")); - newTarget.insert(key, runConfig); - } - - // second iteration: add new signing build step - targetIt.toFront(); - while (targetIt.hasNext()) { - targetIt.next(); - const QString &key = targetIt.key(); - if (!key.startsWith(QLatin1String("ProjectExplorer.Target.BuildConfiguration."))) { - // everything except build configs already handled - continue; - } - QVariantMap buildConfig = targetIt.value().toMap(); - int stepCount = buildConfig.value(QLatin1String("ProjectExplorer.BuildConfiguration.BuildStepsCount")).toInt(); - QVariantMap signBuildStep; - signBuildStep.insert(QLatin1String("ProjectExplorer.ProjectConfiguration.DisplayName"), QLatin1String("Create SIS package")); - signBuildStep.insert(QLatin1String("ProjectExplorer.ProjectConfiguration.Id"), QLatin1String("Qt4ProjectManager.S60SignBuildStep")); - signBuildStep.insert(QLatin1String("Qt4ProjectManager.MakeStep.Clean"), false); - signBuildStep.insert(QLatin1String("Qt4ProjectManager.S60CreatePackageStep.Certificate"), customSignaturePath); - signBuildStep.insert(QLatin1String("Qt4ProjectManager.S60CreatePackageStep.Keyfile"), customKeyPath); - signBuildStep.insert(QLatin1String("Qt4ProjectManager.S60CreatePackageStep.SignMode"), signingMode); - buildConfig.insert(QString::fromLatin1("ProjectExplorer.BuildConfiguration.BuildStep.%1").arg(stepCount), signBuildStep); - buildConfig.insert(QLatin1String("ProjectExplorer.BuildConfiguration.BuildStepsCount"), stepCount + 1); - newTarget.insert(key, buildConfig); - } - result.insert(targetKey, newTarget); + result.insert(targetKey, originalTarget); } return result; } @@ -1645,10 +1575,8 @@ QVariantMap Version4Handler::update(Project *, const QVariantMap &map) continue; } const QVariantMap &originalTarget = it.value().toMap(); - // check for symbian and maemo device target + // check for maemo device target if (originalTarget.value(QLatin1String("ProjectExplorer.ProjectConfiguration.Id")) - != QLatin1String("Qt4ProjectManager.Target.S60DeviceTarget") - && originalTarget.value(QLatin1String("ProjectExplorer.ProjectConfiguration.Id")) != QLatin1String("Qt4ProjectManager.Target.MaemoDeviceTarget")) { result.insert(globalKey, originalTarget); @@ -1742,10 +1670,8 @@ QVariantMap Version5Handler::update(Project *, const QVariantMap &map) continue; } const QVariantMap &originalTarget = it.value().toMap(); - // check for symbian and maemo device target + // check for maemo device target if (originalTarget.value(QLatin1String("ProjectExplorer.ProjectConfiguration.Id")) - != QLatin1String("Qt4ProjectManager.Target.S60DeviceTarget") - && originalTarget.value(QLatin1String("ProjectExplorer.ProjectConfiguration.Id")) != QLatin1String("Qt4ProjectManager.Target.MaemoDeviceTarget")) { result.insert(globalKey, originalTarget); continue; @@ -1818,8 +1744,6 @@ QVariantMap Version6Handler::update(Project *, const QVariantMap &map) if (targetKey == QLatin1String("ProjectExplorer.ProjectConfiguration.Id")) { if (targetIt.value().toString() == QLatin1String("Qt4ProjectManager.Target.MaemoDeviceTarget")) deploymentName = QCoreApplication::translate("ProjectExplorer::UserFileHandler", "Deploy to Maemo device"); - else if (targetIt.value().toString() == QLatin1String("Qt4ProjectManager.Target.S60DeviceTarget")) - deploymentName = QCoreApplication::translate("ProjectExplorer::UserFileHandler", "Deploy to Symbian device"); } if (!targetKey.startsWith(QLatin1String("ProjectExplorer.Target.BuildConfiguration."))) { @@ -1910,45 +1834,7 @@ QVariantMap Version7Handler::update(Project *, const QVariantMap &map) continue; } const QVariantMap &originalTarget = it.value().toMap(); - // check for symbian device target - if (originalTarget.value(QLatin1String("ProjectExplorer.ProjectConfiguration.Id")) - != QLatin1String("Qt4ProjectManager.Target.S60DeviceTarget") ) { - result.insert(globalKey, originalTarget); - continue; - } - - QVariantMap newTarget; - QMapIterator<QString, QVariant> targetIt(originalTarget); - while (targetIt.hasNext()) { - targetIt.next(); - const QString &targetKey = targetIt.key(); - if (targetKey.startsWith(QLatin1String("ProjectExplorer.Target.RunConfiguration."))) { - QVariantMap newRunConfiguration; - const QVariantMap &originalRc = targetIt.value().toMap(); - - QMapIterator<QString, QVariant> rcIt(originalRc); - while (rcIt.hasNext()) { - rcIt.next(); - const QString &rcKey = rcIt.key(); - // remove installation related data from RunConfiguration - if (rcKey.startsWith(QLatin1String("Qt4ProjectManager.S60DeviceRunConfiguration.InstallationDriveLetter"))) { - continue; - } - if (rcKey.startsWith(QLatin1String("Qt4ProjectManager.S60DeviceRunConfiguration.SerialPortName"))) { - continue; - } - if (rcKey.startsWith(QLatin1String("Qt4ProjectManager.S60DeviceRunConfiguration.SilentInstall"))) { - continue; - } - newRunConfiguration.insert(rcKey, rcIt.value()); - } - newTarget.insert(targetKey, newRunConfiguration); - } else { - newTarget.insert(targetKey, targetIt.value()); - continue; - } - } - result.insert(globalKey, newTarget); + result.insert(globalKey, originalTarget); } return result; } @@ -2445,12 +2331,8 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map) } else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.MeegoDeviceTarget")) { tmpProfile->setIconPath(QLatin1String(":/projectexplorer/images/MaemoDevice.png")); tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("MeegoOsType")); - } else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.S60DeviceTarget")) { - tmpProfile->setIconPath(QLatin1String(":/projectexplorer/images/SymbianDevice.png")); - tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Qt4ProjectManager.SymbianDevice")); - tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString::fromLatin1("Symbian Device")); } else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.QtSimulatorTarget")) { - tmpProfile->setIconPath(QLatin1String(":/projectexplorer/images/SymbianEmulator.png")); + tmpProfile->setIconPath(QLatin1String(":/projectexplorer/images/Simulator.png")); tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Desktop")); } else { tmpProfile->setIconPath(QLatin1String(":///DESKTOP///")); @@ -2493,12 +2375,8 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map) const QVariantMap &dc = deployIt.value(); // Device QString devId = dc.value(QLatin1String("Qt4ProjectManager.MaemoRunConfiguration.DeviceId")).toString(); - if (devId.isEmpty()) { - if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.S60DeviceTarget")) - devId = QByteArray("Symbian Device"); - else - devId = QByteArray("Desktop Device"); - } + if (devId.isEmpty()) + devId = QByteArray("Desktop Device"); if (!devId.isEmpty() && !DeviceManager::instance()->find(Core::Id(devId))) // We do not know that device devId.clear(); tmpProfile->setValue(Core::Id("PE.Profile.Device"), devId); diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp index e39240df302..f088b25e6e1 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp @@ -266,8 +266,6 @@ void ItemLibraryWidget::updateImports() foreach (const Import &import, d->model->imports()) if (import.isLibraryImport()) imports << import.url(); - if (imports.contains("com.nokia.symbian", Qt::CaseInsensitive)) - filter = Symbian; if (imports.contains("com.nokia.meego", Qt::CaseInsensitive)) filter = Meego; } @@ -290,23 +288,16 @@ QList<QToolButton *> ItemLibraryWidget::createToolBarWidgets() QAction * basicQtAction = new QAction(menu); basicQtAction->setCheckable(true); basicQtAction->setText("Basic Qt Quick only"); - QAction * symbianAction = new QAction(menu); - symbianAction->setCheckable(true); - symbianAction->setText("Symbian Components"); QAction * meegoAction= new QAction(menu); meegoAction->setCheckable(true); meegoAction->setText("Meego Components"); menu->addAction(basicQtAction); menu->addAction(meegoAction); - menu->addAction(symbianAction); buttons.first()->setMenu(menu); connect(basicQtAction, SIGNAL(toggled(bool)), this, SLOT(onQtBasicOnlyChecked(bool))); connect(this, SIGNAL(qtBasicOnlyChecked(bool)), basicQtAction, SLOT(setChecked(bool))); - connect(symbianAction, SIGNAL(toggled(bool)), this, SLOT(onSymbianChecked(bool))); - connect(this, SIGNAL(symbianChecked(bool)), symbianAction, SLOT(setChecked(bool))); - connect(meegoAction, SIGNAL(toggled(bool)), this, SLOT(onMeegoChecked(bool))); connect(this, SIGNAL(meegoChecked(bool)), meegoAction, SLOT(setChecked(bool))); @@ -355,7 +346,6 @@ void ItemLibraryWidget::emitImportChecked() bool qtOnlyImport = false; bool meegoImport = false; - bool symbianImport = false; foreach (const Import &import, d->model->imports()) { if (import.isLibraryImport()) { @@ -363,17 +353,14 @@ void ItemLibraryWidget::emitImportChecked() meegoImport = true; if (import.url().contains(QString("Qt"), Qt::CaseInsensitive) || import.url().contains(QString("QtQuick"), Qt::CaseInsensitive)) qtOnlyImport = true; - if (import.url().contains(QString("symbian"), Qt::CaseInsensitive)) - symbianImport = true; } } - if (meegoImport || symbianImport) + if (meegoImport) qtOnlyImport = false; emit qtBasicOnlyChecked(qtOnlyImport); emit meegoChecked(meegoImport); - emit symbianChecked(symbianImport); } void ItemLibraryWidget::setImportFilter(FilterChangeFlag flag) @@ -395,16 +382,10 @@ void ItemLibraryWidget::setImportFilter(FilterChangeFlag flag) QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); try { block = true; - if (flag == QtBasic) { - removeImport(QLatin1String("com.nokia.meego")); - removeImport(QLatin1String("com.nokia.symbian")); - } else if (flag == Symbian) { + if (flag == QtBasic) removeImport(QLatin1String("com.nokia.meego")); - addImport(QLatin1String("com.nokia.symbian"), QLatin1String("1.0")); - } else if (flag == Meego) { - removeImport(QLatin1String("com.nokia.symbian")); + else if (flag == Meego) addImport(QLatin1String("com.nokia.meego"), QLatin1String("1.0")); - } QApplication::restoreOverrideCursor(); block = false; m_filterFlag = flag; @@ -431,14 +412,6 @@ void ItemLibraryWidget::onMeegoChecked(bool b) setImportFilter(Meego); } -void ItemLibraryWidget::onSymbianChecked(bool b) -{ - if (b) - setImportFilter(Symbian); -} - - - void ItemLibraryWidget::updateModel() { d->m_itemLibraryModel->update(d->m_itemLibraryInfo.data(), d->model); diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.h index dd0b96d3a9b..b2b76eb080a 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.h @@ -48,8 +48,7 @@ class ItemLibraryWidget : public QFrame enum FilterChangeFlag { QtBasic = 0x0, - Meego = 0x1, - Symbian = 0x2 + Meego = 0x1 }; public: @@ -77,7 +76,6 @@ public Q_SLOTS: void onQtBasicOnlyChecked(bool b); void onMeegoChecked(bool b); - void onSymbianChecked(bool b); protected: void wheelEvent(QWheelEvent *event); @@ -91,7 +89,6 @@ signals: void resetItemsView(); void qtBasicOnlyChecked(bool b); void meegoChecked(bool b); - void symbianChecked(bool b); private: ItemLibraryWidgetPrivate *d; diff --git a/src/plugins/qmldesigner/components/themeloader/qts60stylethemeio.cpp b/src/plugins/qmldesigner/components/themeloader/qts60stylethemeio.cpp deleted file mode 100644 index ab65b01fce3..00000000000 --- a/src/plugins/qmldesigner/components/themeloader/qts60stylethemeio.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the $MODULE$ of the Qt Toolkit. -** -** $TROLLTECH_DUAL_LICENSE$ -** -****************************************************************************/ - -#include "qts60stylethemeio.h" - -#if !defined(QT_NO_STYLE_S60) - -#include "qs60style.h" -#include "qapplication.h" -#include "qwebview.h" -#include "qwebframe.h" -#include "qeventloop.h" -#include "qpicture.h" -#include "qpicture.h" -#include "qpainter.h" -#include "qfile.h" -#include "qdir.h" -#include "qfileinfo.h" -#include "qxmlstream.h" -#include "qbuffer.h" - -#include "qdebug.h" - -static const quint32 blobVersion = 1; -static const int pictureSize = 256; - -void dumpPartPictures(const QHash<QString, QPicture> &partPictures) { - foreach (const QString &partKey, partPictures.keys()) { - QPicture partPicture = partPictures.value(partKey); - qDebug() << partKey << partPicture.boundingRect(); - QImage image(partPicture.boundingRect().size(), QImage::Format_ARGB32); - image.fill(Qt::transparent); - QPainter p(&image); - partPicture.play(&p); - image.save(partKey + QString::fromLatin1(".png")); - } -} - -void dumpColors(const QHash<QPair<QString, int>, QColor> &colors) { - foreach (const QColor &color, colors.values()) { - const QPair<QString, int> key = colors.key(color); - qDebug() << key << color; - } -} - -bool setS60Theme(QHash<QString, QPicture> &partPictures, - QHash<QPair<QString, int>, QColor> &colors, - QS60Style *s60Style) -{ - if (!s60Style) - s60Style = qobject_cast<QS60Style *>(QApplication::style()); - if (!s60Style || !qobject_cast<QS60Style *>(s60Style)) { - qWarning() << __FUNCTION__ << ": No QS60Style found."; - return false; - } - s60Style->setS60Theme(partPictures, colors); - return true; -} - -#ifndef QT_NO_WEBKIT -class WebKitSVGRenderer : public QWebView -{ - Q_OBJECT - -public: - WebKitSVGRenderer(QWidget *parent = 0); - QPicture svgToQPicture(const QString &svgFileName); - -private slots: - void loadFinishedSlot(bool ok); - -private: - QEventLoop m_loop; - QPicture m_result; -}; - -WebKitSVGRenderer::WebKitSVGRenderer(QWidget *parent) - : QWebView(parent) -{ - connect(this, SIGNAL(loadFinished(bool)), SLOT(loadFinishedSlot(bool))); - setFixedSize(pictureSize, pictureSize); - QPalette pal = palette(); - pal.setColor(QPalette::Base, Qt::transparent); - setPalette(pal); -} - -QPicture WebKitSVGRenderer::svgToQPicture(const QString &svgFileName) -{ - load(QUrl::fromLocalFile(svgFileName)); - m_loop.exec(); - return m_result; -} - -void WebKitSVGRenderer::loadFinishedSlot(bool ok) -{ - // crude error-checking - if (!ok) - qDebug() << "Failed loading " << qPrintable(url().toString()); - - page()->mainFrame()->evaluateJavaScript( - "document.rootElement.preserveAspectRatio.baseVal.align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_NONE;" - "document.rootElement.style.width = '100%';" - "document.rootElement.style.height = '100%';" - "document.rootElement.width.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE, 100);" - "document.rootElement.height.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE, 100);" - ); - - m_result = QPicture(); // "Clear" - QPainter p(&m_result); - page()->mainFrame()->render(&p); - p.end(); - m_result.setBoundingRect(QRect(0, 0, pictureSize, pictureSize)); - - m_loop.exit(); -} - -bool parseTdfFile(const QString &tdfFile, - QHash<QString, QString> &partSvgs, - QHash<QPair<QString, int>, QColor> &colors) -{ - const QLatin1String elementKey("element"); - const QLatin1String partKey("part"); - const QLatin1String elementIdKey("id"); - const QLatin1String layerKey("layer"); - const QLatin1String layerFileNameKey("filename"); - const QLatin1String layerColourrgbKey("colourrgb"); - const QString annoyingPrefix("S60_2_6%"); - QFile file(tdfFile); - if (!file.open(QIODevice::ReadOnly)) - return false; - QXmlStreamReader reader(&file); - QString partId; - QPair<QString, int> colorId; - // Somebody with a sense of aesthetics may implement proper XML parsing, here. - while (!reader.atEnd()) { - const QXmlStreamReader::TokenType token = reader.readNext(); - switch (token) { - case QXmlStreamReader::StartElement: - if (reader.name() == elementKey || reader.name() == partKey) { - QString id = reader.attributes().value(elementIdKey).toString(); - if (QS60Style::partKeys().contains(id)) { - partId = id; - } else if (!id.isEmpty() && id.at(id.length()-1).isDigit()) { - QString idText = id; - idText.remove(QRegExp("[0-9]")); - if (QS60Style::colorListKeys().contains(idText)) { - QString idNumber = id; - idNumber.remove(QRegExp("[a-zA-Z]")); - colorId = QPair<QString, int>(idText, idNumber.toInt()); - } - } else if (QS60Style::partKeys().contains(id.mid(annoyingPrefix.length()))) { - partId = id.mid(annoyingPrefix.length()); - } - } else if (reader.name() == layerKey) { - if (!partId.isEmpty()) { - const QString svgFile = reader.attributes().value(layerFileNameKey).toString(); - partSvgs.insert(partId, svgFile); - partId.clear(); - } else if (!colorId.first.isEmpty()) { - const QColor colorValue(reader.attributes().value(layerColourrgbKey).toString().toInt(NULL, 16)); - colors.insert(colorId, colorValue); - colorId.first.clear(); - } - } - break; - case QXmlStreamReader::EndElement: - if (reader.tokenString() == elementKey || reader.name() == partKey) - partId.clear(); - break; - default: - break; - } - } - return true; -} - -bool loadThemeFromTdf(const QString &tdfFile, - QHash<QString, QPicture> &partPictures, - QHash<QPair<QString, int>, QColor> &colors) -{ - QHash<QString, QString> parsedPartSvgs; - QHash<QString, QPicture> parsedPartPictures; - QHash<QPair<QString, int>, QColor> parsedColors; - bool success = parseTdfFile(tdfFile, parsedPartSvgs, parsedColors); - if (!success) - return false; - const QString tdfBasePath = QFileInfo(tdfFile).absolutePath(); - WebKitSVGRenderer renderer; - foreach(const QString& partKey, parsedPartSvgs.keys()) { - const QString tdfFullName = - tdfBasePath + QDir::separator() + parsedPartSvgs.value(partKey); - if (!QFile(tdfFullName).exists()) - qWarning() << "Could not load part " << tdfFullName; - const QPicture partPicture = renderer.svgToQPicture(tdfFullName); - parsedPartPictures.insert(partKey, partPicture); - } -// dumpPartPictures(parsedPartPictures); -// dumpColors(colors); - partPictures = parsedPartPictures; - colors = parsedColors; - return true; -} - -bool QtS60StyleThemeIO::loadThemeFromTdf(const QString &themeTdf, QS60Style *s60Style) -{ - QHash<QString, QPicture> partPictures; - QHash<QPair<QString, int>, QColor> colors; - - if (!::loadThemeFromTdf(themeTdf, partPictures, colors)) - return false; - - return ::setS60Theme(partPictures, colors, s60Style); -} - -bool QtS60StyleThemeIO::convertTdfToBlob(const QString &themeTdf, const QString &themeBlob) -{ - QHash<QString, QPicture> partPictures; - QHash<QPair<QString, int>, QColor> colors; - - if (!::loadThemeFromTdf(themeTdf, partPictures, colors)) - return false; - - QFile blob(themeBlob); - if (!blob.open(QIODevice::WriteOnly)) { - qWarning() << __FUNCTION__ << ": Could not create blob: " << themeBlob; - return false; - } - - QByteArray data; - QBuffer dataBuffer(&data); - dataBuffer.open(QIODevice::WriteOnly); - QDataStream dataOut(&dataBuffer); - - const int colorsCount = colors.count(); - dataOut << colorsCount; - const QList<QPair<QString, int> > colorKeys = colors.keys(); - for (int i = 0; i < colorsCount; ++i) { - const QPair<QString, int> &key = colorKeys.at(i); - dataOut << key; - const QColor color = colors.value(key); - dataOut << color; - } - - const int picturesCount = partPictures.count(); - dataOut << picturesCount; - foreach (const QString &key, partPictures.keys()) { - const QPicture picture = partPictures.value(key); - dataOut << key; - dataOut << picture; - } - - QDataStream blobOut(&blob); - blobOut << blobVersion; - blobOut << qCompress(data); - return blobOut.status() == QDataStream::Ok; -} -#endif // !QT_NO_WEBKIT - -bool QtS60StyleThemeIO::loadThemeFromBlob(const QString &themeBlob, QS60Style *s60Style) -{ - QHash<QString, QPicture> partPictures; - QHash<QPair<QString, int>, QColor> colors; - - QFile blob(themeBlob); - if (!blob.open(QIODevice::ReadOnly)) { - qWarning() << __FUNCTION__ << ": Could not read blob: " << themeBlob; - return false; - } - QDataStream blobIn(&blob); - - quint32 version; - blobIn >> version; - - if (version != blobVersion) { - qWarning() << __FUNCTION__ << ": Invalid blob version: " << version << " ...expected: " << blobVersion; - return false; - } - - QByteArray data; - blobIn >> data; - data = qUncompress(data); - QBuffer dataBuffer(&data); - dataBuffer.open(QIODevice::ReadOnly); - QDataStream dataIn(&dataBuffer); - - int colorsCount; - dataIn >> colorsCount; - for (int i = 0; i < colorsCount; ++i) { - QPair<QString, int> key; - dataIn >> key; - QColor value; - dataIn >> value; - colors.insert(key, value); - } - - int picturesCount; - dataIn >> picturesCount; - for (int i = 0; i < picturesCount; ++i) { - QString key; - dataIn >> key; - QPicture value; - dataIn >> value; - value.setBoundingRect(QRect(0, 0, pictureSize, pictureSize)); // Bug? The forced bounding rect was not deserialized. - partPictures.insert(key, value); - } - - if (dataIn.status() != QDataStream::Ok) { - qWarning() << __FUNCTION__ << ": Invalid data blob: " << themeBlob; - return false; - } - -// dumpPartPictures(partPictures); -// dumpColors(colors); - - return ::setS60Theme(partPictures, colors, s60Style); -} - -#include "qts60stylethemeio.moc" - -#endif // QT_NO_STYLE_S60 diff --git a/src/plugins/qmldesigner/components/themeloader/qts60stylethemeio.h b/src/plugins/qmldesigner/components/themeloader/qts60stylethemeio.h deleted file mode 100644 index 4a606355c78..00000000000 --- a/src/plugins/qmldesigner/components/themeloader/qts60stylethemeio.h +++ /dev/null @@ -1,59 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the $MODULE$ of the Qt Toolkit. -** -** $TROLLTECH_DUAL_LICENSE$ -** -****************************************************************************/ - -#ifndef QTS60STYLETHEMEIO_H -#define QTS60STYLETHEMEIO_H - -#include "qstring.h" - -class QS60Style; - -class QtS60StyleThemeIO -{ -public: - static bool loadThemeFromBlob(const QString &themeBlob, QS60Style *s60Style = 0); -#ifndef QT_NO_WEBKIT - static bool loadThemeFromTdf(const QString &themeTdf, QS60Style *s60Style = 0); - static bool convertTdfToBlob(const QString &themeTdf, const QString &themeBlob); -#endif -}; - -#endif // QTS60STYLETHEMEIO_H diff --git a/src/plugins/qmldesigner/components/themeloader/qts60stylethemeio.pri b/src/plugins/qmldesigner/components/themeloader/qts60stylethemeio.pri deleted file mode 100644 index ec800883be0..00000000000 --- a/src/plugins/qmldesigner/components/themeloader/qts60stylethemeio.pri +++ /dev/null @@ -1,6 +0,0 @@ -contains(QT_CONFIG, webkit) { - QT += webkit -} -#SOURCES += $$PWD/qts60stylethemeio.cpp -#INCLUDE += $$PWD/qts60stylethemeio.h -#INCLUDEPATH += $$PWD diff --git a/src/plugins/qmldesigner/config.pri b/src/plugins/qmldesigner/config.pri index 24a75f2553b..f10396351d6 100644 --- a/src/plugins/qmldesigner/config.pri +++ b/src/plugins/qmldesigner/config.pri @@ -1,6 +1,4 @@ # MOC_DIR = moc -DEFINES += QT_NO_STYLE_S60 - debug { DEFINES += VIEWLOGGER } diff --git a/src/plugins/qmldesigner/customstyleplugin/customstyleplugin.pri b/src/plugins/qmldesigner/customstyleplugin/customstyleplugin.pri index d0b68ece2a0..3d857270a4a 100644 --- a/src/plugins/qmldesigner/customstyleplugin/customstyleplugin.pri +++ b/src/plugins/qmldesigner/customstyleplugin/customstyleplugin.pri @@ -7,7 +7,6 @@ QT += script \ include (../designercore/iwidgetplugin.pri) -DEFINES += SYMBIAN_LIBRARY SOURCES += $$PWD/customstyleplugin.cpp HEADERS += $$PWD/customstyleplugin.h $$PWD/../designercore/include/iwidgetplugin.h diff --git a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp index 02f1201bbaf..8377112d39c 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp @@ -59,7 +59,7 @@ static inline QStringList importPaths() { // env import paths QByteArray envImportPath = qgetenv("QML_IMPORT_PATH"); if (!envImportPath.isEmpty()) { -#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) +#if defined(Q_OS_WIN) QLatin1Char pathSep(';'); #else QLatin1Char pathSep(':'); diff --git a/src/plugins/qmldesigner/desktopplugin/desktopplugin.pri b/src/plugins/qmldesigner/desktopplugin/desktopplugin.pri index 302272967e2..ec6277c6188 100644 --- a/src/plugins/qmldesigner/desktopplugin/desktopplugin.pri +++ b/src/plugins/qmldesigner/desktopplugin/desktopplugin.pri @@ -7,7 +7,6 @@ QT += script \ include (../designercore/iwidgetplugin.pri) -DEFINES += SYMBIAN_LIBRARY SOURCES += $$PWD/desktopplugin.cpp HEADERS += $$PWD/desktopplugin.h $$PWD/../designercore/include/iwidgetplugin.h diff --git a/src/plugins/qmldesigner/extrasplugin/extrasplugin.pri b/src/plugins/qmldesigner/extrasplugin/extrasplugin.pri index 12f923cb1e5..3faaed83f31 100644 --- a/src/plugins/qmldesigner/extrasplugin/extrasplugin.pri +++ b/src/plugins/qmldesigner/extrasplugin/extrasplugin.pri @@ -7,7 +7,6 @@ QT += script \ include (../designercore/iwidgetplugin.pri) -DEFINES += SYMBIAN_LIBRARY SOURCES += $$PWD/extrasplugin.cpp HEADERS += $$PWD/extrasplugin.h $$PWD/../designercore/include/iwidgetplugin.h diff --git a/src/plugins/qmldesigner/meegoplugin/meegoplugin.pri b/src/plugins/qmldesigner/meegoplugin/meegoplugin.pri index 04abc898749..d457b3c4136 100644 --- a/src/plugins/qmldesigner/meegoplugin/meegoplugin.pri +++ b/src/plugins/qmldesigner/meegoplugin/meegoplugin.pri @@ -7,7 +7,6 @@ QT += script \ include (../designercore/iwidgetplugin.pri) -DEFINES += SYMBIAN_LIBRARY SOURCES += $$PWD/meegoplugin.cpp HEADERS += $$PWD/meegoplugin.h $$PWD/../designercore/include/iwidgetplugin.h diff --git a/src/plugins/qmldesigner/qmldesigner.pro b/src/plugins/qmldesigner/qmldesigner.pro index 40bb44a19d6..35d3d369908 100644 --- a/src/plugins/qmldesigner/qmldesigner.pro +++ b/src/plugins/qmldesigner/qmldesigner.pro @@ -1,3 +1,3 @@ TEMPLATE = subdirs -SUBDIRS = qmldesignerplugin.pro qtquickplugin symbianplugin meegoplugin extrasplugin desktopplugin customstyleplugin +SUBDIRS = qmldesignerplugin.pro qtquickplugin meegoplugin extrasplugin desktopplugin customstyleplugin diff --git a/src/plugins/qmldesigner/qmldesignerplugin.pro b/src/plugins/qmldesigner/qmldesignerplugin.pro index fcac4a10ad4..d042701c192 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.pro +++ b/src/plugins/qmldesigner/qmldesignerplugin.pro @@ -16,7 +16,6 @@ include(components/formeditor/formeditor.pri) include(components/itemlibrary/itemlibrary.pri) include(components/navigator/navigator.pri) include(components/pluginmanager/pluginmanager.pri) -include(components/themeloader/qts60stylethemeio.pri) include(components/stateseditor/stateseditor.pri) include(components/resources/resources.pri) diff --git a/src/plugins/qmldesigner/symbianplugin/images/Untitled-2.png b/src/plugins/qmldesigner/symbianplugin/images/Untitled-2.png Binary files differdeleted file mode 100644 index 2e0bf73a26c..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/Untitled-2.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/busyindicator.png b/src/plugins/qmldesigner/symbianplugin/images/busyindicator.png Binary files differdeleted file mode 100644 index 89d0283f260..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/busyindicator.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/busyindicator16.png b/src/plugins/qmldesigner/symbianplugin/images/busyindicator16.png Binary files differdeleted file mode 100644 index 7e3b2d31587..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/busyindicator16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/busyindicatora.png b/src/plugins/qmldesigner/symbianplugin/images/busyindicatora.png Binary files differdeleted file mode 100644 index 433f4d426b9..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/busyindicatora.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/busyindicatora16.png b/src/plugins/qmldesigner/symbianplugin/images/busyindicatora16.png Binary files differdeleted file mode 100644 index 82de5b0a1bc..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/busyindicatora16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/button.png b/src/plugins/qmldesigner/symbianplugin/images/button.png Binary files differdeleted file mode 100644 index 828af210acd..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/button.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/button16.png b/src/plugins/qmldesigner/symbianplugin/images/button16.png Binary files differdeleted file mode 100644 index 8d95760b27a..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/button16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/buttoncolumn.png b/src/plugins/qmldesigner/symbianplugin/images/buttoncolumn.png Binary files differdeleted file mode 100644 index 46db8f6ab5d..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/buttoncolumn.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/buttoncolumn16.png b/src/plugins/qmldesigner/symbianplugin/images/buttoncolumn16.png Binary files differdeleted file mode 100644 index 883258048f3..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/buttoncolumn16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/buttonrow.png b/src/plugins/qmldesigner/symbianplugin/images/buttonrow.png Binary files differdeleted file mode 100644 index 9727749de96..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/buttonrow.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/buttonrow16.png b/src/plugins/qmldesigner/symbianplugin/images/buttonrow16.png Binary files differdeleted file mode 100644 index 420de418605..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/buttonrow16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/checkbox.png b/src/plugins/qmldesigner/symbianplugin/images/checkbox.png Binary files differdeleted file mode 100644 index 0f4a826f4dc..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/checkbox.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/checkbox16.png b/src/plugins/qmldesigner/symbianplugin/images/checkbox16.png Binary files differdeleted file mode 100644 index 01f09e3515a..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/checkbox16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/choicelist.png b/src/plugins/qmldesigner/symbianplugin/images/choicelist.png Binary files differdeleted file mode 100644 index 3fd9876ada4..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/choicelist.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/choicelist16.png b/src/plugins/qmldesigner/symbianplugin/images/choicelist16.png Binary files differdeleted file mode 100644 index 602b28229eb..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/choicelist16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/item-icon.png b/src/plugins/qmldesigner/symbianplugin/images/item-icon.png Binary files differdeleted file mode 100644 index fc53d38ae7f..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/item-icon.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/item-icon16.png b/src/plugins/qmldesigner/symbianplugin/images/item-icon16.png Binary files differdeleted file mode 100644 index 7d2d7a50502..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/item-icon16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/listview-icon.png b/src/plugins/qmldesigner/symbianplugin/images/listview-icon.png Binary files differdeleted file mode 100644 index 9c1327373df..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/listview-icon.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/listview-icon16.png b/src/plugins/qmldesigner/symbianplugin/images/listview-icon16.png Binary files differdeleted file mode 100644 index 1deac24a2a5..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/listview-icon16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/progressbar.png b/src/plugins/qmldesigner/symbianplugin/images/progressbar.png Binary files differdeleted file mode 100644 index 040f5bac039..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/progressbar.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/progressbar16.png b/src/plugins/qmldesigner/symbianplugin/images/progressbar16.png Binary files differdeleted file mode 100644 index e2432475d5b..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/progressbar16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/radiobutton.png b/src/plugins/qmldesigner/symbianplugin/images/radiobutton.png Binary files differdeleted file mode 100644 index 143b6a99f4e..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/radiobutton.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/radiobutton16.png b/src/plugins/qmldesigner/symbianplugin/images/radiobutton16.png Binary files differdeleted file mode 100644 index 94912c20343..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/radiobutton16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/slider.png b/src/plugins/qmldesigner/symbianplugin/images/slider.png Binary files differdeleted file mode 100644 index 746ed519323..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/slider.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/slider16.png b/src/plugins/qmldesigner/symbianplugin/images/slider16.png Binary files differdeleted file mode 100644 index 10c4928b3ce..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/slider16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/sliderh.png b/src/plugins/qmldesigner/symbianplugin/images/sliderh.png Binary files differdeleted file mode 100644 index 87cd55678f1..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/sliderh.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/sliderh16.png b/src/plugins/qmldesigner/symbianplugin/images/sliderh16.png Binary files differdeleted file mode 100644 index c4199113364..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/sliderh16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/statusbar.png b/src/plugins/qmldesigner/symbianplugin/images/statusbar.png Binary files differdeleted file mode 100644 index ebd0775a885..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/statusbar.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/statusbar16.png b/src/plugins/qmldesigner/symbianplugin/images/statusbar16.png Binary files differdeleted file mode 100644 index fec4585dcea..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/statusbar16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/switchbutton.png b/src/plugins/qmldesigner/symbianplugin/images/switchbutton.png Binary files differdeleted file mode 100644 index 48bf247cb8b..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/switchbutton.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/switchbutton16.png b/src/plugins/qmldesigner/symbianplugin/images/switchbutton16.png Binary files differdeleted file mode 100644 index 238a1be632b..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/switchbutton16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/tabbar.png b/src/plugins/qmldesigner/symbianplugin/images/tabbar.png Binary files differdeleted file mode 100644 index 2f44e62b3f5..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/tabbar.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/tabbar16.png b/src/plugins/qmldesigner/symbianplugin/images/tabbar16.png Binary files differdeleted file mode 100644 index 57c7906982e..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/tabbar16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/tabbutton.png b/src/plugins/qmldesigner/symbianplugin/images/tabbutton.png Binary files differdeleted file mode 100644 index d9f5fdb3f94..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/tabbutton.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/tabbutton16.png b/src/plugins/qmldesigner/symbianplugin/images/tabbutton16.png Binary files differdeleted file mode 100644 index 8e279cff657..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/tabbutton16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/textarea.png b/src/plugins/qmldesigner/symbianplugin/images/textarea.png Binary files differdeleted file mode 100644 index 86f2969d001..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/textarea.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/textarea16.png b/src/plugins/qmldesigner/symbianplugin/images/textarea16.png Binary files differdeleted file mode 100644 index 899a4bca2ee..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/textarea16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/textfield.png b/src/plugins/qmldesigner/symbianplugin/images/textfield.png Binary files differdeleted file mode 100644 index b0f13da50d2..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/textfield.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/textfield16.png b/src/plugins/qmldesigner/symbianplugin/images/textfield16.png Binary files differdeleted file mode 100644 index 7feb8c71584..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/textfield16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/toolbar.png b/src/plugins/qmldesigner/symbianplugin/images/toolbar.png Binary files differdeleted file mode 100644 index e67c0424221..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/toolbar.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/toolbar16.png b/src/plugins/qmldesigner/symbianplugin/images/toolbar16.png Binary files differdeleted file mode 100644 index f4a0c5ef690..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/toolbar16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/window.png b/src/plugins/qmldesigner/symbianplugin/images/window.png Binary files differdeleted file mode 100644 index fc53d38ae7f..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/window.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/images/window16.png b/src/plugins/qmldesigner/symbianplugin/images/window16.png Binary files differdeleted file mode 100644 index 7d2d7a50502..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/images/window16.png +++ /dev/null diff --git a/src/plugins/qmldesigner/symbianplugin/source/SymbianListView.qml b/src/plugins/qmldesigner/symbianplugin/source/SymbianListView.qml deleted file mode 100644 index f9bead4d6b5..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/source/SymbianListView.qml +++ /dev/null @@ -1,53 +0,0 @@ -import QtQuick 1.0 -import com.nokia.symbian 1.0 - -ListView { - x: 0 - y: 36 - width: 360 - height: 320 - clip: true - header: ListHeading { - ListItemText { - anchors.fill: parent.paddingItem - role: "Heading" - text: "ListHeading" - } - } - delegate: ListItem { - id: listItem - Column { - anchors.fill: parent.paddingItem - ListItemText { - width: parent.width - mode: listItem.mode - role: "Title" - text: titleText - } - ListItemText { - width: parent.width - mode: listItem.mode - role: "SubTitle" - text: subTitleText - } - } - } - model: ListModel { - ListElement { - titleText: "Title1" - subTitleText: "SubTitle1" - } - ListElement { - titleText: "Title2" - subTitleText: "SubTitle2" - } - ListElement { - titleText: "Title3" - subTitleText: "SubTitle3" - } - ListElement { - titleText: "Title4" - subTitleText: "SubTitle4" - } - } -} diff --git a/src/plugins/qmldesigner/symbianplugin/source/ToolBar.qml b/src/plugins/qmldesigner/symbianplugin/source/ToolBar.qml deleted file mode 100644 index 2bfd94e0e3e..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/source/ToolBar.qml +++ /dev/null @@ -1,15 +0,0 @@ -import QtQuick 1.0 -import com.nokia.symbian 1.0 - -ToolBar { - tools: ToolBarLayout { - ToolButton { - flat: true - iconSource: "toolbar-back" - } - ToolButton { - flat: true - iconSource: "toolbar-menu" - } - } - }
\ No newline at end of file diff --git a/src/plugins/qmldesigner/symbianplugin/symbian.metainfo b/src/plugins/qmldesigner/symbianplugin/symbian.metainfo deleted file mode 100644 index a9781d73879..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/symbian.metainfo +++ /dev/null @@ -1,108 +0,0 @@ -<metainfo> - <node name="com.nokia.symbian.Button" icon=":/symbianplugin/images/button16.png"> - <itemlibraryentry name="Button" category="Components Symbian" libraryIcon=":/symbianplugin/images/button.png" version="1.0" requiredImport="com.nokia.symbian"> - <property name="text" type="QString" value="Button"/> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.ToolButton" icon=":/symbianplugin/images/button16.png"> - <itemlibraryentry name="ToolButton" category="Components Symbian" libraryIcon=":/symbianplugin/images/button.png" version="1.0" requiredImport="com.nokia.symbian"> - <property name="text" type="QString" value="Button"/> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.TabButton" icon=":/symbianplugin/images/tabbutton16.png"> - <itemlibraryentry name="TabButton" category="Components Symbian" libraryIcon=":/symbianplugin/images/tabbutton.png" version="1.0" requiredImport="com.nokia.symbian"> - <property name="text" type="QString" value="Button"/> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.CheckBox" icon=":/symbianplugin/images/checkbox16.png"> - <itemlibraryentry name="CheckBox" category="Components Symbian" libraryIcon=":/symbianplugin/images/checkbox.png" version="1.0" requiredImport="com.nokia.symbian"> - <property name="text" type="QString" value="CheckBox"/> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.BusyIndicator" icon=":/symbianplugin/images/busyindicator16.png"> - <itemlibraryentry name="BusyIndicator" category="Components Symbian" libraryIcon=":/symbianplugin/images/busyindicator.png" version="1.0" requiredImport="com.nokia.symbian"> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.SelectionListItem" icon=":/symbianplugin/images/choicelist16.png"> - <itemlibraryentry name="SelectionListItem" category="Components Symbian" libraryIcon=":/symbianplugin/images/choicelist.png" version="1.0" requiredImport="com.nokia.symbian"> - <property name="title" type="QString" value="SelectionListItem"/> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.StatusBar" icon=":/symbianplugin/images/statusbar16.png"> - <itemlibraryentry name="StatusBar" category="Components Symbian" libraryIcon=":/symbianplugin/images/statusbar.png" version="1.0" requiredImport="com.nokia.symbian"> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.ListView" icon=":/symbianplugin/images/listview-icon16.png"> - <itemlibraryentry name="ListView" category="Components Symbian" libraryIcon=":/symbianplugin/images/listview-icon.png" version="1.0" requiredImport="com.nokia.symbian"> - <qml source=":/symbianplugin/source/SymbianListView.qml"/> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.ProgressBar" icon=":/symbianplugin/images/progressbar16.png"> - <itemlibraryentry name="ProgressBar" category="Components Symbian" libraryIcon=":/symbianplugin/images/progressbar.png" version="1.0" requiredImport="com.nokia.symbian"> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.RadioButton" icon=":/symbianplugin/images/radiobutton16.png"> - <itemlibraryentry name="RadioButton" category="Components Symbian" libraryIcon=":/symbianplugin/images/radiobutton.png" version="1.0" requiredImport="com.nokia.symbian"> - <property name="text" type="QString" value="RadioButton"/> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.TextArea" icon=":/symbianplugin/images/textarea16.png"> - <itemlibraryentry name="TextArea" category="Components Symbian" libraryIcon=":/symbianplugin/images/textarea.png" version="1.0" requiredImport="com.nokia.symbian"> - <property name="width" type="int" value="180"/> - <property name="height" type="int" value="180"/> - <property name="text" type="QString" value="TextArea"/> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.ButtonRow" icon=":/symbianplugin/images/buttonrow16.png"> - <itemlibraryentry name="ButtonRow" category="Components Symbian" libraryIcon=":/symbianplugin/images/buttonrow.png" version="1.0" requiredImport="com.nokia.symbian"> - <property name="width" type="int" value="120"/> - <property name="height" type="int" value="20"/> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.ButtonColumn" icon=":/symbianplugin/images/buttoncolumn16.png"> - <itemlibraryentry name="ButtonColumn" category="Components Symbian" libraryIcon=":/symbianplugin/images/buttoncolumn.png" version="1.0" requiredImport="com.nokia.symbian"> - <property name="width" type="int" value="20"/> - <property name="height" type="int" value="120"/> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.TabBar" icon=":/symbianplugin/images/tabbar16.png"> - <itemlibraryentry name="TabBar" category="Components Symbian" libraryIcon=":/symbianplugin/images/tabbar.png" version="1.0" requiredImport="com.nokia.symbian"> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.Slider" icon=":/symbianplugin/images/slider16.png"> - <itemlibraryentry name="Slider (horizontal)" category="Components Symbian" libraryIcon=":/symbianplugin/images/slider.png" version="1.0" requiredImport="com.nokia.symbian"> - <property name="orientation" type="int" value="1"/> - </itemlibraryentry> - <itemlibraryentry name="Slider (vertical)" category="Components Symbian" libraryIcon=":/symbianplugin/images/sliderh.png" version="1.0" requiredImport="com.nokia.symbian"> - <property name="orientation" type="int" value="2"/> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.Page" icon=":/symbianplugin/images/window16.png"> - <itemlibraryentry name="Page" category="Components Symbian" libraryIcon=":/symbianplugin/images/window.png" version="1.0" requiredImport="com.nokia.symbian"> - <property name="width" type="int" value="360"/> - <property name="height" type="int" value="640"/> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.TabGroup" icon=":/symbianplugin//images/window16.png"> - <itemlibraryentry name="TabGroup" category="Components Symbian" libraryIcon=":/symbianplugin/images/window.png" version="1.0" requiredImport="com.nokia.symbian"> - <property name="width" type="int" value="360"/> - <property name="height" type="int" value="40"/> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.ToolBar" icon=":/symbianplugin/images/toolbar16.png"> - <itemlibraryentry name="ToolBar" category="Components Symbian" libraryIcon=":/symbianplugin/images/toolbar.png" version="1.0" requiredImport="com.nokia.symbian"> - <qml source=":/symbianplugin/source/ToolBar.qml"/> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.Switch" icon=":/symbianplugin/images/switchbutton16.png"> - <itemlibraryentry name="Switch" category="Components Symbian" libraryIcon=":/symbianplugin/images/switchbutton.png" version="1.0" requiredImport="com.nokia.symbian"> - </itemlibraryentry> - </node> - <node name="com.nokia.symbian.TextField" icon=":/symbianplugin/images/textfield16.png"> - <itemlibraryentry name="TextField" category="Components Symbian" libraryIcon=":/symbianplugin/images/textfield.png" version="1.0" requiredImport="com.nokia.symbian"> - <property name="width" type="int" value="180"/> - <property name="height" type="int" value="50"/> - <property name="text" type="QString" value="TextField"/> - </itemlibraryentry> - </node> -</metainfo> diff --git a/src/plugins/qmldesigner/symbianplugin/symbianplugin.cpp b/src/plugins/qmldesigner/symbianplugin/symbianplugin.cpp deleted file mode 100644 index c1483eb44cf..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/symbianplugin.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "symbianplugin.h" -#include <widgetplugin_helper.h> -#include <QtPlugin> - -namespace QmlDesigner { - - -SymbianPlugin::SymbianPlugin() -{ -} - -QString SymbianPlugin::pluginName() const -{ - return ("SymbianPlugin"); -} - -QString SymbianPlugin::metaInfo() const -{ - return QString(":/symbianplugin/symbian.metainfo"); -} - -} - -Q_EXPORT_PLUGIN(QmlDesigner::SymbianPlugin) - diff --git a/src/plugins/qmldesigner/symbianplugin/symbianplugin.h b/src/plugins/qmldesigner/symbianplugin/symbianplugin.h deleted file mode 100644 index a2b3817ca48..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/symbianplugin.h +++ /dev/null @@ -1,53 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef SymbianPLUGIN_H -#define SymbianPLUGIN_H - -#include <iwidgetplugin.h> -#include <qdeclarative.h> - -namespace QmlDesigner { - -class SymbianPlugin : public QObject, QmlDesigner::IWidgetPlugin -{ - Q_OBJECT - Q_INTERFACES(QmlDesigner::IWidgetPlugin) - -public: - SymbianPlugin(); - - QString metaInfo() const; - QString pluginName() const; -}; - -} // namespace QmlDesigner - -#endif // SymbianPLUGIN_H diff --git a/src/plugins/qmldesigner/symbianplugin/symbianplugin.pri b/src/plugins/qmldesigner/symbianplugin/symbianplugin.pri deleted file mode 100644 index 28d6323c68a..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/symbianplugin.pri +++ /dev/null @@ -1,17 +0,0 @@ -TARGET = symbianplugin -TEMPLATE = lib -CONFIG += plugin - -QT += script \ - declarative - -include (../designercore/iwidgetplugin.pri) - -DEFINES += SYMBIAN_LIBRARY -SOURCES += $$PWD/symbianplugin.cpp - -HEADERS += $$PWD/symbianplugin.h $$PWD/../designercore/include/iwidgetplugin.h - -RESOURCES += $$PWD/symbianplugin.qrc - -OTHER_FILES += $$PWD/symbian.metainfo diff --git a/src/plugins/qmldesigner/symbianplugin/symbianplugin.pro b/src/plugins/qmldesigner/symbianplugin/symbianplugin.pro deleted file mode 100644 index b8ea7d042ad..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/symbianplugin.pro +++ /dev/null @@ -1,4 +0,0 @@ -include(../../../../qtcreator.pri) -include(../../../private_headers.pri) -include(symbianplugin.pri) -include(../plugindestdir.pri) diff --git a/src/plugins/qmldesigner/symbianplugin/symbianplugin.qrc b/src/plugins/qmldesigner/symbianplugin/symbianplugin.qrc deleted file mode 100644 index 92c2cc2062d..00000000000 --- a/src/plugins/qmldesigner/symbianplugin/symbianplugin.qrc +++ /dev/null @@ -1,47 +0,0 @@ -<RCC> - <qresource prefix="/symbianplugin"> - <file>symbian.metainfo</file> - <file>images/item-icon16.png</file> - <file>images/item-icon.png</file> - <file>images/button.png</file> - <file>images/button16.png</file> - <file>images/checkbox16.png</file> - <file>images/checkbox.png</file> - <file>images/choicelist16.png</file> - <file>images/choicelist.png</file> - <file>images/progressbar.png</file> - <file>images/progressbar16.png</file> - <file>images/radiobutton.png</file> - <file>images/radiobutton16.png</file> - <file>images/slider.png</file> - <file>images/slider16.png</file> - <file>images/textarea16.png</file> - <file>images/textarea.png</file> - <file>images/textfield16.png</file> - <file>images/textfield.png</file> - <file>images/window16.png</file> - <file>images/window.png</file> - <file>images/tabbutton16.png</file> - <file>images/tabbutton.png</file> - <file>images/busyindicator16.png</file> - <file>images/busyindicator.png</file> - <file>images/sliderh16.png</file> - <file>images/sliderh.png</file> - <file>images/switchbutton16.png</file> - <file>images/switchbutton.png</file> - <file>images/buttonrow.png</file> - <file>images/buttonrow16.png</file> - <file>images/tabbar.png</file> - <file>images/tabbar16.png</file> - <file>images/toolbar.png</file> - <file>images/toolbar16.png</file> - <file>images/buttoncolumn.png</file> - <file>images/buttoncolumn16.png</file> - <file>source/ToolBar.qml</file> - <file>images/listview-icon.png</file> - <file>images/listview-icon16.png</file> - <file>source/SymbianListView.qml</file> - <file>images/statusbar.png</file> - <file>images/statusbar16.png</file> - </qresource> -</RCC> diff --git a/src/plugins/qmljseditor/qmlfilewizard.cpp b/src/plugins/qmljseditor/qmlfilewizard.cpp index 9dbf9f07d9a..38861a91129 100644 --- a/src/plugins/qmljseditor/qmlfilewizard.cpp +++ b/src/plugins/qmljseditor/qmlfilewizard.cpp @@ -63,8 +63,7 @@ QString QmlFileWizard::fileContents(const QString &) const QTextStream str(&contents); // 100:62 is the 'golden ratio' - str << QLatin1String("// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5\n") - << QLatin1String("import QtQuick 1.1\n") + str << QLatin1String("import QtQuick 1.1\n") << QLatin1String("\n") << QLatin1String("Rectangle {\n") << QLatin1String(" width: 100\n") diff --git a/src/plugins/qmljstools/qmljsplugindumper.cpp b/src/plugins/qmljstools/qmljsplugindumper.cpp index ff113d733b7..d9a6cc73345 100644 --- a/src/plugins/qmljstools/qmljsplugindumper.cpp +++ b/src/plugins/qmljstools/qmljsplugindumper.cpp @@ -496,7 +496,6 @@ QString PluginDumper::resolvePlugin(const QDir &qmldirPath, const QString &qmldi \row \i AIX \i \c .a \row \i HP-UX \i \c .sl, \c .so (HP-UXi) \row \i Mac OS X \i \c .dylib, \c .bundle, \c .so - \row \i Symbian \i \c .dll \endtable Version number on unix are ignored. diff --git a/src/plugins/qmlprofiler/codaqmlprofilerrunner.cpp b/src/plugins/qmlprofiler/codaqmlprofilerrunner.cpp deleted file mode 100644 index 9087833b5e3..00000000000 --- a/src/plugins/qmlprofiler/codaqmlprofilerrunner.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "codaqmlprofilerrunner.h" -#include <utils/qtcassert.h> - -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/target.h> -#include <extensionsystem/pluginmanager.h> -#include <qt4projectmanager/qt-s60/s60deployconfiguration.h> -#include <projectexplorer/runconfiguration.h> -#include <analyzerbase/analyzerconstants.h> -#include <qt4projectmanager/qt-s60/codaruncontrol.h> - -using namespace ProjectExplorer; -using namespace Qt4ProjectManager; -using namespace QmlProfiler::Internal; - -CodaQmlProfilerRunner::CodaQmlProfilerRunner(S60DeviceRunConfiguration *configuration, - QObject *parent) : - AbstractQmlProfilerRunner(parent), - m_configuration(configuration), - m_runControl(new CodaRunControl(configuration, QmlProfilerRunMode)) -{ - connect(m_runControl, SIGNAL(finished()), this, SIGNAL(stopped())); - connect(m_runControl, - SIGNAL(appendMessage(ProjectExplorer::RunControl*,QString,Utils::OutputFormat)), - this, SLOT(appendMessage(ProjectExplorer::RunControl*,QString,Utils::OutputFormat))); -} - -CodaQmlProfilerRunner::~CodaQmlProfilerRunner() -{ - delete m_runControl; -} - -void CodaQmlProfilerRunner::start() -{ - QTC_ASSERT(m_runControl, return); - m_runControl->start(); -} - -void CodaQmlProfilerRunner::stop() -{ - QTC_ASSERT(m_runControl, return); - m_runControl->stop(); -} - -void CodaQmlProfilerRunner::appendMessage(ProjectExplorer::RunControl *, const QString &message, - Utils::OutputFormat format) -{ - emit appendMessage(message, format); -} - -quint16 QmlProfiler::Internal::CodaQmlProfilerRunner::debugPort() const -{ - return m_configuration->debuggerAspect()->qmlDebugServerPort(); -} - diff --git a/src/plugins/qmlprofiler/codaqmlprofilerrunner.h b/src/plugins/qmlprofiler/codaqmlprofilerrunner.h deleted file mode 100644 index 59b0979cbdc..00000000000 --- a/src/plugins/qmlprofiler/codaqmlprofilerrunner.h +++ /dev/null @@ -1,69 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef CODAQMLPROFILERRUNNER_H -#define CODAQMLPROFILERRUNNER_H - -#include "abstractqmlprofilerrunner.h" - -#include <utils/environment.h> -#include <projectexplorer/runconfiguration.h> -#include <qt4projectmanager/qt-s60/s60devicerunconfiguration.h> - -namespace QmlProfiler { -namespace Internal { - -class CodaQmlProfilerRunner : public AbstractQmlProfilerRunner -{ - Q_OBJECT - - using AbstractQmlProfilerRunner::appendMessage; // don't hide signal -public: - explicit CodaQmlProfilerRunner(Qt4ProjectManager::S60DeviceRunConfiguration *configuration, - QObject *parent = 0); - ~CodaQmlProfilerRunner(); - - // AbstractQmlProfilerRunner - virtual void start(); - virtual void stop(); - virtual quint16 debugPort() const; - -private slots: - void appendMessage(ProjectExplorer::RunControl *, const QString &message, - Utils::OutputFormat format); -private: - Qt4ProjectManager::S60DeviceRunConfiguration *m_configuration; - ProjectExplorer::RunControl *m_runControl; -}; - -} // namespace Internal -} // namespace QmlProfiler - -#endif // CODAQMLPROFILERRUNNER_H diff --git a/src/plugins/qmlprofiler/qmlprofiler.pro b/src/plugins/qmlprofiler/qmlprofiler.pro index 1f6bf5c6940..8c98eb2c532 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.pro +++ b/src/plugins/qmlprofiler/qmlprofiler.pro @@ -26,7 +26,6 @@ SOURCES += \ qmlprofilerengine.cpp \ qmlprofilerattachdialog.cpp \ localqmlprofilerrunner.cpp \ - codaqmlprofilerrunner.cpp \ remotelinuxqmlprofilerrunner.cpp \ qmlprofilereventview.cpp \ qmlprofilerdetailsrewriter.cpp \ @@ -48,7 +47,6 @@ HEADERS += \ qmlprofilerattachdialog.h \ abstractqmlprofilerrunner.h \ localqmlprofilerrunner.h \ - codaqmlprofilerrunner.h \ remotelinuxqmlprofilerrunner.h \ qmlprofilereventview.h \ qmlprofilerdetailsrewriter.h \ diff --git a/src/plugins/qmlprofiler/qmlprofiler.qbs b/src/plugins/qmlprofiler/qmlprofiler.qbs index 6e2f9f2954f..92fa17e5d4b 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.qbs +++ b/src/plugins/qmlprofiler/qmlprofiler.qbs @@ -13,7 +13,6 @@ QtcPlugin { Depends { name: "RemoteLinux" } Depends { name: "ProjectExplorer" } Depends { name: "QtSupport" } - Depends { name: "symbianutils" } Depends { name: "TextEditor" } Depends { name: "QmlDebug" } Depends { name: "QmlJS" } @@ -23,7 +22,6 @@ QtcPlugin { Depends { name: "cpp" } cpp.includePaths: [ "canvas", - "../../shared/symbianutils", "..", "../../libs", buildDirectory @@ -31,8 +29,6 @@ QtcPlugin { files: [ "abstractqmlprofilerrunner.h", - "codaqmlprofilerrunner.cpp", - "codaqmlprofilerrunner.h", "localqmlprofilerrunner.cpp", "localqmlprofilerrunner.h", "qmlprofilerattachdialog.cpp", diff --git a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp index 547f9a05727..4e7c567b08a 100644 --- a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp @@ -225,13 +225,8 @@ void QmlProfilerClientManager::connectToClient() if (!d->connection || d->connection->state() != QAbstractSocket::UnconnectedState) return; - if (d->connectMode == QmlProfilerClientManagerPrivate::TcpConnection) { - QmlProfilerTool::logStatus(QString("QML Profiler: Connecting to %1:%2 ...").arg(d->tcpHost, QString::number(d->tcpPort))); - d->connection->connectToHost(d->tcpHost, d->tcpPort); - } else { - QmlProfilerTool::logStatus(QString("QML Profiler: Connecting to %1 ...").arg(d->tcpHost)); - d->connection->connectToOst(d->ostDevice); - } + QmlProfilerTool::logStatus(QString("QML Profiler: Connecting to %1:%2 ...").arg(d->tcpHost, QString::number(d->tcpPort))); + d->connection->connectToHost(d->tcpHost, d->tcpPort); } bool QmlProfilerClientManager::isConnected() const diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp index 32a667242d8..90e056aa78a 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp @@ -30,7 +30,6 @@ #include "qmlprofilerengine.h" -#include "codaqmlprofilerrunner.h" #include "localqmlprofilerrunner.h" #include "remotelinuxqmlprofilerrunner.h" @@ -42,8 +41,6 @@ #include <qmlprojectmanager/qmlprojectplugin.h> #include <projectexplorer/localapplicationruncontrol.h> #include <projectexplorer/applicationrunconfiguration.h> -#include <qt4projectmanager/qt-s60/s60devicedebugruncontrol.h> -#include <qt4projectmanager/qt-s60/s60devicerunconfiguration.h> #include <qmldebug/qmloutputparser.h> #include <remotelinux/remotelinuxrunconfiguration.h> @@ -107,9 +104,6 @@ QmlProfilerEngine::QmlProfilerEnginePrivate::createRunner(ProjectExplorer::RunCo conf.environment = rc2->environment(); conf.port = rc2->debuggerAspect()->qmlDebugServerPort(); runner = new LocalQmlProfilerRunner(conf, parent); - } else if (Qt4ProjectManager::S60DeviceRunConfiguration *s60Config = - qobject_cast<Qt4ProjectManager::S60DeviceRunConfiguration*>(runConfiguration)) { - runner = new CodaQmlProfilerRunner(s60Config, parent); } else if (RemoteLinux::RemoteLinuxRunConfiguration *rmConfig = qobject_cast<RemoteLinux::RemoteLinuxRunConfiguration *>(runConfiguration)) { runner = new RemoteLinuxQmlProfilerRunner(rmConfig, parent); diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index caefcd01017..0843297cd43 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -69,11 +69,6 @@ #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actioncontainer.h> -#include <qt4projectmanager/qt-s60/s60devicedebugruncontrol.h> -#include <qt4projectmanager/qt-s60/s60devicerunconfiguration.h> -#include <qt4projectmanager/qt-s60/s60deployconfiguration.h> -#include <qt4projectmanager/qt-s60/symbianidevice.h> - #include <qtsupport/qtprofileinformation.h> #include <QApplication> @@ -253,17 +248,6 @@ IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp return 0; } } - - // Check whether we should use OST instead of TCP - if (Qt4ProjectManager::S60DeployConfiguration *deployConfig - = qobject_cast<Qt4ProjectManager::S60DeployConfiguration*>( - runConfiguration->target()->activeDeployConfiguration())) { - if (deployConfig->device()->communicationChannel() - == Qt4ProjectManager::SymbianIDevice::CommunicationCodaSerialConnection) { - d->m_profilerConnections->setOstConnection(deployConfig->device()->serialPortName()); - isTcpConnection = false; - } - } } // FIXME: Check that there's something sensible in sp.connParams @@ -295,8 +279,7 @@ bool QmlProfilerTool::canRun(RunConfiguration *runConfiguration, RunMode mode) c { if (qobject_cast<QmlProjectRunConfiguration *>(runConfiguration) || qobject_cast<RemoteLinuxRunConfiguration *>(runConfiguration) - || qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration) - || qobject_cast<Qt4ProjectManager::S60DeviceRunConfiguration *>(runConfiguration)) + || qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) return mode == runMode(); return false; } @@ -345,16 +328,6 @@ AnalyzerStartParameters QmlProfilerTool::createStartParameters(RunConfiguration sp.analyzerCmdPrefix = rc3->commandPrefix(); sp.displayName = rc3->displayName(); sp.sysroot = sysroot(rc3); - } else if (Qt4ProjectManager::S60DeviceRunConfiguration *rc4 = - qobject_cast<Qt4ProjectManager::S60DeviceRunConfiguration *>(runConfiguration)) { - Qt4ProjectManager::S60DeployConfiguration *deployConf = - qobject_cast<Qt4ProjectManager::S60DeployConfiguration *>(runConfiguration->target()->activeDeployConfiguration()); - - sp.debuggeeArgs = rc4->commandLineArguments(); - sp.displayName = rc4->displayName(); - sp.connParams.host = deployConf->device()->address(); - sp.connParams.port = rc4->debuggerAspect()->qmlDebugServerPort(); - sp.sysroot = sysroot(rc4); } else { // What could that be? QTC_ASSERT(false, return sp); diff --git a/src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp b/src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp index 2f54679007d..2dd5d8e94e9 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp @@ -120,7 +120,7 @@ Core::GeneratedFiles QmlProjectApplicationWizard::generateFiles(const QWizard *w QTextStream out(&contents); out - << "// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5" << endl + << "// import QtQuick 1.0 // to target Maemo 5" << endl << "import QtQuick 1.1" << endl << endl << "Rectangle {" << endl diff --git a/src/plugins/qt4projectmanager/addlibrarywizard.h b/src/plugins/qt4projectmanager/addlibrarywizard.h index 4c43a206a2c..cc1be230ec3 100644 --- a/src/plugins/qt4projectmanager/addlibrarywizard.h +++ b/src/plugins/qt4projectmanager/addlibrarywizard.h @@ -79,8 +79,7 @@ public: enum Platform { LinuxPlatform = 0x01, MacPlatform = 0x02, - WindowsPlatform = 0x04, - SymbianPlatform = 0x08 + WindowsPlatform = 0x04 }; Q_DECLARE_FLAGS(Platforms, Platform) diff --git a/src/plugins/qt4projectmanager/librarydetailscontroller.cpp b/src/plugins/qt4projectmanager/librarydetailscontroller.cpp index b8ed4641f38..4344d2d6aeb 100644 --- a/src/plugins/qt4projectmanager/librarydetailscontroller.cpp +++ b/src/plugins/qt4projectmanager/librarydetailscontroller.cpp @@ -55,8 +55,7 @@ LibraryDetailsController::LibraryDetailsController( QObject(parent), m_platforms(AddLibraryWizard::LinuxPlatform | AddLibraryWizard::MacPlatform - | AddLibraryWizard::WindowsPlatform - | AddLibraryWizard::SymbianPlatform), + | AddLibraryWizard::WindowsPlatform), m_linkageType(AddLibraryWizard::NoLinkage), m_macLibraryType(AddLibraryWizard::NoLibraryType), m_proFile(proFile), @@ -117,8 +116,6 @@ LibraryDetailsController::LibraryDetailsController( this, SLOT(slotPlatformChanged())); connect(m_libraryDetailsWidget->winCheckBox, SIGNAL(clicked(bool)), this, SLOT(slotPlatformChanged())); - connect(m_libraryDetailsWidget->symCheckBox, SIGNAL(clicked(bool)), - this, SLOT(slotPlatformChanged())); } LibraryDetailsController::CreatorPlatform LibraryDetailsController::creatorPlatform() const @@ -156,8 +153,6 @@ void LibraryDetailsController::updateGui() m_platforms |= AddLibraryWizard::MacPlatform; if (libraryDetailsWidget()->winCheckBox->isChecked()) m_platforms |= AddLibraryWizard::WindowsPlatform; - if (libraryDetailsWidget()->symCheckBox->isChecked()) - m_platforms |= AddLibraryWizard::SymbianPlatform; bool macLibraryTypeUpdated = false; if (!m_linkageRadiosVisible) { @@ -423,16 +418,9 @@ static QString commonScopes(AddLibraryWizard::Platforms scopes, str << "unix"; if (!(common & AddLibraryWizard::MacPlatform)) str << ":!macx"; - if (!(common & AddLibraryWizard::SymbianPlatform)) - str << ":!symbian"; } else { if (scopes & AddLibraryWizard::MacPlatform) str << "macx"; - if (scopes & AddLibraryWizard::MacPlatform && - scopes & AddLibraryWizard::SymbianPlatform) - str << "|"; - if (scopes & AddLibraryWizard::SymbianPlatform) - str << "symbian"; } } if (scopes & AddLibraryWizard::WindowsPlatform) { @@ -466,8 +454,6 @@ static QString generateLibsSnippet(AddLibraryWizard::Platforms platforms, commonPlatforms &= ~QFlags<AddLibraryWizard::Platform>(AddLibraryWizard::MacPlatform); if (useSubfolders || addSuffix) // we will generate a separate debug/release conditions commonPlatforms &= ~QFlags<AddLibraryWizard::Platform>(AddLibraryWizard::WindowsPlatform); - if (generateLibPath) // we will generate a separate line without -L - commonPlatforms &= ~QFlags<AddLibraryWizard::Platform>(AddLibraryWizard::SymbianPlatform); AddLibraryWizard::Platforms diffPlatforms = platforms ^ commonPlatforms; AddLibraryWizard::Platforms generatedPlatforms = 0; @@ -496,12 +482,6 @@ static QString generateLibsSnippet(AddLibraryWizard::Platforms platforms, << "-framework " << libName << "\n"; generatedPlatforms |= AddLibraryWizard::MacPlatform; } - if (diffPlatforms & AddLibraryWizard::SymbianPlatform) { - if (generatedPlatforms) - str << "else:"; - str << "symbian: LIBS += -l" << libName << "\n"; - generatedPlatforms |= AddLibraryWizard::SymbianPlatform; - } if (commonPlatforms) { if (generatedPlatforms) @@ -559,8 +539,6 @@ static QString generatePreTargetDepsSnippet(AddLibraryWizard::Platforms platform } AddLibraryWizard::Platforms commonPlatforms = platforms; commonPlatforms &= ~QFlags<AddLibraryWizard::Platform>(AddLibraryWizard::WindowsPlatform); - // don't generate PRE_TARGETDEPS for symbian - relinking static lib apparently works without that - commonPlatforms &= ~QFlags<AddLibraryWizard::Platform>(AddLibraryWizard::SymbianPlatform); if (commonPlatforms) { if (generatedPlatforms) str << "else:"; diff --git a/src/plugins/qt4projectmanager/librarydetailswidget.ui b/src/plugins/qt4projectmanager/librarydetailswidget.ui index bd581d35d39..70f0186c78b 100644 --- a/src/plugins/qt4projectmanager/librarydetailswidget.ui +++ b/src/plugins/qt4projectmanager/librarydetailswidget.ui @@ -96,16 +96,6 @@ </property> </widget> </item> - <item> - <widget class="QCheckBox" name="symCheckBox"> - <property name="text"> - <string>Symbian</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> </layout> </widget> </item> diff --git a/src/plugins/qt4projectmanager/profilekeywords.cpp b/src/plugins/qt4projectmanager/profilekeywords.cpp index fbb18acb154..b7c8d02f87f 100644 --- a/src/plugins/qt4projectmanager/profilekeywords.cpp +++ b/src/plugins/qt4projectmanager/profilekeywords.cpp @@ -34,8 +34,6 @@ using namespace Qt4ProjectManager::Internal; static const char *const variableKeywords[] = { "BACKUP_REGISTRATION_FILE_MAEMO", - "BACKUP_REGISTRATION_FILE_SYMBIAN", - "BLD_INF_RULES", "CCFLAG", "CONFIG", "DEFINES", @@ -63,7 +61,6 @@ static const char *const variableKeywords[] = { "LITERAL_HASH", "MAKEFILE", "MAKEFILE_GENERATOR", - "MMP_RULES", "MOBILITY", "MOC_DIR", "OBJECTIVE_HEADERS", @@ -207,25 +204,11 @@ static const char *const variableKeywords[] = { "RESOURCES", "RES_FILE", "RSS_RULES", - "S60_VERSION", "SIGNATURE_FILE", "SOURCES", "SRCMOC", "STATECHARTS", "SUBDIRS", - "SYMBIAN_VERSION", - "TARGET", - "TARGET.CAPABILITY", - "TARGET.EPOCALLOWDLLDATA", - "TARGET.EPOCHEAPSIZE", - "TARGET.EPOCSTACKSIZE", - "TARGET.SID", - "TARGET.UID2", - "TARGET.UID3", - "TARGET.VID", - "TARGET_EXT", - "TARGET_x", - "TARGET_x.y.z", "TEMPLATE", "TRANSLATIONS", "UICIMPLS", diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp index d60d98bdb81..a0897c6fab3 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -230,7 +230,7 @@ QStringList QMakeStep::deducedArgumentsAfter() // We have a target which does not allow shadow building. // But we really don't want to have the build artefacts in the source dir // so we try to hack around it, to make the common cases work. - // This is a HACK, remove once the symbian make generator supports + // This is a HACK, remove once all make generators support // shadow building return QStringList() << QLatin1String("-after") << QLatin1String("OBJECTS_DIR=obj") diff --git a/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp b/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp index 29f98f5f374..fd114e78566 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp @@ -91,8 +91,7 @@ Core::FeatureSet SimulatorQtVersion::availableFeatures() const { Core::FeatureSet features = QtSupport::BaseQtVersion::availableFeatures(); if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 4)) //no reliable test for components, yet. - features |= Core::FeatureSet(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_MEEGO) - | Core::FeatureSet(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_SYMBIAN); + features |= Core::FeatureSet(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_MEEGO); features |= Core::FeatureSet(QtSupport::Constants::FEATURE_MOBILE); return features; @@ -100,7 +99,6 @@ Core::FeatureSet SimulatorQtVersion::availableFeatures() const bool SimulatorQtVersion::supportsPlatform(const QString &platformName) const { - return (platformName == QtSupport::Constants::SYMBIAN_PLATFORM - || platformName == QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM + return (platformName == QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM || platformName.isEmpty()); } diff --git a/src/plugins/qt4projectmanager/qt-s60/abldparser.cpp b/src/plugins/qt4projectmanager/qt-s60/abldparser.cpp deleted file mode 100644 index c53098ffd95..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/abldparser.cpp +++ /dev/null @@ -1,234 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "abldparser.h" - -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/task.h> - -using namespace Qt4ProjectManager; -using namespace ProjectExplorer; -using namespace ProjectExplorer::Constants; - -AbldParser::AbldParser() : - m_currentLine(-1), - m_waitingForStdErrContinuation(false), - m_waitingForStdOutContinuation(false) -{ - setObjectName(QLatin1String("AbldParser")); - m_perlIssue.setPattern(QLatin1String("^(WARNING|ERROR):\\s([^\\(\\)]+[^\\d])\\((\\d+)\\) : (.+)$")); - m_perlIssue.setMinimal(true); -} - -void AbldParser::stdOutput(const QString &line) -{ - m_waitingForStdErrContinuation = false; - - QString lne = line.trimmed(); - // possible ABLD.bat errors: - if (lne.startsWith(QLatin1String("Is Perl, version "))) { - emit addTask(Task(Task::Error, - lne /* description */, - Utils::FileName() /* filename */, - -1 /* linenumber */, - Core::Id(TASK_CATEGORY_BUILDSYSTEM))); - return; - } - if (lne.startsWith(QLatin1String("FATAL ERROR:")) || - lne.startsWith(QLatin1String("Error :"))) { - emit addTask(Task(Task::Error, - lne /* description */, - Utils::FileName() /* filename */, - -1 /* linenumber */, - Core::Id(TASK_CATEGORY_BUILDSYSTEM))); - m_waitingForStdOutContinuation = false; - return; - } - - if (m_perlIssue.indexIn(lne) > -1) { - m_waitingForStdOutContinuation = true; - m_currentFile = m_perlIssue.cap(2); - m_currentLine = m_perlIssue.cap(3).toInt(); - - Task task(Task::Unknown, - m_perlIssue.cap(4) /* description */, - Utils::FileName::fromUserInput(m_currentFile), m_currentLine, - Core::Id(TASK_CATEGORY_BUILDSYSTEM)); - - if (m_perlIssue.cap(1) == QLatin1String("WARNING")) - task.type = Task::Warning; - else if (m_perlIssue.cap(1) == QLatin1String("ERROR")) - task.type = Task::Error; - - emit addTask(task); - return; - } - - if (lne.startsWith(QLatin1String("SIS creation failed!"))) { - m_waitingForStdOutContinuation = false; - emit addTask(Task(Task::Error, - line, Utils::FileName(), -1, - Core::Id(TASK_CATEGORY_BUILDSYSTEM))); - return; - } - - if (lne.isEmpty()) { - m_waitingForStdOutContinuation = false; - return; - } - - if (m_waitingForStdOutContinuation) { - emit addTask(Task(Task::Unknown, - lne /* description */, - Utils::FileName::fromUserInput(m_currentFile), m_currentLine, - Core::Id(TASK_CATEGORY_BUILDSYSTEM))); - m_waitingForStdOutContinuation = true; - return; - } - IOutputParser::stdOutput(line); -} - -void AbldParser::stdError(const QString &line) -{ - m_waitingForStdOutContinuation = false; - - QString lne = line.trimmed(); - - // possible abld.pl errors: - if (lne.startsWith(QLatin1String("ABLD ERROR:")) || - lne.startsWith(QLatin1String("This project does not support ")) || - lne.startsWith(QLatin1String("Platform "))) { - emit addTask(Task(Task::Error, - lne /* description */, - Utils::FileName() /* filename */, - -1 /* linenumber */, - Core::Id(TASK_CATEGORY_BUILDSYSTEM))); - return; - } - - if (lne.startsWith(QLatin1String("Died at "))) { - emit addTask(Task(Task::Error, - lne /* description */, - Utils::FileName() /* filename */, - -1 /* linenumber */, - Core::Id(TASK_CATEGORY_BUILDSYSTEM))); - m_waitingForStdErrContinuation = false; - return; - } - - if (lne.startsWith(QLatin1String("MMPFILE \""))) { - m_currentFile = lne.mid(9, lne.size() - 10); - m_waitingForStdErrContinuation = false; - return; - } - if (lne.isEmpty()) { - m_waitingForStdErrContinuation = false; - return; - } - if (lne.startsWith(QLatin1String("WARNING: "))) { - QString description = lne.mid(9); - emit addTask(Task(Task::Warning, description, - Utils::FileName::fromUserInput(m_currentFile), - -1 /* linenumber */, - Core::Id(TASK_CATEGORY_BUILDSYSTEM))); - m_waitingForStdErrContinuation = true; - return; - } - if (lne.startsWith(QLatin1String("ERROR: "))) { - QString description = lne.mid(7); - emit addTask(Task(Task::Error, description, - Utils::FileName::fromUserInput(m_currentFile), - -1 /* linenumber */, - Core::Id(TASK_CATEGORY_BUILDSYSTEM))); - m_waitingForStdErrContinuation = true; - return; - } - if (m_waitingForStdErrContinuation) - { - emit addTask(Task(Task::Unknown, - lne /* description */, - Utils::FileName::fromUserInput(m_currentFile), - -1 /* linenumber */, - Core::Id(TASK_CATEGORY_BUILDSYSTEM))); - m_waitingForStdErrContinuation = true; - return; - } - IOutputParser::stdError(line); -} - -// Unit tests: - -#ifdef WITH_TESTS -# include <QTest> - -# include "qt4projectmanagerplugin.h" - -# include "projectexplorer/outputparser_test.h" - -using namespace Qt4ProjectManager::Internal; - -void Qt4ProjectManagerPlugin::testAbldOutputParsers_data() -{ - QTest::addColumn<QString>("input"); - QTest::addColumn<OutputParserTester::Channel>("inputChannel"); - QTest::addColumn<QString>("childStdOutLines"); - QTest::addColumn<QString>("childStdErrLines"); - QTest::addColumn<QList<ProjectExplorer::Task> >("tasks"); - QTest::addColumn<QString>("outputLines"); - - - QTest::newRow("pass-through stdout") - << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT - << QString::fromLatin1("Sometext\n") << QString() - << QList<ProjectExplorer::Task>() - << QString(); - QTest::newRow("pass-through stderr") - << QString::fromLatin1("Sometext") << OutputParserTester::STDERR - << QString() << QString::fromLatin1("Sometext\n") - << QList<ProjectExplorer::Task>() - << QString(); -} - -void Qt4ProjectManagerPlugin::testAbldOutputParsers() -{ - OutputParserTester testbench; - testbench.appendOutputParser(new AbldParser); - QFETCH(QString, input); - QFETCH(OutputParserTester::Channel, inputChannel); - QFETCH(QList<Task>, tasks); - QFETCH(QString, childStdOutLines); - QFETCH(QString, childStdErrLines); - QFETCH(QString, outputLines); - - testbench.testParsing(input, inputChannel, - tasks, childStdOutLines, childStdErrLines, - outputLines); -} -#endif diff --git a/src/plugins/qt4projectmanager/qt-s60/abldparser.h b/src/plugins/qt4projectmanager/qt-s60/abldparser.h deleted file mode 100644 index 5a05fcded45..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/abldparser.h +++ /dev/null @@ -1,62 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef ABLDPARSER_H -#define ABLDPARSER_H - -#include <projectexplorer/ioutputparser.h> - -#include <QRegExp> - -namespace Qt4ProjectManager { - -class AbldParser : public ProjectExplorer::IOutputParser -{ - Q_OBJECT - -public: - AbldParser(); - - virtual void stdOutput(const QString & line); - virtual void stdError(const QString & line); - -private: - QRegExp m_perlIssue; - - QString m_currentFile; - int m_currentLine; - - bool m_waitingForStdErrContinuation; - bool m_waitingForStdOutContinuation; -}; - -} // namespace Qt4ProjectExplorer - -#endif // ABLDPARSER_H diff --git a/src/plugins/qt4projectmanager/qt-s60/certificatepathchooser.cpp b/src/plugins/qt4projectmanager/qt-s60/certificatepathchooser.cpp deleted file mode 100644 index 24c18ae1059..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/certificatepathchooser.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "certificatepathchooser.h" -#include "s60certificateinfo.h" - -#include <QMessageBox> - -using namespace Qt4ProjectManager; -using namespace Qt4ProjectManager::Internal; - -CertificatePathChooser::CertificatePathChooser(QWidget *parent) : - Utils::PathChooser(parent) -{ -} - -bool CertificatePathChooser::validatePath(const QString &path, QString *errorMessage) -{ - if (Utils::PathChooser::validatePath(path, errorMessage)) { - QScopedPointer<Qt4ProjectManager::Internal::S60CertificateInfo> - certInfoPtr(new Qt4ProjectManager::Internal::S60CertificateInfo(path)); - if (certInfoPtr.data()->validateCertificate() - == Qt4ProjectManager::Internal::S60CertificateInfo::CertificateValid) { - if (errorMessage) - *errorMessage = certInfoPtr.data()->toHtml(); - return true; - } else { - if (errorMessage) - *errorMessage = certInfoPtr.data()->errorString(); - } - } - return false; -} diff --git a/src/plugins/qt4projectmanager/qt-s60/certificatepathchooser.h b/src/plugins/qt4projectmanager/qt-s60/certificatepathchooser.h deleted file mode 100644 index 2f19dd1dedb..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/certificatepathchooser.h +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef CERTIFICATEPATHCHOOSER_H -#define CERTIFICATEPATHCHOOSER_H - -#include "utils/pathchooser.h" - -namespace Qt4ProjectManager { -namespace Internal { - -class CertificatePathChooser : public Utils::PathChooser -{ - Q_OBJECT - -public: - explicit CertificatePathChooser(QWidget *parent = 0); - - virtual bool validatePath(const QString &path, QString *errorMessage = 0); -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // CERTIFICATEPATHCHOOSER_H diff --git a/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.cpp b/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.cpp deleted file mode 100644 index 469d947de8a..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.cpp +++ /dev/null @@ -1,438 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "codaruncontrol.h" - -#include "s60deployconfiguration.h" -#include "s60devicerunconfiguration.h" -#include "symbianidevice.h" - -#include "codadevice.h" -#include "codamessage.h" - -#include "qt4buildconfiguration.h" -#include "symbiandevicemanager.h" - -#include <coreplugin/icore.h> -#include <utils/qtcassert.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/target.h> - -#include <symbianutils/symbiandevicemanager.h> - -#include <QDir> -#include <QFileInfo> -#include <QTimer> - -#include <QMessageBox> - -#include <QTcpSocket> - -using namespace ProjectExplorer; -using namespace Qt4ProjectManager; -using namespace Qt4ProjectManager::Internal; -using namespace Coda; - -enum { debug = 0 }; - -CodaRunControl::CodaRunControl(RunConfiguration *runConfiguration, RunMode mode) : - S60RunControlBase(runConfiguration, mode), - m_port(0), - m_state(StateUninit), - m_stopAfterConnect(false) -{ - const S60DeviceRunConfiguration *s60runConfig = qobject_cast<S60DeviceRunConfiguration *>(runConfiguration); - QTC_ASSERT(s60runConfig, return); - const S60DeployConfiguration *activeDeployConf = qobject_cast<S60DeployConfiguration *>(s60runConfig->target()->activeDeployConfiguration()); - QTC_ASSERT(activeDeployConf, return); - QTC_ASSERT(activeDeployConf->device(), return); - - SymbianIDevice::CommunicationChannel channel = activeDeployConf->device()->communicationChannel(); - if (channel == SymbianIDevice::CommunicationCodaTcpConnection) { - m_address = activeDeployConf->device()->address(); - m_port = activeDeployConf->device()->port().toInt(); - } else if (channel == SymbianIDevice::CommunicationCodaSerialConnection) { - m_serialPort = activeDeployConf->device()->serialPortName(); - } else { - QTC_ASSERT(false, return); - } -} - -CodaRunControl::~CodaRunControl() -{ -} - -bool CodaRunControl::doStart() -{ - if (m_address.isEmpty() && m_serialPort.isEmpty()) { - cancelProgress(); - QString msg = tr("No device is connected. Please connect a device and try again.\n"); - appendMessage(msg, Utils::NormalMessageFormat); - return false; - } - appendMessage(tr("Executable file: %1\n").arg(msgListFile(executableFileName())), - Utils::NormalMessageFormat); - return true; -} - -bool CodaRunControl::isRunning() const -{ - return m_state >= StateConnecting; -} - -QIcon CodaRunControl::icon() const -{ - return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_DEBUG_SMALL)); -} - -bool CodaRunControl::setupLauncher() -{ - QTC_ASSERT(!m_codaDevice, return false); - - if (m_serialPort.length()) { - // We get the port from SymbianDeviceManager - appendMessage(tr("Connecting to '%1'...\n").arg(m_serialPort), Utils::NormalMessageFormat); - m_codaDevice = SymbianUtils::SymbianDeviceManager::instance()->getCodaDevice(m_serialPort); - if (m_codaDevice.isNull()) { - appendMessage(tr("Unable to create CODA connection. Please try again.\n"), Utils::ErrorMessageFormat); - return false; - } - if (!m_codaDevice->device()->isOpen()) { - appendMessage(tr("Could not open serial device: %1\n").arg(m_codaDevice->device()->errorString()), Utils::ErrorMessageFormat); - return false; - } - connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(deviceRemoved(SymbianUtils::SymbianDevice)), - this, SLOT(deviceRemoved(SymbianUtils::SymbianDevice))); - m_state = StateConnecting; - m_codaDevice->sendSerialPing(false); - } else { - // For TCP we don't use device manager, we just set it up directly - m_codaDevice = QSharedPointer<Coda::CodaDevice>(new Coda::CodaDevice, &QObject::deleteLater); // finishRunControl, which deletes m_codaDevice, can get called from within a coda callback, so need to use deleteLater - const QSharedPointer<QTcpSocket> codaSocket(new QTcpSocket); - m_codaDevice->setDevice(codaSocket); - codaSocket->connectToHost(m_address, m_port); - m_state = StateConnecting; - appendMessage(tr("Connecting to %1:%2...\n").arg(m_address).arg(m_port), Utils::NormalMessageFormat); - } - - connect(m_codaDevice.data(), SIGNAL(error(QString)), this, SLOT(slotError(QString))); - connect(m_codaDevice.data(), SIGNAL(logMessage(QString)), this, SLOT(slotCodaLogMessage(QString))); - connect(m_codaDevice.data(), SIGNAL(codaEvent(Coda::CodaEvent)), this, SLOT(slotCodaEvent(Coda::CodaEvent))); - - QTimer::singleShot(5000, this, SLOT(checkForTimeout())); - if (debug) - m_codaDevice->setVerbose(debug); - return true; -} - -void CodaRunControl::doStop() -{ - switch (m_state) { - case StateUninit: - case StateConnecting: - case StateConnected: - finishRunControl(); - break; - case StateProcessRunning: - QTC_ASSERT(!m_runningProcessId.isEmpty(), return); - m_codaDevice->sendRunControlTerminateCommand(CodaCallback(), - m_runningProcessId.toAscii()); - break; - default: - if (debug) - qDebug() << "Unrecognised state while performing shutdown" << m_state; - break; - } -} - -void CodaRunControl::slotError(const QString &error) -{ - appendMessage(tr("Error: %1\n").arg(error), Utils::ErrorMessageFormat); - finishRunControl(); -} - -void CodaRunControl::slotCodaLogMessage(const QString &log) -{ - if (debug > 1) - qDebug("CODA log: %s", qPrintable(log.size()>200?log.left(200).append(QLatin1String("...")): log)); -} - -void CodaRunControl::slotCodaEvent(const CodaEvent &event) -{ - if (debug) - qDebug() << "CODA event:" << "Type:" << event.type() << "Message:" << event.toString(); - - switch (event.type()) { - case CodaEvent::LocatorHello: - handleConnected(event); - break; - case CodaEvent::RunControlContextRemoved: - handleContextRemoved(event); - break; - case CodaEvent::RunControlContextAdded: - m_state = StateProcessRunning; - reportLaunchFinished(); - handleContextAdded(event); - break; - case CodaEvent::RunControlSuspended: - handleContextSuspended(event); - break; - case CodaEvent::RunControlModuleLoadSuspended: - handleModuleLoadSuspended(event); - break; - case CodaEvent::LoggingWriteEvent: - handleLogging(event); - break; - case CodaEvent::ProcessExitedEvent: - handleProcessExited(event); - break; - default: - if (debug) - qDebug() << "CODA event not handled" << event.type(); - break; - } -} - -void CodaRunControl::initCommunication() -{ - m_codaDevice->sendDebugSessionControlSessionStartCommand(CodaCallback(this, &CodaRunControl::handleDebugSessionStarted)); -} - -void CodaRunControl::handleConnected(const CodaEvent &event) -{ - if (m_state >= StateConnected) - return; - m_state = StateConnected; - appendMessage(tr("Connected.\n"), Utils::NormalMessageFormat); - setProgress(maxProgress()*0.80); - - m_codaServices = static_cast<const CodaLocatorHelloEvent &>(event).services(); - - emit connected(); - if (!m_stopAfterConnect) - initCommunication(); -} - -void CodaRunControl::handleContextRemoved(const CodaEvent &event) -{ - const QVector<QByteArray> removedItems - = static_cast<const CodaRunControlContextRemovedEvent &>(event).ids(); - if (!m_runningProcessId.isEmpty() - && removedItems.contains(m_runningProcessId.toAscii())) { - m_codaDevice->sendDebugSessionControlSessionEndCommand(CodaCallback(this, &CodaRunControl::handleDebugSessionEnded)); - } -} - -void CodaRunControl::handleContextAdded(const CodaEvent &event) -{ - typedef CodaRunControlContextAddedEvent CodaAddedEvent; - - const CodaAddedEvent &me = static_cast<const CodaAddedEvent &>(event); - foreach (const RunControlContext &context, me.contexts()) { - if (context.parentId == "root") //is the created context a process - m_runningProcessId = QLatin1String(context.id); - } -} - -void CodaRunControl::handleContextSuspended(const CodaEvent &event) -{ - typedef CodaRunControlContextSuspendedEvent CodaSuspendEvent; - - const CodaSuspendEvent &me = static_cast<const CodaSuspendEvent &>(event); - - switch (me.reason()) { - case CodaSuspendEvent::Other: - case CodaSuspendEvent::Crash: - appendMessage(tr("Thread has crashed: %1\n").arg(QString::fromLatin1(me.message())), Utils::ErrorMessageFormat); - - if (me.reason() == CodaSuspendEvent::Crash) - stop(); - else - m_codaDevice->sendRunControlResumeCommand(CodaCallback(), me.id()); //TODO: Should I resume automatically - break; - default: - if (debug) - qDebug() << "Context suspend not handled:" << "Reason:" << me.reason() << "Message:" << me.message(); - break; - } -} - -void CodaRunControl::handleModuleLoadSuspended(const CodaEvent &event) -{ - // Debug mode start: Continue: - typedef CodaRunControlModuleLoadContextSuspendedEvent CodaModuleLoadSuspendedEvent; - - const CodaModuleLoadSuspendedEvent &me = static_cast<const CodaModuleLoadSuspendedEvent &>(event); - if (me.info().requireResume) - m_codaDevice->sendRunControlResumeCommand(CodaCallback(), me.id()); -} - -void CodaRunControl::handleLogging(const CodaEvent &event) -{ - const CodaLoggingWriteEvent &me = static_cast<const CodaLoggingWriteEvent &>(event); - appendMessage(QString::fromLatin1(QByteArray(me.message() + '\n')), Utils::StdOutFormat); -} - -void CodaRunControl::handleProcessExited(const CodaEvent &event) -{ - Q_UNUSED(event) - appendMessage(tr("Process has finished.\n"), Utils::NormalMessageFormat); - m_codaDevice->sendDebugSessionControlSessionEndCommand(CodaCallback(this, &CodaRunControl::handleDebugSessionEnded)); -} - -void CodaRunControl::handleAddListener(const CodaCommandResult &result) -{ - Q_UNUSED(result) - m_codaDevice->sendSymbianOsDataFindProcessesCommand(CodaCallback(this, &CodaRunControl::handleFindProcesses), - QByteArray(), - QByteArray::number(executableUid(), 16)); -} - -void CodaRunControl::handleDebugSessionStarted(const CodaCommandResult &result) -{ - Q_UNUSED(result) - if (m_codaDevice.isNull()) { - finishRunControl(); - return; - } - m_state = StateDebugSessionStarted; - m_codaDevice->sendLoggingAddListenerCommand(CodaCallback(this, &CodaRunControl::handleAddListener)); -} - -void CodaRunControl::handleDebugSessionEnded(const CodaCommandResult &result) -{ - Q_UNUSED(result) - m_state = StateDebugSessionEnded; - finishRunControl(); -} - -void CodaRunControl::handleFindProcesses(const CodaCommandResult &result) -{ - if (result.values.size() && result.values.at(0).type() == Json::JsonValue::Array && result.values.at(0).children().count()) { - //there are processes running. Cannot run mine - appendMessage(tr("The process is already running on the device. Please first close it.\n"), Utils::ErrorMessageFormat); - finishRunControl(); - } else { - setProgress(maxProgress()*0.90); - m_codaDevice->sendProcessStartCommand(CodaCallback(this, &CodaRunControl::handleCreateProcess), - executableName(), - executableUid(), - commandLineArguments().split(QLatin1Char(' ')), - QString(), - true); - appendMessage(tr("Launching: %1\n").arg(executableName()), Utils::NormalMessageFormat); - } -} - -void CodaRunControl::handleCreateProcess(const CodaCommandResult &result) -{ - const bool ok = result.type == CodaCommandResult::SuccessReply; - bool processCreated = false; - if (ok) { - if (result.values.size()) { - Json::JsonValue id = result.values.at(0).findChild("ID"); - if (id.isValid()) { - m_state = StateProcessRunning; - m_runningProcessId = QLatin1String(id.data()); - processCreated = true; - } - } - } - if (processCreated) { - setProgress(maxProgress()); - appendMessage(tr("Launched.\n"), Utils::NormalMessageFormat); - } else { - appendMessage(tr("Launch failed: %1\n").arg(result.toString()), Utils::ErrorMessageFormat); - finishRunControl(); - } -} - -void CodaRunControl::finishRunControl() -{ - m_runningProcessId.clear(); - if (m_codaDevice) { - disconnect(m_codaDevice.data(), 0, this, 0); - SymbianUtils::SymbianDeviceManager::instance()->releaseCodaDevice(m_codaDevice); - } - m_state = StateUninit; - emit finished(); -} - -QMessageBox *CodaRunControl::createCodaWaitingMessageBox(QWidget *parent) -{ - const QString title = tr("Waiting for CODA"); - const QString text = tr("Qt Creator is waiting for the CODA application to connect.<br>" - "Please make sure the application is running on " - "your mobile phone and the right IP address and/or port are " - "configured in the project settings."); - QMessageBox *mb = new QMessageBox(QMessageBox::Information, title, text, QMessageBox::Cancel, parent); - return mb; -} - -void CodaRunControl::checkForTimeout() -{ - if (m_state != StateConnecting) - return; - - QMessageBox *mb = createCodaWaitingMessageBox(Core::ICore::mainWindow()); - connect(this, SIGNAL(finished()), mb, SLOT(close())); - connect(mb, SIGNAL(finished(int)), this, SLOT(cancelConnection())); - mb->open(); -} - -void CodaRunControl::cancelConnection() -{ - if (m_state != StateConnecting) - return; - - stop(); - appendMessage(tr("Canceled.\n"), Utils::ErrorMessageFormat); - emit finished(); -} - -void CodaRunControl::deviceRemoved(const SymbianUtils::SymbianDevice &device) -{ - if (m_codaDevice && device.portName() == m_serialPort) { - QString msg = tr("The device '%1' has been disconnected.\n").arg(device.friendlyName()); - appendMessage(msg, Utils::ErrorMessageFormat); - finishRunControl(); - } -} - -void CodaRunControl::connect() -{ - m_stopAfterConnect = true; - start(); -} - -void CodaRunControl::run() -{ - initCommunication(); -} diff --git a/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.h b/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.h deleted file mode 100644 index 4830a1c2d2a..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.h +++ /dev/null @@ -1,132 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef CODARUNCONTROL_H -#define CODARUNCONTROL_H - -#include "s60runcontrolbase.h" - -QT_BEGIN_NAMESPACE -class QMessageBox; -class QWidget; -QT_END_NAMESPACE - -namespace Coda { -struct CodaCommandResult; -class CodaDevice; -class CodaEvent; -} - -namespace SymbianUtils { -class SymbianDevice; -} - -namespace Qt4ProjectManager { - -// CodaRunControl configures Coda to run the application -class QT4PROJECTMANAGER_EXPORT CodaRunControl : public S60RunControlBase -{ - Q_OBJECT -public: - CodaRunControl(ProjectExplorer::RunConfiguration *runConfiguration, - ProjectExplorer::RunMode mode); - virtual ~CodaRunControl(); - - virtual bool isRunning() const; - virtual QIcon icon() const; - - static QMessageBox *createCodaWaitingMessageBox(QWidget *parent = 0); - - using QObject::connect; - void connect(); // Like start() but doesn't actually launch the program; just hooks up coda. - void run(); - -protected: - virtual bool doStart(); - virtual void doStop(); - virtual bool setupLauncher(); - -signals: - void connected(); - -protected slots: - void finishRunControl(); - void checkForTimeout(); - void cancelConnection(); - void deviceRemoved(const SymbianUtils::SymbianDevice &device); - -private slots: - void slotError(const QString &error); - void slotCodaLogMessage(const QString &log); - void slotCodaEvent(const Coda::CodaEvent &event); - -private: - void initCommunication(); - - void handleConnected(const Coda::CodaEvent &event); - void handleModuleLoadSuspended(const Coda::CodaEvent &event); - void handleContextSuspended(const Coda::CodaEvent &event); - void handleContextAdded(const Coda::CodaEvent &event); - void handleContextRemoved(const Coda::CodaEvent &event); - void handleLogging(const Coda::CodaEvent &event); - void handleProcessExited(const Coda::CodaEvent &event); - -private: - void handleCreateProcess(const Coda::CodaCommandResult &result); - void handleAddListener(const Coda::CodaCommandResult &result); - void handleDebugSessionStarted(const Coda::CodaCommandResult &result); - void handleDebugSessionEnded(const Coda::CodaCommandResult &result); - void handleFindProcesses(const Coda::CodaCommandResult &result); - -private: - enum State { - StateUninit, - StateConnecting, - StateConnected, - StateDebugSessionStarted, - StateProcessRunning, - StateDebugSessionEnded - }; - - QSharedPointer<Coda::CodaDevice> m_codaDevice; - - QString m_address; - unsigned short m_port; - QString m_serialPort; - QString m_runningProcessId; - QStringList m_codaServices; - - State m_state; - bool m_stopAfterConnect; -}; - -} // namespace Qt4ProjectManager - -#endif // CODARUNCONTROL_H diff --git a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp deleted file mode 100644 index dc6562f9d76..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "gccetoolchain.h" -#include "qt4projectmanagerconstants.h" - -#include <utils/environment.h> -#include <utils/synchronousprocess.h> -#include <projectexplorer/headerpath.h> -#include <projectexplorer/toolchainmanager.h> -#include <qtsupport/qtversionmanager.h> - -#include <QDir> - -namespace Qt4ProjectManager { -namespace Internal { - -static QString gcceVersion(const Utils::FileName &command) -{ - if (command.isEmpty()) - return QString(); - - QProcess gxx; - QStringList arguments; - arguments << QLatin1String("-dumpversion"); - Utils::Environment env = Utils::Environment::systemEnvironment(); - env.set(QLatin1String("LC_ALL"), QLatin1String("C")); //override current locale settings - gxx.setEnvironment(env.toStringList()); - gxx.setReadChannelMode(QProcess::MergedChannels); - gxx.start(command.toString(), arguments); - if (!gxx.waitForStarted()) { - qWarning("Cannot start '%s': %s", qPrintable(command.toUserOutput()), qPrintable(gxx.errorString())); - return QString(); - } - gxx.closeWriteChannel(); - if (!gxx.waitForFinished()) { - Utils::SynchronousProcess::stopProcess(gxx); - qWarning("Timeout running '%s'.", qPrintable(command.toUserOutput())); - return QString(); - } - if (gxx.exitStatus() != QProcess::NormalExit) { - qWarning("'%s' crashed.", qPrintable(command.toUserOutput())); - return QString(); - } - - QString version = QString::fromLocal8Bit(gxx.readLine().trimmed()); - if (version.contains(QRegExp(QLatin1String("^\\d+\\.\\d+\\.\\d+.*$")))) - return version; - - return QString(); -} - - -// ========================================================================== -// GcceToolChain -// ========================================================================== - -QString GcceToolChain::type() const -{ - return QLatin1String("gcce"); -} - -QString GcceToolChain::typeDisplayName() const -{ - return GcceToolChainFactory::tr("GCCE"); -} - -QByteArray GcceToolChain::predefinedMacros(const QStringList &list) const -{ - if (m_predefinedMacros.isEmpty()) { - ProjectExplorer::GccToolChain::predefinedMacros(list); - m_predefinedMacros += "\n" - "#define __GCCE__\n" - "#define __SYMBIAN32__\n"; - } - return m_predefinedMacros; -} - -void GcceToolChain::addToEnvironment(Utils::Environment &env) const -{ - GccToolChain::addToEnvironment(env); - - if (m_gcceVersion.isEmpty()) - m_gcceVersion = gcceVersion(compilerCommand()); - if (m_gcceVersion.isEmpty()) - return; - - env.set(QLatin1String("QT_GCCE_VERSION"), m_gcceVersion); - QString version = m_gcceVersion; - env.set(QString::fromLatin1("SBS_GCCE") + version.remove(QLatin1Char('.')) - + QLatin1String("BIN"), QDir::toNativeSeparators(compilerCommand().toFileInfo().absolutePath())); - // Required for SBS, which checks the version output from its tools - // and gets confused by localized output. - env.set(QLatin1String("LANG"), QString(QLatin1Char('C'))); -} - -QString GcceToolChain::makeCommand() const -{ -#if defined(Q_OS_WIN) - return QLatin1String("make.exe"); -#else - return QLatin1String("make"); -#endif -} - -QString GcceToolChain::defaultMakeTarget() const -{ - return QLatin1String("gcce"); -} - -void GcceToolChain::setCompilerCommand(const Utils::FileName &path) -{ - m_gcceVersion.clear(); - GccToolChain::setCompilerCommand(path); -} - -ProjectExplorer::ToolChain *GcceToolChain::clone() const -{ - return new GcceToolChain(*this); -} - -GcceToolChain::GcceToolChain(bool autodetected) : - GccToolChain(QLatin1String(Constants::GCCE_TOOLCHAIN_ID), autodetected) -{ } - -// ========================================================================== -// GcceToolChainFactory -// ========================================================================== - -QString GcceToolChainFactory::displayName() const -{ - return tr("GCCE"); -} - -QString GcceToolChainFactory::id() const -{ - return QLatin1String(Constants::GCCE_TOOLCHAIN_ID); -} - -QList<ProjectExplorer::ToolChain *> GcceToolChainFactory::autoDetect() -{ - QList<ProjectExplorer::ToolChain *> result; - - // Compatibility to pre-2.2: - while (true) { - const QString path = QtSupport::QtVersionManager::instance()->popPendingGcceUpdate(); - if (path.isNull()) - break; - - QFileInfo fi(path + QLatin1String("/bin/arm-none-symbianelf-g++.exe")); - if (fi.exists() && fi.isExecutable()) { - GcceToolChain *tc = new GcceToolChain(false); - tc->setCompilerCommand(Utils::FileName(fi)); - tc->setDisplayName(tr("GCCE from Qt version")); - result.append(tc); - } - } - - Utils::FileName fullPath = - Utils::FileName::fromString(Utils::Environment::systemEnvironment() - .searchInPath(QLatin1String("arm-none-symbianelf-gcc"))); - QString version = gcceVersion(fullPath); - // If version is empty then this is not a GCC but e.g. bullseye! - if (!fullPath.isEmpty() && !version.isEmpty()) { - GcceToolChain *tc = new GcceToolChain(true); - tc->setCompilerCommand(fullPath); - tc->setDisplayName(tr("GCCE (%1)").arg(version)); - if (tc->targetAbi() == ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, - ProjectExplorer::Abi::SymbianOS, - ProjectExplorer::Abi::SymbianDeviceFlavor, - ProjectExplorer::Abi::ElfFormat, - 32)) - result.append(tc); - } - return result; -} - -bool GcceToolChainFactory::canCreate() -{ - return true; -} - -ProjectExplorer::ToolChain *GcceToolChainFactory::create() -{ - GcceToolChain *tc = new GcceToolChain(false); - tc->setDisplayName(tr("GCCE")); - return tc; -} - -bool GcceToolChainFactory::canRestore(const QVariantMap &data) -{ - return idFromMap(data).startsWith(QLatin1String(Constants::GCCE_TOOLCHAIN_ID)); -} - -ProjectExplorer::ToolChain *GcceToolChainFactory::restore(const QVariantMap &data) -{ - GcceToolChain *tc = new GcceToolChain(false); - if (tc->fromMap(data)) - return tc; - - delete tc; - return 0; -} - -} // namespace Internal -} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h deleted file mode 100644 index 163a4f14cc9..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h +++ /dev/null @@ -1,90 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef GCCETOOLCHAIN_H -#define GCCETOOLCHAIN_H - -#include <projectexplorer/gcctoolchain.h> - -namespace Qt4ProjectManager { -namespace Internal { - -// ========================================================================== -// GcceToolChain -// ========================================================================== - -class GcceToolChain : public ProjectExplorer::GccToolChain -{ -public: - QString type() const; - QString typeDisplayName() const; - - QByteArray predefinedMacros(const QStringList &list) const; - void addToEnvironment(Utils::Environment &env) const; - QString makeCommand() const; - QString defaultMakeTarget() const; - - void setCompilerCommand(const Utils::FileName &); - - ProjectExplorer::ToolChain *clone() const; - -private: - explicit GcceToolChain(bool autodetected); - - mutable QString m_gcceVersion; - - friend class GcceToolChainFactory; -}; - -// ========================================================================== -// GcceToolChainFactory -// ========================================================================== - -class GcceToolChainFactory : public ProjectExplorer::ToolChainFactory -{ - Q_OBJECT - -public: - QString displayName() const; - QString id() const; - - QList<ProjectExplorer::ToolChain *> autoDetect(); - - bool canCreate(); - ProjectExplorer::ToolChain *create(); - - bool canRestore(const QVariantMap &data); - ProjectExplorer::ToolChain *restore(const QVariantMap &data); -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // GCCETOOLCHAIN_H diff --git a/src/plugins/qt4projectmanager/qt-s60/passphraseforkeydialog.cpp b/src/plugins/qt4projectmanager/qt-s60/passphraseforkeydialog.cpp deleted file mode 100644 index 0a2a8254310..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/passphraseforkeydialog.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "passphraseforkeydialog.h" - -#include <QCheckBox> -#include <QDialogButtonBox> -#include <QLabel> -#include <QLineEdit> -#include <QPushButton> -#include <QVBoxLayout> - -using namespace Qt4ProjectManager; - -PassphraseForKeyDialog::PassphraseForKeyDialog(const QString &keyName, QWidget *parent) : - QDialog(parent), - m_buttonBox(0), - m_saveCheckBox(0), - m_passphraseEdit(0) -{ - QVBoxLayout *layout = new QVBoxLayout(this); - - QHBoxLayout *hPasswordLayout = new QHBoxLayout; - - QLabel *passphraseLabel = new QLabel(this); - passphraseLabel->setText(tr("Passphrase:")); - hPasswordLayout->addWidget(passphraseLabel); - - m_passphraseEdit = new QLineEdit(this); - m_passphraseEdit->setEchoMode(QLineEdit::Password); - connect(m_passphraseEdit, SIGNAL(textChanged(QString)), this, SLOT(passphraseChanged())); - hPasswordLayout->addWidget(m_passphraseEdit); - - m_saveCheckBox = new QCheckBox(this); - m_saveCheckBox->setText(tr("Save passphrase")); - m_saveCheckBox->setToolTip(tr("This is an insecure option. The password will be saved as plain text.")); - - m_buttonBox = new QDialogButtonBox(this); - m_buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); - - connect(m_buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - - layout->addLayout(hPasswordLayout); - layout->addWidget(m_saveCheckBox); - layout->addItem(new QSpacerItem(0, 10)); - layout->addWidget(m_buttonBox); - - setWindowTitle(tr("Passphrase for %1").arg(keyName)); - setFixedSize(sizeHint()); - - passphraseChanged(); -} - -void PassphraseForKeyDialog::passphraseChanged() -{ - // We tried the empty passphrase when we get here, so disallow it - Q_ASSERT(m_buttonBox->button(QDialogButtonBox::Ok)); - m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!m_passphraseEdit->text().isEmpty()); -} - -QString PassphraseForKeyDialog::passphrase() const -{ - return m_passphraseEdit->text(); -} - -bool PassphraseForKeyDialog::savePassphrase() const -{ - return m_saveCheckBox->isChecked(); -} diff --git a/src/plugins/qt4projectmanager/qt-s60/passphraseforkeydialog.h b/src/plugins/qt4projectmanager/qt-s60/passphraseforkeydialog.h deleted file mode 100644 index c1df663ab1d..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/passphraseforkeydialog.h +++ /dev/null @@ -1,62 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef PASSPHRASEFORKEYDIALOG_H -#define PASSPHRASEFORKEYDIALOG_H - -#include <QDialog> - -QT_FORWARD_DECLARE_CLASS(QCheckBox) -QT_FORWARD_DECLARE_CLASS(QDialogButtonBox) -QT_FORWARD_DECLARE_CLASS(QLineEdit) - -namespace Qt4ProjectManager { - -class PassphraseForKeyDialog : public QDialog -{ - Q_OBJECT -public: - explicit PassphraseForKeyDialog(const QString &keyName, QWidget *parent = 0); - - QString passphrase() const; - bool savePassphrase() const; - -protected slots: - void passphraseChanged(); - -private: - QDialogButtonBox *m_buttonBox; - QCheckBox *m_saveCheckBox; - QLineEdit *m_passphraseEdit; -}; - -} // namespace Qt4ProjectManager - -#endif // PASSPHRASEFORKEYDIALOG_H diff --git a/src/plugins/qt4projectmanager/qt-s60/qt-s60-todo.txt b/src/plugins/qt4projectmanager/qt-s60/qt-s60-todo.txt deleted file mode 100644 index cbb483b58c2..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/qt-s60-todo.txt +++ /dev/null @@ -1,19 +0,0 @@ -* SDK overview page: - * When the refresh button is pressed - the qtoptionspage is not updated to reflect the new versions - though we update them in S60Manager - -* QtVersion: - * gui for overriding the default make target if necessary, - make arguments --> make options - -* Tool chains - * should the default make target be defined by the project - instead of tool chain, or perhaps by the QtVersion dependent on a - tool chain? - -* Run on device - * time stamp of copied sisx is ridiculous - * don't copy the sisx all the time - * don't hardcode copy destination - * isRunning is wrong diff --git a/src/plugins/qt4projectmanager/qt-s60/qt-s60.pri b/src/plugins/qt4projectmanager/qt-s60/qt-s60.pri deleted file mode 100644 index 9d451e43727..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/qt-s60.pri +++ /dev/null @@ -1,78 +0,0 @@ -CONFIG += exceptions - -SOURCES += $$PWD/s60manager.cpp \ - $$PWD/symbianidevice.cpp \ - $$PWD/symbianideviceconfigwidget.cpp \ - $$PWD/symbianidevicefactory.cpp \ - $$PWD/sbsv2parser.cpp \ - $$PWD/gccetoolchain.cpp \ - $$PWD/s60devicerunconfiguration.cpp \ - $$PWD/s60devicerunconfigurationwidget.cpp \ - $$PWD/rvcttoolchain.cpp \ - $$PWD/abldparser.cpp \ - $$PWD/rvctparser.cpp \ - $$PWD/s60createpackagestep.cpp \ - $$PWD/s60deploystep.cpp \ - $$PWD/s60createpackageparser.cpp \ - $$PWD/passphraseforkeydialog.cpp \ - $$PWD/s60deployconfiguration.cpp \ - $$PWD/s60deployconfigurationwidget.cpp \ - $$PWD/s60certificateinfo.cpp \ - $$PWD/certificatepathchooser.cpp \ - $$PWD/s60symbiancertificate.cpp \ - $$PWD/s60certificatedetailsdialog.cpp \ - $$PWD/s60runcontrolfactory.cpp \ - $$PWD/codaruncontrol.cpp \ - $$PWD/s60runcontrolbase.cpp \ - $$PWD/s60publishingwizardfactories.cpp \ - $$PWD/s60publishingwizardovi.cpp \ - $$PWD/s60publishingsissettingspageovi.cpp \ - $$PWD/s60publisherovi.cpp \ - $$PWD/s60publishingbuildsettingspageovi.cpp \ - $$PWD/s60publishingresultspageovi.cpp \ - $$PWD/symbianqtversionfactory.cpp \ - $$PWD/symbianqtversion.cpp \ - $$PWD/s60devicedebugruncontrol.cpp - -HEADERS += $$PWD/s60manager.h \ - $$PWD/symbianidevice.h \ - $$PWD/symbianideviceconfigwidget.h \ - $$PWD/symbianidevicefactory.h \ - $$PWD/sbsv2parser.h \ - $$PWD/gccetoolchain.h \ - $$PWD/s60devicerunconfiguration.h \ - $$PWD/s60devicerunconfigurationwidget.h \ - $$PWD/rvcttoolchain.h \ - $$PWD/abldparser.h \ - $$PWD/rvctparser.h \ - $$PWD/s60createpackagestep.h \ - $$PWD/s60deploystep.h \ - $$PWD/s60createpackageparser.h \ - $$PWD/passphraseforkeydialog.h \ - $$PWD/s60deployconfiguration.h \ - $$PWD/s60deployconfigurationwidget.h \ - $$PWD/s60certificateinfo.h \ - $$PWD/certificatepathchooser.h \ - $$PWD/s60symbiancertificate.h \ - $$PWD/s60certificatedetailsdialog.h \ - $$PWD/s60runcontrolfactory.h \ - $$PWD/codaruncontrol.h \ - $$PWD/s60runcontrolbase.h \ - $$PWD/s60publishingwizardfactories.h \ - $$PWD/s60publishingwizardovi.h \ - $$PWD/s60publishingsissettingspageovi.h \ - $$PWD/s60publisherovi.h \ - $$PWD/s60publishingbuildsettingspageovi.h \ - $$PWD/s60publishingresultspageovi.h \ - $$PWD/symbianqtversionfactory.h \ - $$PWD/symbianqtversion.h \ - $$PWD/s60devicedebugruncontrol.h - -FORMS += $$PWD/s60createpackagestep.ui \ - $$PWD/s60certificatedetailsdialog.ui \ - $$PWD/s60publishingbuildsettingspageovi.ui \ - $$PWD/s60publishingresultspageovi.ui \ - $$PWD/s60publishingsissettingspageovi.ui - -include(../../../shared/json/json.pri) -DEFINES += JSON_INCLUDE_PRI diff --git a/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp b/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp deleted file mode 100644 index 3e831fbbcf8..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp +++ /dev/null @@ -1,254 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "rvctparser.h" -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/task.h> - -using namespace ProjectExplorer; -using namespace ProjectExplorer::Constants; -using namespace Qt4ProjectManager; - -RvctParser::RvctParser() : - m_task(0) -{ - setObjectName(QLatin1String("RvctParser")); - // Start of a error or warning: - m_warningOrError.setPattern(QLatin1String("^\"([^\\(\\)]+[^\\d])\", line (\\d+):(\\s(Warning|Error):)\\s+([^\\s].*)$")); - m_warningOrError.setMinimal(true); - - // Last message for any file with warnings/errors. - m_wrapUpTask.setPattern(QLatin1String("^([^\\(\\)]+[^\\d]):\\s(\\d+) warnings?,\\s(\\d+) errors?$")); - m_wrapUpTask.setMinimal(true); - - // linker problems: - m_genericProblem.setPattern(QLatin1String("^(Error|Warning): (.*)$")); - m_genericProblem.setMinimal(true); -} - -RvctParser::~RvctParser() -{ - sendTask(); -} - -void RvctParser::stdError(const QString &line) -{ - QString lne = line.trimmed(); - if (m_genericProblem.indexIn(lne) > -1) { - sendTask(); - - m_task = new Task(Task::Error, - m_genericProblem.cap(2) /* description */, - Utils::FileName(), - -1 /* linenumber */, - Core::Id(TASK_CATEGORY_COMPILE)); - if (m_warningOrError.cap(4) == QLatin1String("Warning")) - m_task->type = Task::Warning; - else if (m_warningOrError.cap(4) == QLatin1String("Error")) - m_task->type = Task::Error; - - return; - } - if (m_warningOrError.indexIn(lne) > -1) { - sendTask(); - - m_task = new Task(Task::Unknown, - m_warningOrError.cap(5) /* description */, - Utils::FileName::fromUserInput(m_warningOrError.cap(1)) /* file */, - m_warningOrError.cap(2).toInt() /* line */, - Core::Id(TASK_CATEGORY_COMPILE)); - if (m_warningOrError.cap(4) == QLatin1String("Warning")) - m_task->type = Task::Warning; - else if (m_warningOrError.cap(4) == QLatin1String("Error")) - m_task->type = Task::Error; - return; - } - - if (m_wrapUpTask.indexIn(lne) > -1) { - sendTask(); - return; - } - if (m_task) { - QString description = line; - if (description.startsWith(QLatin1String(" "))) - description = description.mid(2); - if (description.endsWith(QLatin1Char('\n'))) - description.chop(1); - if (m_task->formats.isEmpty()) { - QTextLayout::FormatRange fr; - fr.start = m_task->description.count(); // incl. '\n' we are about to add! - fr.length = description.count() - 1; - fr.format.setFontItalic(true); - m_task->formats.append(fr); - } else { - m_task->formats[0].length += description.count() - 2 + 1; - } - m_task->description += QLatin1Char('\n') + description; - - // Wrap up license error: - if (description.endsWith(QLatin1String("at \"www.macrovision.com\"."))) - sendTask(); - - return; - } - IOutputParser::stdError(line); -} - -void RvctParser::sendTask() -{ - if (!m_task) - return; - emit addTask(*m_task); - delete m_task; - m_task = 0; -} - -// Unit tests: - -#ifdef WITH_TESTS -# include <QTest> - -# include "qt4projectmanagerplugin.h" -# include <projectexplorer/metatypedeclarations.h> -# include <projectexplorer/outputparser_test.h> - -using namespace Qt4ProjectManager::Internal; - -void Qt4ProjectManagerPlugin::testRvctOutputParser_data() -{ - QTest::addColumn<QString>("input"); - QTest::addColumn<OutputParserTester::Channel>("inputChannel"); - QTest::addColumn<QString>("childStdOutLines"); - QTest::addColumn<QString>("childStdErrLines"); - QTest::addColumn<QList<ProjectExplorer::Task> >("tasks"); - QTest::addColumn<QString>("outputLines"); - - const Core::Id categoryCompile = Core::Id(Constants::TASK_CATEGORY_COMPILE); - QTest::newRow("pass-through stdout") - << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT - << QString::fromLatin1("Sometext\n") << QString() - << QList<ProjectExplorer::Task>() - << QString(); - QTest::newRow("pass-through stderr") - << QString::fromLatin1("Sometext") << OutputParserTester::STDERR - << QString() << QString::fromLatin1("Sometext\n") - << QList<ProjectExplorer::Task>() - << QString(); - - QTest::newRow("Rvct warning") - << QString::fromLatin1("\"../../../../s60-sdk/epoc32/include/stdapis/stlport/stl/_limits.h\", line 256: Warning: #68-D: integer conversion resulted in a change of sign\n" - " : public _Integer_limits<char, CHAR_MIN, CHAR_MAX, -1, true>\n" - " ^") - << OutputParserTester::STDERR - << QString() << QString() - << (QList<ProjectExplorer::Task>() - << Task(Task::Warning, - QLatin1String("#68-D: integer conversion resulted in a change of sign\n" - " : public _Integer_limits<char, CHAR_MIN, CHAR_MAX, -1, true>\n" - " ^"), - Utils::FileName::fromUserInput("../../../../s60-sdk/epoc32/include/stdapis/stlport/stl/_limits.h"), 256, - categoryCompile) - ) - << QString(); - QTest::newRow("Rvct error") - << QString::fromLatin1("\"mainwindow.cpp\", line 22: Error: #20: identifier \"e\" is undefined\n" - " delete ui;e\n" - " ^") - << OutputParserTester::STDERR - << QString() << QString() - << (QList<ProjectExplorer::Task>() - << Task(Task::Error, - QLatin1String("#20: identifier \"e\" is undefined\n" - " delete ui;e\n" - " ^"), - Utils::FileName::fromUserInput("mainwindow.cpp"), 22, - categoryCompile) - ) - << QString(); - QTest::newRow("Rvct linking error") - << QString::fromLatin1("Error: L6218E: Undefined symbol MainWindow::sth() (referred from mainwindow.o)") - << OutputParserTester::STDERR - << QString() << QString() - << (QList<ProjectExplorer::Task>() - << Task(Task::Error, - QLatin1String("L6218E: Undefined symbol MainWindow::sth() (referred from mainwindow.o)"), - Utils::FileName(), -1, - categoryCompile) - ) - << QString(); - QTest::newRow("Rvct license error") - << QString::fromLatin1("Error: C3397E: Cannot obtain license for Compiler (feature compiler) with license version >= 2.2:\n" - "Cannot find license file.\n" - " The license files (or license server system network addresses) attempted are \n" - "listed below. Use LM_LICENSE_FILE to use a different license file,\n" - " or contact your software provider for a license file.\n" - "Feature: compiler\n" - "Filename: /usr/local/flexlm/licenses/license.dat\n" - "License path: /usr/local/flexlm/licenses/license.dat\n" - "FLEXnet Licensing error:-1,359. System Error: 2 \"No such file or directory\"\n" - "For further information, refer to the FLEXnet Licensing End User Guide,\n" - "available at \"www.macrovision.com\".") - << OutputParserTester::STDERR - << QString() << QString() - << (QList<ProjectExplorer::Task>() - << Task(Task::Error, - QLatin1String("C3397E: Cannot obtain license for Compiler (feature compiler) with license version >= 2.2:\n" - "Cannot find license file.\n" - " The license files (or license server system network addresses) attempted are \n" - "listed below. Use LM_LICENSE_FILE to use a different license file,\n" - " or contact your software provider for a license file.\n" - "Feature: compiler\n" - "Filename: /usr/local/flexlm/licenses/license.dat\n" - "License path: /usr/local/flexlm/licenses/license.dat\n" - "FLEXnet Licensing error:-1,359. System Error: 2 \"No such file or directory\"\n" - "For further information, refer to the FLEXnet Licensing End User Guide,\n" - "available at \"www.macrovision.com\"."), - Utils::FileName(), -1, - categoryCompile) - ) - << QString(); -} - -void Qt4ProjectManagerPlugin::testRvctOutputParser() -{ - OutputParserTester testbench; - testbench.appendOutputParser(new RvctParser); - QFETCH(QString, input); - QFETCH(OutputParserTester::Channel, inputChannel); - QFETCH(QList<Task>, tasks); - QFETCH(QString, childStdOutLines); - QFETCH(QString, childStdErrLines); - QFETCH(QString, outputLines); - - testbench.testParsing(input, inputChannel, - tasks, childStdOutLines, childStdErrLines, - outputLines); -} -#endif diff --git a/src/plugins/qt4projectmanager/qt-s60/rvctparser.h b/src/plugins/qt4projectmanager/qt-s60/rvctparser.h deleted file mode 100644 index 089641b39eb..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/rvctparser.h +++ /dev/null @@ -1,61 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef RVCTPARSER_H -#define RVCTPARSER_H - -#include <projectexplorer/ioutputparser.h> - -#include <QRegExp> - -namespace Qt4ProjectManager { - -class RvctParser : public ProjectExplorer::IOutputParser -{ - Q_OBJECT - -public: - RvctParser(); - ~RvctParser(); - virtual void stdError(const QString & line); - -private: - void sendTask(); - - QRegExp m_warningOrError; - QRegExp m_wrapUpTask; - QRegExp m_genericProblem; - - ProjectExplorer::Task * m_task; -}; - -} // namespace Qt4ProjectManager - -#endif // RVCTPARSER_H diff --git a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp deleted file mode 100644 index a6530d4d09a..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp +++ /dev/null @@ -1,581 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "rvcttoolchain.h" -#include "rvctparser.h" -#include "qt4projectmanager/qt4projectmanagerconstants.h" - -#include <projectexplorer/abi.h> -#include <projectexplorer/headerpath.h> -#include <projectexplorer/toolchainmanager.h> -#include <utils/environment.h> -#include <utils/environmentmodel.h> -#include <utils/pathchooser.h> -#include <utils/synchronousprocess.h> - -#include <QComboBox> -#include <QDir> -#include <QFileInfo> -#include <QFormLayout> -#include <QGridLayout> -#include <QGroupBox> -#include <QHeaderView> -#include <QLabel> -#include <QProcess> -#include <QTableView> - -namespace Qt4ProjectManager { -namespace Internal { - -#if defined Q_OS_WIN -static const char RVCT_BINARY[] = "armcc.exe"; -#else -static const char RVCT_BINARY[] = "armcc"; -#endif - -static const char RVCT_LICENSE_KEY[] = "ARMLMD_LICENSE_FILE"; - -static const char rvctPathKeyC[] = "Qt4ProjectManager.RvctToolChain.CompilerPath"; -static const char rvctEnvironmentKeyC[] = "Qt4ProjectManager.RvctToolChain.Environment"; -static const char rvctArmVersionKeyC[] = "Qt4ProjectManager.RvctToolChain.ArmVersion"; - -static QString valueOf(const QList<Utils::EnvironmentItem> &items, const QString &suffix) -{ - foreach (const Utils::EnvironmentItem &i, items) { - if (i.name.mid(6) == suffix && !i.unset) - return i.value; - } - return QString(); -} - -static QString armVersionString(RvctToolChain::ArmVersion av) -{ - switch (av) { - case RvctToolChain::ARMv5: - return RvctToolChainFactory::tr("ARMv5"); - case RvctToolChain::ARMv6: - return RvctToolChainFactory::tr("ARMv6"); - }; - return QString(); -} - -static Utils::Environment baseEnvironment(RvctToolChain *tc) -{ - Utils::Environment result; - result.modify(tc->environmentChanges()); - return result; -} - -// ========================================================================== -// RvctToolChain -// ========================================================================== - -RvctToolChain::RvctToolChain(bool autodetected) : - ToolChain(QLatin1String(Constants::RVCT_TOOLCHAIN_ID), autodetected), - m_armVersion(ARMv5) -{ } - -RvctToolChain::RvctToolChain(const RvctToolChain &tc) : - ToolChain(tc), - m_compilerCommand(tc.m_compilerCommand), - m_environmentChanges(tc.m_environmentChanges), - m_armVersion(tc.m_armVersion) -{ } - -RvctToolChain::RvctVersion RvctToolChain::version(const Utils::FileName &rvctPath) -{ - RvctToolChain::RvctVersion v; - - QProcess armcc; - armcc.start(rvctPath.toString(), QStringList(QLatin1String("--version_number"))); - if (!armcc.waitForStarted()) { - qWarning("Unable to run rvct binary '%s' when trying to determine version.", qPrintable(rvctPath.toUserOutput())); - return v; - } - armcc.closeWriteChannel(); - if (!armcc.waitForFinished()) { - Utils::SynchronousProcess::stopProcess(armcc); - qWarning("Timeout running rvct binary '%s' trying to determine version.", qPrintable(rvctPath.toUserOutput())); - return v; - } - if (armcc.exitStatus() != QProcess::NormalExit) { - qWarning("A crash occurred when running rvct binary '%s' trying to determine version.", qPrintable(rvctPath.toUserOutput())); - return v; - } - QString versionLine = QString::fromLocal8Bit(armcc.readAllStandardOutput()); - versionLine += QString::fromLocal8Bit(armcc.readAllStandardError()); - QRegExp versionRegExp(QLatin1String("^(\\d)(\\d)0*([1-9]\\d*)"), Qt::CaseInsensitive); - Q_ASSERT(versionRegExp.isValid()); - - if (versionRegExp.indexIn(versionLine) != -1) { - v.majorVersion = versionRegExp.cap(1).toInt(); - v.minorVersion = versionRegExp.cap(2).toInt(); - v.build = versionRegExp.cap(3).toInt(); - } - return v; -} - -QString RvctToolChain::type() const -{ - return QLatin1String("rvct"); -} - -QString RvctToolChain::typeDisplayName() const -{ - return RvctToolChainFactory::tr("RVCT"); -} - -ProjectExplorer::Abi RvctToolChain::targetAbi() const -{ - return ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::SymbianOS, - ProjectExplorer::Abi::SymbianDeviceFlavor, ProjectExplorer::Abi::ElfFormat, - 32); -} - -bool RvctToolChain::isValid() const -{ - return !m_compilerCommand.isEmpty(); -} - -QByteArray RvctToolChain::predefinedMacros(const QStringList &cxxflags) const -{ - Q_UNUSED(cxxflags); - // see http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0205f/Babbacdb.html (version 2.2) - // and http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0491b/BABJFEFG.html (version 4.0) - QByteArray ba("#define __ARRAY_OPERATORS\n" - "#define _BOOL\n" - "#define __cplusplus\n" - "#define __CC_ARM 1\n" - "#define __EDG__\n" - "#define __STDC__\n" - "#define __STDC_VERSION__\n" - "#define __sizeof_int 4" - "#define __sizeof_long 4" - "#define __sizeof_ptr 4" - "#define __TARGET_FEATURE_DOUBLEWORD\n" - "#define __TARGET_FEATURE_DSPMUL\n" - "#define __TARGET_FEATURE_HALFWORD\n" - "#define __TARGET_FEATURE_THUMB\n" - "#define _WCHAR_T\n" - "#define __SYMBIAN32__\n"); - return ba; -} - -ProjectExplorer::ToolChain::CompilerFlags RvctToolChain::compilerFlags(const QStringList &cxxflags) const -{ - Q_UNUSED(cxxflags); - return NO_FLAGS; -} - -QList<ProjectExplorer::HeaderPath> RvctToolChain::systemHeaderPaths() const -{ - return QList<ProjectExplorer::HeaderPath>() - << ProjectExplorer::HeaderPath(valueOf(m_environmentChanges, QLatin1String("INC")), - ProjectExplorer::HeaderPath::GlobalHeaderPath); -} - -void RvctToolChain::addToEnvironment(Utils::Environment &env) const -{ - if (m_compilerCommand.isEmpty()) - return; - - if (m_version.isNull()) - setVersion(version(m_compilerCommand)); - if (m_version.isNull()) - return; - - env.modify(m_environmentChanges); - - env.set(QLatin1String("QT_RVCT_VERSION"), QString::fromLatin1("%1.%2") - .arg(m_version.majorVersion).arg(m_version.minorVersion)); - const QString cxxPath = compilerCommand().toFileInfo().absolutePath(); - env.set(varName(QLatin1String("BIN")), QDir::toNativeSeparators(cxxPath)); - - // Add rvct to path and set locale to 'C' - if (!m_compilerCommand.isEmpty()) - env.prependOrSetPath(cxxPath); - env.set(QLatin1String("LANG"), QString(QLatin1Char('C'))); -} - -QString RvctToolChain::makeCommand() const -{ -#if defined(Q_OS_WIN) - return QLatin1String("make.exe"); -#else - return QLatin1String("make"); -#endif -} - -QString RvctToolChain::defaultMakeTarget() const -{ - if (!isValid()) - return QString(); - if (m_armVersion == ARMv6) - return QLatin1String("armv6"); - return QLatin1String("armv5"); -} - -ProjectExplorer::IOutputParser *RvctToolChain::outputParser() const -{ - return new RvctParser; -} - -bool RvctToolChain::operator ==(const ToolChain &other) const -{ - if (!ToolChain::operator ==(other)) - return false; - const RvctToolChain *otherPtr = dynamic_cast<const RvctToolChain *>(&other); - return m_compilerCommand == otherPtr->m_compilerCommand - && m_environmentChanges == otherPtr->m_environmentChanges - && m_armVersion == otherPtr->m_armVersion; -} - -void RvctToolChain::setEnvironmentChanges(const QList<Utils::EnvironmentItem> &changes) -{ - if (m_environmentChanges == changes) - return; - m_environmentChanges = changes; - toolChainUpdated(); -} - -QList<Utils::EnvironmentItem> RvctToolChain::environmentChanges() const -{ - return m_environmentChanges; -} - -void RvctToolChain::setCompilerCommand(const Utils::FileName &path) -{ - if (m_compilerCommand == path) - return; - - m_compilerCommand = path; - m_version.reset(); - toolChainUpdated(); -} - -Utils::FileName RvctToolChain::compilerCommand() const -{ - return m_compilerCommand; -} - -void RvctToolChain::setArmVersion(RvctToolChain::ArmVersion av) -{ - if (m_armVersion == av) - return; - m_armVersion = av; - toolChainUpdated(); -} - -RvctToolChain::ArmVersion RvctToolChain::armVersion() const -{ - return m_armVersion; -} - -void RvctToolChain::setVersion(const RvctVersion &v) const -{ - if (m_version == v) - return; - m_version = v; - // Internal use only! No need to call toolChainUpdated()! -} - -ProjectExplorer::ToolChainConfigWidget *RvctToolChain::configurationWidget() -{ - return new RvctToolChainConfigWidget(this); -} - -ProjectExplorer::ToolChain *RvctToolChain::clone() const -{ - return new RvctToolChain(*this); -} - - -QVariantMap RvctToolChain::toMap() const -{ - QVariantMap result = ToolChain::toMap(); - result.insert(QLatin1String(rvctPathKeyC), m_compilerCommand.toString()); - QVariantMap tmp; - foreach (const Utils::EnvironmentItem &i, m_environmentChanges) - tmp.insert(i.name, i.value); - result.insert(QLatin1String(rvctEnvironmentKeyC), tmp); - result.insert(QLatin1String(rvctArmVersionKeyC), static_cast<int>(m_armVersion)); - return result; -} - -bool RvctToolChain::fromMap(const QVariantMap &data) -{ - if (!ToolChain::fromMap(data)) - return false; - m_compilerCommand = Utils::FileName::fromString(data.value(QLatin1String(rvctPathKeyC)).toString()); - - m_environmentChanges.clear(); - QVariantMap tmp = data.value(QLatin1String(rvctEnvironmentKeyC)).toMap(); - for (QVariantMap::const_iterator i = tmp.constBegin(); i != tmp.constEnd(); ++i) - m_environmentChanges.append(Utils::EnvironmentItem(i.key(), i.value().toString())); - m_armVersion = static_cast<ArmVersion>(data.value(QLatin1String(rvctArmVersionKeyC), 0).toInt()); - return isValid(); -} - -QString RvctToolChain::varName(const QString &postFix) const -{ - return QString::fromLatin1("RVCT%1%2%3") - .arg(m_version.majorVersion).arg(m_version.minorVersion).arg(postFix); -} - -// ========================================================================== -// RvctToolChainConfigWidget -// ========================================================================== - -class RvctToolChainConfigWidgetUi -{ -public: - QComboBox *versionComboBox; - Utils::PathChooser *compilerPath; - QTableView *environmentView; -}; - -RvctToolChainConfigWidget::RvctToolChainConfigWidget(RvctToolChain *tc) : - ProjectExplorer::ToolChainConfigWidget(tc), - m_ui(new RvctToolChainConfigWidgetUi), - m_model(new Utils::EnvironmentModel(this)) -{ - m_ui->versionComboBox = new QComboBox(this); - m_ui->versionComboBox->addItem(tr("Version 5")); - m_ui->versionComboBox->addItem(tr("Version 6")); - m_ui->compilerPath = new Utils::PathChooser(this); - m_ui->environmentView = new QTableView(this); - - m_mainLayout->addRow(tr("ARM &version:"), m_ui->versionComboBox); - m_mainLayout->addRow(tr("&Compiler path:"), m_ui->compilerPath); - m_mainLayout->addRow(tr("Environment Variables"), m_ui->environmentView); - - m_ui->environmentView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); - m_ui->environmentView->horizontalHeader()->setStretchLastSection(true); - m_ui->environmentView->horizontalHeader()->setHighlightSections(false); - m_ui->environmentView->setGridStyle(Qt::NoPen); - m_ui->environmentView->verticalHeader()->hide(); - QFontMetrics fm(font()); - m_ui->environmentView->verticalHeader()->setDefaultSectionSize(qMax(int(fm.height() * 1.2), fm.height() + 4)); - m_ui->environmentView->setModel(m_model); - - connect(m_model, SIGNAL(userChangesChanged()), this, SIGNAL(dirty())); - - m_ui->compilerPath->setExpectedKind(Utils::PathChooser::ExistingCommand); - m_ui->compilerPath->setFileName(tc->compilerCommand()); - connect(m_ui->compilerPath, SIGNAL(changed(QString)), this, SIGNAL(dirty())); - m_ui->versionComboBox->setCurrentIndex(static_cast<int>(tc->armVersion())); - connect(m_ui->versionComboBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(dirty())); - - setFromToolChain(); -} - -RvctToolChainConfigWidget::~RvctToolChainConfigWidget() -{ - delete m_ui; -} - -void RvctToolChainConfigWidget::applyImpl() -{ - RvctToolChain *tc = static_cast<RvctToolChain *>(toolChain()); - Q_ASSERT(tc); - - QList<Utils::EnvironmentItem> changes = environmentChanges(); - tc->setCompilerCommand(m_ui->compilerPath->fileName()); - tc->setArmVersion(static_cast<RvctToolChain::ArmVersion>(m_ui->versionComboBox->currentIndex())); - tc->setEnvironmentChanges(changes); - - m_model->setUserChanges(changes); -} - -void RvctToolChainConfigWidget::setFromToolChain() -{ - RvctToolChain *tc = static_cast<RvctToolChain *>(toolChain()); - Q_ASSERT(tc); - - m_model->setBaseEnvironment(baseEnvironment(tc)); - - m_ui->compilerPath->setFileName(tc->compilerCommand()); - m_ui->versionComboBox->setCurrentIndex(static_cast<int>(tc->armVersion())); -} - -bool RvctToolChainConfigWidget::isDirtyImpl() const -{ - RvctToolChain *tc = static_cast<RvctToolChain *>(toolChain()); - Q_ASSERT(tc); - - return tc->compilerCommand() != m_ui->compilerPath->fileName() - || tc->armVersion() != static_cast<RvctToolChain::ArmVersion>(m_ui->versionComboBox->currentIndex()) - || tc->environmentChanges() != environmentChanges(); -} - -void RvctToolChainConfigWidget::makeReadOnlyImpl() -{ - m_ui->versionComboBox->setEnabled(false); - m_ui->compilerPath->setEnabled(false); - m_ui->environmentView->setEditTriggers(QAbstractItemView::NoEditTriggers); -} - -QList<Utils::EnvironmentItem> RvctToolChainConfigWidget::environmentChanges() const -{ - Utils::Environment baseEnv; - Utils::Environment resultEnv = baseEnvironment(static_cast<RvctToolChain *>(toolChain())); - resultEnv.modify(m_model->userChanges()); - return baseEnv.diff(resultEnv); -} - -void RvctToolChainConfigWidget::changeEvent(QEvent *ev) -{ - if (ev->type() == QEvent::EnabledChange) { - if (isEnabled()) { - m_ui->environmentView->horizontalHeader()->setVisible(true); - m_ui->environmentView->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); - } else { - m_ui->environmentView->horizontalHeader()->setVisible(false); - m_ui->environmentView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - } - } - ToolChainConfigWidget::changeEvent(ev); -} - -// ========================================================================== -// RvctToolChainFactory -// ========================================================================== - -QString RvctToolChainFactory::displayName() const -{ - return tr("RVCT"); -} - -QString RvctToolChainFactory::id() const -{ - return QLatin1String(Constants::RVCT_TOOLCHAIN_ID); -} - -QList<ProjectExplorer::ToolChain *> RvctToolChainFactory::autoDetect() -{ - Utils::Environment env = Utils::Environment::systemEnvironment(); - - QMap<QString, QList<Utils::EnvironmentItem> > rvcts; - QList<Utils::EnvironmentItem> globalItems; - - // Find all RVCT..x variables - for (Utils::Environment::const_iterator i = env.constBegin(); i != env.constEnd(); ++i) { - if (i.key() == QLatin1String(RVCT_LICENSE_KEY)) - globalItems.append(Utils::EnvironmentItem(i.key(), i.value())); - if (!i.key().startsWith(QLatin1String("RVCT"))) - continue; - - const QString key = i.key().left(6); - QList<Utils::EnvironmentItem> values = rvcts.value(key); - - values.append(Utils::EnvironmentItem(i.key(), i.value())); - - rvcts.insert(key, values); - } - - // Set up tool chains for each RVCT.. set - QList<ProjectExplorer::ToolChain *> result; - for (QMap<QString, QList<Utils::EnvironmentItem> >::const_iterator i = rvcts.constBegin(); - i != rvcts.constEnd(); ++i) { - QList<Utils::EnvironmentItem> changes = i.value(); - changes.append(globalItems); - - Utils::FileName binary = Utils::FileName::fromUserInput(valueOf(changes, QLatin1String("BIN"))); - if (binary.isEmpty()) - continue; - binary.appendPath(QLatin1String(RVCT_BINARY)); - QFileInfo fi(binary.toFileInfo()); - if (!fi.exists() || !fi.isExecutable()) - continue; - - RvctToolChain::RvctVersion v = RvctToolChain::version(binary); - if (v.majorVersion == 0 && v.minorVersion == 0 && v.build == 0) - continue; // Failed to start. - - //: %1 arm version, %2 major version, %3 minor version, %4 build number - const QString name = tr("RVCT (%1 %2.%3 Build %4)"); - - RvctToolChain *tc = new RvctToolChain(true); - tc->setCompilerCommand(binary); - tc->setEnvironmentChanges(changes); - tc->setDisplayName(name.arg(armVersionString(tc->armVersion())) - .arg(v.majorVersion).arg(v.minorVersion).arg(v.build)); - tc->setVersion(v); - result.append(tc); - - tc = new RvctToolChain(true); - tc->setCompilerCommand(binary); - tc->setEnvironmentChanges(changes); - tc->setArmVersion(RvctToolChain::ARMv6); - tc->setDisplayName(name.arg(armVersionString(tc->armVersion())) - .arg(v.majorVersion).arg(v.minorVersion).arg(v.build)); - tc->setVersion(v); - result.append(tc); - } - - return result; -} - -bool RvctToolChainFactory::canCreate() -{ - return true; -} - -ProjectExplorer::ToolChain *RvctToolChainFactory::create() -{ - RvctToolChain *tc = new RvctToolChain(false); - Utils::Environment env = Utils::Environment::systemEnvironment(); - if (env.hasKey(QLatin1String(RVCT_LICENSE_KEY))) { - tc->setEnvironmentChanges(QList<Utils::EnvironmentItem>() - << Utils::EnvironmentItem(QLatin1String(RVCT_LICENSE_KEY), - env.value(QLatin1String(RVCT_LICENSE_KEY)))); - } - tc->setDisplayName(tr("RVCT")); - return tc; -} - -bool RvctToolChainFactory::canRestore(const QVariantMap &data) -{ - return idFromMap(data).startsWith(QLatin1String(Constants::RVCT_TOOLCHAIN_ID)); -} - -ProjectExplorer::ToolChain *RvctToolChainFactory::restore(const QVariantMap &data) -{ - RvctToolChain *tc = new RvctToolChain(false); - if (tc->fromMap(data)) - return tc; - - delete tc; - return 0; - -} - -} // Internal -} // Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h deleted file mode 100644 index 362d58b22e3..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h +++ /dev/null @@ -1,179 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef RVCTTOOLCHAIN_H -#define RVCTTOOLCHAIN_H - -#include <projectexplorer/toolchain.h> -#include <projectexplorer/toolchainconfigwidget.h> -#include <utils/environment.h> - -namespace Utils { -class EnvironmentModel; -class PathChooser; -} // namespace Utils - -namespace Qt4ProjectManager { -namespace Internal { - -class RvctToolChainConfigWidgetUi; -class RvctToolChainFactory; - -// ========================================================================== -// RvctToolChain -// ========================================================================== - -class RvctToolChain : public ProjectExplorer::ToolChain -{ -public: - struct RvctVersion { - RvctVersion() : majorVersion(0), minorVersion(0), build(0) - { } - - bool isNull() { return majorVersion == 0 && minorVersion == 0 && build == 0; } - void reset() { majorVersion = 0; minorVersion = 0; build = 0; } - - bool operator ==(const RvctVersion &other) const - { - return majorVersion == other.majorVersion - && minorVersion == other.minorVersion - && build == other.build; - } - - int majorVersion; - int minorVersion; - int build; - }; - - static RvctVersion version(const Utils::FileName &rvctPath); - - enum ArmVersion { ARMv5, ARMv6 }; - - QString type() const; - QString typeDisplayName() const; - ProjectExplorer::Abi targetAbi() const; - - bool isValid() const; - - QByteArray predefinedMacros(const QStringList &cxxflags) const; - ProjectExplorer::ToolChain::CompilerFlags compilerFlags(const QStringList &cxxflags) const; - QList<ProjectExplorer::HeaderPath> systemHeaderPaths() const; - void addToEnvironment(Utils::Environment &env) const; - QString makeCommand() const; - QString defaultMakeTarget() const; - ProjectExplorer::IOutputParser *outputParser() const; - - bool operator ==(const ToolChain &) const; - - void setEnvironmentChanges(const QList<Utils::EnvironmentItem> &changes); - QList<Utils::EnvironmentItem> environmentChanges() const; - - void setCompilerCommand(const Utils::FileName &path); - Utils::FileName compilerCommand() const; - - void setArmVersion(ArmVersion); - ArmVersion armVersion() const; - - ProjectExplorer::ToolChainConfigWidget *configurationWidget(); - ProjectExplorer::ToolChain *clone() const; - - QVariantMap toMap() const; - bool fromMap(const QVariantMap &data); - -private: - void setVersion(const RvctVersion &v) const; - - explicit RvctToolChain(bool autodetected = false); - RvctToolChain(const RvctToolChain &); - - QString varName(const QString &postFix) const; - - QList<ProjectExplorer::HeaderPath> m_systemHeaderPaths; - Utils::FileName m_compilerCommand; - QList<Utils::EnvironmentItem> m_environmentChanges; - ArmVersion m_armVersion; - mutable RvctVersion m_version; - - friend class RvctToolChainFactory; -}; - -// ========================================================================== -// RvctToolChainConfigWidget -// ========================================================================== - -class RvctToolChainConfigWidget : public ProjectExplorer::ToolChainConfigWidget -{ - Q_OBJECT - -public: - RvctToolChainConfigWidget(RvctToolChain *tc); - ~RvctToolChainConfigWidget(); - -private: - void applyImpl(); - void discardImpl() { setFromToolChain(); } - bool isDirtyImpl() const; - void makeReadOnlyImpl(); - void changeEvent(QEvent *ev); - - void setFromToolChain(); - QList<Utils::EnvironmentItem> environmentChanges() const; - - RvctToolChainConfigWidgetUi *m_ui; - Utils::EnvironmentModel *m_model; -}; - -// ========================================================================== -// RvctToolChainFactory -// ========================================================================== - -class RvctToolChainFactory : public ProjectExplorer::ToolChainFactory -{ - Q_OBJECT - -public: - // Name used to display the name of the tool chain that will be created. - QString displayName() const; - QString id() const; - - QList<ProjectExplorer::ToolChain *> autoDetect(); - - bool canCreate(); - ProjectExplorer::ToolChain *create(); - - // Used by the ToolChainManager to restore user-generated tool chains - bool canRestore(const QVariantMap &data); - ProjectExplorer::ToolChain *restore(const QVariantMap &data); -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // RVCTTOOLCHAIN_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60certificatedetailsdialog.cpp b/src/plugins/qt4projectmanager/qt-s60/s60certificatedetailsdialog.cpp deleted file mode 100644 index 743ca2b40ba..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60certificatedetailsdialog.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60certificatedetailsdialog.h" -#include "ui_s60certificatedetailsdialog.h" - -using namespace Qt4ProjectManager; -using namespace Qt4ProjectManager::Internal; - -struct S60CertificateDetailsDialogPrivate -{ - S60CertificateDetailsDialogPrivate(){} - Ui::S60CertificateDetailsDialog m_ui; -}; - -S60CertificateDetailsDialog::S60CertificateDetailsDialog(QWidget *parent) : - QDialog(parent), - d(new S60CertificateDetailsDialogPrivate) -{ - d->m_ui.setupUi(this); - connect(d->m_ui.buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); -} - -S60CertificateDetailsDialog::~S60CertificateDetailsDialog() -{ - delete d; -} - -void S60CertificateDetailsDialog::setText(const QString &text) -{ - d->m_ui.textBrowser->setText(text); -} diff --git a/src/plugins/qt4projectmanager/qt-s60/s60certificatedetailsdialog.h b/src/plugins/qt4projectmanager/qt-s60/s60certificatedetailsdialog.h deleted file mode 100644 index a8c95b4bee9..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60certificatedetailsdialog.h +++ /dev/null @@ -1,58 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60CERTIFICATEDETAILSDIALOG_H -#define S60CERTIFICATEDETAILSDIALOG_H - -#include <QDialog> - -struct S60CertificateDetailsDialogPrivate; - -namespace Qt4ProjectManager { -namespace Internal { - -class S60CertificateDetailsDialog : public QDialog -{ - Q_OBJECT - -public: - explicit S60CertificateDetailsDialog(QWidget *parent = 0); - ~S60CertificateDetailsDialog(); - - void setText(const QString &text); - -private: - S60CertificateDetailsDialogPrivate *d; -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // S60CERTIFICATEDETAILSDIALOG_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60certificatedetailsdialog.ui b/src/plugins/qt4projectmanager/qt-s60/s60certificatedetailsdialog.ui deleted file mode 100644 index 076515885ff..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60certificatedetailsdialog.ui +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Qt4ProjectManager::Internal::S60CertificateDetailsDialog</class> - <widget class="QDialog" name="Qt4ProjectManager::Internal::S60CertificateDetailsDialog"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>400</width> - <height>300</height> - </rect> - </property> - <property name="windowTitle"> - <string>Details of Certificate</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QTextBrowser" name="textBrowser"/> - </item> - <item> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="standardButtons"> - <set>QDialogButtonBox::Close</set> - </property> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/src/plugins/qt4projectmanager/qt-s60/s60certificateinfo.cpp b/src/plugins/qt4projectmanager/qt-s60/s60certificateinfo.cpp deleted file mode 100644 index 3620b30f5d2..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60certificateinfo.cpp +++ /dev/null @@ -1,295 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60certificateinfo.h" -#include "s60symbiancertificate.h" - -#include <QDateTime> -#include <QFileInfo> -#include <QCoreApplication> -#include <QTextStream> -#include <QHash> -#include <QMutableHashIterator> - -using namespace Qt4ProjectManager; -using namespace Qt4ProjectManager::Internal; - -namespace { - const char * const SIMPLE_DATE_FORMAT = "dd.MM.yyyy"; -} - -struct Capability { - const char *name; - const int value; -}; - -static const Capability capability[] = -{ - { "LocalServices", S60CertificateInfo::LocalServices }, - { "Location", S60CertificateInfo::Location }, - { "NetworkServices", S60CertificateInfo::NetworkServices }, - { "ReadUserData", S60CertificateInfo::ReadUserData }, - { "UserEnvironment", S60CertificateInfo::UserEnvironment }, - { "WriteUserData", S60CertificateInfo::WriteUserData }, - { "PowerMgmt", S60CertificateInfo::PowerMgmt }, - { "ProtServ", S60CertificateInfo::ProtServ }, - { "ReadDeviceData", S60CertificateInfo::ReadDeviceData }, - { "SurroundingsDD", S60CertificateInfo::SurroundingsDD }, - { "SwEvent", S60CertificateInfo::SwEvent }, - { "TrustedUI", S60CertificateInfo::TrustedUI }, - { "WriteDeviceData", S60CertificateInfo::WriteDeviceData }, - { "CommDD", S60CertificateInfo::CommDD }, - { "DiskAdmin", S60CertificateInfo::DiskAdmin }, - { "NetworkControl", S60CertificateInfo::NetworkControl }, - { "MultimediaDD", S60CertificateInfo::MultimediaDD }, - { "AllFiles", S60CertificateInfo::AllFiles }, - { "DRM", S60CertificateInfo::DRM }, - { "TCB", S60CertificateInfo::TCB } -}; - -struct CapabilitySet { - const char *color; - const int value; -}; - -static const CapabilitySet capabilitySet[] = -{ - { "green", S60CertificateInfo::UserCapabilities }, - { "darkorange", S60CertificateInfo::SystemCapabilities }, - { "orangered", S60CertificateInfo::RestrictedCapabilities }, - { "red", S60CertificateInfo::ManufacturerCapabilities } -}; - -QHash<int, QStringList> createCapabilityMap(uint capabilities) -{ - const int capabilityCount = sizeof(capability)/sizeof(capability[0]); - const int capabilitySetCount = sizeof(capabilitySet)/sizeof(capabilitySet[0]); - - QHash<int, QStringList> capabilityMap; //to separate the groups of capabilities - for(int i = 0; i < capabilityCount; ++i) - if (capabilities&capability[i].value) { - for (int j = 0; j < capabilitySetCount; ++j) - if (capability[i].value&capabilitySet[j].value) { - capabilityMap[capabilitySet[j].value] << QLatin1String(capability[i].name); - break; - } - } - - QMutableHashIterator<int, QStringList> i(capabilityMap); - while (i.hasNext()) { - i.next(); - i.value().sort(); - } - - return capabilityMap; -} - -QStringList createCapabilityList(uint capabilities) -{ - QHash<int, QStringList> capabilityMap(createCapabilityMap(capabilities)); - - return capabilityMap[S60CertificateInfo::UserCapabilities] - + capabilityMap[S60CertificateInfo::SystemCapabilities] - + capabilityMap[S60CertificateInfo::RestrictedCapabilities] - + capabilityMap[S60CertificateInfo::ManufacturerCapabilities]; -} - -QStringList createHtmlCapabilityList(uint capabilities) -{ - const int capabilitySetCount = sizeof(capabilitySet)/sizeof(capabilitySet[0]); - QHash<int, QStringList> capabilityMap(createCapabilityMap(capabilities)); - QStringList result; - - for (int j = 0; j < capabilitySetCount; ++j) { - QHashIterator<int, QStringList> i(capabilityMap); - while (i.hasNext()) { - i.next(); - if (i.key() == capabilitySet[j].value) { - foreach (const QString &capability, i.value()) { - result << QString::fromAscii("<font color=\"%1\">%2</font>") - .arg(QLatin1String(capabilitySet[j].color)).arg(capability); - } - break; - } - } - } - return result; -} - -S60CertificateInfo::S60CertificateInfo(const QString &filePath, QObject* parent) - : QObject(parent), - m_certificate(new S60SymbianCertificate(filePath)), - m_filePath(filePath), - m_capabilities(NoInformation) -{ - if (!m_certificate->isValid()) - return; - - m_imeiList = m_certificate->subjectInfo(QLatin1String("1.2.826.0.1.1796587.1.1.1.1")); - - const QStringList capabilityList(m_certificate->subjectInfo(QLatin1String("1.2.826.0.1.1796587.1.1.1.6"))); - if (capabilityList.isEmpty()) - m_capabilities = 0; - else - m_capabilities = capabilityList.at(0).toLong(); -} - -S60CertificateInfo::~S60CertificateInfo() -{ - delete m_certificate; -} - -S60CertificateInfo::CertificateState S60CertificateInfo::validateCertificate() -{ - CertificateState result = CertificateValid; - if (m_certificate->isValid()) { - QDateTime currentTime(QDateTime::currentDateTimeUtc()); - QDateTime endTime(m_certificate->endTime()); - QDateTime startTime(m_certificate->startTime()); - if (currentTime > endTime) { - m_errorString = tr("The certificate \"%1\" has already expired and cannot be used." - "\nExpiration date: %2.") - .arg(QFileInfo(m_filePath).fileName()) - .arg(endTime.toLocalTime().toString(QLatin1String(SIMPLE_DATE_FORMAT))); - result = CertificateError; - } else if (currentTime < startTime) { - m_errorString = tr("The certificate \"%1\" is not yet valid.\nValid from: %2.") - .arg(QFileInfo(m_filePath).fileName()) - .arg(startTime.toLocalTime().toString(QLatin1String(SIMPLE_DATE_FORMAT))); - result = CertificateWarning; //This certificate may be valid in the near future - } - } else { - m_errorString = tr("The certificate \"%1\" is not a valid X.509 certificate.") - .arg(QFileInfo(m_filePath).baseName()); - result = CertificateError; - } - return result; -} - -bool S60CertificateInfo::compareCapabilities(const QStringList &givenCaps, QStringList &unsupportedCaps) const -{ - if (!m_certificate->isValid()) - return false; - unsupportedCaps.clear(); - if (capabilitiesSupported() == NoInformation) - return true; - - QStringList capabilities(createCapabilityList(capabilitiesSupported())); - foreach (const QString &capability, givenCaps) { - if (!capabilities.contains(capability, Qt::CaseInsensitive)) - unsupportedCaps << capability; - } - return true; -} - -QString S60CertificateInfo::errorString() const -{ - return m_errorString.isEmpty()?m_certificate->errorString():m_errorString; -} - -QStringList S60CertificateInfo::devicesSupported() const -{ - return m_imeiList; -} - -quint32 S60CertificateInfo::capabilitiesSupported() const -{ - return m_capabilities; -} - -bool S60CertificateInfo::isDeveloperCertificate() const -{ - return !devicesSupported().isEmpty() || capabilitiesSupported(); -} - -QString S60CertificateInfo::toHtml(bool keepShort) -{ - if (!m_certificate->isValid()) - return errorString(); - - QString htmlString; - QTextStream str(&htmlString); - str << "<html><body><table>" - << "<tr><td><b>" << tr("Type: ") << "</b></td>"; - - if (isDeveloperCertificate()) - str << "<td>" << tr("Developer certificate") << "</td>"; - if (m_certificate->isSelfSigned()) - str << "<td>" << tr("Self signed certificate") << "</td>"; - str << "</tr>"; - - QString issuer; - QStringList issuerOrganizationList(m_certificate->issuerInfo(QLatin1String("X520.Organization"))); - if (!issuerOrganizationList.isEmpty()) - issuer = issuerOrganizationList.join(QLatin1String(" ")); - - QString subject; - QStringList subjectOrganizationList(m_certificate->subjectInfo(QLatin1String("X520.Organization"))); - if (!subjectOrganizationList.isEmpty()) - subject = subjectOrganizationList.join(QLatin1String(" ")); - - QDateTime startDate(m_certificate->startTime().toLocalTime()); - QDateTime endDate(m_certificate->endTime().toLocalTime()); - - str << "<tr><td><b>" << tr("Issued by: ") - << "</b></td><td>" << issuer << "</td></tr>" - << "<tr><td><b>" << tr("Issued to: ") - << "</b></td><td>" << subject << "</td></tr>" - << "<tr><td><b>" << tr("Valid from: ") - << "</b></td><td>" << startDate.toString(QLatin1String(SIMPLE_DATE_FORMAT)) << "</td></tr>" - << "<tr><td><b>" << tr("Valid to: ") - << "</b></td><td>" << endDate.toString(QLatin1String(SIMPLE_DATE_FORMAT)) << "</td></tr>"; - - if (capabilitiesSupported()) { - QStringList capabilities; - if (keepShort) - capabilities = createCapabilityList(capabilitiesSupported()); - else - capabilities = createHtmlCapabilityList(capabilitiesSupported()); - str << "<tr><td><b>" << tr("Capabilities: ") - << "</b></td><td><i>" << capabilities.join(QLatin1String(" ")) << "</i></td></tr>"; - } - - const QStringList &imeiList(devicesSupported()); - if (!imeiList.isEmpty()) { - QString imeiListString; - const QString space(QLatin1Char(' ')); - int MAX_DISPLAYED_IMEI_COUNT = 30; - if (imeiList.count() > MAX_DISPLAYED_IMEI_COUNT && keepShort) {//1000 items would be too much :) - for (int i = 0; i < MAX_DISPLAYED_IMEI_COUNT; ++i) - imeiListString += imeiList.at(i) + space; - imeiListString.replace(imeiListString.length()-1, 1, QLatin1String("...")); - } else - imeiListString = imeiList.join(space); - str << "<tr><td><b>" << tr("Supporting %n device(s): ", "", imeiList.count()) - << "</b></td><td>" << imeiListString << "</td></tr>"; - } - return htmlString; -} diff --git a/src/plugins/qt4projectmanager/qt-s60/s60certificateinfo.h b/src/plugins/qt4projectmanager/qt-s60/s60certificateinfo.h deleted file mode 100644 index 0ce1075884b..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60certificateinfo.h +++ /dev/null @@ -1,111 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60CERTIFICATEINFO_H -#define S60CERTIFICATEINFO_H - -#include <QObject> -#include <QStringList> -#include <QtGlobal> - -namespace Qt4ProjectManager { -namespace Internal { - -class S60SymbianCertificate; - -class S60CertificateInfo : public QObject -{ - Q_OBJECT - -public: - enum CertificateState { - CertificateValid, - CertificateWarning, - CertificateError - }; - - enum S60Capability { - TCB = 1 << (31-0), - CommDD = 1 << (31-1), - PowerMgmt = 1 << (31-2), - MultimediaDD = 1 << (31-3), - ReadDeviceData = 1 << (31-4), - WriteDeviceData = 1 << (31-5), - DRM = 1 << (31-6), - TrustedUI = 1 << (31-7), - ProtServ = 1 << (31-8), - DiskAdmin = 1 << (31-9), - NetworkControl = 1 << (31-10), - AllFiles = 1 << (31-11), - SwEvent = 1 << (31-12), - NetworkServices = 1 << (31-13), - LocalServices = 1 << (31-14), - ReadUserData = 1 << (31-15), - WriteUserData = 1 << (31-16), - Location = 1 << (31-17), - SurroundingsDD = 1 << (31-18), - UserEnvironment = 1 << (31-19), - - NoInformation = 0 - }; - - enum S60CapabilitySet { - UserCapabilities = LocalServices|Location|NetworkServices|ReadUserData - |UserEnvironment|WriteUserData, - SystemCapabilities = PowerMgmt|ProtServ|ReadDeviceData|SurroundingsDD - |SwEvent|TrustedUI|WriteDeviceData, - RestrictedCapabilities = CommDD|DiskAdmin|NetworkControl|MultimediaDD, - ManufacturerCapabilities = AllFiles|DRM|TCB - }; - - explicit S60CertificateInfo(const QString &filePath, QObject* parent = 0); - ~S60CertificateInfo(); - - CertificateState validateCertificate(); - QStringList devicesSupported() const; - quint32 capabilitiesSupported() const; - QString toHtml(bool keepShort = true); - QString errorString() const; - bool isDeveloperCertificate() const; - - bool compareCapabilities(const QStringList &givenCaps, QStringList &unsupportedCaps) const; - -private: - S60SymbianCertificate *m_certificate; - QString m_filePath; - QString m_errorString; - QStringList m_imeiList; - quint32 m_capabilities; -}; - -} // namespace Internal -} // namespace Qt4ProjectExplorer - -#endif // S60CERTIFICATEINFO_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60createpackageparser.cpp b/src/plugins/qt4projectmanager/qt-s60/s60createpackageparser.cpp deleted file mode 100644 index 3c0d8a0a3aa..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60createpackageparser.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60createpackageparser.h" - -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/task.h> - -using namespace Qt4ProjectManager::Internal; - -S60CreatePackageParser::S60CreatePackageParser(const QString &packageName) : - m_packageName(packageName), - m_needPassphrase(false) -{ - setObjectName(QLatin1String("S60CreatePackageParser")); - m_signSis.setPattern(QLatin1String("^(\\s*|\\(\\d+\\)\\s*:\\s*)(error\\s?:\\s?)+(.+)$")); - m_signSis.setMinimal(true); - m_signSis.setCaseSensitivity(Qt::CaseInsensitive); -} - -bool S60CreatePackageParser::parseLine(const QString &line) -{ - if (line.startsWith(QLatin1String("Patching: "))) { - m_patchingLines.append(line.mid(10).trimmed()); - return true; - } - if (!m_patchingLines.isEmpty()) { - emit packageWasPatched(m_packageName, m_patchingLines); - - QString lines = m_patchingLines.join(QLatin1String("\n")); - m_patchingLines.clear(); - //: %1 package name, %2 will be replaced by a list of patching lines. - QString message = tr("The binary package '%1' was patched to be installable after being self-signed.\n%2\n" - "Use a developer certificate or any other signing option to prevent " - "this patching from happening."). - arg(m_packageName, lines); - ProjectExplorer::Task task(ProjectExplorer::Task::Warning, message, Utils::FileName(), -1, - Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); - - QTextLayout::FormatRange fr; - fr.start = message.indexOf(lines); - fr.length = lines.length(); - fr.format.setFontItalic(true); - task.formats.append(fr); - - emit addTask(task); - } - - if (m_signSis.indexIn(line) > -1) { - QString errorMessage(m_signSis.cap(3)); - if (errorMessage.contains(QLatin1String("bad password")) - || errorMessage.contains(QLatin1String("bad decrypt"))) - m_needPassphrase = true; - else if (errorMessage.contains(QLatin1String("Cannot open file")) - && errorMessage.contains(QLatin1String("smartinstaller"))) - emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, - tr("Cannot create Smart Installer package " - "as the Smart Installer's base file is missing. " - "Please ensure that it is located in the SDK."), - Utils::FileName(), -1, - Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); - else - emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, Utils::FileName(), -1, - Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); - return true; - } - return false; -} - -void S60CreatePackageParser::stdOutput(const QString &line) -{ - if (!parseLine(line)) - IOutputParser::stdOutput(line); -} - -void S60CreatePackageParser::stdError(const QString &line) -{ - if (!parseLine(line)) - IOutputParser::stdError(line); -} - -bool S60CreatePackageParser::needPassphrase() const -{ - return m_needPassphrase; -} - -/* STDOUT: -make[1]: Entering directory `C:/temp/test/untitled131' -createpackage.bat -g untitled131_template.pkg RELEASE-armv5 -Auto-patching capabilities for self signed package. - -Patching package file and relevant binaries... -Patching: Removed dependency to qt.sis (0x2001E61C) to avoid installation issues in case qt.sis is also patched. - - -NOTE: A patched package may not work as expected due to reduced capabilities and other modifications, - so it should not be used for any kind of Symbian signing or distribution! - Use a proper certificate to avoid the need to patch the package. - -Processing untitled131_release-armv5.pkg... - - -and errors like: -(35) : error: Cannot find file : c:/QtSDK/Symbian/SDKs/Symbian3Qt471/epoc32/data/z/resource/apps/untitledSymbian.mif -*/ diff --git a/src/plugins/qt4projectmanager/qt-s60/s60createpackageparser.h b/src/plugins/qt4projectmanager/qt-s60/s60createpackageparser.h deleted file mode 100644 index f8b56230cbe..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60createpackageparser.h +++ /dev/null @@ -1,71 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef SIGNSISPARSER_H -#define SIGNSISPARSER_H - -#include <projectexplorer/ioutputparser.h> - -#include <QRegExp> - -namespace Qt4ProjectManager { -namespace Internal { - -class S60CreatePackageParser : public ProjectExplorer::IOutputParser -{ - Q_OBJECT - -public: - S60CreatePackageParser(const QString &packageName); - - virtual void stdOutput(const QString &line); - virtual void stdError(const QString &line); - - bool needPassphrase() const; - -signals: - void packageWasPatched(const QString &, const QStringList &pachingLines); - -private: - bool parseLine(const QString &line); - - const QString m_packageName; - - QRegExp m_signSis; - QStringList m_patchingLines; - - bool m_needPassphrase; -}; - -} // namespace Internal -} // namespace Qt4ProjectExplorer - - -#endif // SIGNSISPARSER_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp deleted file mode 100644 index 3f53cff59eb..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp +++ /dev/null @@ -1,973 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60createpackagestep.h" - -#include "qt4projectmanagerconstants.h" -#include "qt4buildconfiguration.h" -#include "qt4nodes.h" -#include "qt4project.h" -#include "s60createpackageparser.h" -#include "abldparser.h" -#include "sbsv2parser.h" -#include "passphraseforkeydialog.h" -#include "s60certificateinfo.h" -#include "s60certificatedetailsdialog.h" -#include "symbianqtversion.h" -#include "symbianidevicefactory.h" - -#include <app/app_version.h> - -#include <utils/checkablemessagebox.h> -#include <utils/fileutils.h> - -#include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/buildsteplist.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/profileinformation.h> -#include <projectexplorer/target.h> -#include <projectexplorer/project.h> -#include <projectexplorer/gnumakeparser.h> -#include <projectexplorer/task.h> - -#include <qtsupport/qtprofileinformation.h> - -#include <QDir> -#include <QTimer> -#include <QCryptographicHash> - -#include <QSettings> -#include <QMessageBox> - -using namespace Qt4ProjectManager; -using namespace Qt4ProjectManager::Internal; - -namespace { - const char * const SIGN_BS_ID = "Qt4ProjectManager.S60SignBuildStep"; - const char * const SIGNMODE_KEY("Qt4ProjectManager.S60CreatePackageStep.SignMode"); - const char * const CERTIFICATE_KEY("Qt4ProjectManager.S60CreatePackageStep.Certificate"); - const char * const KEYFILE_KEY("Qt4ProjectManager.S60CreatePackageStep.Keyfile"); - const char * const SMART_INSTALLER_KEY("Qt4ProjectManager.S60CreatorPackageStep.SmartInstaller"); - const char * const PATCH_WARNING_SHOWN_KEY("Qt4ProjectManager.S60CreatorPackageStep.PatchWarningShown"); - const char * const SUPPRESS_PATCH_WARNING_DIALOG_KEY("Qt4ProjectManager.S60CreatorPackageStep.SuppressPatchWarningDialog"); - - const char * const MAKE_PASSPHRASE_ARGUMENT("QT_SIS_PASSPHRASE="); - const char * const MAKE_KEY_ARGUMENT("QT_SIS_KEY="); - const char * const MAKE_CERTIFICATE_ARGUMENT("QT_SIS_CERTIFICATE="); -} - -S60CreatePackageStep::S60CreatePackageStep(ProjectExplorer::BuildStepList *bsl) : - BuildStep(bsl, Core::Id(SIGN_BS_ID)), - m_signingMode(SignSelf), - m_createSmartInstaller(false), - m_outputParserChain(0), - m_process(0), - m_timer(0), - m_eventLoop(0), - m_futureInterface(0), - m_passphrases(0), - m_parser(0), - m_suppressPatchWarningDialog(false), - m_patchWarningDialog(0) -{ - ctor_package(); -} - -S60CreatePackageStep::S60CreatePackageStep(ProjectExplorer::BuildStepList *bsl, S60CreatePackageStep *bs) : - BuildStep(bsl, bs), - m_signingMode(bs->m_signingMode), - m_customSignaturePath(bs->m_customSignaturePath), - m_customKeyPath(bs->m_customKeyPath), - m_passphrase(bs->m_passphrase), - m_createSmartInstaller(bs->m_createSmartInstaller), - m_outputParserChain(0), - m_timer(0), - m_eventLoop(0), - m_futureInterface(0), - m_passphrases(0), - m_parser(0), - m_suppressPatchWarningDialog(false), - m_patchWarningDialog(0) -{ - ctor_package(); -} - -S60CreatePackageStep::S60CreatePackageStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id) : - BuildStep(bsl, id), - m_signingMode(SignSelf), - m_createSmartInstaller(false), - m_outputParserChain(0), - m_timer(0), - m_eventLoop(0), - m_futureInterface(0), - m_passphrases(0), - m_parser(0), - m_suppressPatchWarningDialog(false), - m_patchWarningDialog(0) -{ - ctor_package(); -} - -void S60CreatePackageStep::ctor_package() -{ - //: default create SIS package build step display name - setDefaultDisplayName(tr("Create SIS Package")); - connect(this, SIGNAL(badPassphrase()), - this, SLOT(definePassphrase()), Qt::QueuedConnection); - connect(this, SIGNAL(warnAboutPatching()), - this, SLOT(handleWarnAboutPatching()), Qt::QueuedConnection); - - m_passphrases = new QSettings(QSettings::IniFormat, QSettings::UserScope, - QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR), - QLatin1String("QtCreatorKeys"), this); -} - -S60CreatePackageStep::~S60CreatePackageStep() -{ - delete m_patchWarningDialog; -} - -QVariantMap S60CreatePackageStep::toMap() const -{ - QVariantMap map(BuildStep::toMap()); - map.insert(QLatin1String(SIGNMODE_KEY), static_cast<int>(m_signingMode)); - map.insert(QLatin1String(CERTIFICATE_KEY), m_customSignaturePath); - map.insert(QLatin1String(KEYFILE_KEY), m_customKeyPath); - map.insert(QLatin1String(SMART_INSTALLER_KEY), m_createSmartInstaller); - map.insert(QLatin1String(SUPPRESS_PATCH_WARNING_DIALOG_KEY), m_suppressPatchWarningDialog); - return map; -} - -bool S60CreatePackageStep::fromMap(const QVariantMap &map) -{ - m_signingMode = static_cast<SigningMode>(map.value(QLatin1String(SIGNMODE_KEY), static_cast<int>(SignSelf)).toInt()); - m_customSignaturePath = map.value(QLatin1String(CERTIFICATE_KEY)).toString(); - setCustomKeyPath(map.value(QLatin1String(KEYFILE_KEY)).toString()); - m_createSmartInstaller = map.value(QLatin1String(SMART_INSTALLER_KEY), false).toBool(); - m_suppressPatchWarningDialog = map.value(QLatin1String(SUPPRESS_PATCH_WARNING_DIALOG_KEY), - false).toBool(); - return BuildStep::fromMap(map); -} - -Qt4BuildConfiguration *S60CreatePackageStep::qt4BuildConfiguration() const -{ - return static_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration()); -} - -bool S60CreatePackageStep::init() -{ - Qt4Project *pro = qobject_cast<Qt4Project *>(project()); - ProjectExplorer::ToolChain *tc - = ProjectExplorer::ToolChainProfileInformation::toolChain(target()->profile()); - - QList<Qt4ProFileNode *> nodes = pro->allProFiles(); - - SymbianQtVersion *sqv - = dynamic_cast<SymbianQtVersion *>(QtSupport::QtProfileInformation::qtVersion(target()->profile())); - if (!sqv) { - emit addOutput(tr("The selected target is not configured with a Symbian Qt"), BuildStep::ErrorOutput); - return false; - } - if (!tc) { - emit addOutput(ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget(), BuildStep::ErrorOutput); - return false; - } - m_isBuildWithSymbianSbsV2 = sqv->isBuildWithSymbianSbsV2(); - - m_workingDirectories.clear(); - QStringList projectCapabilities; - foreach (Qt4ProFileNode *node, nodes) { - projectCapabilities += node->symbianCapabilities(); - m_workingDirectories << node->buildDir(); - } - projectCapabilities.removeDuplicates(); - - m_makeCmd = tc->makeCommand(); - if (!QFileInfo(m_makeCmd).isAbsolute()) { - // Try to detect command in environment - const QString tmp = qt4BuildConfiguration()->environment().searchInPath(m_makeCmd); - if (tmp.isEmpty()) { - emit addOutput(tr("Could not find make command '%1' in the build environment").arg(m_makeCmd), BuildStep::ErrorOutput); - return false; - } - m_makeCmd = tmp; - } - - if (signingMode() == SignCustom && !validateCustomSigningResources(projectCapabilities)) - return false; - - m_environment = qt4BuildConfiguration()->environment(); - - m_cancel = false; - - return true; -} - -void S60CreatePackageStep::definePassphrase() -{ - Q_ASSERT(!m_cancel); - PassphraseForKeyDialog *passwordDialog - = new PassphraseForKeyDialog(QFileInfo(customKeyPath()).fileName()); - if (passwordDialog->exec()) { - QString newPassphrase = passwordDialog->passphrase(); - setPassphrase(newPassphrase); - if (passwordDialog->savePassphrase()) - savePassphraseForKey(m_keyId, newPassphrase); - } else { - m_cancel = true; - } - delete passwordDialog; - - m_waitCondition.wakeAll(); -} - -void S60CreatePackageStep::packageWasPatched(const QString &package, const QStringList &changes) -{ - m_packageChanges.append(qMakePair(package, changes)); -} - -void S60CreatePackageStep::handleWarnAboutPatching() -{ - if (!m_suppressPatchWarningDialog && !m_packageChanges.isEmpty()) { - if (m_patchWarningDialog){ - m_patchWarningDialog->raise(); - return; - } - - m_patchWarningDialog = new Utils::CheckableMessageBox(0); - connect(m_patchWarningDialog, SIGNAL(finished(int)), this, SLOT(packageWarningDialogDone())); - - QString title; - QString changedText; - const QString url = QString::fromLatin1("qthelp://com.nokia.qtcreator.%1%2%3/doc/creator-run-settings.html#capabilities-and-signing"). - arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR).arg(IDE_VERSION_RELEASE); - if (m_packageChanges.count() == 1) { - title = tr("Package Modified"); - changedText = tr("<p>Qt modified your package <b>%1</b>.</p>").arg(m_packageChanges.at(0).first); - } else { - title = tr("Packages Modified"); - changedText = tr("<p>Qt modified some of your packages.</p>"); - } - const QString text = - tr("%1<p><em>These changes were not part of your build profile</em> but are required to " - "make sure the <em>self-signed</em> package can be installed successfully on a device.</p>" - "<p>Check the Issues pane for more details on the modifications made.</p>" - "<p>Please see the <a href=\"%2\">documentation</a> for other signing options which " - "remove the need for this patching.</p>").arg(changedText, url); - m_patchWarningDialog->setWindowTitle(title); - m_patchWarningDialog->setText(text); - m_patchWarningDialog->setCheckBoxText(tr("Ignore patching for this packaging step.")); - m_patchWarningDialog->setIconPixmap(QMessageBox::standardIcon(QMessageBox::Warning)); - m_patchWarningDialog->setChecked(m_suppressPatchWarningDialog); - m_patchWarningDialog->setStandardButtons(QDialogButtonBox::Ok); - m_patchWarningDialog->open(); - } -} - -void S60CreatePackageStep::savePassphraseForKey(const QString &keyId, const QString &passphrase) -{ - m_passphrases->beginGroup(QLatin1String("keys")); - if (passphrase.isEmpty()) - m_passphrases->remove(keyId); - else - m_passphrases->setValue(keyId, obfuscatePassphrase(passphrase, keyId)); - m_passphrases->endGroup(); -} - -QString S60CreatePackageStep::loadPassphraseForKey(const QString &keyId) -{ - if (keyId.isEmpty()) - return QString(); - m_passphrases->beginGroup(QLatin1String("keys")); - QString passphrase = elucidatePassphrase(m_passphrases->value(keyId, QByteArray()).toByteArray(), keyId); - m_passphrases->endGroup(); - return passphrase; -} - -QByteArray S60CreatePackageStep::obfuscatePassphrase(const QString &passphrase, const QString &key) const -{ - QByteArray byteArray = passphrase.toUtf8(); - char *data = byteArray.data(); - const QChar *keyData = key.data(); - int keyDataSize = key.size(); - for (int i = 0; i <byteArray.size(); ++i) - data[i] = data[i]^keyData[i%keyDataSize].toAscii(); - return byteArray.toBase64(); -} - -QString S60CreatePackageStep::elucidatePassphrase(QByteArray obfuscatedPassphrase, const QString &key) const -{ - QByteArray byteArray = QByteArray::fromBase64(obfuscatedPassphrase); - if (byteArray.isEmpty()) - return QString(); - - char *data = byteArray.data(); - const QChar *keyData = key.data(); - int keyDataSize = key.size(); - for (int i = 0; i < byteArray.size(); ++i) - data[i] = data[i]^keyData[i%keyDataSize].toAscii(); - return QString::fromUtf8(byteArray.data()); -} - -void S60CreatePackageStep::run(QFutureInterface<bool> &fi) -{ - if (m_workingDirectories.isEmpty()) { - fi.reportResult(true); - return; - } - - m_timer = new QTimer(); - connect(m_timer, SIGNAL(timeout()), this, SLOT(checkForCancel()), Qt::DirectConnection); - m_timer->start(500); - m_eventLoop = new QEventLoop; - - bool returnValue = false; - if (!createOnePackage()) { - fi.reportResult(false); - return; - } - - Q_ASSERT(!m_futureInterface); - m_futureInterface = &fi; - returnValue = m_eventLoop->exec(); - - // Finished - m_timer->stop(); - delete m_timer; - m_timer = 0; - - delete m_process; - m_process = 0; - delete m_eventLoop; - m_eventLoop = 0; - - m_futureInterface = 0; - - if (returnValue) - emit warnAboutPatching(); - fi.reportResult(returnValue); -} - -bool S60CreatePackageStep::createOnePackage() -{ - // Setup arguments: - m_args.clear(); - if (m_createSmartInstaller) { - if (signingMode() == NotSigned) - m_args << QLatin1String("unsigned_installer_sis"); - else - m_args << QLatin1String("installer_sis"); - } else if (signingMode() == NotSigned) - m_args << QLatin1String("unsigned_sis"); - else - m_args << QLatin1String("sis"); - - if (signingMode() == SignCustom) { - m_args << QLatin1String(MAKE_CERTIFICATE_ARGUMENT) + QDir::toNativeSeparators(customSignaturePath()) - << QLatin1String(MAKE_KEY_ARGUMENT) + QDir::toNativeSeparators(customKeyPath()); - - setPassphrase(loadPassphraseForKey(m_keyId)); - - if (!passphrase().isEmpty()) - m_args << QLatin1String(MAKE_PASSPHRASE_ARGUMENT) + passphrase(); - } - - // Setup working directory: - QString workingDirectory = m_workingDirectories.first(); - QDir wd(workingDirectory); - if (!wd.exists()) - wd.mkpath(wd.absolutePath()); - - - // Setup process... - Q_ASSERT(!m_process); - m_process = new QProcess(); - m_process->setEnvironment(m_environment.toStringList()); - - connect(m_process, SIGNAL(readyReadStandardOutput()), - this, SLOT(processReadyReadStdOutput()), - Qt::DirectConnection); - connect(m_process, SIGNAL(readyReadStandardError()), - this, SLOT(processReadyReadStdError()), - Qt::DirectConnection); - - connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)), - this, SLOT(packageDone(int,QProcess::ExitStatus)), - Qt::DirectConnection); - - m_process->setWorkingDirectory(wd.absolutePath()); - - // Setup parsers: - Q_ASSERT(!m_outputParserChain); - if (!m_isBuildWithSymbianSbsV2) { - m_outputParserChain = new Qt4ProjectManager::AbldParser; - m_outputParserChain->appendOutputParser(new ProjectExplorer::GnuMakeParser); - } else { - m_outputParserChain = new ProjectExplorer::GnuMakeParser(); - } - Q_ASSERT(!m_parser); - m_parser = new S60CreatePackageParser(wd.absolutePath()); - m_outputParserChain->appendOutputParser(m_parser); - m_outputParserChain->setWorkingDirectory(wd.absolutePath()); - - connect(m_outputParserChain, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat)), - this, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat))); - connect(m_outputParserChain, SIGNAL(addTask(ProjectExplorer::Task)), - this, SIGNAL(addTask(ProjectExplorer::Task)), Qt::DirectConnection); - - connect(m_parser, SIGNAL(packageWasPatched(QString,QStringList)), - this, SLOT(packageWasPatched(QString,QStringList)), Qt::DirectConnection); - - // Go for it! - m_process->start(m_makeCmd, m_args); - if (!m_process->waitForStarted()) { - emit addOutput(tr("Could not start process \"%1\" in %2") - .arg(QDir::toNativeSeparators(m_makeCmd), - workingDirectory), - BuildStep::ErrorMessageOutput); - return false; - } - emit addOutput(tr("Starting: \"%1\" %2 in %3\n") - .arg(QDir::toNativeSeparators(m_makeCmd), - m_args.join(QLatin1String(" ")), - workingDirectory), - BuildStep::MessageOutput); - return true; -} - -bool S60CreatePackageStep::validateCustomSigningResources(const QStringList &capabilitiesInPro) -{ - Q_ASSERT(signingMode() == SignCustom); - - QString errorString; - if (customSignaturePath().isEmpty()) - errorString = tr("No certificate file specified. Please specify one in the project settings."); - else if (!QFileInfo(customSignaturePath()).exists()) - errorString = tr("Certificate file \"%1\" does not exist. " - "Please specify an existing certificate file in the project settings.").arg(customSignaturePath()); - - if (customKeyPath().isEmpty()) - errorString = tr("No key file specified. Please specify one in the project settings."); - else if (!QFileInfo(customKeyPath()).exists()) - errorString = tr("Key file \"%1\" does not exist. " - "Please specify an existing key file in the project settings.").arg(customKeyPath()); - - if (!errorString.isEmpty()) { - reportPackageStepIssue(errorString, true); - return false; - } - QScopedPointer<S60CertificateInfo> certInfoPtr(new S60CertificateInfo(customSignaturePath())); - S60CertificateInfo::CertificateState certState = certInfoPtr.data()->validateCertificate(); - switch (certState) { - case S60CertificateInfo::CertificateError: - reportPackageStepIssue(certInfoPtr.data()->errorString(), true); - return false; - case S60CertificateInfo::CertificateWarning: - reportPackageStepIssue(certInfoPtr.data()->errorString(), false); - break; - default: - break; - } - - QStringList unsupportedCaps; - if (certInfoPtr.data()->compareCapabilities(capabilitiesInPro, unsupportedCaps)) { - if (!unsupportedCaps.isEmpty()) { - QString message = tr("The package created will not install on a " - "device as some of the defined capabilities " - "are not supported by the certificate: %1") - .arg(unsupportedCaps.join(QLatin1String(" "))); - reportPackageStepIssue(message, true); - return false; - } - - } else - reportPackageStepIssue(certInfoPtr.data()->errorString(), false); - return true; -} - -void S60CreatePackageStep::reportPackageStepIssue(const QString &message, bool isError ) -{ - emit addOutput(message, isError? - BuildStep::ErrorMessageOutput: - BuildStep::MessageOutput); - emit addTask(ProjectExplorer::Task(isError? - ProjectExplorer::Task::Error: - ProjectExplorer::Task::Warning, - message, - Utils::FileName(), -1, - Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); -} - -void S60CreatePackageStep::packageWarningDialogDone() -{ - if (m_patchWarningDialog) - m_suppressPatchWarningDialog = m_patchWarningDialog->isChecked(); - if (m_suppressPatchWarningDialog) { - m_patchWarningDialog->deleteLater(); - m_patchWarningDialog = 0; - } -} - -void S60CreatePackageStep::packageDone(int exitCode, QProcess::ExitStatus status) -{ - QString line = QString::fromLocal8Bit(m_process->readAllStandardError()); - if (!line.isEmpty()) - stdError(line); - - line = QString::fromLocal8Bit(m_process->readAllStandardOutput()); - if (!line.isEmpty()) - stdOutput(line); - - if (status == QProcess::NormalExit && exitCode == 0) { - emit addOutput(tr("The process \"%1\" exited normally.") - .arg(QDir::toNativeSeparators(m_makeCmd)), - BuildStep::MessageOutput); - } else if (status == QProcess::NormalExit) { - emit addOutput(tr("The process \"%1\" exited with code %2.") - .arg(QDir::toNativeSeparators(m_makeCmd), QString::number(exitCode)), - BuildStep::ErrorMessageOutput); - } else { - emit addOutput(tr("The process \"%1\" crashed.").arg(QDir::toNativeSeparators(m_makeCmd)), BuildStep::ErrorMessageOutput); - } - - bool needPassphrase = m_parser->needPassphrase(); - - // Clean up: - delete m_outputParserChain; - m_outputParserChain = 0; - m_parser = 0; - delete m_process; - m_process = 0; - - // Process next directories: - if (needPassphrase) { - emit badPassphrase(); - QMutexLocker locker(&m_mutex); - m_waitCondition.wait(&m_mutex); - } else { - if (status != QProcess::NormalExit || exitCode != 0) { - m_eventLoop->exit(false); - return; - } - - m_workingDirectories.removeFirst(); - if (m_workingDirectories.isEmpty()) { - m_eventLoop->exit(true); - return; - } - } - - if (m_cancel || !createOnePackage()) - m_eventLoop->exit(false); -} - -void S60CreatePackageStep::processReadyReadStdOutput() -{ - m_process->setReadChannel(QProcess::StandardOutput); - while (m_process->canReadLine()) { - QString line = QString::fromLocal8Bit(m_process->readLine()); - stdOutput(line); - } -} - -void S60CreatePackageStep::stdOutput(const QString &line) -{ - if (m_outputParserChain) - m_outputParserChain->stdOutput(line); - emit addOutput(line, BuildStep::NormalOutput, BuildStep::DontAppendNewline); -} - -void S60CreatePackageStep::processReadyReadStdError() -{ - m_process->setReadChannel(QProcess::StandardError); - while (m_process->canReadLine()) { - QString line = QString::fromLocal8Bit(m_process->readLine()); - stdError(line); - } -} - -void S60CreatePackageStep::stdError(const QString &line) -{ - if (m_outputParserChain) - m_outputParserChain->stdError(line); - emit addOutput(line, BuildStep::ErrorOutput, BuildStep::DontAppendNewline); -} - -void S60CreatePackageStep::checkForCancel() -{ - if (m_futureInterface->isCanceled() - && m_timer && m_timer->isActive()) { - m_timer->stop(); - if (m_process) { - m_process->terminate(); - m_process->waitForFinished(5000); //while waiting, the process can be killed - if (m_process) - m_process->kill(); - } - if (m_eventLoop) - m_eventLoop->exit(false); - } -} - -QString S60CreatePackageStep::generateKeyId(const QString &keyPath) const -{ - if (keyPath.isEmpty()) - return QString(); - - Utils::FileReader reader; - if (!reader.fetch(keyPath, QIODevice::Text)) { - emit addOutput(reader.errorString(), BuildStep::ErrorOutput); - return QString(); - } - - //key file is quite small in size - return QLatin1String(QCryptographicHash::hash(reader.data(), - QCryptographicHash::Md5).toHex()); -} - -bool S60CreatePackageStep::immutable() const -{ - return false; -} - -ProjectExplorer::BuildStepConfigWidget *S60CreatePackageStep::createConfigWidget() -{ - return new S60CreatePackageStepConfigWidget(this); -} - -S60CreatePackageStep::SigningMode S60CreatePackageStep::signingMode() const -{ - return m_signingMode; -} - -void S60CreatePackageStep::setSigningMode(SigningMode mode) -{ - m_signingMode = mode; -} - -QString S60CreatePackageStep::customSignaturePath() const -{ - return m_customSignaturePath; -} - -void S60CreatePackageStep::setCustomSignaturePath(const QString &path) -{ - m_customSignaturePath = path; -} - -QString S60CreatePackageStep::customKeyPath() const -{ - return m_customKeyPath; -} - -void S60CreatePackageStep::setCustomKeyPath(const QString &path) -{ - m_customKeyPath = path; - m_keyId = generateKeyId(m_customKeyPath); -} - -QString S60CreatePackageStep::passphrase() const -{ - return m_passphrase; -} - -void S60CreatePackageStep::setPassphrase(const QString &passphrase) -{ - if (passphrase.isEmpty()) - return; - m_passphrase = passphrase; -} - -QString S60CreatePackageStep::keyId() const -{ - return m_keyId; -} - -void S60CreatePackageStep::setKeyId(const QString &keyId) -{ - m_keyId = keyId; -} - -bool S60CreatePackageStep::createsSmartInstaller() const -{ - return m_createSmartInstaller; -} - -void S60CreatePackageStep::setCreatesSmartInstaller(bool value) -{ - m_createSmartInstaller = value; - qt4BuildConfiguration()->emitS60CreatesSmartInstallerChanged(); -} - -void S60CreatePackageStep::resetPassphrases() -{ - m_passphrases->beginGroup(QLatin1String("keys")); - QStringList keys = m_passphrases->allKeys(); - foreach (const QString &key, keys) { - m_passphrases->setValue(key, QString()); - } - m_passphrases->remove(QString()); - m_passphrases->endGroup(); -} - -// #pragma mark -- S60SignBuildStepFactory - -S60CreatePackageStepFactory::S60CreatePackageStepFactory(QObject *parent) : - ProjectExplorer::IBuildStepFactory(parent) -{ -} - -S60CreatePackageStepFactory::~S60CreatePackageStepFactory() -{ -} - -bool S60CreatePackageStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const -{ - return canHandle(parent) && id == SIGN_BS_ID; -} - -ProjectExplorer::BuildStep *S60CreatePackageStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id) -{ - if (!canCreate(parent, id)) - return 0; - return new S60CreatePackageStep(parent); -} - -bool S60CreatePackageStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const -{ - return canCreate(parent, source->id()); -} - -ProjectExplorer::BuildStep *S60CreatePackageStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) -{ - if (!canClone(parent, source)) - return 0; - return new S60CreatePackageStep(parent, static_cast<S60CreatePackageStep *>(source)); -} - -bool S60CreatePackageStepFactory::canHandle(ProjectExplorer::BuildStepList *parent) const -{ - if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY) - return false; - Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(parent->target()->profile()); - if (deviceType != SymbianIDeviceFactory::deviceType()) - return false; - return qobject_cast<Qt4Project *>(parent->target()->project()); -} - -bool S60CreatePackageStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const -{ - return canCreate(parent, ProjectExplorer::idFromMap(map)); -} - -ProjectExplorer::BuildStep *S60CreatePackageStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) -{ - if (!canRestore(parent, map)) - return 0; - S60CreatePackageStep *bs(new S60CreatePackageStep(parent)); - if (bs->fromMap(map)) - return bs; - delete bs; - return 0; -} - -QList<Core::Id> S60CreatePackageStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const -{ - if (!canHandle(parent)) - return QList<Core::Id>(); - - return QList<Core::Id>() << Core::Id(SIGN_BS_ID); -} - -QString S60CreatePackageStepFactory::displayNameForId(const Core::Id id) const -{ - if (id == SIGN_BS_ID) - return tr("Create SIS Package"); - return QString(); -} - -// #pragma mark -- S60SignBuildStepConfigWidget - -S60CreatePackageStepConfigWidget::S60CreatePackageStepConfigWidget(S60CreatePackageStep *signStep) - : BuildStepConfigWidget(), m_signStep(signStep) -{ - m_ui.setupUi(this); - m_ui.signaturePath->setExpectedKind(Utils::PathChooser::File); - m_ui.signaturePath->setPromptDialogFilter(QLatin1String("*.cer *.crt *.der *.pem")); - m_ui.keyFilePath->setExpectedKind(Utils::PathChooser::File); - updateUi(); - - bool enableCertDetails = m_signStep->signingMode() == S60CreatePackageStep::SignCustom - && m_ui.signaturePath->isValid(); - m_ui.certificateDetails->setEnabled(enableCertDetails); - - connect(m_ui.certificateDetails, SIGNAL(clicked()), - this, SLOT(displayCertificateDetails())); - connect(m_ui.customCertificateButton, SIGNAL(clicked()), - this, SLOT(updateFromUi())); - connect(m_ui.selfSignedButton, SIGNAL(clicked()), - this, SLOT(updateFromUi())); - connect(m_ui.notSignedButton, SIGNAL(clicked()), - this, SLOT(updateFromUi())); - connect(m_ui.signaturePath, SIGNAL(changed(QString)), - this, SLOT(signatureChanged(QString))); - connect(m_ui.keyFilePath, SIGNAL(changed(QString)), - this, SLOT(updateFromUi())); - connect(m_ui.smartInstaller, SIGNAL(clicked()), - this, SLOT(updateFromUi())); - connect(m_ui.resetPassphrasesButton, SIGNAL(clicked()), - this, SLOT(resetPassphrases())); -} - -void S60CreatePackageStepConfigWidget::signatureChanged(QString certFile) -{ - m_ui.certificateDetails->setEnabled(m_ui.signaturePath->isValid()); - - if (!certFile.isEmpty() && m_ui.keyFilePath->path().isEmpty()) { - /* If a cert file is selected and there is not key file inserted, - then we check if there is a .key or .pem file in the folder with - the same base name as the cert file. This file is probably a key - file for this cert and the key field is then populated automatically - */ - QFileInfo certFileInfo(certFile); - QDir directory = QDir(certFileInfo.absolutePath()); - QString keyFile(certFileInfo.baseName() + QLatin1String(".key")); - QString pemFile(certFileInfo.baseName() + QLatin1String(".pem")); - QStringList files; - QStringList keys; - keys << keyFile << pemFile; - files = directory.entryList(QStringList(keys), - QDir::Files | QDir::NoSymLinks); - - if (files.isEmpty()) - m_ui.keyFilePath->setInitialBrowsePathBackup(certFileInfo.path()); - else - m_ui.keyFilePath->setPath(directory.filePath(files[0])); - } - updateFromUi(); -} - -void S60CreatePackageStepConfigWidget::updateUi() -{ - switch(m_signStep->signingMode()) { - case S60CreatePackageStep::SignCustom: - m_ui.selfSignedButton->setChecked(false); - m_ui.customCertificateButton->setChecked(true); - m_ui.notSignedButton->setChecked(false); - m_ui.certificateDetails->setEnabled(m_ui.signaturePath->isValid()); - break; - case S60CreatePackageStep::NotSigned: - m_ui.selfSignedButton->setChecked(false); - m_ui.customCertificateButton->setChecked(false); - m_ui.notSignedButton->setChecked(true); - m_ui.certificateDetails->setEnabled(false); - break; - default: - m_ui.selfSignedButton->setChecked(true); - m_ui.customCertificateButton->setChecked(false); - m_ui.notSignedButton->setChecked(false); - m_ui.certificateDetails->setEnabled(false); - break; - } - bool customSigned = m_signStep->signingMode() == S60CreatePackageStep::SignCustom; - m_ui.signaturePath->setEnabled(customSigned); - m_ui.keyFilePath->setEnabled(customSigned); - m_ui.signaturePath->setPath(m_signStep->customSignaturePath()); - m_ui.keyFilePath->setPath(m_signStep->customKeyPath()); - m_ui.smartInstaller->setChecked(m_signStep->createsSmartInstaller()); - emit updateSummary(); -} - -void S60CreatePackageStepConfigWidget::updateFromUi() -{ - S60CreatePackageStep::SigningMode signingMode(S60CreatePackageStep::SignSelf); - if (m_ui.selfSignedButton->isChecked()) - signingMode = S60CreatePackageStep::SignSelf; - else if (m_ui.customCertificateButton->isChecked()) - signingMode = S60CreatePackageStep::SignCustom; - else if (m_ui.notSignedButton->isChecked()) - signingMode = S60CreatePackageStep::NotSigned; - - m_signStep->setSigningMode(signingMode); - m_signStep->setCustomSignaturePath(m_ui.signaturePath->path()); - m_signStep->setCustomKeyPath(m_ui.keyFilePath->path()); - m_signStep->setCreatesSmartInstaller(m_ui.smartInstaller->isChecked()); - updateUi(); -} - -void S60CreatePackageStepConfigWidget::displayCertificateDetails() -{ - S60CertificateInfo *certificateInformation = new S60CertificateInfo(m_ui.signaturePath->path()); - certificateInformation->devicesSupported().sort(); - - S60CertificateDetailsDialog dialog; - dialog.setText(certificateInformation->toHtml(false)); - dialog.exec(); - delete certificateInformation; -} - -void S60CreatePackageStepConfigWidget::resetPassphrases() -{ - QMessageBox msgBox(QMessageBox::Question, tr("Reset Passphrases"), - tr("Do you want to reset all passphrases saved for keys used?"), - QMessageBox::Reset|QMessageBox::Cancel, this); - if (msgBox.exec() == QMessageBox::Reset) - m_signStep->resetPassphrases(); -} - -QString S60CreatePackageStepConfigWidget::summaryText() const -{ - QString text; - switch(m_signStep->signingMode()) { - case S60CreatePackageStep::SignCustom: - if (!m_signStep->customSignaturePath().isEmpty() - && !m_signStep->customKeyPath().isEmpty()) - text = tr("signed with the certificate \"%1\" using the key \"%2\"") - .arg(QFileInfo(m_signStep->customSignaturePath()).fileName(), - QFileInfo(m_signStep->customKeyPath()).fileName()); - else - text = tr("signed with a certificate and a key that need to be specified"); - break; - case S60CreatePackageStep::NotSigned: - text = tr("not signed"); - break; - default: - text = tr("self-signed"); - break; - } - if (m_signStep->createsSmartInstaller()) - return tr("<b>Create SIS Package:</b> %1, using Smart Installer").arg(text); - return tr("<b>Create SIS Package:</b> %1").arg(text); -} - -QString S60CreatePackageStepConfigWidget::displayName() const -{ - return m_signStep->displayName(); -} diff --git a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.h b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.h deleted file mode 100644 index 515d300b5ba..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.h +++ /dev/null @@ -1,212 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60CREATEPACKAGESTEP_H -#define S60CREATEPACKAGESTEP_H - -#include "ui_s60createpackagestep.h" - -#include <projectexplorer/buildstep.h> -#include <qt4projectmanager/makestep.h> - -#include <QMutex> -#include <QWaitCondition> - -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - -namespace Utils { -class CheckableMessageBox; -} // namespace Utils - -namespace Qt4ProjectManager { -namespace Internal { - -class S60CreatePackageParser; - -class S60CreatePackageStepFactory : public ProjectExplorer::IBuildStepFactory -{ - Q_OBJECT -public: - explicit S60CreatePackageStepFactory(QObject *parent = 0); - ~S60CreatePackageStepFactory(); - - // used to show the list of possible additons to a target, returns a list of types - QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const; - // used to translate the types to names to display to the user - QString displayNameForId(const Core::Id id) const; - - bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const; - ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id); - // used to recreate the runConfigurations when restoring settings - bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const; - ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map); - bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const; - ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product); - - bool canHandle(ProjectExplorer::BuildStepList *parent) const; -}; - - -class S60CreatePackageStep : public ProjectExplorer::BuildStep -{ - Q_OBJECT - friend class S60CreatePackageStepFactory; - -public: - enum SigningMode { - SignSelf = 0, - SignCustom = 1, - NotSigned = 2 - }; - - explicit S60CreatePackageStep(ProjectExplorer::BuildStepList *bsl); - virtual ~S60CreatePackageStep(); - - virtual bool init(); - virtual void run(QFutureInterface<bool> &fi); - virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); - virtual bool immutable() const; - - QVariantMap toMap() const; - - SigningMode signingMode() const; - void setSigningMode(SigningMode mode); - QString customSignaturePath() const; - void setCustomSignaturePath(const QString &path); - QString customKeyPath() const; - void setCustomKeyPath(const QString &path); - QString passphrase() const ; - void setPassphrase(const QString &passphrase); - QString keyId() const; - void setKeyId(const QString &keyId); - bool createsSmartInstaller() const; - void setCreatesSmartInstaller(bool value); - - void resetPassphrases(); - -signals: - void badPassphrase(); - void warnAboutPatching(); - -protected: - S60CreatePackageStep(ProjectExplorer::BuildStepList *bsl, S60CreatePackageStep *bs); - S60CreatePackageStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id); - bool fromMap(const QVariantMap &map); - - Qt4BuildConfiguration *qt4BuildConfiguration() const; - -private slots: - void packageWarningDialogDone(); - void packageDone(int, QProcess::ExitStatus); - void processReadyReadStdOutput(); - void processReadyReadStdError(); - void checkForCancel(); - void definePassphrase(); - - void packageWasPatched(const QString &, const QStringList &); - void handleWarnAboutPatching(); - -private: - void stdOutput(const QString &line); - void stdError(const QString &line); - - void reportPackageStepIssue(const QString &message, bool isError ); - void setupProcess(); - bool createOnePackage(); - bool validateCustomSigningResources(const QStringList &capabilitiesInPro); - - QString generateKeyId(const QString &keyPath) const; - QString loadPassphraseForKey(const QString &keyId); - void savePassphraseForKey(const QString &keyId, const QString &passphrase); - QString elucidatePassphrase(QByteArray obfuscatedPassphrase, const QString &key) const; - QByteArray obfuscatePassphrase(const QString &passphrase, const QString &key) const; - - QStringList m_workingDirectories; - - QString m_makeCmd; - Utils::Environment m_environment; - QStringList m_args; - - void ctor_package(); - - SigningMode m_signingMode; - QString m_customSignaturePath; - QString m_customKeyPath; - QString m_passphrase; - QString m_keyId; - bool m_createSmartInstaller; - ProjectExplorer::IOutputParser *m_outputParserChain; - - QProcess *m_process; - QTimer *m_timer; - QEventLoop *m_eventLoop; - QFutureInterface<bool> *m_futureInterface; - - QWaitCondition m_waitCondition; - QMutex m_mutex; - - bool m_cancel; - - QSettings *m_passphrases; - S60CreatePackageParser *m_parser; - QList<QPair<QString, QStringList> > m_packageChanges; - - bool m_suppressPatchWarningDialog; - Utils::CheckableMessageBox *m_patchWarningDialog; - bool m_isBuildWithSymbianSbsV2; -}; - -class S60CreatePackageStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget -{ - Q_OBJECT -public: - S60CreatePackageStepConfigWidget(S60CreatePackageStep *signStep); - QString displayName() const; - QString summaryText() const; - -private slots: - void updateUi(); - void updateFromUi(); - void resetPassphrases(); - void signatureChanged(QString certFile); - void displayCertificateDetails(); - -private: - S60CreatePackageStep *m_signStep; - - Ui::S60CreatePackageStepWidget m_ui; -}; - -} // Internal -} // Qt4ProjectManager - -#endif // S60CREATEPACKAGESTEP_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.ui b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.ui deleted file mode 100644 index 17f55a750cb..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.ui +++ /dev/null @@ -1,192 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Qt4ProjectManager::Internal::S60CreatePackageStepWidget</class> - <widget class="QWidget" name="Qt4ProjectManager::Internal::S60CreatePackageStepWidget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>517</width> - <height>171</height> - </rect> - </property> - <property name="windowTitle"> - <string notr="true">Form</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <layout class="QGridLayout" name="gridLayout_3" rowstretch="0,0" columnstretch="0,0" rowminimumheight="0,0" columnminimumwidth="0,0"> - <item row="1" column="0"> - <widget class="QRadioButton" name="notSignedButton"> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLabel" name="notSignedLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Not signed</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0" columnminimumwidth="0,0"> - <item row="0" column="0"> - <widget class="QRadioButton" name="selfSignedButton"> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLabel" name="selfSignedLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Self-signed certificate</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <widget class="QRadioButton" name="customCertificateButton"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="0" column="1" rowspan="2"> - <layout class="QFormLayout" name="formLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="customLabel"> - <property name="text"> - <string>Custom certificate:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="CertificatePathChooser" name="signaturePath" native="true"> - <property name="promptDialogTitle" stdset="0"> - <string>Choose certificate file</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Key file:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="Utils::PathChooser" name="keyFilePath" native="true"/> - </item> - </layout> - </item> - </layout> - </item> - <item> - <widget class="QCheckBox" name="smartInstaller"> - <property name="text"> - <string>Create Smart Installer package</string> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QPushButton" name="resetPassphrasesButton"> - <property name="toolTip"> - <string>Resets saved passphrases for all used keys</string> - </property> - <property name="text"> - <string>Reset Passphrases</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="certificateDetails"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="toolTip"> - <string/> - </property> - <property name="text"> - <string>Certificate's details</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>Utils::PathChooser</class> - <extends>QWidget</extends> - <header location="global">utils/pathchooser.h</header> - <container>1</container> - <slots> - <signal>editingFinished()</signal> - <signal>browsingFinished()</signal> - </slots> - </customwidget> - <customwidget> - <class>CertificatePathChooser</class> - <extends>QWidget</extends> - <header location="global">qt4projectmanager/qt-s60/certificatepathchooser.h</header> - <container>1</container> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.cpp deleted file mode 100644 index 2ef0e4d64cd..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.cpp +++ /dev/null @@ -1,448 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60deployconfiguration.h" -#include "s60deployconfigurationwidget.h" -#include "s60manager.h" -#include "qt4project.h" -#include "qt4nodes.h" -#include "qt4projectmanagerconstants.h" -#include "qt4buildconfiguration.h" -#include "s60createpackagestep.h" -#include "s60deploystep.h" -#include "symbianidevice.h" -#include "symbianidevicefactory.h" - -#include <utils/qtcassert.h> -#include <symbianutils/symbiandevicemanager.h> - -#include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/buildsteplist.h> -#include <projectexplorer/devicesupport/devicemanager.h> -#include <projectexplorer/project.h> -#include <projectexplorer/profileinformation.h> -#include <projectexplorer/target.h> -#include <projectexplorer/toolchain.h> -#include <projectexplorer/devicesupport/devicemanager.h> - -#include <qtsupport/qtprofileinformation.h> - -#include <QFileInfo> - -using namespace ProjectExplorer; -using namespace Qt4ProjectManager; -using namespace Qt4ProjectManager::Internal; - -namespace { -const char S60_DC_PREFIX[] = "Qt4ProjectManager.S60DeployConfiguration."; - -const char INSTALLATION_DRIVE_LETTER_KEY[] = "Qt4ProjectManager.S60DeployConfiguration.InstallationDriveLetter"; -const char SILENT_INSTALL_KEY[] = "Qt4ProjectManager.S60DeployConfiguration.SilentInstall"; - -QString pathFromId(Core::Id id) -{ - QString idstr = QString::fromUtf8(id.name()); - const QString prefix = QLatin1String(S60_DC_PREFIX); - if (!idstr.startsWith(prefix)) - return QString(); - return idstr.mid(prefix.size()); -} - -} // namespace - -// ======== S60DeployConfiguration - -S60DeployConfiguration::S60DeployConfiguration(Target *parent) : - DeployConfiguration(parent, Core::Id(S60_DEPLOYCONFIGURATION_ID)), - m_activeBuildConfiguration(0), - m_installationDrive('C'), - m_silentInstall(true) -{ - ctor(); - - ProjectExplorer::DeviceManager *dm = ProjectExplorer::DeviceManager::instance(); - IDevice::ConstPtr defaultDevice - = dm->defaultDevice(Internal::SymbianIDeviceFactory::deviceType()); - if (defaultDevice) - m_deviceId = defaultDevice->id(); -} - -S60DeployConfiguration::S60DeployConfiguration(Target *target, S60DeployConfiguration *source) : - DeployConfiguration(target, source), - m_activeBuildConfiguration(0), - m_deviceId(source->m_deviceId), - m_installationDrive(source->m_installationDrive), - m_silentInstall(source->m_silentInstall) -{ - ctor(); -} - -void S60DeployConfiguration::ctor() -{ - setDefaultDisplayName(defaultDisplayName()); - - Qt4Project *project = static_cast<Qt4Project *>(target()->project()); - // TODO disable S60 Deploy Configuration while parsing - // requires keeping track of the parsing state of the project - connect(project, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)), - this, SLOT(slotTargetInformationChanged(Qt4ProjectManager::Qt4ProFileNode*,bool,bool))); - connect(target(), SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)), - this, SLOT(updateActiveBuildConfiguration(ProjectExplorer::BuildConfiguration*))); - connect(target(), SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)), - this, SLOT(updateActiveRunConfiguration(ProjectExplorer::RunConfiguration*))); - updateActiveBuildConfiguration(target()->activeBuildConfiguration()); -} - -S60DeployConfiguration::~S60DeployConfiguration() -{ } - -ProjectExplorer::DeployConfigurationWidget *S60DeployConfiguration::configurationWidget() const -{ - return new S60DeployConfigurationWidget(); -} - -void S60DeployConfiguration::slotTargetInformationChanged(Qt4ProjectManager::Qt4ProFileNode*,bool success, bool parseInProgress) -{ - Q_UNUSED(success) - if (!parseInProgress) - emit targetInformationChanged(); -} - -bool S60DeployConfiguration::isStaticLibrary(const Qt4ProFileNode &projectNode) const -{ - if (projectNode.projectType() == LibraryTemplate) { - const QStringList &config(projectNode.variableValue(ConfigVar)); - if (config.contains(QLatin1String("static")) || config.contains(QLatin1String("staticlib"))) - return true; - } - return false; -} - -bool S60DeployConfiguration::isApplication(const Qt4ProFileNode &projectNode) const -{ - return projectNode.projectType() == ApplicationTemplate; -} - -bool S60DeployConfiguration::hasSisPackage(const Qt4ProFileNode &projectNode) const -{ - return projectNode.isDeployable(); -} - -QStringList S60DeployConfiguration::signedPackages() const -{ - QList<Qt4ProFileNode *> list = static_cast<Qt4Project *>(target()->project())->allProFiles(); - QStringList result; - foreach (Qt4ProFileNode *node, list) { - if (!hasSisPackage(*node)) - continue; - TargetInformation ti = node->targetInformation(); - if (ti.valid) - result << ti.buildDir + QLatin1Char('/') + createPackageName(ti.target); - } - return result; -} - -QString S60DeployConfiguration::createPackageName(const QString &baseName) const -{ - QString name(baseName); - name += runSmartInstaller() ? QLatin1String("_installer") : QLatin1String(""); - name += isSigned() ? QLatin1String("") : QLatin1String("_unsigned"); - name += QLatin1String(".sis"); - return name; -} - -SymbianIDevice::ConstPtr S60DeployConfiguration::device() const -{ - return ProjectExplorer::DeviceManager::instance()->find(m_deviceId).dynamicCast<const SymbianIDevice>(); -} - -QStringList S60DeployConfiguration::packageFileNamesWithTargetInfo() const -{ - QList<Qt4ProFileNode *> leafs = static_cast<Qt4Project *>(target()->project())->allProFiles(); - QStringList result; - foreach (Qt4ProFileNode *qt4ProFileNode, leafs) { - if (!hasSisPackage(*qt4ProFileNode)) - continue; - TargetInformation ti = qt4ProFileNode->targetInformation(); - if (!ti.valid) - continue; - QString baseFileName = ti.buildDir + QLatin1Char('/') + ti.target; - ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(target()->profile()); - baseFileName += QLatin1Char('_') - + (isDebug() ? QLatin1String("debug") : QLatin1String("release")) - + QLatin1Char('-') + S60Manager::platform(tc) + QLatin1String(".sis"); - result << baseFileName; - } - return result; -} - -QStringList S60DeployConfiguration::packageTemplateFileNames() const -{ - QList<Qt4ProFileNode *> list = static_cast<Qt4Project *>(target()->project())->allProFiles(); - QStringList result; - foreach (Qt4ProFileNode *node, list) { - if (!hasSisPackage(*node)) - continue; - TargetInformation ti = node->targetInformation(); - if (ti.valid) - result << ti.buildDir + QLatin1Char('/') + ti.target + QLatin1String("_template.pkg"); - } - return result; -} - -QStringList S60DeployConfiguration::appPackageTemplateFileNames() const -{ - QList<Qt4ProFileNode *> list = static_cast<Qt4Project *>(target()->project())->allProFiles(); - QStringList result; - foreach (Qt4ProFileNode *node, list) { - if (!hasSisPackage(*node)) - continue; - TargetInformation ti = node->targetInformation(); - if (ti.valid) - result << ti.buildDir + QLatin1Char('/') + ti.target + QLatin1String("_template.pkg"); - } - return result; -} - -bool S60DeployConfiguration::runSmartInstaller() const -{ - DeployConfiguration *dc = target()->activeDeployConfiguration(); - QTC_ASSERT(dc, return false); - BuildStepList *bsl = dc->stepList(); - QTC_ASSERT(bsl, return false); - QList<BuildStep *> steps = bsl->steps(); - foreach (const BuildStep *step, steps) { - if (const S60CreatePackageStep *packageStep = qobject_cast<const S60CreatePackageStep *>(step)) { - return packageStep->createsSmartInstaller(); - } - } - return false; -} - -bool S60DeployConfiguration::isSigned() const -{ - DeployConfiguration *dc = target()->activeDeployConfiguration(); - QTC_ASSERT(dc, return false); - BuildStepList *bsl = dc->stepList(); - QTC_ASSERT(bsl, return false); - QList<BuildStep *> steps = bsl->steps(); - foreach (const BuildStep *step, steps) { - if (const S60CreatePackageStep *packageStep = qobject_cast<const S60CreatePackageStep *>(step)) { - return packageStep->signingMode() != S60CreatePackageStep::NotSigned; - } - } - return false; -} - -bool S60DeployConfiguration::isDebug() const -{ - const Qt4BuildConfiguration *qt4bc = qobject_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration()); - QTC_ASSERT(qt4bc, return false); - return (qt4bc->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild); -} - -QString S60DeployConfiguration::symbianTarget() const -{ - return isDebug() ? QLatin1String("udeb") : QLatin1String("urel"); -} - -void S60DeployConfiguration::updateActiveBuildConfiguration(ProjectExplorer::BuildConfiguration *buildConfiguration) -{ - if (m_activeBuildConfiguration) - disconnect(m_activeBuildConfiguration, SIGNAL(s60CreatesSmartInstallerChanged()), - this, SIGNAL(targetInformationChanged())); - m_activeBuildConfiguration = buildConfiguration; - if (m_activeBuildConfiguration) - connect(m_activeBuildConfiguration, SIGNAL(s60CreatesSmartInstallerChanged()), - this, SIGNAL(targetInformationChanged())); -} - -void S60DeployConfiguration::updateActiveRunConfiguration(ProjectExplorer::RunConfiguration *runConfiguration) -{ - Q_UNUSED(runConfiguration); - setDefaultDisplayName(defaultDisplayName()); -} - -QVariantMap S60DeployConfiguration::toMap() const -{ - QVariantMap map(ProjectExplorer::DeployConfiguration::toMap()); - map.insert(QLatin1String(INSTALLATION_DRIVE_LETTER_KEY), QChar(QLatin1Char(m_installationDrive))); - map.insert(QLatin1String(SILENT_INSTALL_KEY), QVariant(m_silentInstall)); - - return map; -} - -QString S60DeployConfiguration::defaultDisplayName() const -{ - QList<Qt4ProFileNode *> list = static_cast<Qt4Project *>(target()->project())->allProFiles(); - foreach (Qt4ProFileNode *node, list) { - TargetInformation ti = node->targetInformation(); - if (ti.valid && !ti.buildDir.isEmpty()) - return tr("Deploy %1 to Symbian device").arg(QFileInfo(ti.buildDir).completeBaseName()); - } - return tr("Deploy to Symbian device"); -} - -bool S60DeployConfiguration::fromMap(const QVariantMap &map) -{ - if (!DeployConfiguration::fromMap(map)) - return false; - m_installationDrive = map.value(QLatin1String(INSTALLATION_DRIVE_LETTER_KEY), QChar(QLatin1Char('C'))) - .toChar().toAscii(); - m_silentInstall = map.value(QLatin1String(SILENT_INSTALL_KEY), QVariant(true)).toBool(); - - setDefaultDisplayName(defaultDisplayName()); - return true; -} - -char S60DeployConfiguration::installationDrive() const -{ - return m_installationDrive; -} - -void S60DeployConfiguration::setInstallationDrive(char drive) -{ - if (m_installationDrive == drive) - return; - m_installationDrive = drive; - emit installationDriveChanged(); -} - -bool S60DeployConfiguration::silentInstall() const -{ - return m_silentInstall; -} - -void S60DeployConfiguration::setSilentInstall(bool silent) -{ - m_silentInstall = silent; -} - -void S60DeployConfiguration::setAvailableDeviceDrives(QList<DeviceDrive> drives) -{ - m_availableDeviceDrives = drives; - emit availableDeviceDrivesChanged(); -} - -const QList<S60DeployConfiguration::DeviceDrive> &S60DeployConfiguration::availableDeviceDrives() const -{ - return m_availableDeviceDrives; -} - -// ======== S60DeployConfigurationFactory - -S60DeployConfigurationFactory::S60DeployConfigurationFactory(QObject *parent) : - DeployConfigurationFactory(parent) -{ setObjectName(QLatin1String("S60DeployConfiguration")); } - -S60DeployConfigurationFactory::~S60DeployConfigurationFactory() -{ -} - -QList<Core::Id> S60DeployConfigurationFactory::availableCreationIds(Target *parent) const -{ - QList<Core::Id> result; - Qt4Project *project = qobject_cast<Qt4Project *>(parent->project()); - - if (!project) - return result; - - ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceProfileInformation::device(parent->profile()); - if (dev.isNull() || dev->type() != SymbianIDeviceFactory::deviceType()) - return result; - - QStringList proFiles = project->applicationProFilePathes(QLatin1String(S60_DC_PREFIX)); - foreach (const QString &pf, proFiles) - result << Core::Id(pf.toUtf8().constData()); - return result; -} - -QString S60DeployConfigurationFactory::displayNameForId(const Core::Id id) const -{ - if (!pathFromId(id).isEmpty()) - return tr("%1 on Symbian Device").arg(QFileInfo(pathFromId(id)).completeBaseName()); - return QString(); -} - -DeployConfiguration *S60DeployConfigurationFactory::create(Target *parent, const Core::Id id) -{ - if (!canCreate(parent, id)) - return 0; - - S60DeployConfiguration *dc = new S60DeployConfiguration(parent); - - dc->setDefaultDisplayName(tr("Deploy to Symbian device")); - dc->stepList()->insertStep(0, new S60CreatePackageStep(dc->stepList())); - dc->stepList()->insertStep(1, new S60DeployStep(dc->stepList())); - return dc; -} - -bool S60DeployConfigurationFactory::canCreate(Target *parent, const Core::Id id) const -{ - Qt4Project *project = qobject_cast<Qt4Project *>(parent->project()); - if (!project) - return false; - ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceProfileInformation::device(parent->profile()); - if (dev.isNull() || dev->type() != SymbianIDeviceFactory::deviceType()) - return false; - return id == S60_DEPLOYCONFIGURATION_ID; -} - -bool S60DeployConfigurationFactory::canRestore(Target *parent, const QVariantMap& map) const -{ - return canCreate(parent, idFromMap(map)); -} - -DeployConfiguration *S60DeployConfigurationFactory::restore(Target *parent, const QVariantMap &map) -{ - if (!canRestore(parent, map)) - return 0; - S60DeployConfiguration *dc = new S60DeployConfiguration(parent); - if (dc->fromMap(map)) - return dc; - - delete dc; - return 0; -} - -bool S60DeployConfigurationFactory::canClone(Target *parent, DeployConfiguration *source) const -{ - if (!qobject_cast<Qt4Project *>(parent->project())) - return false; - return source->id() == S60_DEPLOYCONFIGURATION_ID; -} - -DeployConfiguration *S60DeployConfigurationFactory::clone(Target *parent, DeployConfiguration *source) -{ - if (!canClone(parent, source)) - return 0; - S60DeployConfiguration *old = static_cast<S60DeployConfiguration *>(source); - return new S60DeployConfiguration(parent, old); -} diff --git a/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.h b/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.h deleted file mode 100644 index 9b3b1d2f990..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.h +++ /dev/null @@ -1,148 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60DEPLOYCONFIGURATION_H -#define S60DEPLOYCONFIGURATION_H - -#include "symbianidevice.h" - -#include <projectexplorer/deployconfiguration.h> -#include <qt4projectmanager/qt4projectmanager_global.h> - -namespace ProjectExplorer { -class BuildConfiguration; -class RunConfiguration; -class ToolChain; -} - -namespace QtSupport { -class BaseQtVersion; -} - -namespace Qt4ProjectManager { -class Qt4ProFileNode; -class S60DeployConfigurationFactory; - -namespace Internal { -class Qt4SymbianTarget; - -const char S60_DEPLOYCONFIGURATION_ID[] = "Qt4ProjectManager.S60DeployConfiguration"; -} - -class QT4PROJECTMANAGER_EXPORT S60DeployConfiguration : public ProjectExplorer::DeployConfiguration -{ - Q_OBJECT - friend class S60DeployConfigurationFactory; - -public: - typedef QPair<char, int> DeviceDrive; - - explicit S60DeployConfiguration(ProjectExplorer::Target *parent); - virtual ~S60DeployConfiguration(); - - ProjectExplorer::DeployConfigurationWidget *configurationWidget() const; - - char installationDrive() const; - void setInstallationDrive(char drive); - - bool silentInstall() const; - void setSilentInstall(bool silent); - - void setAvailableDeviceDrives(QList<DeviceDrive> drives); - const QList<DeviceDrive> &availableDeviceDrives() const; - - QStringList signedPackages() const; - QStringList packageFileNamesWithTargetInfo() const; - QStringList packageTemplateFileNames() const; - QStringList appPackageTemplateFileNames() const; - - bool runSmartInstaller() const; - SymbianIDevice::ConstPtr device() const; - - QVariantMap toMap() const; - -signals: - void deviceChanged(); - void targetInformationChanged(); - void availableDeviceDrivesChanged(); - void installationDriveChanged(); - -private slots: - void slotTargetInformationChanged(Qt4ProjectManager::Qt4ProFileNode*,bool success, bool parseInProgress); - void updateActiveBuildConfiguration(ProjectExplorer::BuildConfiguration *buildConfiguration); - void updateActiveRunConfiguration(ProjectExplorer::RunConfiguration *runConfiguration); - -protected: - S60DeployConfiguration(ProjectExplorer::Target *parent, S60DeployConfiguration *source); - virtual bool fromMap(const QVariantMap &map); - QString defaultDisplayName() const; - -private: - void ctor(); - bool isSigned() const; - QString symbianTarget() const; - QString createPackageName(const QString &baseName) const; - bool isDebug() const; - bool isStaticLibrary(const Qt4ProFileNode &projectNode) const; - bool isApplication(const Qt4ProFileNode &projectNode) const; - bool hasSisPackage(const Qt4ProFileNode &projectNode) const; - -private: - ProjectExplorer::BuildConfiguration *m_activeBuildConfiguration; - Core::Id m_deviceId; - - char m_installationDrive; - bool m_silentInstall; - QList<DeviceDrive> m_availableDeviceDrives; -}; - -class S60DeployConfigurationFactory : public ProjectExplorer::DeployConfigurationFactory -{ - Q_OBJECT - -public: - explicit S60DeployConfigurationFactory(QObject *parent = 0); - ~S60DeployConfigurationFactory(); - - bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; - ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id); - bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; - ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map); - bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source) const; - ProjectExplorer::DeployConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source); - - QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const; - // used to translate the ids to names to display to the user - QString displayNameForId(const Core::Id id) const; -}; - -} // namespace Qt4ProjectManager - -#endif // S60DEPLOYCONFIGURATION_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60deployconfigurationwidget.cpp b/src/plugins/qt4projectmanager/qt-s60/s60deployconfigurationwidget.cpp deleted file mode 100644 index 7f5c2139498..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60deployconfigurationwidget.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60deployconfigurationwidget.h" -#include "s60deployconfiguration.h" -#include "s60devicerunconfiguration.h" -#include "symbianidevice.h" - -#include <symbianutils/symbiandevicemanager.h> -#include <codadevice.h> - -#include <coreplugin/helpmanager.h> - -#include "codaruncontrol.h" - -#include <utils/detailswidget.h> -#include <utils/ipaddresslineedit.h> -#include <utils/qtcassert.h> -#include <utils/pathchooser.h> - -#include <QDir> -#include <QTimer> -#include <QLabel> -#include <QLineEdit> -#include <QComboBox> -#include <QVBoxLayout> -#include <QHBoxLayout> -#include <QFormLayout> -#include <QToolButton> -#include <QStyle> -#include <QApplication> -#include <QSpacerItem> -#include <QMessageBox> -#include <QCheckBox> -#include <QGroupBox> -#include <QRadioButton> -#include <QValidator> - -#include <QTcpSocket> - -Q_DECLARE_METATYPE(SymbianUtils::SymbianDevice) - -static const char STARTING_DRIVE_LETTER = 'C'; -static const char LAST_DRIVE_LETTER = 'Z'; - -static QString formatDriveText(const Qt4ProjectManager::S60DeployConfiguration::DeviceDrive &drive) -{ - const QChar driveLetter = QChar(QLatin1Char(drive.first)).toUpper(); - if (drive.second <= 0) - return driveLetter + QLatin1Char(':'); - if (drive.second >= 1024) - return QString::fromLatin1("%1:%2 MB").arg(driveLetter).arg(drive.second); - return QString::fromLatin1("%1:%2 kB").arg(driveLetter).arg(drive.second); -} - -namespace Qt4ProjectManager { -namespace Internal { - - -S60DeployConfigurationWidget::S60DeployConfigurationWidget(QWidget *parent) - : ProjectExplorer::DeployConfigurationWidget(parent), - m_detailsWidget(new Utils::DetailsWidget), - m_sisFileLabel(new QLabel), - m_deviceInfoButton(new QToolButton), - m_installationDriveCombo(new QComboBox()), - m_silentInstallCheckBox(new QCheckBox(tr("Silent installation"))) -{ -} - -S60DeployConfigurationWidget::~S60DeployConfigurationWidget() -{ -} - -void S60DeployConfigurationWidget::init(ProjectExplorer::DeployConfiguration *dc) -{ - m_deployConfiguration = qobject_cast<S60DeployConfiguration *>(dc); - - m_detailsWidget->setState(Utils::DetailsWidget::NoSummary); - - QVBoxLayout *mainBoxLayout = new QVBoxLayout(); - mainBoxLayout->setMargin(0); - setLayout(mainBoxLayout); - mainBoxLayout->addWidget(m_detailsWidget); - QWidget *detailsContainer = new QWidget; - m_detailsWidget->setWidget(detailsContainer); - - QVBoxLayout *detailsBoxLayout = new QVBoxLayout(); - detailsBoxLayout->setMargin(0); - detailsContainer->setLayout(detailsBoxLayout); - - QFormLayout *formLayout = new QFormLayout(); - formLayout->setMargin(0); - detailsBoxLayout->addLayout(formLayout); - formLayout->addRow(tr("Installation file:"), m_sisFileLabel); - - // Installation Drive control - updateInstallationDrives(); - - QHBoxLayout *installationBoxLayout = new QHBoxLayout(); - m_installationDriveCombo->setSizeAdjustPolicy(QComboBox::AdjustToContents); - connect(m_installationDriveCombo, SIGNAL(activated(int)), this, SLOT(setInstallationDrive(int))); - QHBoxLayout *installationDriveHBoxLayout = new QHBoxLayout; - installationDriveHBoxLayout->addWidget(m_installationDriveCombo); - installationBoxLayout->addLayout(installationDriveHBoxLayout); - - // Non-silent installs are a fallback if one wants to override missing dependencies. - m_silentInstallCheckBox->setChecked(m_deployConfiguration->silentInstall()); - m_silentInstallCheckBox->setToolTip(tr("Silent installation is an installation mode " - "that does not require user's intervention. " - "In case it fails the non silent installation is launched.")); - connect(m_silentInstallCheckBox, SIGNAL(stateChanged(int)), this, SLOT(silentInstallChanged(int))); - installationBoxLayout->addWidget(m_silentInstallCheckBox); - installationBoxLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored)); - formLayout->addRow(tr("Installation drive:"), installationBoxLayout); - - updateTargetInformation(); - connect(m_deployConfiguration, SIGNAL(targetInformationChanged()), - this, SLOT(updateTargetInformation())); - connect(m_deployConfiguration, SIGNAL(availableDeviceDrivesChanged()), - this, SLOT(updateInstallationDrives())); -} - -void S60DeployConfigurationWidget::updateInstallationDrives() -{ - m_installationDriveCombo->clear(); - const QList<S60DeployConfiguration::DeviceDrive> &availableDrives(m_deployConfiguration->availableDeviceDrives()); - int index = 0; - char currentDrive = QChar::toUpper(static_cast<ushort>(m_deployConfiguration->installationDrive())); - if (availableDrives.isEmpty()) { - for (int i = STARTING_DRIVE_LETTER; i <= LAST_DRIVE_LETTER; ++i) { - const QChar qc = QLatin1Char(static_cast<char>(i)); - m_installationDriveCombo->addItem(qc + QLatin1Char(':'), QVariant(qc)); - } - index = currentDrive - STARTING_DRIVE_LETTER; - } else { - for (int i = 0; i < availableDrives.count(); ++i) { - const S60DeployConfiguration::DeviceDrive& drive(availableDrives.at(i)); - char driveLetter = QChar::toUpper(static_cast<ushort>(drive.first)); - m_installationDriveCombo->addItem(formatDriveText(drive), - QVariant(QChar(QLatin1Char(driveLetter)))); - if (currentDrive == driveLetter) - index = i; - } - } - QTC_ASSERT(index >= 0 && index <= m_installationDriveCombo->count(), return); - - m_installationDriveCombo->setCurrentIndex(index); - setInstallationDrive(index); -} - -void S60DeployConfigurationWidget::silentInstallChanged(int state) -{ - m_deployConfiguration->setSilentInstall(state == Qt::Checked); -} - -void S60DeployConfigurationWidget::updateTargetInformation() -{ - QString package; - for (int i = 0; i < m_deployConfiguration->signedPackages().count(); ++i) - package += m_deployConfiguration->signedPackages()[i] + QLatin1String("\n"); - if (!package.isEmpty()) - package.remove(package.length()-1, 1); - m_sisFileLabel->setText(QDir::toNativeSeparators(package)); -} - -void S60DeployConfigurationWidget::setInstallationDrive(int index) -{ - QTC_ASSERT(index >= 0, return); - QTC_ASSERT(index < m_installationDriveCombo->count(), return); - - QChar driveLetter(m_installationDriveCombo->itemData(index).toChar()); - m_deployConfiguration->setInstallationDrive(driveLetter.toAscii()); -} - -} // namespace Internal -} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-s60/s60deployconfigurationwidget.h b/src/plugins/qt4projectmanager/qt-s60/s60deployconfigurationwidget.h deleted file mode 100644 index 46d0336bb89..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60deployconfigurationwidget.h +++ /dev/null @@ -1,101 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60DEPLOYCONFIGURATIONWIDGET_H -#define S60DEPLOYCONFIGURATIONWIDGET_H - -#include <projectexplorer/deployconfiguration.h> - -#include <QWidget> -#include <QPointer> - -QT_BEGIN_NAMESPACE -class QLabel; -class QLineEdit; -class QComboBox; -class QToolButton; -class QCheckBox; -class QRadioButton; -QT_END_NAMESPACE - -namespace Utils { - class DetailsWidget; - class IpAddressLineEdit; -} - -namespace SymbianUtils { -class SymbianDevice; -} - -namespace Coda { - class CodaDevice; - class CodaEvent; - struct CodaCommandResult; -} - -namespace Qt4ProjectManager { - -class S60DeployConfiguration; - -namespace Internal { - -/* Configuration widget for S60 devices on serial ports that are - * provided by the SerialDeviceLister class. Has an info/test - * button connecting to the device and showing info. */ -class S60DeployConfigurationWidget : public ProjectExplorer::DeployConfigurationWidget -{ - Q_OBJECT -public: - explicit S60DeployConfigurationWidget(QWidget *parent = 0); - ~S60DeployConfigurationWidget(); - - void init(ProjectExplorer::DeployConfiguration *dc); - -private slots: - void updateTargetInformation(); - void updateInstallationDrives(); - void setInstallationDrive(int index); - void silentInstallChanged(int); - -private: - void setDeviceInfoLabel(const QString &message, bool isError = false); - - S60DeployConfiguration *m_deployConfiguration; - Utils::DetailsWidget *m_detailsWidget; - QLabel *m_sisFileLabel; - QToolButton *m_deviceInfoButton; - QComboBox *m_installationDriveCombo; - QCheckBox *m_silentInstallCheckBox; -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // S60DEPLOYCONFIGURATIONWIDGET_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp b/src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp deleted file mode 100644 index 00b24f3a9bf..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp +++ /dev/null @@ -1,745 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60deploystep.h" - -#include "qt4buildconfiguration.h" -#include "qt4project.h" -#include "s60deployconfiguration.h" -#include "s60devicerunconfiguration.h" -#include "symbianidevice.h" -#include "symbianidevicefactory.h" -#include "codadevice.h" -#include "codaruncontrol.h" - -#include <coreplugin/icore.h> -#include <projectexplorer/buildsteplist.h> -#include <projectexplorer/target.h> -#include <projectexplorer/profileinformation.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <qt4projectmanagerconstants.h> - -#include <symbianutils/symbiandevicemanager.h> -#include <utils/qtcassert.h> - -#include <QMessageBox> - -#include <QTimer> -#include <QDateTime> -#include <QDir> -#include <QEventLoop> -#include <QFile> -#include <QFileInfo> - -#include <QTcpSocket> - -using namespace ProjectExplorer; -using namespace Qt4ProjectManager::Internal; - -enum { debug = 0 }; - -static const quint64 DEFAULT_CHUNK_SIZE = 40000; - -namespace { -const char * const S60_DEPLOY_STEP_ID = "Qt4ProjectManager.S60DeployStep"; -} - -static inline bool ensureDeleteFile(const QString &fileName, QString *errorMessage) -{ - QFile file(fileName); - if (file.exists() && !file.remove()) { - *errorMessage = S60DeployStep::tr("Unable to remove existing file '%1': %2").arg(fileName, file.errorString()); - return false; - } - return true; -} - -static inline bool renameFile(const QString &sourceName, const QString &targetName, - QString *errorMessage) -{ - if (sourceName == targetName) - return true; - if (!ensureDeleteFile(targetName, errorMessage)) - return false; - QFile source(sourceName); - if (!source.rename(targetName)) { - *errorMessage = S60DeployStep::tr("Unable to rename file '%1' to '%2': %3") - .arg(sourceName, targetName, source.errorString()); - return false; - } - return true; -} - -// #pragma mark -- S60DeployStep - -S60DeployStep::S60DeployStep(ProjectExplorer::BuildStepList *bc, - S60DeployStep *bs): - BuildStep(bc, bs), m_timer(0), - m_timeoutTimer(new QTimer(this)), - m_eventLoop(0), - m_state(StateUninit), - m_putWriteOk(false), - m_putLastChunkSize(0), - m_putChunkSize(DEFAULT_CHUNK_SIZE), - m_currentFileIndex(0), - m_channel(bs->m_channel), - m_deployCanceled(false), - m_copyProgress(0) -{ - ctor(); -} - -S60DeployStep::S60DeployStep(ProjectExplorer::BuildStepList *bc): - BuildStep(bc, Core::Id(S60_DEPLOY_STEP_ID)), m_timer(0), - m_timeoutTimer(new QTimer(this)), - m_eventLoop(0), - m_state(StateUninit), - m_putWriteOk(false), - m_putLastChunkSize(0), - m_putChunkSize(DEFAULT_CHUNK_SIZE), - m_currentFileIndex(0), - m_channel(SymbianIDevice::CommunicationCodaSerialConnection), - m_deployCanceled(false), - m_copyProgress(0) -{ - ctor(); -} - -void S60DeployStep::ctor() -{ - //: Qt4 Deploystep display name - setDefaultDisplayName(tr("Deploy SIS Package")); - m_timeoutTimer->setSingleShot(true); - m_timeoutTimer->setInterval(10000); - connect(m_timeoutTimer, SIGNAL(timeout()), this, SLOT(timeout())); -} - -S60DeployStep::~S60DeployStep() -{ - delete m_timer; - delete m_eventLoop; -} - - -bool S60DeployStep::init() -{ - Qt4BuildConfiguration *bc = static_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration()); - S60DeployConfiguration *deployConfiguration = static_cast<S60DeployConfiguration *>(bc->target()->activeDeployConfiguration()); - if (!deployConfiguration) - return false; - - SymbianIDevice::ConstPtr dev = deployConfiguration->device(); - m_serialPortName = dev->serialPortName(); - m_serialPortFriendlyName = SymbianUtils::SymbianDeviceManager::instance()->friendlyNameForPort(m_serialPortName); - m_packageFileNamesWithTarget = deployConfiguration->packageFileNamesWithTargetInfo(); - m_signedPackages = deployConfiguration->signedPackages(); - m_installationDrive = deployConfiguration->installationDrive(); - m_silentInstall = deployConfiguration->silentInstall(); - m_channel = dev->communicationChannel(); - - if (m_signedPackages.isEmpty()) { - appendMessage(tr("No package has been found. Specify at least one installation package."), true); - return false; - } - - if (m_channel == SymbianIDevice::CommunicationCodaTcpConnection) { - m_address = dev->address(); - m_port = dev->port().toInt(); - } - return true; -} - -QVariantMap S60DeployStep::toMap() const -{ - return BuildStep::toMap(); -} - -bool S60DeployStep::fromMap(const QVariantMap &map) -{ - return BuildStep::fromMap(map); -} - -void S60DeployStep::appendMessage(const QString &error, bool isError) -{ - emit addOutput(error, isError?ProjectExplorer::BuildStep::ErrorMessageOutput: - ProjectExplorer::BuildStep::MessageOutput); -} - -void S60DeployStep::reportError(const QString &error) -{ - emit addOutput(error, ProjectExplorer::BuildStep::ErrorMessageOutput); - emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, - error, - Utils::FileName(), -1, - Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); - emit s60DeploymentFinished(false); -} - -bool S60DeployStep::processPackageName(QString &errorMessage) -{ - for (int i = 0; i < m_signedPackages.count(); ++i) { - QFileInfo packageInfo(m_signedPackages.at(i)); - // support for 4.6.1 and pre, where make sis creates 'targetname_armX_udeb.sis' instead of 'targetname.sis' - QFileInfo packageWithTargetInfo(m_packageFileNamesWithTarget.at(i)); - // does the 4.6.1 version exist? - if (packageWithTargetInfo.exists() && packageWithTargetInfo.isFile()) { - // is the 4.6.1 version newer? (to guard against behavior change Qt Creator 1.3 --> 2.0) - if (!packageInfo.exists() || packageInfo.lastModified() < packageWithTargetInfo.lastModified()) { //TODO change the QtCore - // the 'targetname_armX_udeb.sis' crap exists and is new, rename it - appendMessage(tr("Renaming new package '%1' to '%2'") - .arg(QDir::toNativeSeparators(m_packageFileNamesWithTarget.at(i)), - QDir::toNativeSeparators(m_signedPackages.at(i))), false); - return renameFile(m_packageFileNamesWithTarget.at(i), m_signedPackages.at(i), &errorMessage); - } else { - // the 'targetname_armX_udeb.sis' crap exists but is old, remove it - appendMessage(tr("Removing old package '%1'") - .arg(QDir::toNativeSeparators(m_packageFileNamesWithTarget.at(i))), - false); - ensureDeleteFile(m_packageFileNamesWithTarget.at(i), &errorMessage); - } - } - if (!packageInfo.exists() || !packageInfo.isFile()) { - errorMessage = tr("'%1': Package file not found").arg(m_signedPackages.at(i)); - return false; - } - } - return true; -} - -void S60DeployStep::start() -{ - QString errorMessage; - - bool serialConnection = m_channel == SymbianIDevice::CommunicationCodaSerialConnection; - - if (serialConnection && m_serialPortName.isEmpty()) { - errorMessage = tr("No device is connected. Connect a device and try again."); - reportError(errorMessage); - return; - } - QTC_ASSERT(!m_codaDevice.data(), return); - if (m_address.isEmpty() && !serialConnection) { - errorMessage = tr("No address for a device has been defined. Define an address and try again."); - reportError(errorMessage); - return; - } - - // make sure we have the right name of the sis package - if (processPackageName(errorMessage)) - startDeployment(); - else { - errorMessage = tr("Failed to find package %1").arg(errorMessage); - reportError(errorMessage); - stop(); - } -} - -void S60DeployStep::stop() -{ - if (m_codaDevice) { - switch (state()) { - case StateSendingData: - closeFiles(); - break; - default: - break; //should also stop the package installation, but CODA does not support it yet - } - disconnect(m_codaDevice.data(), 0, this, 0); - SymbianUtils::SymbianDeviceManager::instance()->releaseCodaDevice(m_codaDevice); - } - setState(StateUninit); - emit s60DeploymentFinished(false); -} - -void S60DeployStep::setupConnections() -{ - if (m_channel == SymbianIDevice::CommunicationCodaSerialConnection) - connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(deviceRemoved(SymbianUtils::SymbianDevice)), - this, SLOT(deviceRemoved(SymbianUtils::SymbianDevice))); - - connect(m_codaDevice.data(), SIGNAL(error(QString)), this, SLOT(slotError(QString))); - connect(m_codaDevice.data(), SIGNAL(logMessage(QString)), this, SLOT(slotCodaLogMessage(QString))); - connect(m_codaDevice.data(), SIGNAL(codaEvent(Coda::CodaEvent)), this, SLOT(slotCodaEvent(Coda::CodaEvent)), Qt::DirectConnection); - connect(m_codaDevice.data(), SIGNAL(serialPong(QString)), this, SLOT(slotSerialPong(QString))); - connect(this, SIGNAL(manualInstallation()), this, SLOT(showManualInstallationInfo())); -} - -void S60DeployStep::startDeployment() -{ - QTC_ASSERT(!m_codaDevice.data(), return); - - // We need to defer setupConnections() in the case of CommunicationCodaSerialConnection - //setupConnections(); - - if (m_channel == SymbianIDevice::CommunicationCodaSerialConnection) { - appendMessage(tr("Deploying application to '%1'...").arg(m_serialPortFriendlyName), false); - m_codaDevice = SymbianUtils::SymbianDeviceManager::instance()->getCodaDevice(m_serialPortName); - bool ok = m_codaDevice && m_codaDevice->device()->isOpen(); - if (!ok) { - QString deviceError = tr("No such port"); - if (m_codaDevice) - deviceError = m_codaDevice->device()->errorString(); - reportError(tr("Could not open serial device: %1").arg(deviceError)); - stop(); - return; - } - setupConnections(); - setState(StateConnecting); - m_codaDevice->sendSerialPing(false); - } else { - m_codaDevice = QSharedPointer<Coda::CodaDevice>(new Coda::CodaDevice); - setupConnections(); - const QSharedPointer<QTcpSocket> codaSocket(new QTcpSocket); - m_codaDevice->setDevice(codaSocket); - codaSocket->connectToHost(m_address, m_port); - setState(StateConnecting); - appendMessage(tr("Connecting to %1:%2...").arg(m_address).arg(m_port), false); - } - QTimer::singleShot(4000, this, SLOT(checkForTimeout())); -} - -void S60DeployStep::run(QFutureInterface<bool> &fi) -{ - m_futureInterface = &fi; - m_deployResult = true; - m_deployCanceled = false; - disconnect(this); - - m_futureInterface->setProgressRange(0, 100*m_signedPackages.count()); - - connect(this, SIGNAL(s60DeploymentFinished(bool)), this, SLOT(deploymentFinished(bool))); - connect(this, SIGNAL(finishNow(bool)), this, SLOT(deploymentFinished(bool)), Qt::DirectConnection); - connect(this, SIGNAL(allFilesSent()), this, SLOT(startInstalling()), Qt::DirectConnection); - connect(this, SIGNAL(allFilesInstalled()), this, SIGNAL(s60DeploymentFinished()), Qt::DirectConnection); - connect(this, SIGNAL(copyProgressChanged(int)), this, SLOT(updateProgress(int))); - - start(); - m_timer = new QTimer(); - connect(m_timer, SIGNAL(timeout()), this, SLOT(checkForCancel()), Qt::DirectConnection); - m_timer->start(500); - m_eventLoop = new QEventLoop(); - m_eventLoop->exec(); - m_timer->stop(); - delete m_timer; - m_timer = 0; - - if (m_codaDevice) { - disconnect(m_codaDevice.data(), 0, this, 0); - SymbianUtils::SymbianDeviceManager::instance()->releaseCodaDevice(m_codaDevice); - } - - delete m_eventLoop; - m_eventLoop = 0; - fi.reportResult(m_deployResult); - m_futureInterface = 0; -} - -void S60DeployStep::slotWaitingForCodaClosed(int result) -{ - if (result == QMessageBox::Cancel) - m_deployCanceled = true; -} - -void S60DeployStep::slotError(const QString &error) -{ - reportError(tr("Error: %1").arg(error)); -} - -void S60DeployStep::slotCodaLogMessage(const QString &log) -{ - if (debug > 1) - qDebug() << "CODA log:" << log; -} - -void S60DeployStep::slotSerialPong(const QString &message) -{ - if (debug) - qDebug() << "CODA serial pong:" << message; - handleConnected(); -} - -void S60DeployStep::slotCodaEvent(const Coda::CodaEvent &event) -{ - if (debug) - qDebug() << "CODA event:" << "Type:" << event.type() << "Message:" << event.toString(); - - switch (event.type()) { - case Coda::CodaEvent::LocatorHello: - handleConnected(); - break; - default: - if (debug) - qDebug() << "Unhandled event:" << "Type:" << event.type() << "Message:" << event.toString(); - break; - } -} - -void S60DeployStep::handleConnected() -{ - if (state() >= StateConnected) - return; - setState(StateConnected); - emit codaConnected(); - startTransferring(); -} - -void S60DeployStep::initFileSending() -{ - QTC_ASSERT(m_currentFileIndex < m_signedPackages.count(), return); - QTC_ASSERT(m_currentFileIndex >= 0, return); - QTC_ASSERT(m_codaDevice, return); - - const unsigned flags = - Coda::CodaDevice::FileSystem_TCF_O_WRITE - |Coda::CodaDevice::FileSystem_TCF_O_CREAT - |Coda::CodaDevice::FileSystem_TCF_O_TRUNC; - m_putWriteOk = false; - - QString packageName(QFileInfo(m_signedPackages.at(m_currentFileIndex)).fileName()); - QString remoteFileLocation = QString::fromLatin1("%1:\\Data\\%2").arg(m_installationDrive).arg(packageName); - m_codaDevice->sendFileSystemOpenCommand(Coda::CodaCallback(this, &S60DeployStep::handleFileSystemOpen), - remoteFileLocation.toAscii(), flags); - appendMessage(tr("Copying \"%1\"...").arg(packageName), false); - m_timeoutTimer->start(); -} - -void S60DeployStep::initFileInstallation() -{ - QTC_ASSERT(m_currentFileIndex < m_signedPackages.count(), return); - QTC_ASSERT(m_currentFileIndex >= 0, return); - - if (!m_codaDevice) - return; - - QString packageName(QFileInfo(m_signedPackages.at(m_currentFileIndex)).fileName()); - QString remoteFileLocation = QString::fromLatin1("%1:\\Data\\%2").arg(m_installationDrive).arg(packageName); - if (m_silentInstall) { - m_codaDevice->sendSymbianInstallSilentInstallCommand(Coda::CodaCallback(this, &S60DeployStep::handleSymbianInstall), - remoteFileLocation.toAscii(), QString::fromLatin1("%1:").arg(m_installationDrive).toAscii()); - appendMessage(tr("Installing package \"%1\" on drive %2:...").arg(packageName).arg(m_installationDrive), false); - } else { - m_codaDevice->sendSymbianInstallUIInstallCommand(Coda::CodaCallback(this, &S60DeployStep::handleSymbianInstall), - remoteFileLocation.toAscii()); - appendMessage(tr("Continue the installation on your device."), false); - emit manualInstallation(); - } -} - -void S60DeployStep::startTransferring() -{ - m_currentFileIndex = 0; - initFileSending(); - setState(StateSendingData); -} - -void S60DeployStep::startInstalling() -{ - m_currentFileIndex = 0; - initFileInstallation(); - setState(StateInstalling); -} - -void S60DeployStep::handleFileSystemOpen(const Coda::CodaCommandResult &result) -{ - if (result.type != Coda::CodaCommandResult::SuccessReply) { - reportError(tr("Could not open remote file: %1").arg(result.errorString())); - return; - } - - if (result.values.size() < 1 || result.values.at(0).data().isEmpty()) { - reportError(tr("Internal error: No filehandle obtained")); - return; - } - - m_remoteFileHandle = result.values.at(0).data(); - - const QString fileName = m_signedPackages.at(m_currentFileIndex); - m_putFile.reset(new QFile(fileName)); - if (!m_putFile->open(QIODevice::ReadOnly)) { // Should not fail, was checked before - reportError(tr("Could not open local file %1: %2").arg(fileName, m_putFile->errorString())); - return; - } - putSendNextChunk(); -} - -void S60DeployStep::handleSymbianInstall(const Coda::CodaCommandResult &result) -{ - if (result.type == Coda::CodaCommandResult::SuccessReply) { - appendMessage(tr("Installation has finished"), false); - if (++m_currentFileIndex >= m_signedPackages.count()) { - setState(StateFinished); - emit allFilesInstalled(); - } else - initFileInstallation(); - } else { - reportError(tr("Installation failed: %1; " - "see %2 for descriptions of the error codes") - .arg(result.errorString(), - QLatin1String("http://www.developer.nokia.com/Community/Wiki/Symbian_OS_Error_Codes"))); - } -} - -void S60DeployStep::putSendNextChunk() -{ - if (!m_codaDevice) - return; - QTC_ASSERT(m_putFile, return); - - // Read and send off next chunk - const quint64 pos = m_putFile->pos(); - const QByteArray data = m_putFile->read(m_putChunkSize); - const quint64 size = m_putFile->size(); - if (data.isEmpty()) { - m_putWriteOk = true; - closeFiles(); - setCopyProgress(100); - } else { - m_putLastChunkSize = data.size(); - if (debug > 1) - qDebug("Writing %llu bytes to remote file '%s' at %llu\n", - m_putLastChunkSize, - m_remoteFileHandle.constData(), pos); - m_codaDevice->sendFileSystemWriteCommand(Coda::CodaCallback(this, &S60DeployStep::handleFileSystemWrite), - m_remoteFileHandle, data, unsigned(pos)); - setCopyProgress((100*(m_putLastChunkSize+pos))/size); - m_timeoutTimer->start(); - } -} - -void S60DeployStep::closeFiles() -{ - m_putFile.reset(); - QTC_ASSERT(m_codaDevice, return); - - emit addOutput(QLatin1String("\n"), ProjectExplorer::BuildStep::MessageOutput); - m_codaDevice->sendFileSystemCloseCommand(Coda::CodaCallback(this, &S60DeployStep::handleFileSystemClose), - m_remoteFileHandle); -} - -void S60DeployStep::handleFileSystemWrite(const Coda::CodaCommandResult &result) -{ - m_timeoutTimer->stop(); - // Close remote file even if copy fails - m_putWriteOk = result; - if (!m_putWriteOk) { - QString packageName(QFileInfo(m_signedPackages.at(m_currentFileIndex)).fileName()); - reportError(tr("Could not write to file %1 on device: %2").arg(packageName).arg(result.errorString())); - } - - if (!m_putWriteOk || m_putLastChunkSize < m_putChunkSize) { - closeFiles(); - } else { - putSendNextChunk(); - } -} - -void S60DeployStep::handleFileSystemClose(const Coda::CodaCommandResult &result) -{ - if (result.type == Coda::CodaCommandResult::SuccessReply) { - if (debug) - qDebug("File closed.\n"); - if (++m_currentFileIndex >= m_signedPackages.count()) - emit allFilesSent(); - else - initFileSending(); - } else { - reportError(tr("Failed to close the remote file: %1").arg(result.toString())); - } -} - -void S60DeployStep::checkForTimeout() -{ - if (state() != StateConnecting) - return; - QMessageBox *mb = CodaRunControl::createCodaWaitingMessageBox(Core::ICore::mainWindow()); - connect(this, SIGNAL(codaConnected()), mb, SLOT(close())); - connect(this, SIGNAL(s60DeploymentFinished()), mb, SLOT(close())); - connect(this, SIGNAL(finishNow()), mb, SLOT(close())); - connect(mb, SIGNAL(finished(int)), this, SLOT(slotWaitingForCodaClosed(int))); - mb->open(); -} - -void S60DeployStep::showManualInstallationInfo() -{ - const QString title = tr("Installation"); - const QString text = tr("Continue the installation on your device."); - QMessageBox *mb = new QMessageBox(QMessageBox::Information, title, text, - QMessageBox::Ok, Core::ICore::mainWindow()); - connect(this, SIGNAL(allFilesInstalled()), mb, SLOT(close())); - connect(this, SIGNAL(s60DeploymentFinished()), mb, SLOT(close())); - connect(this, SIGNAL(finishNow()), mb, SLOT(close())); - mb->open(); -} - -void S60DeployStep::checkForCancel() -{ - if ((m_futureInterface->isCanceled() || m_deployCanceled) && m_timer->isActive()) { - m_timer->stop(); - stop(); - QString canceledText(tr("Deployment has been cancelled.")); - appendMessage(canceledText, true); - emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, - canceledText, - Utils::FileName(), -1, - Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); - emit finishNow(false); - } -} - -void S60DeployStep::deploymentFinished(bool success) -{ - m_deployResult = success; - if(m_deployResult && m_futureInterface) - m_futureInterface->setProgressValue(m_futureInterface->progressMaximum()); - if (m_eventLoop) - m_eventLoop->exit(); -} - -void S60DeployStep::deviceRemoved(const SymbianUtils::SymbianDevice &device) -{ - if (device.portName() == m_serialPortName) - reportError(tr("The device '%1' has been disconnected").arg(device.friendlyName())); -} - -void S60DeployStep::setCopyProgress(int progress) -{ - if (progress < 0) - progress = 0; - else if (progress > 100) - progress = 100; - if (copyProgress() == progress) - return; - m_copyProgress = progress; - emit addOutput(QLatin1String("."), ProjectExplorer::BuildStep::MessageOutput, DontAppendNewline); - emit copyProgressChanged(m_copyProgress); -} - -int S60DeployStep::copyProgress() const -{ - return m_copyProgress; -} - -void S60DeployStep::updateProgress(int progress) -{ - //This would show the percentage on the Compile output - //appendMessage(tr("Copy percentage: %1%").arg((m_currentFileIndex*100 + progress) /m_signedPackages.count()), false); - int copyProgress = ((m_currentFileIndex*100 + progress) /m_signedPackages.count()); - int entireProgress = copyProgress * 0.8; //the copy progress is just 80% of the whole deployment progress - m_futureInterface->setProgressValueAndText(entireProgress, tr("Copy progress: %1%").arg(copyProgress)); -} - -void S60DeployStep::timeout() -{ - reportError(tr("A timeout while deploying has occurred. CODA might not be responding. Try reconnecting the device.")); -} - -BuildStepConfigWidget *S60DeployStep::createConfigWidget() -{ - return new SimpleBuildStepConfigWidget(this); -} - -// #pragma mark -- S60DeployStepFactory - -S60DeployStepFactory::S60DeployStepFactory(QObject *parent) : - ProjectExplorer::IBuildStepFactory(parent) -{ -} - -S60DeployStepFactory::~S60DeployStepFactory() -{ -} - -bool S60DeployStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const -{ - return canHandle(parent) && id == S60_DEPLOY_STEP_ID; -} - -ProjectExplorer::BuildStep *S60DeployStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id) -{ - if (!canCreate(parent, id)) - return 0; - return new S60DeployStep(parent); -} - -bool S60DeployStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const -{ - if (!canCreate(parent, source->id())) - return false; - if (!qobject_cast<S60DeployStep *>(source)) - return false; - return true; -} - -ProjectExplorer::BuildStep *S60DeployStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) -{ - if (!canClone(parent, source)) - return 0; - return new S60DeployStep(parent, static_cast<S60DeployStep *>(source)); -} - -bool S60DeployStepFactory::canHandle(BuildStepList *parent) const -{ - if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY) - return false; - Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(parent->target()->profile()); - if (deviceType != SymbianIDeviceFactory::deviceType()) - return false; - return qobject_cast<Qt4Project *>(parent->target()->project()); -} - -bool S60DeployStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const -{ - return canCreate(parent, ProjectExplorer::idFromMap(map)); -} - -ProjectExplorer::BuildStep *S60DeployStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) -{ - if (!canRestore(parent, map)) - return 0; - S60DeployStep *bs = new S60DeployStep(parent); - if (bs->fromMap(map)) - return bs; - delete bs; - return 0; -} - -QList<Core::Id> S60DeployStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const -{ - if (!canHandle(parent)) - return QList<Core::Id>(); - return QList<Core::Id>() << Core::Id(S60_DEPLOY_STEP_ID); -} - -QString S60DeployStepFactory::displayNameForId(const Core::Id id) const -{ - if (id == S60_DEPLOY_STEP_ID) - return tr("Deploy SIS Package"); - return QString(); -} diff --git a/src/plugins/qt4projectmanager/qt-s60/s60deploystep.h b/src/plugins/qt4projectmanager/qt-s60/s60deploystep.h deleted file mode 100644 index 58e03fe4913..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60deploystep.h +++ /dev/null @@ -1,213 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60DeployStep_H -#define S60DeployStep_H - -#include <projectexplorer/buildstep.h> - -#include <QString> - -QT_FORWARD_DECLARE_CLASS(QEventLoop) -QT_FORWARD_DECLARE_CLASS(QFile) - -namespace SymbianUtils { -class SymbianDevice; -} - -namespace Coda { - struct CodaCommandResult; - class CodaDevice; - class CodaEvent; -} - -namespace ProjectExplorer { -class IOutputParser; -} - -namespace Qt4ProjectManager { - -class S60DeviceRunConfiguration; - -namespace Internal { - -class BuildConfiguration; -struct CommunicationChannel; - -class S60DeployStepFactory : public ProjectExplorer::IBuildStepFactory -{ - Q_OBJECT -public: - explicit S60DeployStepFactory(QObject *parent = 0); - virtual ~S60DeployStepFactory(); - - // used to show the list of possible additons to a target, returns a list of types - QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const; - // used to translate the types to names to display to the user - QString displayNameForId(const Core::Id id) const; - - bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const; - ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id); - // used to recreate the runConfigurations when restoring settings - bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const; - ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map); - bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const; - ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product); - - bool canHandle(ProjectExplorer::BuildStepList *parent) const; -}; - -class S60DeployStep : public ProjectExplorer::BuildStep -{ - Q_OBJECT -public: - friend class S60DeployStepFactory; - - explicit S60DeployStep(ProjectExplorer::BuildStepList *parent); - - virtual ~S60DeployStep(); - - virtual bool init(); - virtual void run(QFutureInterface<bool> &fi); - virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); - - virtual QVariantMap toMap() const; - -protected: - virtual bool fromMap(const QVariantMap &map); - -protected slots: - void deviceRemoved(const SymbianUtils::SymbianDevice &); - -private slots: - void checkForCancel(); - void checkForTimeout(); - void timeout(); - - void slotError(const QString &error); - void slotCodaLogMessage(const QString &log); - void slotSerialPong(const QString &message); - void slotCodaEvent(const Coda::CodaEvent &event); - - void startInstalling(); - void startTransferring(); - - void deploymentFinished(bool success); - void slotWaitingForCodaClosed(int result); - void showManualInstallationInfo(); - - void setCopyProgress(int progress); - - void updateProgress(int progress); - -signals: - void s60DeploymentFinished(bool success = true); - void finishNow(bool success = true); - - void allFilesSent(); - void allFilesInstalled(); - - void codaConnected(); - - void manualInstallation(); - void copyProgressChanged(int progress); - -private: - S60DeployStep(ProjectExplorer::BuildStepList *parent, - S60DeployStep *bs); - void ctor(); - - void start(); - void stop(); - void startDeployment(); - bool processPackageName(QString &errorMessage); - void setupConnections(); - void appendMessage(const QString &error, bool isError); - void reportError(const QString &error); - - void handleConnected(); - void handleSymbianInstall(const Coda::CodaCommandResult &result); - void handleFileSystemOpen(const Coda::CodaCommandResult &result); - void handleFileSystemWrite(const Coda::CodaCommandResult &result); - void closeFiles(); - void putSendNextChunk(); - void handleFileSystemClose(const Coda::CodaCommandResult &result); - - void initFileSending(); - void initFileInstallation(); - int copyProgress() const; - - enum State { - StateUninit, - StateConnecting, - StateConnected, - StateSendingData, - StateInstalling, - StateFinished - }; - - inline void setState(State state) { m_state = state; } - inline State state() { return m_state; } - - QString m_serialPortName; - QString m_serialPortFriendlyName; - QStringList m_packageFileNamesWithTarget; // Support for 4.6.1 - QStringList m_signedPackages; - QString m_address; - unsigned short m_port; - - QTimer *m_timer; - QTimer* m_timeoutTimer; - - QFutureInterface<bool> *m_futureInterface; //not owned - - QSharedPointer<Coda::CodaDevice> m_codaDevice; - - QEventLoop *m_eventLoop; - bool m_deployResult; - char m_installationDrive; - bool m_silentInstall; - - State m_state; - bool m_putWriteOk; - QScopedPointer<QFile> m_putFile; - quint64 m_putLastChunkSize; - QByteArray m_remoteFileHandle; - quint64 m_putChunkSize; - int m_currentFileIndex; - int m_channel; - volatile bool m_deployCanceled; - int m_copyProgress; -}; - -} // Internal -} // Qt4ProjectManager - -#endif // S60DeployStep_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicedebugruncontrol.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicedebugruncontrol.cpp deleted file mode 100644 index ebffb5b73ab..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicedebugruncontrol.cpp +++ /dev/null @@ -1,247 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60devicedebugruncontrol.h" - -#include "codaruncontrol.h" -#include "s60deployconfiguration.h" -#include "s60devicerunconfiguration.h" -#include "symbianidevice.h" - -#include <coreplugin/icore.h> -#include <debugger/debuggerengine.h> -#include <debugger/debuggerprofileinformation.h> -#include <debugger/debuggerstartparameters.h> -#include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/profile.h> -#include <projectexplorer/profileinformation.h> -#include <projectexplorer/project.h> -#include <projectexplorer/target.h> -#include <utils/qtcassert.h> - -#include <QFileInfo> - -using namespace ProjectExplorer; -using namespace Qt4ProjectManager::Internal; -using namespace Qt4ProjectManager; - -// Return symbol file which should co-exist with the executable. -// location in debug builds. This can be 'foo.sym' (ABLD) or 'foo.exe.sym' (Raptor) -static inline QString symbolFileFromExecutable(const QString &executable) -{ - // 'foo.exe.sym' (Raptor) - const QFileInfo raptorSymFi(executable + QLatin1String(".sym")); - if (raptorSymFi.isFile()) - return raptorSymFi.absoluteFilePath(); - // 'foo.sym' (ABLD) - const int lastDotPos = executable.lastIndexOf(QLatin1Char('.')); - if (lastDotPos != -1) { - const QString symbolFileName = executable.mid(0, lastDotPos) + QLatin1String(".sym"); - const QFileInfo symbolFileNameFi(symbolFileName); - if (symbolFileNameFi.isFile()) - return symbolFileNameFi.absoluteFilePath(); - } - return QString(); -} - -// Create start parameters from run configuration -static Debugger::DebuggerStartParameters s60DebuggerStartParams(const S60DeviceRunConfiguration *rc) -{ - Debugger::DebuggerStartParameters sp; - QTC_ASSERT(rc, return sp); - - const S60DeployConfiguration *activeDeployConf = - qobject_cast<S60DeployConfiguration *>(rc->target()->activeDeployConfiguration()); - QTC_ASSERT(activeDeployConf, return sp); - - DebuggerRunConfigurationAspect *debuggerAspect = rc->debuggerAspect(); - - const QString debugFileName = QString::fromLatin1("%1:\\sys\\bin\\%2.exe") - .arg(activeDeployConf->installationDrive()).arg(rc->targetName()); - - Profile *profile = rc->target()->profile(); - sp.sysRoot = SysRootProfileInformation::sysRoot(profile).toString(); - sp.debuggerCommand = Debugger::DebuggerProfileInformation::debuggerCommand(profile).toString(); - if (ToolChain *tc = ToolChainProfileInformation::toolChain(profile)) - sp.toolChainAbi = tc->targetAbi(); - SymbianIDevice::ConstPtr dev = activeDeployConf->device(); - sp.remoteChannel = dev->serialPortName(); - sp.processArgs = rc->commandLineArguments(); - if (debuggerAspect->useQmlDebugger() && !debuggerAspect->useCppDebugger()) { - sp.remoteSetupNeeded = true; - sp.startMode = Debugger::AttachToRemoteServer; - } else { - sp.startMode = Debugger::StartInternal; - } - - sp.executable = debugFileName; - sp.executableUid = rc->executableUid(); - sp.serverAddress = dev->address(); - sp.serverPort = dev->port().toInt(); - sp.displayName = rc->displayName(); - sp.qmlServerAddress = dev->address(); - sp.qmlServerPort = debuggerAspect->qmlDebugServerPort(); - if (debuggerAspect->useQmlDebugger()) { - sp.languages |= Debugger::QmlLanguage; - QString qmlArgs = rc->qmlCommandLineArguments(); - if (sp.processArgs.length()) - sp.processArgs.prepend(QLatin1Char(' ')); - sp.processArgs.prepend(qmlArgs); - } - if (debuggerAspect->useCppDebugger()) - sp.languages |= Debugger::CppLanguage; - - sp.communicationChannel = dev->communicationChannel() == SymbianIDevice::CommunicationCodaTcpConnection? - Debugger::DebuggerStartParameters::CommunicationChannelTcpIp: - Debugger::DebuggerStartParameters::CommunicationChannelUsb; - - if (const ProjectExplorer::Project *project = rc->target()->project()) { - sp.projectSourceDirectory = project->projectDirectory(); - if (const ProjectExplorer::BuildConfiguration *buildConfig = rc->target()->activeBuildConfiguration()) { - sp.projectBuildDirectory = buildConfig->buildDirectory(); - } - sp.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles); - } - - QTC_ASSERT(sp.executableUid, return sp); - - // Prefer the '*.sym' file over the '.exe', which should exist at the same - // location in debug builds. This can be 'foo.exe' (ABLD) or 'foo.exe.sym' (Raptor) - sp.symbolFileName = symbolFileFromExecutable(rc->localExecutableFileName()); - return sp; -} - -S60DeviceDebugRunControl::S60DeviceDebugRunControl(S60DeviceRunConfiguration *rc, - const Debugger::DebuggerStartParameters &sp) : - Debugger::DebuggerRunControl(rc, sp), - m_codaRunControl(NULL), - m_codaState(ENotUsingCodaRunControl) -{ - if (startParameters().symbolFileName.isEmpty()) { - const QString msg = tr("Warning: Cannot locate the symbol file belonging to %1.\n"). - arg(rc->localExecutableFileName()); - appendMessage(msg, Utils::ErrorMessageFormat); - } - if (sp.masterEngineType == Debugger::QmlEngineType) { - connect(engine(), SIGNAL(requestRemoteSetup()), this, SLOT(remoteSetupRequested())); - connect(engine(), SIGNAL(stateChanged(Debugger::DebuggerState)), this, SLOT(qmlEngineStateChanged(Debugger::DebuggerState))); - } -} - -void S60DeviceDebugRunControl::start() -{ - appendMessage(tr("Launching debugger...\n"), Utils::NormalMessageFormat); - Debugger::DebuggerRunControl::start(); -} - -bool S60DeviceDebugRunControl::promptToStop(bool *) const -{ - // We override the settings prompt - return Debugger::DebuggerRunControl::promptToStop(0); -} - -void S60DeviceDebugRunControl::remoteSetupRequested() -{ - // This is called from Engine->setupInferior(), ie InferiorSetupRequested state - QTC_CHECK(runConfiguration()->debuggerAspect()->useQmlDebugger() && !runConfiguration()->debuggerAspect()->useCppDebugger()); - m_codaRunControl = new CodaRunControl(runConfiguration(), DebugRunMode); - connect(m_codaRunControl, SIGNAL(connected()), this, SLOT(codaConnected())); - connect(m_codaRunControl, SIGNAL(finished()), this, SLOT(codaFinished())); - connect(m_codaRunControl, SIGNAL(appendMessage(ProjectExplorer::RunControl*,QString,Utils::OutputFormat)), this, SLOT(handleMessageFromCoda(ProjectExplorer::RunControl*,QString,Utils::OutputFormat))); - connect(this, SIGNAL(finished()), this, SLOT(handleDebuggingFinished())); - m_codaState = EWaitingForCodaConnection; - m_codaRunControl->connect(); -} - -void S60DeviceDebugRunControl::codaFinished() -{ - if (m_codaRunControl) { - m_codaRunControl->deleteLater(); - m_codaRunControl = NULL; - } - if (m_codaState == EWaitingForCodaConnection) { - engine()->notifyEngineRemoteSetupFailed(QLatin1String("CODA failed to initialise")); // TODO sort out this error string? Unlikely we'll ever hit this state anyway. - } else { - debuggingFinished(); - } - m_codaState = ENotUsingCodaRunControl; -} - -void S60DeviceDebugRunControl::codaConnected() -{ - QTC_ASSERT(m_codaState == EWaitingForCodaConnection, return); - m_codaState = ECodaConnected; - engine()->notifyEngineRemoteSetupDone(-1, -1); // calls notifyInferiorSetupOk() -} - -void S60DeviceDebugRunControl::qmlEngineStateChanged(Debugger::DebuggerState state) -{ - if (state == Debugger::EngineRunRequested) - m_codaRunControl->run(); -} - -void S60DeviceDebugRunControl::handleDebuggingFinished() -{ - if (m_codaRunControl) { - m_codaRunControl->stop(); // We'll get a callback to our codaFinished() slot when it's done - } -} - -void S60DeviceDebugRunControl::handleMessageFromCoda(ProjectExplorer::RunControl *aCodaRunControl, const QString &msg, Utils::OutputFormat format) -{ - // This only gets used when QmlEngine is the master debug engine. If GDB is running, messages are handled via the gdb adapter - Q_UNUSED(aCodaRunControl) - Q_UNUSED(format) - engine()->showMessage(msg, Debugger::AppOutput); -} - -// - -S60DeviceDebugRunControlFactory::S60DeviceDebugRunControlFactory(QObject *parent) : - IRunControlFactory(parent) -{ -} - -bool S60DeviceDebugRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const -{ - return mode == DebugRunMode && qobject_cast<S60DeviceRunConfiguration *>(runConfiguration); -} - -ProjectExplorer::RunControl* S60DeviceDebugRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode) -{ - S60DeviceRunConfiguration *rc = qobject_cast<S60DeviceRunConfiguration *>(runConfiguration); - QTC_ASSERT(rc && mode == DebugRunMode, return 0); - return new S60DeviceDebugRunControl(rc, s60DebuggerStartParams(rc)); -} - -QString S60DeviceDebugRunControlFactory::displayName() const -{ - return S60DeviceDebugRunControl::tr("Debug on Device"); -} diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicedebugruncontrol.h b/src/plugins/qt4projectmanager/qt-s60/s60devicedebugruncontrol.h deleted file mode 100644 index f01d4a13c2b..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicedebugruncontrol.h +++ /dev/null @@ -1,83 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60DEVICEDEBUGRUNCONTROL_H -#define S60DEVICEDEBUGRUNCONTROL_H - -#include <debugger/debuggerrunner.h> - -namespace Qt4ProjectManager { - -class S60DeviceRunConfiguration; -class CodaRunControl; - -namespace Internal { - -class S60DeviceDebugRunControl : public Debugger::DebuggerRunControl -{ - Q_OBJECT - -public: - explicit S60DeviceDebugRunControl(S60DeviceRunConfiguration *runConfiguration, - const Debugger::DebuggerStartParameters &sp); - virtual void start(); - virtual bool promptToStop(bool *optionalPrompt = 0) const; - -private slots: - void remoteSetupRequested(); - void codaConnected(); - void qmlEngineStateChanged(Debugger::DebuggerState state); - void codaFinished(); - void handleDebuggingFinished(); - void handleMessageFromCoda(ProjectExplorer::RunControl *aCodaRunControl, const QString &msg, Utils::OutputFormat format); - -private: - CodaRunControl *m_codaRunControl; - enum { - ENotUsingCodaRunControl = 0, - EWaitingForCodaConnection, - ECodaConnected - } m_codaState; -}; - -class S60DeviceDebugRunControlFactory : public ProjectExplorer::IRunControlFactory -{ -public: - explicit S60DeviceDebugRunControlFactory(QObject *parent = 0); - bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const; - - ProjectExplorer::RunControl* create(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode); - QString displayName() const; -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // S60DEVICEDEBUGRUNCONTROL_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp deleted file mode 100644 index b8cf0ddb40e..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp +++ /dev/null @@ -1,410 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60devicerunconfiguration.h" - -#include "qt4project.h" -#include "qt4nodes.h" -#include "qt4projectmanagerconstants.h" -#include "qt4buildconfiguration.h" -#include "s60deployconfiguration.h" -#include "s60devicerunconfigurationwidget.h" -#include "s60manager.h" -#include "symbianidevice.h" -#include "symbianidevicefactory.h" -#include "symbianqtversion.h" - -#include <utils/qtcassert.h> -#include <projectexplorer/profileinformation.h> -#include <projectexplorer/target.h> -#include <qtsupport/customexecutablerunconfiguration.h> -#include <qtsupport/qtoutputformatter.h> -#include <qtsupport/qtprofileinformation.h> - -using namespace ProjectExplorer; -using namespace Qt4ProjectManager; -using namespace Qt4ProjectManager::Internal; - -namespace { - -const char * const S60_DEVICE_RC_ID("Qt4ProjectManager.S60DeviceRunConfiguration"); -const char * const S60_DEVICE_RC_PREFIX("Qt4ProjectManager.S60DeviceRunConfiguration:"); - -const char * const PRO_FILE_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.ProFile"); -const char * const COMMUNICATION_TYPE_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.CommunicationType"); -const char * const COMMAND_LINE_ARGUMENTS_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.CommandLineArguments"); - -enum { debug = 0 }; - -QString pathFromId(Core::Id id) -{ - QString idstr = QString::fromUtf8(id.name()); - const QString prefix = QLatin1String(S60_DEVICE_RC_PREFIX); - if (!idstr.startsWith(prefix)) - return QString(); - return idstr.mid(prefix.size()); -} - -} // anonymous namespace - -// ======== S60DeviceRunConfiguration - -S60DeviceRunConfiguration::S60DeviceRunConfiguration(Target *parent, Core::Id id) : - RunConfiguration(parent, id), - m_proFilePath(pathFromId(id)) -{ - Qt4Project *project = static_cast<Qt4Project *>(parent->project()); - m_validParse = project->validParse(m_proFilePath); - m_parseInProgress = project->parseInProgress(m_proFilePath); - - ctor(); -} - -S60DeviceRunConfiguration::S60DeviceRunConfiguration(Target *parent, S60DeviceRunConfiguration *source) : - RunConfiguration(parent, source), - m_proFilePath(source->m_proFilePath), - m_commandLineArguments(source->m_commandLineArguments), - m_validParse(source->m_validParse), - m_parseInProgress(source->m_parseInProgress) -{ - ctor(); -} - -void S60DeviceRunConfiguration::ctor() -{ - if (!m_proFilePath.isEmpty()) - //: S60 device runconfiguration default display name, %1 is base pro-File name - setDefaultDisplayName(tr("%1 on Symbian Device").arg(QFileInfo(m_proFilePath).completeBaseName())); - else - //: S60 device runconfiguration default display name (no profile set) - setDefaultDisplayName(tr("Run on Symbian device")); - - Qt4Project *pro = static_cast<Qt4Project *>(target()->project()); - connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)), - this, SLOT(proFileUpdate(Qt4ProjectManager::Qt4ProFileNode*,bool,bool))); -} - -void S60DeviceRunConfiguration::proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress) -{ - if (m_proFilePath != pro->path()) - return; - bool enabled = isEnabled(); - QString reason = disabledReason(); - m_validParse = success; - m_parseInProgress = parseInProgress; - if (enabled != isEnabled() || reason != disabledReason()) - emit enabledChanged(); - if (!parseInProgress) - emit targetInformationChanged(); -} - -S60DeviceRunConfiguration::~S60DeviceRunConfiguration() -{ -} - -bool S60DeviceRunConfiguration::isEnabled() const -{ - return m_validParse && !m_parseInProgress; -} - -QString S60DeviceRunConfiguration::disabledReason() const -{ - if (m_parseInProgress) - return tr("The .pro file '%1' is currently being parsed.") - .arg(QFileInfo(m_proFilePath).fileName()); - if (!m_validParse) - return static_cast<Qt4Project *>(target()->project())->disabledReasonForRunConfiguration(m_proFilePath); - return QString(); -} - -QWidget *S60DeviceRunConfiguration::createConfigurationWidget() -{ - return new S60DeviceRunConfigurationWidget(this); -} - -Utils::OutputFormatter *S60DeviceRunConfiguration::createOutputFormatter() const -{ - return new QtSupport::QtOutputFormatter(target()->project()); -} - -QVariantMap S60DeviceRunConfiguration::toMap() const -{ - QVariantMap map = ProjectExplorer::RunConfiguration::toMap(); - const QDir projectDir = QDir(target()->project()->projectDirectory()); - - map.insert(QLatin1String(PRO_FILE_KEY), projectDir.relativeFilePath(m_proFilePath)); - map.insert(QLatin1String(COMMAND_LINE_ARGUMENTS_KEY), m_commandLineArguments); - - return map; -} - -bool S60DeviceRunConfiguration::fromMap(const QVariantMap &map) -{ - const QDir projectDir = QDir(target()->project()->projectDirectory()); - - m_proFilePath = QDir::cleanPath(projectDir.filePath(map.value(QLatin1String(PRO_FILE_KEY)).toString())); - m_commandLineArguments = map.value(QLatin1String(COMMAND_LINE_ARGUMENTS_KEY)).toString(); - - if (m_proFilePath.isEmpty()) - return false; - if (!QFileInfo(m_proFilePath).exists()) - return false; - - m_validParse = static_cast<Qt4Project *>(target()->project())->validParse(m_proFilePath); - m_parseInProgress = static_cast<Qt4Project *>(target()->project())->parseInProgress(m_proFilePath); - - setDefaultDisplayName(tr("%1 on Symbian Device").arg(QFileInfo(m_proFilePath).completeBaseName())); - - return RunConfiguration::fromMap(map); -} - -static inline QString fixBaseNameTarget(const QString &in) -{ - if (in == QLatin1String("udeb")) - return QLatin1String("debug"); - if (in == QLatin1String("urel")) - return QLatin1String("release"); - return in; -} - -QString S60DeviceRunConfiguration::targetName() const -{ - TargetInformation ti = static_cast<Qt4Project *>(target()->project()) - ->rootQt4ProjectNode()->targetInformation(projectFilePath()); - if (!ti.valid) - return QString(); - return ti.target; -} - -bool S60DeviceRunConfiguration::isDebug() const -{ - const Qt4BuildConfiguration *qt4bc = static_cast<const Qt4BuildConfiguration *>(target()->activeBuildConfiguration()); - return (qt4bc->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild); -} - -QString S60DeviceRunConfiguration::symbianTarget() const -{ - return isDebug() ? QLatin1String("udeb") : QLatin1String("urel"); -} - -// ABLD/Raptor: Return executable from device/EPOC -static inline QString localExecutableFromVersion(const ProjectExplorer::Profile *p, - const QString &symbianTarget, /* udeb/urel */ - const QString &targetName) -{ - Q_ASSERT(p); - - ToolChain *tc = ToolChainProfileInformation::toolChain(p); - SymbianQtVersion *qtv = dynamic_cast<SymbianQtVersion *>(QtSupport::QtProfileInformation::qtVersion(p)); - QString root; - if (SysRootProfileInformation::hasSysRoot(p)) - root = SysRootProfileInformation::sysRoot(p).toString(); - - if (!tc) - return QString(); - - QString localExecutable; - QString platform = S60Manager::platform(tc); - if (qtv->isBuildWithSymbianSbsV2() && platform == QLatin1String("gcce")) - platform = QLatin1String("armv5"); - QTextStream(&localExecutable) << root << "/epoc32/release/" - << platform << '/' << symbianTarget << '/' << targetName << ".exe"; - return localExecutable; -} - -QString S60DeviceRunConfiguration::localExecutableFileName() const -{ - TargetInformation ti = static_cast<Qt4Project *>(target()->project())->rootQt4ProjectNode()->targetInformation(projectFilePath()); - if (!ti.valid) - return QString(); - - return localExecutableFromVersion(target()->profile(), symbianTarget(), targetName()); -} - -quint32 S60DeviceRunConfiguration::executableUid() const -{ - quint32 uid = 0; - QString executablePath = localExecutableFileName(); - if (!executablePath.isEmpty()) { - QFile file(executablePath); - if (file.open(QIODevice::ReadOnly)) { - // executable's UID is 4 bytes starting at 8. - const QByteArray data = file.read(12); - if (data.size() == 12) { - const unsigned char *d = reinterpret_cast<const unsigned char*>(data.data() + 8); - uid = *d++; - uid += *d++ << 8; - uid += *d++ << 16; - uid += *d++ << 24; - } - } - } - return uid; -} - -QString S60DeviceRunConfiguration::projectFilePath() const -{ - return m_proFilePath; -} - -QString S60DeviceRunConfiguration::commandLineArguments() const -{ - return m_commandLineArguments; -} - -void S60DeviceRunConfiguration::setCommandLineArguments(const QString &args) -{ - m_commandLineArguments = args; -} - -QString S60DeviceRunConfiguration::qmlCommandLineArguments() const -{ - QString args; - if (debuggerAspect()->useQmlDebugger()) { - const S60DeployConfiguration *activeDeployConf = - qobject_cast<const S60DeployConfiguration *>(target()->activeDeployConfiguration()); - QTC_ASSERT(activeDeployConf, return args); - - QSharedPointer<const SymbianIDevice> dev = activeDeployConf->device().dynamicCast<const SymbianIDevice>(); - if (dev->communicationChannel() == SymbianIDevice::CommunicationCodaTcpConnection) - args = QString::fromLatin1("-qmljsdebugger=port:%1,block").arg(debuggerAspect()->qmlDebugServerPort()); - else - args = QLatin1String("-qmljsdebugger=ost"); - } - return args; -} - -QString S60DeviceRunConfiguration::proFilePath() const -{ - return m_proFilePath; -} - -// ======== S60DeviceRunConfigurationFactory - -S60DeviceRunConfigurationFactory::S60DeviceRunConfigurationFactory(QObject *parent) : - QmakeRunConfigurationFactory(parent) -{ setObjectName(QLatin1String("S60DeviceRunConfigurationFactory"));} - -S60DeviceRunConfigurationFactory::~S60DeviceRunConfigurationFactory() -{ } - -QList<Core::Id> S60DeviceRunConfigurationFactory::availableCreationIds(Target *parent) const -{ - QList<Core::Id> result; - if (!canHandle(parent)) - return result; - - Qt4Project *project = static_cast<Qt4Project *>(parent->project()); - QStringList proFiles = project->applicationProFilePathes(QLatin1String(S60_DEVICE_RC_PREFIX)); - foreach (const QString &pf, proFiles) - result << Core::Id(pf); - return result; -} - -QString S60DeviceRunConfigurationFactory::displayNameForId(const Core::Id id) const -{ - if (!pathFromId(id).isEmpty()) - return tr("%1 on Symbian Device").arg(QFileInfo(pathFromId(id)).completeBaseName()); - return QString(); -} - -bool S60DeviceRunConfigurationFactory::canHandle(Target *t) const -{ - if (!t->project()->supportsProfile(t->profile())) - return false; - if (!qobject_cast<Qt4Project *>(t->project())) - return false; - - Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(t->profile()); - return deviceType == SymbianIDeviceFactory::deviceType(); -} - -QList<RunConfiguration *> S60DeviceRunConfigurationFactory::runConfigurationsForNode(Target *t, ProjectExplorer::Node *n) -{ - QList<ProjectExplorer::RunConfiguration *> result; - foreach (ProjectExplorer::RunConfiguration *rc, t->runConfigurations()) { - if (S60DeviceRunConfiguration *s60rc = qobject_cast<S60DeviceRunConfiguration *>(rc)) - if (s60rc->proFilePath() == n->path()) - result << rc; - } - return result; -} - -bool S60DeviceRunConfigurationFactory::canCreate(Target *parent, const Core::Id id) const -{ - if (!canHandle(parent)) - return false; - Qt4Project *project = static_cast<Qt4Project *>(parent->project()); - return project->hasApplicationProFile(pathFromId(id)); -} - -RunConfiguration *S60DeviceRunConfigurationFactory::create(Target *parent, const Core::Id id) -{ - if (!canCreate(parent, id)) - return 0; - - return new S60DeviceRunConfiguration(parent, id); -} - -bool S60DeviceRunConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const -{ - if (!canHandle(parent)) - return false; - - const Core::Id id = ProjectExplorer::idFromMap(map); - return id == S60_DEVICE_RC_ID; -} - -RunConfiguration *S60DeviceRunConfigurationFactory::restore(Target *parent, const QVariantMap &map) -{ - if (!canRestore(parent, map)) - return 0; - S60DeviceRunConfiguration *rc = new S60DeviceRunConfiguration(parent, idFromMap(map)); - if (rc->fromMap(map)) - return rc; - - delete rc; - return 0; -} - -bool S60DeviceRunConfigurationFactory::canClone(Target *parent, RunConfiguration *source) const -{ - if (!canHandle(parent)) - return false; - return source->id() == S60_DEVICE_RC_ID; -} - -RunConfiguration *S60DeviceRunConfigurationFactory::clone(Target *parent, RunConfiguration *source) -{ - if (!canClone(parent, source)) - return 0; - S60DeviceRunConfiguration *old = static_cast<S60DeviceRunConfiguration *>(source); - return new S60DeviceRunConfiguration(parent, old); -} diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h deleted file mode 100644 index f76f6a67b4e..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h +++ /dev/null @@ -1,132 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60DEVICERUNCONFIGURATION_H -#define S60DEVICERUNCONFIGURATION_H - -#include "../qmakerunconfigurationfactory.h" -#include "../qt4projectmanager_global.h" - -#include <projectexplorer/runconfiguration.h> - -#include <QFutureInterface> -#include <QStringList> - -QT_BEGIN_NAMESPACE -class QWidget; -QT_END_NAMESPACE - -namespace ProjectExplorer { class Node; } - -namespace Qt4ProjectManager { -class Qt4ProFileNode; - -namespace Internal { class SymbianQtVersion; } - -class S60DeviceRunConfigurationFactory; - -class QT4PROJECTMANAGER_EXPORT S60DeviceRunConfiguration : public ProjectExplorer::RunConfiguration -{ - Q_OBJECT - friend class S60DeviceRunConfigurationFactory; - -public: - S60DeviceRunConfiguration(ProjectExplorer::Target *parent, Core::Id id); - virtual ~S60DeviceRunConfiguration(); - - bool isEnabled() const; - QString disabledReason() const; - QWidget *createConfigurationWidget(); - - Utils::OutputFormatter *createOutputFormatter() const; - - QString commandLineArguments() const; - void setCommandLineArguments(const QString &args); - QString qmlCommandLineArguments() const; - - QString projectFilePath() const; - - QString targetName() const; - QString localExecutableFileName() const; - quint32 executableUid() const; - - bool isDebug() const; - QString symbianTarget() const; - - QVariantMap toMap() const; - - QString proFilePath() const; -signals: - void targetInformationChanged(); - -protected: - S60DeviceRunConfiguration(ProjectExplorer::Target *parent, S60DeviceRunConfiguration *source); - QString defaultDisplayName() const; - virtual bool fromMap(const QVariantMap &map); - -private slots: - void proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress); - -private: - void ctor(); - - QString m_proFilePath; - QString m_commandLineArguments; - bool m_validParse; - bool m_parseInProgress; -}; - -class S60DeviceRunConfigurationFactory : public QmakeRunConfigurationFactory -{ - Q_OBJECT - -public: - explicit S60DeviceRunConfigurationFactory(QObject *parent = 0); - ~S60DeviceRunConfigurationFactory(); - - bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; - ProjectExplorer::RunConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id); - bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; - ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map); - bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const; - ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source); - - QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const; - // used to translate the ids to names to display to the user - QString displayNameForId(const Core::Id id) const; - - bool canHandle(ProjectExplorer::Target *t) const; - QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Target *t, - ProjectExplorer::Node *n); -}; - -} // namespace Qt4ProjectManager - -#endif // S60DEVICERUNCONFIGURATION_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfigurationwidget.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfigurationwidget.cpp deleted file mode 100644 index b981ab5ca56..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfigurationwidget.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60devicerunconfigurationwidget.h" -#include "s60devicerunconfiguration.h" - -#include <utils/detailswidget.h> - -#include <coreplugin/helpmanager.h> - -#include <QLabel> -#include <QLineEdit> -#include <QVBoxLayout> -#include <QHBoxLayout> -#include <QFormLayout> - -namespace Qt4ProjectManager { -namespace Internal { - -S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget( - S60DeviceRunConfiguration *runConfiguration, - QWidget *parent) - : QWidget(parent), - m_runConfiguration(runConfiguration), - m_detailsWidget(new Utils::DetailsWidget), - m_argumentsLineEdit(new QLineEdit(m_runConfiguration->commandLineArguments())) -{ - m_detailsWidget->setState(Utils::DetailsWidget::NoSummary); - QVBoxLayout *mainBoxLayout = new QVBoxLayout(); - mainBoxLayout->setMargin(0); - - QHBoxLayout *hl = new QHBoxLayout(); - hl->addStretch(); - m_disabledIcon = new QLabel(this); - m_disabledIcon->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_warning.png"))); - hl->addWidget(m_disabledIcon); - m_disabledReason = new QLabel(this); - m_disabledReason->setVisible(false); - hl->addWidget(m_disabledReason); - hl->addStretch(); - mainBoxLayout->addLayout(hl); - - setLayout(mainBoxLayout); - mainBoxLayout->addWidget(m_detailsWidget); - QWidget *detailsContainer = new QWidget; - m_detailsWidget->setWidget(detailsContainer); - - QVBoxLayout *detailsBoxLayout = new QVBoxLayout(); - detailsBoxLayout->setMargin(0); - detailsContainer->setLayout(detailsBoxLayout); - - QFormLayout *formLayout = new QFormLayout(); - formLayout->setMargin(0); - detailsBoxLayout->addLayout(formLayout); - formLayout->addRow(tr("Arguments:"), m_argumentsLineEdit); - - connect(m_argumentsLineEdit, SIGNAL(textEdited(QString)), - this, SLOT(argumentsEdited(QString))); - - connect(m_runConfiguration, SIGNAL(enabledChanged()), - this, SLOT(runConfigurationEnabledChange())); - - runConfigurationEnabledChange(); -} - -void S60DeviceRunConfigurationWidget::argumentsEdited(const QString &text) -{ - m_runConfiguration->setCommandLineArguments(text.trimmed()); -} - -void S60DeviceRunConfigurationWidget::runConfigurationEnabledChange() -{ - bool enabled = m_runConfiguration->isEnabled(); - m_detailsWidget->setEnabled(enabled); - m_disabledIcon->setVisible(!enabled); - m_disabledReason->setVisible(!enabled); - m_disabledReason->setText(m_runConfiguration->disabledReason()); -} - -} // namespace Internal -} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfigurationwidget.h b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfigurationwidget.h deleted file mode 100644 index 0ebb2b6029f..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfigurationwidget.h +++ /dev/null @@ -1,70 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60DEVICERUNCONFIGURATIONWIDGET_H -#define S60DEVICERUNCONFIGURATIONWIDGET_H - -#include <QWidget> -#include <QLabel> - -QT_BEGIN_NAMESPACE -class QLineEdit; -QT_END_NAMESPACE - -namespace Utils { class DetailsWidget; } - -namespace Qt4ProjectManager { - -class S60DeviceRunConfiguration; - -namespace Internal { - -class S60DeviceRunConfigurationWidget : public QWidget -{ - Q_OBJECT -public: - explicit S60DeviceRunConfigurationWidget(S60DeviceRunConfiguration *runConfiguration, - QWidget *parent = 0); -private slots: - void argumentsEdited(const QString &text); - void runConfigurationEnabledChange(); - -private: - S60DeviceRunConfiguration *m_runConfiguration; - QLabel *m_disabledIcon; - QLabel *m_disabledReason; - Utils::DetailsWidget *m_detailsWidget; - QLineEdit *m_argumentsLineEdit; -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // S60DEVICERUNCONFIGURATIONWIDGET_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp b/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp deleted file mode 100644 index 18a065a4205..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp +++ /dev/null @@ -1,220 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60manager.h" - -#include "s60devicerunconfiguration.h" -#include "s60createpackagestep.h" -#include "s60deployconfiguration.h" -#include "s60deploystep.h" -#include "s60runcontrolfactory.h" -#include "s60devicedebugruncontrol.h" -#include "symbianidevice.h" -#include "symbianidevicefactory.h" - -#include "s60publishingwizardfactories.h" - -#include "gccetoolchain.h" -#include "rvcttoolchain.h" -#include "symbianqtversionfactory.h" - -#include <symbianutils/symbiandevicemanager.h> - -#include <coreplugin/icore.h> -#include <extensionsystem/pluginmanager.h> -#include <projectexplorer/devicesupport/devicemanager.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <qtsupport/qtversionmanager.h> -#include <qtsupport/qtsupportconstants.h> -#include <debugger/debuggerconstants.h> -#include <utils/qtcassert.h> - -#include <QDir> - -namespace Qt4ProjectManager { -namespace Internal { - -S60Manager *S60Manager::m_instance = 0; - -// ======== Parametrizable Factory for RunControls, depending on the configuration -// class and mode. - -template <class RunControl, class RunConfiguration> - class RunControlFactory : public ProjectExplorer::IRunControlFactory -{ -public: - RunControlFactory(ProjectExplorer::RunMode mode, const QString &name, QObject *parent = 0) : - IRunControlFactory(parent), m_mode(mode), m_name(name) {} - - bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const - { - return mode == m_mode && qobject_cast<RunConfiguration *>(runConfiguration); - } - - ProjectExplorer::RunControl* create(ProjectExplorer::RunConfiguration *runConfiguration, - ProjectExplorer::RunMode mode) - { - RunConfiguration *rc = qobject_cast<RunConfiguration *>(runConfiguration); - QTC_ASSERT(rc && mode == m_mode, return 0); - return new RunControl(rc, mode); - } - - QString displayName() const { - return m_name; - } - -private: - const ProjectExplorer::RunMode m_mode; - const QString m_name; -}; - -// ======== S60Manager - -S60Manager *S60Manager::instance() { return m_instance; } - -S60Manager::S60Manager(QObject *parent) : QObject(parent) -{ - m_instance = this; - - addAutoReleasedObject(new GcceToolChainFactory); - addAutoReleasedObject(new RvctToolChainFactory); - - addAutoReleasedObject(new S60DeviceRunConfigurationFactory); - addAutoReleasedObject(new S60RunControlFactory(ProjectExplorer::NormalRunMode, - tr("Run on Device"), parent)); - addAutoReleasedObject(new S60CreatePackageStepFactory); - addAutoReleasedObject(new S60DeployStepFactory); - - addAutoReleasedObject(new S60DeviceDebugRunControlFactory); - addAutoReleasedObject(new S60DeployConfigurationFactory); - - addAutoReleasedObject(new S60PublishingWizardFactoryOvi); - addAutoReleasedObject(new SymbianQtVersionFactory); - - addAutoReleasedObject(new Internal::SymbianIDeviceFactory); - - connect(Core::ICore::mainWindow(), SIGNAL(deviceChange()), - SymbianUtils::SymbianDeviceManager::instance(), SLOT(update())); - - SymbianUtils::SymbianDeviceManager *dm = SymbianUtils::SymbianDeviceManager::instance(); - connect(dm, SIGNAL(deviceAdded(SymbianUtils::SymbianDevice)), - this, SLOT(symbianDeviceAdded(SymbianUtils::SymbianDevice))); - connect(dm, SIGNAL(deviceRemoved(SymbianUtils::SymbianDevice)), - this, SLOT(symbianDeviceRemoved(SymbianUtils::SymbianDevice))); -} - -S60Manager::~S60Manager() -{ - for (int i = m_pluginObjects.size() - 1; i >= 0; i--) { - ExtensionSystem::PluginManager::removeObject(m_pluginObjects.at(i)); - delete m_pluginObjects.at(i); - } -} - -QString S60Manager::platform(const ProjectExplorer::ToolChain *tc) -{ - if (!tc || tc->targetAbi().os() != ProjectExplorer::Abi::SymbianOS) - return QString(); - QString target = tc->defaultMakeTarget(); - return target.right(target.lastIndexOf(QLatin1Char('-'))); -} - -void S60Manager::extensionsInitialize() -{ - handleQtVersionChanges(); - connect(QtSupport::QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), - this, SLOT(handleQtVersionChanges())); -} - -void S60Manager::symbianDeviceRemoved(const SymbianUtils::SymbianDevice &d) -{ - handleSymbianDeviceStateChange(d, ProjectExplorer::IDevice::DeviceDisconnected); -} - -void S60Manager::symbianDeviceAdded(const SymbianUtils::SymbianDevice &d) -{ - handleSymbianDeviceStateChange(d, ProjectExplorer::IDevice::DeviceReadyToUse); -} - -void S60Manager::handleQtVersionChanges() -{ - bool symbianQtFound = false; - Core::Id symbianDeviceId; - QList<QtSupport::BaseQtVersion *> versionList = QtSupport::QtVersionManager::instance()->versions(); - foreach (QtSupport::BaseQtVersion *v, versionList) { - if (v->platformName() != QLatin1String(QtSupport::Constants::SYMBIAN_PLATFORM)) - continue; - - symbianQtFound = true; - break; - } - - ProjectExplorer::DeviceManager *dm = ProjectExplorer::DeviceManager::instance(); - for (int i = 0; i < dm->deviceCount(); ++i) { - ProjectExplorer::IDevice::ConstPtr dev = dm->deviceAt(i); - if (dev->type() != SymbianIDeviceFactory::deviceType()) - continue; - - symbianDeviceId = dev->id(); - break; - } - - if (symbianQtFound && !symbianDeviceId.isValid()) - dm->addDevice(ProjectExplorer::IDevice::Ptr(new SymbianIDevice)); - if (!symbianQtFound && symbianDeviceId.isValid()) - dm->removeDevice(symbianDeviceId); -} - -void S60Manager::handleSymbianDeviceStateChange(const SymbianUtils::SymbianDevice &d, ProjectExplorer::IDevice::DeviceState s) -{ - ProjectExplorer::DeviceManager *dm = ProjectExplorer::DeviceManager::instance(); - for (int i = 0; i < dm->deviceCount(); ++i) { - ProjectExplorer::IDevice::ConstPtr dev = dm->deviceAt(i); - const SymbianIDevice *sdev = dynamic_cast<const SymbianIDevice *>(dev.data()); - if (!sdev || sdev->communicationChannel() != SymbianIDevice::CommunicationCodaSerialConnection) - continue; - if (sdev->serialPortName() != d.portName()) - continue; - - SymbianIDevice *newDev = new SymbianIDevice(*sdev); // Get a new device to replace the current one - newDev->setDeviceState(s); - dm->addDevice(ProjectExplorer::IDevice::Ptr(newDev)); - break; - } -} - -void S60Manager::addAutoReleasedObject(QObject *o) -{ - ExtensionSystem::PluginManager::addObject(o); - m_pluginObjects.push_back(o); -} - -} // namespace internal -} // namespace qt4projectmanager diff --git a/src/plugins/qt4projectmanager/qt-s60/s60manager.h b/src/plugins/qt4projectmanager/qt-s60/s60manager.h deleted file mode 100644 index 467316273f4..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60manager.h +++ /dev/null @@ -1,76 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60MANAGER_H -#define S60MANAGER_H - -#include <projectexplorer/devicesupport/idevice.h> -#include <symbianutils/symbiandevicemanager.h> - -#include <QObject> - -namespace ProjectExplorer { class ToolChain; } - -namespace Qt4ProjectManager { -namespace Internal { - -class S60Manager : public QObject -{ - Q_OBJECT -public: - S60Manager(QObject *parent = 0); - ~S60Manager(); - - static S60Manager *instance(); - - static QString platform(const ProjectExplorer::ToolChain *tc); - - void extensionsInitialize(); - -private slots: - void symbianDeviceRemoved(const SymbianUtils::SymbianDevice &d); - void symbianDeviceAdded(const SymbianUtils::SymbianDevice &d); - - void handleQtVersionChanges(); - -private: - void handleSymbianDeviceStateChange(const SymbianUtils::SymbianDevice &d, - ProjectExplorer::IDevice::DeviceState s); - - void addAutoReleasedObject(QObject *p); - - static S60Manager *m_instance; - QObjectList m_pluginObjects; -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // S60MANAGER_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publisherovi.cpp b/src/plugins/qt4projectmanager/qt-s60/s60publisherovi.cpp deleted file mode 100644 index d87f7a65069..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60publisherovi.cpp +++ /dev/null @@ -1,552 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ -#include "s60publisherovi.h" - -#include "s60certificateinfo.h" -#include "s60manager.h" - -#include "qt4buildconfiguration.h" -#include "qmakestep.h" -#include "makestep.h" -#include "qt4project.h" -#include "qt4nodes.h" - -#include <projectexplorer/buildsteplist.h> -#include <projectexplorer/buildstep.h> -#include <projectexplorer/target.h> -#include <qtsupport/qtversionmanager.h> -#include <qtsupport/qtprofileinformation.h> -#include <qtsupport/profilereader.h> - -#include <utils/qtcassert.h> -#include <utils/fileutils.h> -#include <proparser/prowriter.h> - -#include <QProcess> - -namespace Qt4ProjectManager { -namespace Internal { - -S60PublisherOvi::S60PublisherOvi(QObject *parent) : - QObject(parent), - m_reader(0), - m_finishedAndSuccessful(false) -{ - // build m_rejectedVendorNames - m_rejectedVendorNames.append(QLatin1String(Constants::REJECTED_VENDOR_NAMES_NOKIA)); - m_rejectedVendorNames.append(QLatin1String(Constants::REJECTED_VENDOR_NAMES_VENDOR)); - m_rejectedVendorNames.append(QLatin1String(Constants::REJECTED_VENDOR_NAMES_VENDOR_EN)); - m_rejectedVendorNames.append(QLatin1String(Constants::REJECTED_VENDOR_NAMES_EMPTY)); - - // build m_capabilitiesForCertifiedSigned - m_capabilitiesForCertifiedSigned.append(QLatin1String(Constants::CERTIFIED_SIGNED_CAPABILITY_COMM_DD)); - m_capabilitiesForCertifiedSigned.append(QLatin1String(Constants::CERTIFIED_SIGNED_CAPABILITY_DISK_ADMIN)); - m_capabilitiesForCertifiedSigned.append(QLatin1String(Constants::CERTIFIED_SIGNED_CAPABILITY_MULTIMEDIA_DD)); - m_capabilitiesForCertifiedSigned.append(QLatin1String(Constants::CERTIFIED_SIGNED_CAPABILITY_NETWORK_CONTROL)); - - // build m_capabilitesForManufacturerApproved - m_capabilitesForManufacturerApproved.append(QLatin1String(Constants::MANUFACTURER_APPROVED_CAPABILITY_ALL_FILES)); - m_capabilitesForManufacturerApproved.append(QLatin1String(Constants::MANUFACTURER_APPROVED_CAPABILITY_DRM)); - m_capabilitesForManufacturerApproved.append(QLatin1String(Constants::MANUFACTURER_APPROVED_CAPABILITY_TCB)); - - // set up colours for progress reports - m_errorColor = Qt::red; - m_commandColor = Qt::blue; - m_okColor = Qt::darkGreen; - m_normalColor = Qt::black; -} - -S60PublisherOvi::~S60PublisherOvi() -{ - cleanUp(); -} - -void S60PublisherOvi::setBuildConfiguration(Qt4BuildConfiguration *qt4bc) -{ - // set build configuration - m_qt4bc = qt4bc; -} - -void S60PublisherOvi::setDisplayName(const QString &displayName) -{ - m_displayName = displayName; -} - -void S60PublisherOvi::setVendorName(const QString &vendorName) -{ - m_vendorName = vendorName; -} - -void S60PublisherOvi::setLocalVendorNames(const QString &localVendorNames) -{ - QStringList vendorNames = localVendorNames.split(QLatin1Char(',')); - QStringList resultingList; - foreach (QString vendorName, vendorNames) { - resultingList.append(QLatin1String("\\\"") + vendorName.trimmed() + QLatin1String("\\\"")); - } - m_localVendorNames = resultingList.join(QLatin1String(", ")); -} - -void S60PublisherOvi::setAppUid(const QString &appuid) -{ - m_appUid = appuid; -} - -void S60PublisherOvi::cleanUp() -{ - if (m_qt4project && m_reader) { - m_qt4project->destroyProFileReader(m_reader); - m_reader = 0; - } - m_publishSteps.clear(); -} - -void S60PublisherOvi::completeCreation() -{ -#if 0 // FIXME: This needs serious reworking! - // set active target - m_activeTargetOfProject = qobject_cast<Qt4SymbianTarget *>(m_qt4bc->target()); - QTC_ASSERT(m_activeTargetOfProject, return); - - //set up project - m_qt4project = m_activeTargetOfProject->qt4Project(); - - // set up pro file reader - m_reader = m_qt4project->createProFileReader(m_qt4project->rootQt4ProjectNode(), m_qt4bc); - //m_reader->setCumulative(false); // todo need to reenable that, after fixing parsing for symbian scopes - - ProFile *profile = m_reader->parsedProFile(m_qt4project->rootProjectNode()->path()); - m_reader->accept(profile, QMakeEvaluator::LoadProOnly); - profile->deref(); - - // set up process for creating the resulting SIS files - ProjectExplorer::AbstractProcessStep * makeStep = m_qt4bc->makeStep(); - makeStep->init(); - const ProjectExplorer::ProcessParameters * const makepp = makeStep->processParameters(); - - ProjectExplorer::AbstractProcessStep *qmakeStep = m_qt4bc->qmakeStep(); - qmakeStep->init(); - const ProjectExplorer::ProcessParameters * const qmakepp = qmakeStep->processParameters(); - - m_publishSteps.clear(); - const QChar space = QLatin1Char(' '); - m_publishSteps.append(new S60CommandPublishStep(*m_qt4bc, - makepp->effectiveCommand() + QLatin1String(" clean -w"), - tr("Clean"), - false)); - - m_publishSteps.append(new S60CommandPublishStep(*m_qt4bc, - qmakepp->effectiveCommand() + space + qmakepp->arguments(), - tr("qmake"))); - - m_publishSteps.append(new S60CommandPublishStep(*m_qt4bc, - makepp->effectiveCommand() + space + makepp->arguments(), - tr("Build"))); - if (isDynamicLibrary(*m_qt4project)) { - const QString freezeArg = QLatin1String("freeze-") + makepp->arguments(); - m_publishSteps.append(new S60CommandPublishStep(*m_qt4bc, - makepp->effectiveCommand() + space + freezeArg, - tr("Freeze"))); - - m_publishSteps.append(new S60CommandPublishStep(*m_qt4bc, - makepp->effectiveCommand() + QLatin1String(" clean -w"), - tr("Secondary clean"), - false)); - - m_publishSteps.append(new S60CommandPublishStep(*m_qt4bc, - qmakepp->effectiveCommand() + space + qmakepp->arguments(), - tr("Secondary qmake"))); - - m_publishSteps.append(new S60CommandPublishStep(*m_qt4bc, - makepp->effectiveCommand() + space + makepp->arguments(), - tr("Secondary build"))); - } - - QString signArg = QLatin1String("unsigned_installer_sis"); - if (m_qt4bc->qtVersion()->qtVersion() == QtSupport::QtVersionNumber(4,6,3) ) - signArg = QLatin1String("installer_sis"); - m_publishSteps.append(new S60CommandPublishStep(*m_qt4bc, - makepp->effectiveCommand() + space + signArg, - tr("Making SIS file"))); - - // set up access to vendor names - QStringList deploymentLevelVars = m_reader->values(QLatin1String("DEPLOYMENT")); - QStringList vendorInfoVars; - QStringList valueLevelVars; - - foreach (const QString &deploymentLevelVar, deploymentLevelVars) { - vendorInfoVars = m_reader->values(deploymentLevelVar+QLatin1String(".pkg_prerules")); - foreach (const QString &vendorInfoVar, vendorInfoVars) { - valueLevelVars = m_reader->values(vendorInfoVar); - foreach (const QString &valueLevelVar, valueLevelVars) { - if (valueLevelVar.startsWith(QLatin1String("%{\""))) { - m_vendorInfoVariable = vendorInfoVar; - break; - } - } - } - } -#endif -} - -bool S60PublisherOvi::isDynamicLibrary(const Qt4Project &project) const -{ - Qt4ProFileNode *proFile = project.rootQt4ProjectNode(); - if (proFile->projectType() == LibraryTemplate) { - const QStringList &config(proFile->variableValue(ConfigVar)); - if (!config.contains(QLatin1String("static")) && !config.contains(QLatin1String("staticlib"))) - return true; - } - return false; -} - -QString S60PublisherOvi::nameFromTarget() const -{ - QString target = m_reader->value(QLatin1String("TARGET")); - if (target.isEmpty()) - target = QFileInfo(m_qt4project->rootProjectNode()->path()).baseName(); - return target; -} - -QString S60PublisherOvi::displayName() const -{ - const QStringList displayNameList = m_reader->values(QLatin1String("DEPLOYMENT.display_name")); - - if (displayNameList.isEmpty()) - return nameFromTarget(); - - return displayNameList.join(QLatin1String(" ")); -} - -QString S60PublisherOvi::globalVendorName() const -{ - QStringList vendorinfos = m_reader->values(m_vendorInfoVariable); - - foreach (QString vendorinfo, vendorinfos) { - if (vendorinfo.startsWith(QLatin1Char(':'))) { - return vendorinfo.remove(QLatin1Char(':')).remove(QLatin1Char('"')).trimmed(); - } - } - return QString(); -} - -QString S60PublisherOvi::localisedVendorNames() const -{ - QStringList vendorinfos = m_reader->values(m_vendorInfoVariable); - QString result; - - QStringList localisedVendorNames; - foreach (QString vendorinfo, vendorinfos) { - if (vendorinfo.startsWith(QLatin1Char('%'))) { - localisedVendorNames = vendorinfo.remove(QLatin1String("%{")).remove(QLatin1Char('}')).split(QLatin1Char(',')); - foreach (QString localisedVendorName, localisedVendorNames) { - if (!result.isEmpty()) - result.append(QLatin1String(", ")); - result.append(localisedVendorName.remove(QLatin1Char('"')).trimmed()); - } - return result; - } - } - return QString(); -} - -bool S60PublisherOvi::isVendorNameValid(const QString &vendorName) const -{ - // vendorName cannot containg "Nokia" - if (vendorName.trimmed().contains(QLatin1String(Constants::REJECTED_VENDOR_NAMES_NOKIA), Qt::CaseInsensitive)) - return false; - - // vendorName cannot be any of the rejected vendor names - foreach (const QString &rejectedVendorName, m_rejectedVendorNames) - if (vendorName.trimmed().compare(rejectedVendorName, Qt::CaseInsensitive) == 0) - return false; - - return true; -} - -QString S60PublisherOvi::qtVersion() const -{ - QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(m_qt4bc->target()->profile()); - return version ? version->displayName() : QString(); -} - -QString S60PublisherOvi::uid3() const -{ - return m_reader->value(QLatin1String("TARGET.UID3")); -} - -bool S60PublisherOvi::isUID3Valid(const QString &uid3) const -{ - bool ok; - ulong hex = uid3.trimmed().toULong(&ok, 0); - - return ok && (hex >= AssignedRestrictedStart && hex <= AssignedRestrictedEnd); -} - -bool S60PublisherOvi::isTestUID3(const QString &uid3) const -{ - bool ok; - ulong hex = uid3.trimmed().toULong(&ok, 0); - return ok && (hex >= TestStart && hex <= TestEnd); -} - -bool S60PublisherOvi::isKnownSymbianSignedUID3(const QString &uid3) const -{ - bool ok; - ulong hex = uid3.trimmed().toULong(&ok, 0); - return ok && (hex >= SymbianSignedUnprotectedStart && hex <= SymbianSignedUnprotectedEnd); -} - -QString S60PublisherOvi::capabilities() const -{ - return m_reader->values(QLatin1String("TARGET.CAPABILITY")).join(QLatin1String(", ")); -} - -bool S60PublisherOvi::isCapabilityOneOf(const QString &capability, CapabilityLevel level) const -{ - QStringList capabilitiesInLevel; - if (level == CertifiedSigned) - capabilitiesInLevel = m_capabilitiesForCertifiedSigned; - else if (level == ManufacturerApproved) - capabilitiesInLevel = m_capabilitesForManufacturerApproved; - - return capabilitiesInLevel.contains(capability.trimmed()); -} - -void S60PublisherOvi::updateProFile(const QString &var, const QString &values) -{ - QStringList lines; - ProFile *profile = m_reader->parsedProFile(m_qt4project->rootProjectNode()->path()); - - Utils::FileReader reader; - if (!reader.fetch(m_qt4project->rootProjectNode()->path(), QIODevice::Text)) { - emit progressReport(reader.errorString(), m_errorColor); - return; - } - lines = QString::fromLocal8Bit(reader.data()).split(QLatin1Char('\n')); - - ProWriter::putVarValues(profile, &lines, QStringList() << values, var, - ProWriter::ReplaceValues | ProWriter::OneLine | ProWriter::AppendOperator, - QLatin1String("symbian")); - - Utils::FileSaver saver(m_qt4project->rootProjectNode()->path(), QIODevice::Text); - saver.write(lines.join(QLatin1String("\n")).toLocal8Bit()); - if (!saver.finalize()) - emit progressReport(saver.errorString(), m_errorColor); -} - -void S60PublisherOvi::updateProFile() -{ - if (m_vendorInfoVariable.isEmpty()) { - m_vendorInfoVariable = QLatin1String("vendorinfo"); - updateProFile(QLatin1String("my_deployment.pkg_prerules"), m_vendorInfoVariable); - updateProFile(QLatin1String("DEPLOYMENT"), QLatin1String("my_deployment")); - } - - if (!m_displayName.isEmpty() && m_displayName != nameFromTarget()) - updateProFile(QLatin1String("DEPLOYMENT.display_name"), m_displayName); - - updateProFile(m_vendorInfoVariable, QLatin1String("\"%{") - + m_localVendorNames - + QLatin1String("}\" \":\\\"") - + m_vendorName - + QLatin1String("\\\"\"") ); - updateProFile(QLatin1String("TARGET.UID3"), m_appUid); -} - -void S60PublisherOvi::buildSis() -{ - updateProFile(); - if (!runStep()) { - emit progressReport(tr("Done.\n"), m_commandColor); - emit finished(); - } -} - -bool S60PublisherOvi::runStep() -{ - QTC_ASSERT(m_publishSteps.count(), return false); - - S60PublishStep *step = m_publishSteps.at(0); - emit progressReport(step->displayDescription() + QLatin1Char('\n'), m_commandColor); - connect(step, SIGNAL(finished(bool)), this, SLOT(publishStepFinished(bool))); - connect(step, SIGNAL(output(QString,bool)), this, SLOT(printMessage(QString,bool))); - step->start(); - return true; -} - -bool S60PublisherOvi::nextStep() -{ - QTC_ASSERT(m_publishSteps.count(), return false); - m_publishSteps.removeAt(0); - return m_publishSteps.count(); -} - -void S60PublisherOvi::printMessage(QString message, bool error) -{ - emit progressReport(message + QLatin1Char('\n'), error ? m_errorColor : m_okColor); -} - -void S60PublisherOvi::publishStepFinished(bool success) -{ - if (!success && m_publishSteps.at(0)->mandatory()) { - emit progressReport(tr("SIS file not created due to previous errors.\n") , m_errorColor); - emit finished(); - return; - } - - if (nextStep()) - runStep(); - else { - QString sisFile; - if (sisExists(sisFile)) { - emit progressReport(tr("Created %1.\n").arg(QDir::toNativeSeparators(sisFile)), m_normalColor); - m_finishedAndSuccessful = true; - emit succeeded(); - } - emit progressReport(tr("Done.\n"), m_commandColor); - emit finished(); - } -} - -bool S60PublisherOvi::sisExists(QString &sisFile) -{ - QString fileNamePostFix = QLatin1String("_installer_unsigned.sis"); - QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(m_qt4bc->target()->profile()); - if (version && version->qtVersion() == QtSupport::QtVersionNumber(4,6,3) ) - fileNamePostFix = QLatin1String("_installer.sis"); - - sisFile = m_qt4bc->buildDirectory() + QLatin1Char('/') + m_qt4project->displayName() + fileNamePostFix; - - QFileInfo fi(sisFile); - return fi.exists(); -} - -QString S60PublisherOvi::createdSisFileContainingFolder() -{ - QString fileNamePostFix = QLatin1String("_installer_unsigned.sis"); - QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(m_qt4bc->target()->profile()); - if (version && version->qtVersion() == QtSupport::QtVersionNumber(4,6,3) ) - fileNamePostFix = QLatin1String("_installer.sis"); - - QString resultFile = m_qt4bc->buildDirectory() + QLatin1Char('/') + m_qt4project->displayName() + fileNamePostFix; - QFileInfo fi(resultFile); - - return fi.exists() ? QDir::toNativeSeparators(m_qt4bc->buildDirectory()) : QString(); -} - -QString S60PublisherOvi::createdSisFilePath() -{ - QString fileNamePostFix = QLatin1String("_installer_unsigned.sis"); - QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(m_qt4bc->target()->profile()); - if (version && version->qtVersion() == QtSupport::QtVersionNumber(4,6,3) ) - fileNamePostFix = QLatin1String("_installer.sis"); - - const QString resultFile = m_qt4bc->buildDirectory() + QLatin1Char('/') - + m_qt4project->displayName() + fileNamePostFix; - QFileInfo fi(resultFile); - return fi.exists() ? QDir::toNativeSeparators(resultFile) : QString(); -} - -bool S60PublisherOvi::hasSucceeded() -{ - return m_finishedAndSuccessful; -} - -// ======== S60PublishStep - -S60PublishStep::S60PublishStep(bool mandatory, QObject *parent) - : QObject(parent), - m_succeeded(false), - m_mandatory(mandatory) -{ -} - -bool S60PublishStep::succeeded() const -{ - return m_succeeded; -} - -bool S60PublishStep::mandatory() const -{ - return m_mandatory; -} - -void S60PublishStep::setSucceeded(bool succeeded) -{ - m_succeeded = succeeded; -} - -// ======== S60CommandPublishStep - -S60CommandPublishStep::S60CommandPublishStep(const Qt4ProjectManager::Qt4BuildConfiguration &bc, - const QString &command, - const QString &name, - bool mandatory, - QObject *parent) - : S60PublishStep(mandatory, parent), - m_proc(new QProcess(this)), - m_command(command), - m_name(name) -{ - m_proc->setEnvironment(bc.environment().toStringList()); - m_proc->setWorkingDirectory(bc.buildDirectory()); - - connect(m_proc, SIGNAL(finished(int)), SLOT(processFinished(int))); -} - -void S60CommandPublishStep::processFinished(int exitCode) -{ - QByteArray outputText = m_proc->readAllStandardOutput(); - if (!outputText.isEmpty()) - emit output(QString::fromLocal8Bit(outputText), false); - - outputText = m_proc->readAllStandardError(); - if (!outputText.isEmpty()) - emit output(QString::fromLocal8Bit(outputText), true); - - setSucceeded(exitCode == QProcess::NormalExit); - emit finished(succeeded()); -} - -void S60CommandPublishStep::start() -{ - emit output(m_command, false); - m_proc->start(m_command); -} - -QString S60CommandPublishStep::displayDescription() const -{ - //: %1 is a name of the Publish Step i.e. Clean Step - return tr("Running %1").arg(m_name); -} - -} // namespace Internal -} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publisherovi.h b/src/plugins/qt4projectmanager/qt-s60/s60publisherovi.h deleted file mode 100644 index 8438ad90140..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60publisherovi.h +++ /dev/null @@ -1,231 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ -#ifndef S60PUBLISHEROVI_H -#define S60PUBLISHEROVI_H - -#include <QObject> -#include <QColor> - -QT_BEGIN_NAMESPACE -class QProcess; -QT_END_NAMESPACE - -namespace QtSupport { -class ProFileReader; -} - -namespace ProjectExplorer { -class Project; -} - -namespace Qt4ProjectManager { -class Qt4BuildConfiguration; -class Qt4Project; -namespace Internal { -class Qt4SymbianTarget; -class S60PublishStep; - -namespace Constants { -const char REJECTED_VENDOR_NAMES_VENDOR[] = "Vendor"; -const char REJECTED_VENDOR_NAMES_VENDOR_EN[] = "Vendor-EN"; -const char REJECTED_VENDOR_NAMES_NOKIA[] = "Nokia"; -const char REJECTED_VENDOR_NAMES_EMPTY[] = ""; - -const char CERTIFIED_SIGNED_CAPABILITY_NETWORK_CONTROL[] = "NetworkControl"; -const char CERTIFIED_SIGNED_CAPABILITY_MULTIMEDIA_DD[] = "MultimediaDD"; -const char CERTIFIED_SIGNED_CAPABILITY_COMM_DD[] = "CommDD"; -const char CERTIFIED_SIGNED_CAPABILITY_DISK_ADMIN[] = "DiskAdmin"; -const char MANUFACTURER_APPROVED_CAPABILITY_ALL_FILES[] = "AllFiles"; -const char MANUFACTURER_APPROVED_CAPABILITY_DRM[] = "DRM"; -const char MANUFACTURER_APPROVED_CAPABILITY_TCB[] = "TCB"; -} - -class S60PublisherOvi : public QObject -{ - Q_OBJECT - -public: - enum UID3Ranges { - // Protected UID range: 0x00000000 - 0x7FFFFFFF - // Unprotected UID range: 0x80000000 - 0xFFFFFFFF - // - // Specifically, there are two important unprotected UID ranges: - // UIDs from Symbian Signed: 0xA0000000 - 0xAFFFFFFF - // UIDs for test/development use: 0xE0000000 - 0xEFFFFFFF - // - // And one important protected range: - // UIDs from Ovi Sign: 0x20000000 to 0x2FFFFFFF - // Warning: Some of these UIDs are assigned by Symbiansigned. - // Apps with such UIDs cannot be signed by Ovi. - // It is currently impossible to say which UIDs have been assigned by whome. - - AssignedRestrictedStart = 0x20000000, - AssignedRestrictedEnd = 0x2FFFFFFF, - SymbianSignedUnprotectedStart = 0xA0000000, - SymbianSignedUnprotectedEnd = 0xAFFFFFFF, - TestStart = 0xE0000000, - TestEnd = 0xEFFFFFFF - }; - - enum CapabilityLevel { - CertifiedSigned, - ManufacturerApproved - }; - -public: - explicit S60PublisherOvi(QObject *parent = 0); - ~S60PublisherOvi(); - - void setBuildConfiguration(Qt4BuildConfiguration *qt4bc); - void cleanUp(); - void completeCreation(); - - QString displayName() const; - QString globalVendorName() const; - QString localisedVendorNames() const; - bool isVendorNameValid(const QString &vendorName) const; - - QString nameFromTarget() const; - QString qtVersion() const; - - QString uid3() const; - bool isUID3Valid(const QString &uid3) const; - bool isTestUID3(const QString &uid3) const; - bool isKnownSymbianSignedUID3(const QString &uid3) const; - - QString capabilities() const; - bool isCapabilityOneOf(const QString &capability, CapabilityLevel level) const; - - void updateProFile(); - void updateProFile(const QString &var, const QString &values); - void buildSis(); - - QString createdSisFileContainingFolder(); - QString createdSisFilePath(); - - bool hasSucceeded(); - - void setDisplayName(const QString &displayName); - void setVendorName(const QString &vendorName); - void setLocalVendorNames(const QString &localVendorNames); - void setAppUid(const QString &appuid); - -signals: - void progressReport(const QString& status, QColor c); - void succeeded(); - void finished(); - -public slots: - void publishStepFinished(bool succeeded); - void printMessage(QString message, bool error); - -private: - bool nextStep(); - bool runStep(); - - bool sisExists(QString &sisFile); - bool isDynamicLibrary(const Qt4Project &project) const; - -private: - QColor m_errorColor; - QColor m_commandColor; - QColor m_okColor; - QColor m_normalColor; - - Qt4BuildConfiguration * m_qt4bc; - const Qt4SymbianTarget * m_activeTargetOfProject; - Qt4Project * m_qt4project; - QtSupport::ProFileReader *m_reader; - QStringList m_rejectedVendorNames; - QStringList m_capabilitiesForCertifiedSigned; - QStringList m_capabilitesForManufacturerApproved; - QString m_vendorInfoVariable; - QString m_vendorName; - QString m_localVendorNames; - QString m_appUid; - QString m_displayName; - - QList<S60PublishStep *> m_publishSteps; - - bool m_finishedAndSuccessful; -}; - -class S60PublishStep : public QObject -{ - Q_OBJECT - -public: - explicit S60PublishStep(bool mandatory, QObject *parent = 0); - virtual void start() = 0; - - virtual QString displayDescription() const = 0; - bool succeeded() const; - bool mandatory() const; - -signals: - void finished(bool succeeded); - void output(QString output, bool error); - -protected: - void setSucceeded(bool succeeded); - -private: - bool m_succeeded; - bool m_mandatory; -}; - -class S60CommandPublishStep : public S60PublishStep -{ - Q_OBJECT - -public: - explicit S60CommandPublishStep(const Qt4BuildConfiguration& bc, - const QString &command, - const QString &name, - bool mandatory = true, - QObject *parent = 0); - - virtual void start(); - virtual QString displayDescription() const; - -private slots: - void processFinished(int exitCode); - -private: - QProcess* m_proc; - const QString m_command; - const QString m_name; - -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // S60PUBLISHEROVI_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingbuildsettingspageovi.cpp b/src/plugins/qt4projectmanager/qt-s60/s60publishingbuildsettingspageovi.cpp deleted file mode 100644 index 69352b346e1..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60publishingbuildsettingspageovi.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60publishingbuildsettingspageovi.h" -#include "s60publisherovi.h" -#include "ui_s60publishingbuildsettingspageovi.h" -#include "qt4buildconfiguration.h" -#include "qt4projectmanagerconstants.h" - -#include <projectexplorer/project.h> -#include <projectexplorer/target.h> -#include <projectexplorer/toolchain.h> - -#include <QAbstractButton> - -namespace Qt4ProjectManager { -namespace Internal { - -S60PublishingBuildSettingsPageOvi::S60PublishingBuildSettingsPageOvi(S60PublisherOvi *publisher, const ProjectExplorer::Project *project, QWidget *parent) : - QWizardPage(parent), - m_bc(0), - m_toolchain(0), - m_ui(new Ui::S60PublishingBuildSettingsPageOvi), - m_publisher(publisher) -{ - m_ui->setupUi(this); - -#if 0 // FIXME: This needs serious work! - QList<Qt4BuildConfiguration *> list; - foreach (const ProjectExplorer::Target *const target, project->targets()) { - if (target->id() != Qt4ProjectManager::Constants::S60_DEVICE_TARGET_ID) - continue; - foreach (ProjectExplorer::BuildConfiguration * const bc, target->buildConfigurations()) { - Qt4BuildConfiguration * const qt4bc - = qobject_cast<Qt4BuildConfiguration *>(bc); - if (!qt4bc || !qt4bc->qtVersion()) - continue; - if (qt4bc->qtVersion()->qtVersion() > QtSupport::QtVersionNumber(4, 6, 2)) - list << qt4bc; - } - break; - } - - foreach (Qt4BuildConfiguration *qt4bc, list) - m_ui->chooseBuildConfigDropDown->addItem(qt4bc->displayName(), QVariant::fromValue(static_cast<ProjectExplorer::BuildConfiguration *>(qt4bc))); - - // todo more intelligent selection? prefer newer versions? - foreach (Qt4BuildConfiguration *qt4bc, list) - if (!m_bc && !(qt4bc->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild)) - m_bc = qt4bc; - - if (!m_bc && !list.isEmpty()) - m_bc = list.first(); - - m_ui->chooseBuildConfigDropDown->setSizeAdjustPolicy(QComboBox::AdjustToContentsOnFirstShow); - int focusedIndex = m_ui->chooseBuildConfigDropDown->findData(QVariant::fromValue(m_bc)); - m_ui->chooseBuildConfigDropDown->setCurrentIndex(focusedIndex); - m_ui->chooseBuildConfigDropDown->setEnabled(!list.isEmpty()); - m_publisher->setBuildConfiguration(static_cast<Qt4BuildConfiguration *>(m_bc)); - m_ui->buildConfigInfoLabel->setVisible(list.isEmpty()); - - m_ui->buildConfigInfoLabel->setToolTip(tr("No valid Qt version has been detected.<br>" - "Define a correct Qt version in \"Options > Qt4\"")); - m_ui->toolchainInfoIconLabel->setToolTip(tr("No valid tool chain has been detected.<br>" - "Define a correct tool chain in \"Options > Tool Chains\"")); - populateToolchainList(m_bc); -#else - Q_UNUSED(project); -#endif - - //change the build configuration if the user changes it - connect(m_ui->chooseBuildConfigDropDown, SIGNAL(currentIndexChanged(int)), this, SLOT(buildConfigChosen())); - connect(this, SIGNAL(configurationChosen()), SIGNAL(completeChanged())); - connect(this, SIGNAL(toolchainConfigurationChosen()), SIGNAL(completeChanged())); -} - -bool S60PublishingBuildSettingsPageOvi::isComplete() const -{ - return m_bc && m_toolchain; -} - -void S60PublishingBuildSettingsPageOvi::populateToolchainList(ProjectExplorer::BuildConfiguration *bc) -{ -#if 0 // FIXME: Do the right thing here... - if (!bc) - return; - - disconnect(m_ui->chooseToolchainDropDown, SIGNAL(currentIndexChanged(int)), this, SLOT(toolchainChosen())); - m_ui->chooseToolchainDropDown->clear(); - QList<ProjectExplorer::ToolChain *> toolchains = bc->target()->possibleToolChains(bc); - - int index = 0; - bool toolchainChanged = true; // if the new build conf. doesn't contain previous toolchain - foreach (ProjectExplorer::ToolChain *toolchain, toolchains) { - m_ui->chooseToolchainDropDown->addItem(toolchain->displayName(), - qVariantFromValue(static_cast<void *>(toolchain))); - if (toolchainChanged && m_toolchain == toolchain) { - toolchainChanged = false; - m_ui->chooseToolchainDropDown->setCurrentIndex(index); - } - ++index; - } - - connect(m_ui->chooseToolchainDropDown, SIGNAL(currentIndexChanged(int)), this, SLOT(toolchainChosen())); - - m_ui->toolchainInfoIconLabel->setVisible(!toolchains.size()); - m_ui->chooseToolchainDropDown->setEnabled(toolchains.size() > 1); - - if (toolchainChanged) - toolchainChosen(); - else - bc->setToolChain(m_toolchain); -#else - Q_UNUSED(bc); -#endif -} - -void S60PublishingBuildSettingsPageOvi::buildConfigChosen() -{ - int currentIndex = m_ui->chooseBuildConfigDropDown->currentIndex(); - if (currentIndex == -1) - return; - m_bc = m_ui->chooseBuildConfigDropDown->itemData(currentIndex).value<ProjectExplorer::BuildConfiguration *>(); - populateToolchainList(m_bc); - m_publisher->setBuildConfiguration(static_cast<Qt4BuildConfiguration *>(m_bc)); - emit configurationChosen(); -} - -void S60PublishingBuildSettingsPageOvi::toolchainChosen() -{ -#if 0 // FIXME: Do the right thing! - const int currentIndex = m_ui->chooseToolchainDropDown->currentIndex(); - if (currentIndex == -1) { - m_toolchain = 0; - emit toolchainConfigurationChosen(); - return; - } - - m_toolchain = static_cast<ProjectExplorer::ToolChain *>(m_ui->chooseToolchainDropDown->itemData(currentIndex, Qt::UserRole).value<void *>()); - - if (m_bc) - m_bc->setToolChain(m_toolchain); -#endif - emit toolchainConfigurationChosen(); -} - -S60PublishingBuildSettingsPageOvi::~S60PublishingBuildSettingsPageOvi() -{ - delete m_ui; -} - -} // namespace Internal -} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingbuildsettingspageovi.h b/src/plugins/qt4projectmanager/qt-s60/s60publishingbuildsettingspageovi.h deleted file mode 100644 index 6f6e69af30c..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60publishingbuildsettingspageovi.h +++ /dev/null @@ -1,82 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60PUBLISHINGBUILDSETTINGSPAGEOVI_H -#define S60PUBLISHINGBUILDSETTINGSPAGEOVI_H - -#include <QWizardPage> - -namespace ProjectExplorer { -class Project; -class BuildConfiguration; -class ToolChain; -} - -namespace Qt4ProjectManager { -namespace Internal { - -namespace Ui { class S60PublishingBuildSettingsPageOvi; } - -class S60PublisherOvi; - - -class S60PublishingBuildSettingsPageOvi : public QWizardPage -{ - Q_OBJECT - -public: - explicit S60PublishingBuildSettingsPageOvi(S60PublisherOvi *publisher, - const ProjectExplorer::Project *project, QWidget *parent = 0); - ~S60PublishingBuildSettingsPageOvi(); - - virtual bool isComplete() const; - -signals: - void configurationChosen(); - void toolchainConfigurationChosen(); - -private slots: - void buildConfigChosen(); - void toolchainChosen(); - -private: - void populateToolchainList(ProjectExplorer::BuildConfiguration *bc); - -private: - ProjectExplorer::BuildConfiguration *m_bc; - ProjectExplorer::ToolChain *m_toolchain; - Ui::S60PublishingBuildSettingsPageOvi *m_ui; - S60PublisherOvi * const m_publisher; -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // S60PUBLISHINGBUILDSETTINGSPAGEOVI_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingbuildsettingspageovi.ui b/src/plugins/qt4projectmanager/qt-s60/s60publishingbuildsettingspageovi.ui deleted file mode 100644 index b4efc6b00ee..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60publishingbuildsettingspageovi.ui +++ /dev/null @@ -1,118 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Qt4ProjectManager::Internal::S60PublishingBuildSettingsPageOvi</class> - <widget class="QWidget" name="Qt4ProjectManager::Internal::S60PublishingBuildSettingsPageOvi"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>414</width> - <height>300</height> - </rect> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="2" column="1"> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item row="0" column="2"> - <widget class="QLabel" name="buildConfigInfoLabel"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/compile_error.png</pixmap> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QComboBox" name="chooseToolchainDropDown"> - <property name="enabled"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="chooseBuildConfigLabel"> - <property name="text"> - <string>Choose a build configuration:</string> - </property> - </widget> - </item> - <item row="0" column="3"> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>252</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="0" column="1"> - <widget class="QComboBox" name="chooseBuildConfigDropDown"> - <property name="enabled"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="chooseToolchainLabel"> - <property name="text"> - <string>Choose a tool chain:</string> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QLabel" name="toolchainInfoIconLabel"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/compile_error.png</pixmap> - </property> - </widget> - </item> - <item row="3" column="0" colspan="4"> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Only Qt versions above 4.6.3 are made available in this wizard. -Previous Qt versions have limitations in building suitable SIS files.</string> - </property> - </widget> - </item> - <item row="1" column="3"> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <resources> - <include location="../../projectexplorer/projectexplorer.qrc"/> - </resources> - <connections/> -</ui> diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.cpp b/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.cpp deleted file mode 100644 index 993202e5e2c..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ -#include "s60publishingresultspageovi.h" -#include "s60publisherovi.h" -#include "ui_s60publishingresultspageovi.h" - -#include <QDesktopServices> -#include <QAbstractButton> -#include <QScrollBar> -#include <QProcess> - -namespace Qt4ProjectManager { -namespace Internal { - -S60PublishingResultsPageOvi::S60PublishingResultsPageOvi(S60PublisherOvi *publisher, QWidget *parent) : - QWizardPage(parent), - ui(new Ui::S60PublishingResultsPageOvi), - m_publisher(publisher) -{ - ui->setupUi(this); - connect(m_publisher, SIGNAL(progressReport(QString,QColor)), SLOT(updateResultsPage(QString,QColor))); -} - -S60PublishingResultsPageOvi::~S60PublishingResultsPageOvi() -{ - delete ui; -} - -void S60PublishingResultsPageOvi::initializePage() -{ - wizard()->setButtonText(QWizard::FinishButton, tr("Open Containing Folder")); - connect(m_publisher, SIGNAL(finished()), SIGNAL(completeChanged())); - connect(m_publisher, SIGNAL(finished()), SLOT(packageCreationFinished())); - connect(wizard()->button(QWizard::FinishButton), SIGNAL(clicked()), SLOT(openFileLocation())); - m_publisher->buildSis(); -} - -bool S60PublishingResultsPageOvi::isComplete() const -{ - return m_publisher->hasSucceeded(); -} - -void S60PublishingResultsPageOvi::packageCreationFinished() -{ - wizard()->setButtonText(QWizard::CancelButton, tr("Close")); -} - -void S60PublishingResultsPageOvi::updateResultsPage(const QString& status, QColor c) -{ - const bool atBottom = isScrollbarAtBottom(); - QTextCursor cur(ui->resultsTextBrowser->document()); - QTextCharFormat tcf = cur.charFormat(); - tcf.setForeground(c); - cur.movePosition(QTextCursor::End); - cur.insertText(status, tcf); - if (atBottom) - scrollToBottom(); -} - -bool S60PublishingResultsPageOvi::isScrollbarAtBottom() const -{ - QScrollBar *scrollBar = ui->resultsTextBrowser->verticalScrollBar(); - return scrollBar->value() == scrollBar->maximum(); -} - -void S60PublishingResultsPageOvi::scrollToBottom() -{ - QScrollBar *scrollBar = ui->resultsTextBrowser->verticalScrollBar(); - scrollBar->setValue(scrollBar->maximum()); - // QPlainTextEdit destroys the first calls value in case of multiline - // text, so make sure that the scroll bar actually gets the value set. - // Is a noop if the first call succeeded. - scrollBar->setValue(scrollBar->maximum()); -} - -void S60PublishingResultsPageOvi::openFileLocation() -{ -#ifdef Q_OS_WIN - QProcess::startDetached(QLatin1String("explorer /select,")+ m_publisher->createdSisFilePath()); -#else - QDesktopServices::openUrl(QUrl(QLatin1String("file:///") + m_publisher->createdSisFileContainingFolder())); -#endif -} - -} // namespace Internal -} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.h b/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.h deleted file mode 100644 index 5d86ff8e8e6..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.h +++ /dev/null @@ -1,71 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60PUBLISHINGRESULTSPAGEOVI_H -#define S60PUBLISHINGRESULTSPAGEOVI_H - -#include <QWizardPage> - -namespace Qt4ProjectManager { -namespace Internal { - -class S60PublisherOvi; - -namespace Ui { class S60PublishingResultsPageOvi; } - -class S60PublishingResultsPageOvi : public QWizardPage -{ - Q_OBJECT - -public: - explicit S60PublishingResultsPageOvi(S60PublisherOvi *publisher, QWidget *parent = 0); - ~S60PublishingResultsPageOvi(); - - virtual void initializePage(); - virtual bool isComplete() const; - -public slots: - void updateResultsPage(const QString &status, QColor c); - void openFileLocation(); - void packageCreationFinished(); - -private: - void scrollToBottom(); - bool isScrollbarAtBottom() const; - -private: - Ui::S60PublishingResultsPageOvi *ui; - S60PublisherOvi * const m_publisher; -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // S60PUBLISHINGRESULTSPAGEOVI_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.ui b/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.ui deleted file mode 100644 index b5307d8e560..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.ui +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Qt4ProjectManager::Internal::S60PublishingResultsPageOvi</class> - <widget class="QWidget" name="Qt4ProjectManager::Internal::S60PublishingResultsPageOvi"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>400</width> - <height>300</height> - </rect> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <widget class="QTextBrowser" name="resultsTextBrowser"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingsissettingspageovi.cpp b/src/plugins/qt4projectmanager/qt-s60/s60publishingsissettingspageovi.cpp deleted file mode 100644 index 94ac9cefed0..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60publishingsissettingspageovi.cpp +++ /dev/null @@ -1,311 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60publishingsissettingspageovi.h" -#include "ui_s60publishingsissettingspageovi.h" -#include "s60publisherovi.h" -#include "s60certificateinfo.h" - -#include <QAbstractButton> - -using namespace ProjectExplorer; - -namespace Qt4ProjectManager { -namespace Internal { - -S60PublishingSisSettingsPageOvi::S60PublishingSisSettingsPageOvi(S60PublisherOvi *publisher, QWidget *parent) : - QWizardPage(parent), - ui(new Ui::S60PublishingSisSettingsPageOvi), - m_publisher(publisher) -{ - ui->setupUi(this); - - //Setup labels which display icons about the state of the entry - //error icons - ui->capabilitiesErrorLabel->hide(); - ui->qtVersionErrorLabel->hide(); - ui->uid3ErrorLabel->hide(); - ui->globalVendorNameErrorLabel->hide(); - ui->localisedVendorNamesErrorLabel->hide(); - //ok icons - ui->capabilitiesOkLabel->hide(); - ui->qtVersionOkLabel->hide(); - ui->uid3OkLabel->hide(); - ui->globalVendorNameOkLabel->hide(); - ui->localisedVendorNamesOkLabel->hide(); - //warning icons - ui->globalVendorNameWarningLabel->hide(); - ui->localisedVendorNamesWarningLabel->hide(); - ui->qtVersionWarningLabel->hide(); - ui->uid3WarningLabel->hide(); -} - -void S60PublishingSisSettingsPageOvi::initializePage() -{ - //Finish creation of the publisher - m_publisher->completeCreation(); - - showWarningsForUnenforcableChecks(); - - //Check Display Name - ui->displayNameLineEdit->setText(m_publisher->displayName()); - displayNameChanged(); - connect(ui->displayNameLineEdit,SIGNAL(textChanged(QString)),SLOT(displayNameChanged())); - - //Check Global Vendor Name - ui->globalVendorNameLineEdit->setText(m_publisher->globalVendorName()); - globalVendorNameChanged(); - connect(ui->globalVendorNameLineEdit,SIGNAL(textChanged(QString)),SLOT(globalVendorNameChanged())); - - //Check Localised Vendor Names - ui->localisedVendorNamesLineEdit->setText(m_publisher->localisedVendorNames()); - localisedVendorNamesChanged(); - connect(ui->localisedVendorNamesLineEdit,SIGNAL(textChanged(QString)),SLOT(localisedVendorNamesChanged())); - - //Check Qt Version Used in Builds - ui->qtVersionDisplayLabel->setText(m_publisher->qtVersion()); - qtVersionChanged(); - - //Check UID3 - ui->uid3LineEdit->setText(m_publisher->uid3()); - uid3Changed(); - connect(ui->uid3LineEdit,SIGNAL(textChanged(QString)),SLOT(uid3Changed())); - - //Check for capabilities which are not signed for - ui->capabilitiesDisplayLabel->setText(m_publisher->capabilities()); - capabilitiesChanged(); -} - -void S60PublishingSisSettingsPageOvi::cleanupPage() -{ - m_publisher->cleanUp(); -} - -S60PublishingSisSettingsPageOvi::~S60PublishingSisSettingsPageOvi() -{ - delete ui; -} - -void S60PublishingSisSettingsPageOvi::reflectSettingState(bool settingState, QLabel *okLabel, QLabel *errorLabel, QLabel *errorReasonLabel, const QString &errorReason) -{ - if (!settingState) { - okLabel->hide(); - errorLabel->show(); - errorReasonLabel->setTextFormat(Qt::RichText); - errorReasonLabel->setText(errorReason); - errorReasonLabel->show(); - } else { - okLabel->show(); - errorLabel->hide(); - errorReasonLabel->hide(); - } - - // This is a hack. - // the labels change size, most likely increasing height but that doesn't change the wizard layout - // It essentially forces QWizard to update its layout. (Until setTitleFormat checks whether the format changed at all...) - // todo figure out whether the QWizard should be doing that automatically - wizard()->setTitleFormat(wizard()->titleFormat()); -} - -void S60PublishingSisSettingsPageOvi::displayNameChanged() -{ - reflectSettingState(!ui->displayNameLineEdit->text().isEmpty(), - ui->displayNameOkLabel, - ui->displayNameErrorLabel, - ui->displayNameErrorReasonLabel, - tr("This should be application's display name. <br>" - "It cannot be empty.<br>")); - - const int visibleCharacters = 12; - if (ui->displayNameLineEdit->text().length() > visibleCharacters) { - ui->displayNameWarningLabel->show(); - ui->displayNameWarningReasonLabel->setText(tr("The display name is quite long.<br>" - "It might not be fully visible in the phone's menu.<br>")); - ui->displayNameWarningReasonLabel->show(); - } else { - ui->displayNameWarningLabel->hide(); - ui->displayNameWarningReasonLabel->hide(); - } - - m_publisher->setDisplayName(ui->displayNameLineEdit->text()); -} - -void S60PublishingSisSettingsPageOvi::globalVendorNameChanged() -{ - reflectSettingState(m_publisher->isVendorNameValid(ui->globalVendorNameLineEdit->text()), - ui->globalVendorNameOkLabel, - ui->globalVendorNameErrorLabel, - ui->globalVendorNameErrorReasonLabel, - tr("\"%1\" is a default vendor name used for testing and development. <br>" - "The Vendor_Name field cannot contain the name 'Nokia'. <br>" - "You are advised against using the default names 'Vendor' and 'Vendor-EN'. <br>" - "You should also not leave the entry blank. <br>" - "see <a href=\"http://www.developer.nokia.com/Distribute/Packaging_and_signing.xhtml\">Packaging and Signing</a> for guidelines.<br>") - .arg(ui->globalVendorNameLineEdit->text())); - m_publisher->setVendorName(ui->globalVendorNameLineEdit->text()); -} - -void S60PublishingSisSettingsPageOvi::localisedVendorNamesChanged() -{ - QStringList localisedVendorNames = ui->localisedVendorNamesLineEdit->text().split(QLatin1Char(',')); - - bool settingState = true; - QStringList wrongVendorNames; - - foreach (const QString &localisedVendorName, localisedVendorNames) { - if (!m_publisher->isVendorNameValid(localisedVendorName)) { - wrongVendorNames.append(localisedVendorName); - settingState = false; - } - } - - const QString wrongVendorNamesString = wrongVendorNames.join(QLatin1String(", ")); - QString pluralOrSingular = tr("%1 is a default vendor name used for testing and development.").arg(wrongVendorNamesString); - if (wrongVendorNames.count() > 1) - pluralOrSingular = tr("%1 are default vendor names used for testing and development.").arg(wrongVendorNamesString); - - reflectSettingState(settingState, - ui->localisedVendorNamesOkLabel, - ui->localisedVendorNamesErrorLabel, - ui->localisedVendorNamesErrorReasonLabel, - tr("%1 <br>" - "The Vendor_Name field cannot contain the name 'Nokia'. <br>" - "You are advised against using the default names 'Vendor' and 'Vendor-EN'. <br>" - "You should also not leave the entry blank. <br>" - "See <a href=\"http://www.developer.nokia.com/Distribute/Packaging_and_signing.xhtml\">" - "Packaging and Signing</a> for guidelines.<br>").arg(pluralOrSingular)); - m_publisher->setLocalVendorNames(ui->localisedVendorNamesLineEdit->text()); -} - -void S60PublishingSisSettingsPageOvi::qtVersionChanged() -{ -} - -void S60PublishingSisSettingsPageOvi::uid3Changed() -{ - QString testUID3ErrorMsg = tr("The application UID %1 is only for testing and development.<br>" - "SIS packages built with it cannot be distributed via the Nokia Store.<br>"); - - QString symbianSignedUID3ErrorMsg = tr("The application UID %1 is a symbiansigned.com UID. <br>" - "Applications with this UID will be rejected by " - "Application Signing Services for Nokia Store.<br>" - "If you want to continue with a symbiansigned.com UID, " - "sign your application on symbiansigned.com and upload the " - "signed application to Nokia Publish.<br>"); - - QString errorMsg = tr("The application UID %1 is not an acceptable UID.<br>" - "SIS packages built with it cannot be signed by " - "Application Signing Services for Nokia Store.<br>"); - - if (m_publisher->isTestUID3(ui->uid3LineEdit->text())) { - errorMsg = testUID3ErrorMsg; - } else if (m_publisher->isKnownSymbianSignedUID3(ui->uid3LineEdit->text())) { - errorMsg = symbianSignedUID3ErrorMsg; - } - - reflectSettingState(m_publisher->isUID3Valid(ui->uid3LineEdit->text()), - ui->uid3OkLabel, - ui->uid3ErrorLabel, - ui->uid3ErrorReasonLabel, - tr("The application UID is a global unique indentifier of the SIS package.<br>") + - errorMsg.arg(ui->uid3LineEdit->text()) + - tr("To get a unique application UID for your package file,<br>" - "please register at <a href=\"http://info.publish.ovi.com/\">publish.ovi.com</a>")); - - if (m_publisher->isUID3Valid(ui->uid3LineEdit->text())) { - ui->uid3WarningLabel->show(); - ui->uid3WarningReasonLabel->setText(tr("If this UID is from symbiansigned.com, It will be " - "rejected by Application Signing Services for Nokia Store.<br>" - "If you want to continue with a symbiansigned.com UID, " - "sign your application on symbiansigned.com and upload " - "the signed application to Nokia Publish.<br>" - "It is, however, recommended that you obtain a UID from " - "<a href=\"http://info.publish.ovi.com/\">publish.ovi.com</a>")); - ui->uid3WarningReasonLabel->show(); - } else { - ui->uid3WarningLabel->hide(); - ui->uid3WarningReasonLabel->hide(); - } - - m_publisher->setAppUid(ui->uid3LineEdit->text()); -} - -void S60PublishingSisSettingsPageOvi::capabilitiesChanged() -{ - QStringList capabilities = ui->capabilitiesDisplayLabel->text().split(QLatin1Char(',')); - QString errorMessage; - - //Check for certified Signed capabilities - QStringList capabilitesNeedingCertifiedSigned; - foreach (const QString &capability, capabilities) { - if (m_publisher->isCapabilityOneOf(capability, S60PublisherOvi::CertifiedSigned)) { - capabilitesNeedingCertifiedSigned.append(capability); - capabilities.removeOne(capability); - } - } - - if (!capabilitesNeedingCertifiedSigned.isEmpty()) - errorMessage.append(tr("%1 need(s) to be certified signed. " - "Please go to <a href=\"symbiansigned.com\">symbiansigned.com</a> for guidance.") - .arg(capabilitesNeedingCertifiedSigned.join(QLatin1String(", ")))); - - //Check for capabilities needing manufacturer approval - QStringList capabilitiesNeedingManufacturerApproved; - - foreach (const QString &capability, capabilities) { - if (m_publisher->isCapabilityOneOf(capability, S60PublisherOvi::ManufacturerApproved)) - capabilitiesNeedingManufacturerApproved.append(capability); - } - - if (!capabilitiesNeedingManufacturerApproved.isEmpty()) { - errorMessage.append(tr("<br>%1 need(s) manufacturer approval.<br>") - .arg(capabilitiesNeedingManufacturerApproved.join(QLatin1String(", ")))); - } - - errorMessage.prepend(tr("Some capabilities might require a special kind of signing or approval from the manufacturer.<br>")); - - reflectSettingState(capabilitesNeedingCertifiedSigned.isEmpty() && capabilitiesNeedingManufacturerApproved.isEmpty(), - ui->capabilitiesOkLabel, - ui->capabilitiesErrorLabel, - ui->capabilitiesErrorReasonLabel, - errorMessage); -} - -void S60PublishingSisSettingsPageOvi::showWarningsForUnenforcableChecks() -{ - //Warn about use of unreleased Qt Versions - //ui->qtVersionWarningLabel->show(); //looks better without... - ui->qtVersionWarningReasonLabel->setText(tr("Please verify that you have a released version of Qt. <br>" - "<a href=\"http://www.developer.nokia.com/Community/Wiki/Nokia_Smart_Installer_for_Symbian\">" - "Qt Packages Distributed by Smart Installer</a> has a list of released Qt versions.")); -} - -} // namespace Internal -} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingsissettingspageovi.h b/src/plugins/qt4projectmanager/qt-s60/s60publishingsissettingspageovi.h deleted file mode 100644 index d47eeaa69b7..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60publishingsissettingspageovi.h +++ /dev/null @@ -1,80 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60PUBLISHINGSISSETTINGSPAGEOVI_H -#define S60PUBLISHINGSISSETTINGSPAGEOVI_H - -#include <QWizardPage> - -QT_BEGIN_NAMESPACE -class QLabel; -QT_END_NAMESPACE - -namespace ProjectExplorer { class Project; } - -namespace Qt4ProjectManager { -namespace Internal { - -class S60PublisherOvi; - -namespace Ui { class S60PublishingSisSettingsPageOvi; } - -class S60PublishingSisSettingsPageOvi : public QWizardPage -{ - Q_OBJECT -public: - explicit S60PublishingSisSettingsPageOvi(S60PublisherOvi *publisher, QWidget *parent = 0); - ~S60PublishingSisSettingsPageOvi(); - - virtual void initializePage(); - virtual void cleanupPage(); - - -private slots: - void globalVendorNameChanged(); - void localisedVendorNamesChanged(); - void qtVersionChanged(); - void uid3Changed(); - void capabilitiesChanged(); - void displayNameChanged(); - -private: - void reflectSettingState(bool settingState, QLabel *okLabel, - QLabel *errorLabel, QLabel *errorReasonLabel, const QString &errorReason); - void showWarningsForUnenforcableChecks(); - - Ui::S60PublishingSisSettingsPageOvi *ui; - S60PublisherOvi * const m_publisher; -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // S60PUBLISHINGSISSETTINGSPAGEOVI_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingsissettingspageovi.ui b/src/plugins/qt4projectmanager/qt-s60/s60publishingsissettingspageovi.ui deleted file mode 100644 index b48f74fda2c..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60publishingsissettingspageovi.ui +++ /dev/null @@ -1,535 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Qt4ProjectManager::Internal::S60PublishingSisSettingsPageOvi</class> - <widget class="QWidget" name="Qt4ProjectManager::Internal::S60PublishingSisSettingsPageOvi"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>453</width> - <height>630</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - <layout class="QGridLayout" name="gridLayout"> - <property name="sizeConstraint"> - <enum>QLayout::SetMinAndMaxSize</enum> - </property> - <item row="10" column="1" colspan="2"> - <widget class="QLabel" name="localisedVendorNamesErrorReasonLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="10" column="0"> - <widget class="QLabel" name="localisedVendorNamesErrorLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/compile_error.png</pixmap> - </property> - </widget> - </item> - <item row="9" column="2"> - <widget class="QLabel" name="localisedVendorNamesOkLabel"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/DeviceReadyToUse.png</pixmap> - </property> - </widget> - </item> - <item row="9" column="1"> - <widget class="QLineEdit" name="localisedVendorNamesLineEdit"> - <property name="text"> - <string>Localised Vendor Names</string> - </property> - </widget> - </item> - <item row="5" column="1"> - <widget class="QLineEdit" name="globalVendorNameLineEdit"> - <property name="text"> - <string>Current Global Vendor Name</string> - </property> - </widget> - </item> - <item row="24" column="1" colspan="3"> - <widget class="QLabel" name="capabilitiesErrorReasonLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="4" column="0" colspan="4"> - <widget class="Line" name="line_5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="displayNameErrorLabel"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/compile_error.png</pixmap> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="displayNameLabel"> - <property name="text"> - <string>Display name:</string> - </property> - </widget> - </item> - <item row="19" column="1"> - <widget class="QLabel" name="uid3WarningReasonLabel"> - <property name="text"> - <string/> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="19" column="0"> - <widget class="QLabel" name="uid3WarningLabel"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/compile_warning.png</pixmap> - </property> - </widget> - </item> - <item row="20" column="0" colspan="4"> - <widget class="Line" name="line"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="7" column="1" colspan="2"> - <widget class="QLabel" name="globalVendorNameWarningReasonLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="7" column="0"> - <widget class="QLabel" name="globalVendorNameWarningLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/compile_warning.png</pixmap> - </property> - </widget> - </item> - <item row="15" column="1" colspan="2"> - <widget class="QLabel" name="qtVersionWarningReasonLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="15" column="0"> - <widget class="QLabel" name="qtVersionWarningLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/compile_warning.png</pixmap> - </property> - </widget> - </item> - <item row="11" column="0"> - <widget class="QLabel" name="localisedVendorNamesWarningLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/compile_warning.png</pixmap> - </property> - </widget> - </item> - <item row="11" column="1" colspan="2"> - <widget class="QLabel" name="localisedVendorNamesWarningReasonLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="12" column="0" colspan="4"> - <widget class="Line" name="line_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="24" column="0"> - <widget class="QLabel" name="capabilitiesErrorLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/compile_error.png</pixmap> - </property> - </widget> - </item> - <item row="18" column="0"> - <widget class="QLabel" name="uid3ErrorLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/compile_error.png</pixmap> - </property> - </widget> - </item> - <item row="14" column="0"> - <widget class="QLabel" name="qtVersionErrorLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/compile_error.png</pixmap> - </property> - </widget> - </item> - <item row="9" column="0"> - <widget class="QLabel" name="localisedVendorNamesLabel"> - <property name="text"> - <string>Localised vendor names:</string> - </property> - </widget> - </item> - <item row="23" column="0"> - <widget class="QLabel" name="capabilitiesLabel"> - <property name="text"> - <string>Capabilities:</string> - </property> - </widget> - </item> - <item row="6" column="1" colspan="3"> - <widget class="QLabel" name="globalVendorNameErrorReasonLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="17" column="2"> - <widget class="QLabel" name="uid3OkLabel"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/DeviceReadyToUse.png</pixmap> - </property> - </widget> - </item> - <item row="17" column="1"> - <widget class="QLineEdit" name="uid3LineEdit"> - <property name="text"> - <string>Current UID3</string> - </property> - </widget> - </item> - <item row="17" column="0"> - <widget class="QLabel" name="uid3Label"> - <property name="text"> - <string>Application UID:</string> - </property> - </widget> - </item> - <item row="13" column="2"> - <widget class="QLabel" name="qtVersionOkLabel"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/DeviceReadyToUse.png</pixmap> - </property> - </widget> - </item> - <item row="13" column="1"> - <widget class="QLabel" name="qtVersionDisplayLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="text"> - <string>Current Qt Version</string> - </property> - </widget> - </item> - <item row="13" column="0"> - <widget class="QLabel" name="qtVersionLabel"> - <property name="text"> - <string>Qt version used in builds:</string> - </property> - </widget> - </item> - <item row="23" column="1"> - <widget class="QLabel" name="capabilitiesDisplayLabel"> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="text"> - <string>Current set of capabilities</string> - </property> - </widget> - </item> - <item row="5" column="0"> - <widget class="QLabel" name="globalVendorNameLabel"> - <property name="text"> - <string>Global vendor name:</string> - </property> - </widget> - </item> - <item row="5" column="2"> - <widget class="QLabel" name="globalVendorNameOkLabel"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/DeviceReadyToUse.png</pixmap> - </property> - </widget> - </item> - <item row="16" column="0" colspan="4"> - <widget class="Line" name="line_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="8" column="0" colspan="4"> - <widget class="Line" name="line_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="6" column="0"> - <widget class="QLabel" name="globalVendorNameErrorLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/compile_error.png</pixmap> - </property> - </widget> - </item> - <item row="18" column="1" colspan="3"> - <widget class="QLabel" name="uid3ErrorReasonLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="14" column="1" colspan="3"> - <widget class="QLabel" name="qtVersionErrorReasonLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="23" column="2"> - <widget class="QLabel" name="capabilitiesOkLabel"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/DeviceReadyToUse.png</pixmap> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="displayNameWarningLabel"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/compile_warning.png</pixmap> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="displayNameLineEdit"/> - </item> - <item row="1" column="2"> - <widget class="QLabel" name="displayNameOkLabel"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../../projectexplorer/projectexplorer.qrc">:/projectexplorer/images/DeviceReadyToUse.png</pixmap> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QLabel" name="displayNameWarningReasonLabel"> - <property name="text"> - <string/> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QLabel" name="displayNameErrorReasonLabel"> - <property name="text"> - <string/> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> - <resources> - <include location="../../projectexplorer/projectexplorer.qrc"/> - </resources> - <connections/> -</ui> diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingwizardfactories.cpp b/src/plugins/qt4projectmanager/qt-s60/s60publishingwizardfactories.cpp deleted file mode 100644 index 0a74b22a264..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60publishingwizardfactories.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60publishingwizardfactories.h" -#include "s60publishingwizardovi.h" - -#include "qmakestep.h" -#include "qt4project.h" -#include "qt4projectmanagerconstants.h" - -#include <projectexplorer/target.h> - -#include <qtsupport/qtsupportconstants.h> -#include <qtsupport/baseqtversion.h> -#include <qtsupport/qtprofileinformation.h> - -using namespace ProjectExplorer; - -namespace Qt4ProjectManager { -namespace Internal { -S60PublishingWizardFactoryOvi::S60PublishingWizardFactoryOvi(QObject *parent) - : IPublishingWizardFactory(parent) -{} - -QString S60PublishingWizardFactoryOvi::displayName() const -{ - return tr("Publish Qt Symbian Applications to Nokia Store"); -} - -QString S60PublishingWizardFactoryOvi::description() const -{ - return tr("This wizard checks " - "your project file to make sure it complies with " - "Nokia Store submission criteria.\n\n" - "The wizard creates SIS files that can be submitted " - "to Nokia Publish.\n\n" - "You cannot use it if you use application UIDs from Symbian Signed.\n\n" - "You cannot use it for the Certified Signed and Manufacturer level capabilities:\n" - "NetworkControl, MultimediaDD, CommDD, DiskAdmin, AllFiles, DRM and TCB.\n\n" - "Your application will also be rejected by Nokia Store QA if you choose " - "an unreleased Qt version on the next page."); -} - -bool S60PublishingWizardFactoryOvi::canCreateWizard(const Project *project) const -{ - if (!qobject_cast<const Qt4Project *>(project)) - return false; - foreach (const Target *const target, project->targets()) { - QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target->profile()); - if (version->type() == QLatin1String(QtSupport::Constants::SYMBIANQT)) - return true; - } - return false; -} - -QWizard *S60PublishingWizardFactoryOvi::createWizard(const Project *project) const -{ - Q_ASSERT(canCreateWizard(project)); - return new S60PublishingWizardOvi(project); -} - -} // namespace Internal -} // namespace Qt4ProjectManager - diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingwizardfactories.h b/src/plugins/qt4projectmanager/qt-s60/s60publishingwizardfactories.h deleted file mode 100644 index 518f8c2afdd..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60publishingwizardfactories.h +++ /dev/null @@ -1,53 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60PUBLISHINGWIZARDFACTORIES_H -#define S60PUBLISHINGWIZARDFACTORIES_H - -#include <projectexplorer/publishing/ipublishingwizardfactory.h> - -namespace Qt4ProjectManager { -namespace Internal { - -class S60PublishingWizardFactoryOvi : public ProjectExplorer::IPublishingWizardFactory -{ - Q_OBJECT -public: - explicit S60PublishingWizardFactoryOvi(QObject *parent =0); -private: - QString displayName() const; - QString description() const; - bool canCreateWizard(const ProjectExplorer::Project *project) const; - QWizard *createWizard(const ProjectExplorer::Project *project) const; -}; -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // S60PUBLISHINGWIZARDFACTORIES_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingwizardovi.cpp b/src/plugins/qt4projectmanager/qt-s60/s60publishingwizardovi.cpp deleted file mode 100644 index a3fb0b25fa6..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60publishingwizardovi.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60publishingwizardovi.h" -#include "s60publisherovi.h" -#include "s60publishingbuildsettingspageovi.h" -#include "s60publishingsissettingspageovi.h" -#include "s60publishingresultspageovi.h" - -using namespace ProjectExplorer; - -namespace Qt4ProjectManager { -namespace Internal { - -S60PublishingWizardOvi::S60PublishingWizardOvi(const Project *project, QWidget *parent) : - Wizard(parent), - m_publisher(new S60PublisherOvi(this)) -{ - setWindowTitle(tr("Publishing to Nokia Store")); - - m_buildSettingsPage = new S60PublishingBuildSettingsPageOvi(m_publisher, project); - m_buildSettingsPage->setTitle(tr("Build Configuration")); - addPage(m_buildSettingsPage); - - m_sisSettingsPage = new S60PublishingSisSettingsPageOvi(m_publisher); - m_sisSettingsPage->setTitle(tr("Project File Checks")); - m_sisSettingsPage->setCommitPage(true); - addPage(m_sisSettingsPage); - - m_resultsPage = new S60PublishingResultsPageOvi(m_publisher); - m_resultsPage->setTitle(tr("Creating an Uploadable SIS File")); - m_resultsPage->setFinalPage(true); - addPage(m_resultsPage); - - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); -} - -S60PublishingWizardOvi::~S60PublishingWizardOvi() -{ - delete m_publisher; -} - -} // namespace Internal -} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingwizardovi.h b/src/plugins/qt4projectmanager/qt-s60/s60publishingwizardovi.h deleted file mode 100644 index a6dc735d361..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60publishingwizardovi.h +++ /dev/null @@ -1,63 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60PUBLISHINGWIZARDOVI_H -#define S60PUBLISHINGWIZARDOVI_H - -#include <utils/wizard.h> - -namespace ProjectExplorer { -class Project; -} - -namespace Qt4ProjectManager { -namespace Internal { -class S60PublisherOvi; -class S60PublishingBuildSettingsPageOvi; -class S60PublishingSisSettingsPageOvi; -class S60PublishingResultsPageOvi; - -class S60PublishingWizardOvi : public Utils::Wizard -{ - Q_OBJECT -public: - explicit S60PublishingWizardOvi(const ProjectExplorer::Project *project, QWidget *parent = 0); - ~S60PublishingWizardOvi(); - -private: - S60PublisherOvi *m_publisher; - S60PublishingBuildSettingsPageOvi *m_buildSettingsPage; - S60PublishingSisSettingsPageOvi *m_sisSettingsPage; - S60PublishingResultsPageOvi *m_resultsPage; -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // S60PUBLISHINGWIZARDOVI_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60runcontrolbase.cpp b/src/plugins/qt4projectmanager/qt-s60/s60runcontrolbase.cpp deleted file mode 100644 index 1cd924b68c4..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60runcontrolbase.cpp +++ /dev/null @@ -1,242 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60runcontrolbase.h" - -#include "qt4buildconfiguration.h" -#include "s60deployconfiguration.h" -#include "s60devicerunconfiguration.h" - -#include <analyzerbase/analyzerconstants.h> -#include <coreplugin/icore.h> -#include <debugger/debuggerconstants.h> -#include <coreplugin/progressmanager/progressmanager.h> -#include <projectexplorer/target.h> -#include <qtsupport/qtprofileinformation.h> -#include <utils/qtcassert.h> - -#include <QDateTime> -#include <QDir> -#include <QFileInfo> - -using namespace ProjectExplorer; -using namespace Qt4ProjectManager; -using namespace Qt4ProjectManager::Internal; - -const int PROGRESS_MIN = 0; -const int PROGRESS_MAX = 200; - -enum { debug = 0 }; - -// Format information about a file -QString S60RunControlBase::msgListFile(const QString &file) -{ - QString rc; - const QFileInfo fi(file); - QTextStream str(&rc); - if (fi.exists()) - str << fi.size() << ' ' << fi.lastModified().toString(Qt::ISODate) << ' ' << QDir::toNativeSeparators(fi.absoluteFilePath()); - else - str << "<non-existent> " << QDir::toNativeSeparators(fi.absoluteFilePath()); - return rc; -} - -S60RunControlBase::S60RunControlBase(RunConfiguration *runConfiguration, - RunMode mode) : - RunControl(runConfiguration, mode), - m_launchProgress(0) -{ - connect(this, SIGNAL(finished()), this, SLOT(reportLaunchFinished())); - connect(this, SIGNAL(finished()), this, SLOT(handleFinished())); - - const S60DeviceRunConfiguration *s60runConfig = qobject_cast<S60DeviceRunConfiguration *>(runConfiguration); - QTC_ASSERT(s60runConfig, return); - const Qt4BuildConfiguration *activeBuildConf = qobject_cast<Qt4BuildConfiguration *>(s60runConfig->target()->activeBuildConfiguration()); - QTC_ASSERT(activeBuildConf, return); - const S60DeployConfiguration *activeDeployConf = qobject_cast<S60DeployConfiguration *>(s60runConfig->target()->activeDeployConfiguration()); - QTC_ASSERT(activeDeployConf, return); - - m_executableUid = s60runConfig->executableUid(); - m_targetName = s60runConfig->targetName(); - m_commandLineArguments = s60runConfig->commandLineArguments(); - QString qmlArgs = s60runConfig->qmlCommandLineArguments(); - if ((mode == DebugRunMode || mode == QmlProfilerRunMode) && !qmlArgs.isEmpty()) { - m_commandLineArguments.prepend(QLatin1Char(' ')); - m_commandLineArguments.prepend(qmlArgs); - } - m_installationDrive = activeDeployConf->installationDrive(); - m_executableFileName = s60runConfig->localExecutableFileName(); - m_runSmartInstaller = activeDeployConf->runSmartInstaller(); - - if (debug) - qDebug() << "S60RunControlBase::CT" << m_targetName; -} - -void S60RunControlBase::start() -{ - QTC_ASSERT(!m_launchProgress, return); - - m_launchProgress = new QFutureInterface<void>; - Core::ICore::progressManager()->addTask(m_launchProgress->future(), - tr("Launching"), - QLatin1String("Symbian.Launch")); - m_launchProgress->setProgressRange(PROGRESS_MIN, PROGRESS_MAX); - m_launchProgress->setProgressValue(PROGRESS_MIN); - m_launchProgress->reportStarted(); - - if (m_runSmartInstaller) { //Smart Installer does the running by itself - cancelProgress(); - appendMessage(tr("Please finalise the installation on your device.\n"), Utils::NormalMessageFormat); - emit finished(); - return; - } - - if (!doStart()) { - emit finished(); - return; - } - emit started(); - startLaunching(); -} - -S60RunControlBase::~S60RunControlBase() -{ - if (m_launchProgress) { - m_launchProgress->reportFinished(); - delete m_launchProgress; - m_launchProgress = 0; - } -} - -RunControl::StopResult S60RunControlBase::stop() -{ - doStop(); - return AsynchronousStop; -} - -bool S60RunControlBase::promptToStop(bool *optionalPrompt) const -{ - Q_UNUSED(optionalPrompt) - // We override the settings prompt - QTC_ASSERT(isRunning(), return true); - - const QString question = tr("<html><head/><body><center><i>%1</i> is still running on the device.</center>" - "<center>Terminating it can leave the target in an inconsistent state.</center>" - "<center>Would you still like to terminate it?</center></body></html>").arg(displayName()); - return showPromptToStopDialog(tr("Application Still Running"), question, - tr("Force Quit"), tr("Keep Running")); -} - -void S60RunControlBase::startLaunching() -{ - if (setupLauncher()) - setProgress(maxProgress()*0.30); - else { - stop(); - emit finished(); - } -} - -void S60RunControlBase::handleFinished() -{ - appendMessage(tr("Finished.\n"), Utils::NormalMessageFormat); -} - -void S60RunControlBase::setProgress(int value) -{ - if (m_launchProgress) { - if (value < PROGRESS_MAX) { - if (value < PROGRESS_MIN) - m_launchProgress->setProgressValue(PROGRESS_MIN); - else - m_launchProgress->setProgressValue(value); - } else { - m_launchProgress->setProgressValue(PROGRESS_MAX); - m_launchProgress->reportFinished(); - delete m_launchProgress; - m_launchProgress = 0; - } - } -} - -void S60RunControlBase::cancelProgress() -{ - if (m_launchProgress) { - m_launchProgress->reportCanceled(); - m_launchProgress->reportFinished(); - } - delete m_launchProgress; - m_launchProgress = 0; -} - -int S60RunControlBase::maxProgress() const -{ - return PROGRESS_MAX; -} - -void S60RunControlBase::reportLaunchFinished() -{ - setProgress(maxProgress()); -} - -quint32 S60RunControlBase::executableUid() const -{ - return m_executableUid; -} - -QString S60RunControlBase::executableName() const -{ - return QString::fromLatin1("%1.exe").arg(targetName()); -} - -const QString &S60RunControlBase::targetName() const -{ - return m_targetName; -} - -const QString &S60RunControlBase::commandLineArguments() const -{ - return m_commandLineArguments; -} - -const QString &S60RunControlBase::executableFileName() const -{ - return m_executableFileName; -} - -bool S60RunControlBase::runSmartInstaller() const -{ - return m_runSmartInstaller; -} - -char S60RunControlBase::installationDrive() const -{ - return m_installationDrive; -} diff --git a/src/plugins/qt4projectmanager/qt-s60/s60runcontrolbase.h b/src/plugins/qt4projectmanager/qt-s60/s60runcontrolbase.h deleted file mode 100644 index c5a5ae22f39..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60runcontrolbase.h +++ /dev/null @@ -1,96 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60RUNCONTROLBASE_H -#define S60RUNCONTROLBASE_H - -#include <qt4projectmanager/qt4projectmanager_global.h> -#include <projectexplorer/runconfiguration.h> -#include <projectexplorer/toolchain.h> - -#include <QFutureInterface> - -namespace Qt4ProjectManager { - -class QT4PROJECTMANAGER_EXPORT S60RunControlBase : public ProjectExplorer::RunControl -{ - Q_OBJECT -public: - S60RunControlBase(ProjectExplorer::RunConfiguration *runConfiguration, - ProjectExplorer::RunMode mode); - ~S60RunControlBase(); - - virtual void start(); - virtual StopResult stop(); - virtual bool promptToStop(bool *optionalPrompt = 0) const; - - static QString msgListFile(const QString &file); - -protected: - virtual bool doStart() = 0; - virtual void doStop() = 0; - virtual bool setupLauncher() = 0; - -protected: - quint32 executableUid() const; - QString executableName() const; - const QString &targetName() const; - const QString &commandLineArguments() const; - const QString &executableFileName() const; - bool runSmartInstaller() const; - char installationDrive() const; - - void setProgress(int value); - void cancelProgress(); - int maxProgress() const; - -private: - void startLaunching(); - - -protected slots: - void reportLaunchFinished(); - -private slots: - void handleFinished(); - -private: - QFutureInterface<void> *m_launchProgress; - quint32 m_executableUid; - QString m_targetName; - QString m_commandLineArguments; - QString m_executableFileName; - bool m_runSmartInstaller; - char m_installationDrive; -}; - -} // namespace Qt4ProjectManager - -#endif // S60RUNCONTROLBASE_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60runcontrolfactory.cpp b/src/plugins/qt4projectmanager/qt-s60/s60runcontrolfactory.cpp deleted file mode 100644 index 24c72a0cd94..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60runcontrolfactory.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60runcontrolfactory.h" - -#include "codaruncontrol.h" -#include "s60devicerunconfiguration.h" -#include "s60deployconfiguration.h" - -#include <projectexplorer/target.h> -#include <utils/qtcassert.h> - -using namespace ProjectExplorer; -using namespace Qt4ProjectManager; -using namespace Qt4ProjectManager::Internal; - -S60RunControlFactory::S60RunControlFactory(RunMode mode, const QString &name, QObject *parent) : - IRunControlFactory(parent), m_mode(mode), m_name(name) -{ -} - -bool S60RunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const -{ - if (mode != m_mode) - return false; - S60DeviceRunConfiguration *rc = qobject_cast<S60DeviceRunConfiguration *>(runConfiguration); - if (!rc) - return false; - S60DeployConfiguration *activeDeployConf = qobject_cast<S60DeployConfiguration *>(rc->target()->activeDeployConfiguration()); - return activeDeployConf != 0; -} - -RunControl* S60RunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode) -{ - S60DeviceRunConfiguration *rc = qobject_cast<S60DeviceRunConfiguration *>(runConfiguration); - - QTC_ASSERT(rc, return 0); - QTC_ASSERT(mode == m_mode, return 0); - - S60DeployConfiguration *activeDeployConf = qobject_cast<S60DeployConfiguration *>(rc->target()->activeDeployConfiguration()); - if (!activeDeployConf) - return 0; - return new CodaRunControl(rc, mode); -} - -QString S60RunControlFactory::displayName() const -{ - return m_name; -} diff --git a/src/plugins/qt4projectmanager/qt-s60/s60runcontrolfactory.h b/src/plugins/qt4projectmanager/qt-s60/s60runcontrolfactory.h deleted file mode 100644 index 29413f825c2..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60runcontrolfactory.h +++ /dev/null @@ -1,62 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60RUNCONTROLFACTORY_H -#define S60RUNCONTROLFACTORY_H - -#include <projectexplorer/runconfiguration.h> - -namespace Qt4ProjectManager { -namespace Internal { - -class S60RunControlFactory : public ProjectExplorer::IRunControlFactory -{ -public: - explicit S60RunControlFactory(ProjectExplorer::RunMode mode, - const QString &name, - QObject *parent = 0); - - bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, - ProjectExplorer::RunMode mode) const; - - ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration, - ProjectExplorer::RunMode mode); - - QString displayName() const; - -private: - const ProjectExplorer::RunMode m_mode; - const QString m_name; -}; - -} // namespace Internal -} // namespace Qt4ProjectExplorer - -#endif // S60RUNCONTROLFACTORY_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60symbiancertificate.cpp b/src/plugins/qt4projectmanager/qt-s60/s60symbiancertificate.cpp deleted file mode 100644 index 6b01c73d51a..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60symbiancertificate.cpp +++ /dev/null @@ -1,841 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "s60symbiancertificate.h" - -#include <botan/botan.h> - -#include <algorithm> -#include <memory> -#include <string> - -#include <QDateTime> - -using namespace Botan; -using namespace Qt4ProjectManager; -using namespace Qt4ProjectManager::Internal; - -namespace { - const char CERT_IMEI_FIELD_NAME[] = "1.2.826.0.1.1796587.1.1.1.1"; - const char CERT_CAPABILITY_FIELD_NAME[] = "1.2.826.0.1.1796587.1.1.1.6"; -} - -// ======== S60CertificateExtension - -/* -* X.509 S60 Certificate Extension -*/ -class S60CertificateExtension : public Certificate_Extension -{ -public: - OID oid_of() const; - - virtual S60CertificateExtension* copy() const = 0; - virtual ~S60CertificateExtension() {} -protected: - friend class S60Extensions; - virtual bool should_encode() const { return false; } - virtual MemoryVector<byte> encode_inner() const = 0; - virtual void decode_inner(const MemoryRegion<byte>&) = 0; -}; - -// ======== S60DeviceIdListConstraint - -class S60DeviceIdListConstraint : public S60CertificateExtension -{ -public: - S60CertificateExtension* copy() const { return new S60DeviceIdListConstraint(imei_list); } - - S60DeviceIdListConstraint() {} - S60DeviceIdListConstraint(const std::vector<ASN1_String>& o) : imei_list(o) {} - - std::vector<ASN1_String> get_imei_list() const { return imei_list; } -private: - std::string config_id() const { return "deviceid_list_constraint"; } - std::string oid_name() const { return CERT_IMEI_FIELD_NAME; } - - MemoryVector<byte> encode_inner() const; - void decode_inner(const MemoryRegion<byte>&); - void contents_to(Data_Store&, Data_Store&) const; - - std::vector<ASN1_String> imei_list; -}; - -/* -* Encode the extension -*/ -MemoryVector<byte> S60DeviceIdListConstraint::encode_inner() const -{ - qFatal("Encoding S60 extensions is not supported."); - return MemoryVector<byte>(); -} - -/* -* Decode the extension -*/ -void S60DeviceIdListConstraint::decode_inner(const MemoryRegion<byte>& in) -{ - BER_Decoder(in) - .start_cons(SEQUENCE) - .decode_list(imei_list) - .end_cons(); -} - -/* -* Return a textual representation -*/ -void S60DeviceIdListConstraint::contents_to(Data_Store& subject, Data_Store&) const -{ - for(u32bit j = 0; j != imei_list.size(); ++j) - subject.add(CERT_IMEI_FIELD_NAME, imei_list[j].value()); -} - -// ======== S60CapabilityConstraint - -class S60CapabilityConstraint : public S60CertificateExtension -{ -public: - S60CertificateExtension* copy() const { return new S60CapabilityConstraint(capabilities); } - - S60CapabilityConstraint() {} - S60CapabilityConstraint(const SecureVector<byte>& o) : capabilities(o) {} - - SecureVector<byte> get_capability_list() const { return capabilities; } -private: - std::string config_id() const { return "capability_constraint"; } - std::string oid_name() const { return "CERT_CAPABILITY_FIELD_NAME"; } - - MemoryVector<byte> encode_inner() const; - void decode_inner(const MemoryRegion<byte>&); - void contents_to(Data_Store&, Data_Store&) const; - - SecureVector<byte> capabilities; -}; - -/* -* Encode the extension -*/ -MemoryVector<byte> S60CapabilityConstraint::encode_inner() const -{ - qFatal("Encoding S60 extensions is not supported."); - return MemoryVector<byte>(); -} - -/* -* Decode the extension -*/ -void S60CapabilityConstraint::decode_inner(const MemoryRegion<byte>& in) -{ - BER_Decoder(in) - .decode(capabilities, BIT_STRING) - .verify_end(); -} - -/* -* Return a textual representation -*/ -void S60CapabilityConstraint::contents_to(Data_Store& subject, Data_Store&) const -{ - quint32 capabilitiesValue = 0; - for(u32bit j = 0; j != sizeof(quint32); ++j) { - quint32 capabilitie(capabilities[sizeof(quint32)-1-j]); - capabilitiesValue |= capabilitie << 8*j; - } - subject.add(CERT_CAPABILITY_FIELD_NAME, capabilitiesValue); -} - -// ======== S60Extensions - -class S60Extensions : public ASN1_Object -{ -public: - void encode_into(class DER_Encoder&) const; - void decode_from(class BER_Decoder&); - - void contents_to(Data_Store&, Data_Store&) const; - - void add(Certificate_Extension* extn) - { extensions.push_back(extn); } - - S60Extensions& operator=(const S60Extensions&); - - S60Extensions(const S60Extensions&); - S60Extensions(bool st = true) : should_throw(st) {} - ~S60Extensions(); -private: - static Certificate_Extension* get_extension(const OID&); - - std::vector<Certificate_Extension*> extensions; - bool should_throw; -}; - -/* -* S60Extensions Copy Constructor -*/ -S60Extensions::S60Extensions(const S60Extensions& extensions) : ASN1_Object() -{ - *this = extensions; -} - -/* -* Extensions Assignment Operator -*/ -S60Extensions& S60Extensions::operator=(const S60Extensions& other) -{ - for(u32bit j = 0; j != extensions.size(); ++j) - delete extensions[j]; - extensions.clear(); - - for(u32bit j = 0; j != other.extensions.size(); ++j) - extensions.push_back(other.extensions[j]->copy()); - - return (*this); -} - -/* -* Return the OID of this extension -*/ -OID S60CertificateExtension::oid_of() const -{ - return OIDS::lookup(oid_name()); -} - -/* -* Encode an Extensions list -*/ -void S60Extensions::encode_into(DER_Encoder& to_object) const -{ - Q_UNUSED(to_object); - qFatal("Encoding S60 extensions is not supported."); -} - -/* -* Decode a list of Extensions -*/ -void S60Extensions::decode_from(BER_Decoder& from_source) -{ - for(u32bit j = 0; j != extensions.size(); ++j) - delete extensions[j]; - extensions.clear(); - - BER_Decoder sequence = from_source.start_cons(SEQUENCE); - while(sequence.more_items()) - { - OID oid; - MemoryVector<byte> value; - bool critical; - - sequence.start_cons(SEQUENCE) - .decode(oid) - .decode_optional(critical, BOOLEAN, UNIVERSAL, false) - .decode(value, OCTET_STRING) - .verify_end() - .end_cons(); - - S60CertificateExtension* ext = 0; - if (OIDS::name_of(oid, CERT_IMEI_FIELD_NAME)) - ext = new S60DeviceIdListConstraint(); - - if (OIDS::name_of(oid, CERT_CAPABILITY_FIELD_NAME)) - ext = new S60CapabilityConstraint(); - - if (!ext) { - if (!critical || !should_throw) - continue; - - throw Decoding_Error("Encountered unknown X.509 extension marked " - "as critical; OID = " + oid.as_string()); - } - ext->decode_inner(value); - extensions.push_back(ext); - } - sequence.verify_end(); -} - -/* -* Write the extensions to an info store -*/ -void S60Extensions::contents_to(Data_Store& subject_info, - Data_Store& issuer_info) const -{ - for(u32bit j = 0; j != extensions.size(); ++j) - extensions[j]->contents_to(subject_info, issuer_info); -} - -/* -* Delete an Extensions list -*/ -S60Extensions::~S60Extensions() -{ - for(u32bit j = 0; j != extensions.size(); ++j) - delete extensions[j]; -} - - - -// ======== S60SymbianCertificatePrivate - -class S60SymbianCertificatePrivate : private Botan::X509_Object -{ -public: - /** - * Get the issuer certificate DN. - * @return the issuer DN of this certificate - */ - Botan::X509_DN issuerDn() const; - - /** - * Get the subject certificate DN. - * @return the subject DN of this certificate - */ - Botan::X509_DN subjectDn() const; - - /** - * Get a value for a specific subject_info parameter name. - * @param name the name of the parameter to look up. Possible names are - * "X509.Certificate.version", "X509.Certificate.serial", - * "X509.Certificate.start", "X509.Certificate.end", - * "X509.Certificate.v2.key_id", "X509.Certificate.public_key", - * "X509v3.BasicConstraints.path_constraint", - * "X509v3.BasicConstraints.is_ca", "X509v3.ExtendedKeyUsage", - * "X509v3.CertificatePolicies", "X509v3.SubjectKeyIdentifier" or - * "X509.Certificate.serial". - * @return the value(s) of the specified parameter - */ - std::vector<std::string> subjectInfo(const std::string& name) const; - - /** - * Get a value for a specific subject_info parameter name. - * @param name the name of the parameter to look up. Possible names are - * "X509.Certificate.v2.key_id" or "X509v3.AuthorityKeyIdentifier". - * @return the value(s) of the specified parameter - */ - std::vector<std::string> issuerInfo(const std::string& name) const; - - /** - * Get the notBefore of the certificate. - * @return the notBefore of the certificate - */ - std::string startTime() const; - - /** - * Get the notAfter of the certificate. - * @return the notAfter of the certificate - */ - std::string endTime() const; - - /** - * Get the X509 version of this certificate object. - * @return the X509 version - */ - Botan::u32bit x509Version() const; - - /** - * Get the serial number of this certificate. - * @return the certificates serial number - */ - Botan::MemoryVector<Botan::byte> serialNumber() const; - - /** - * Check whether this certificate is self signed. - * @return true if this certificate is self signed - */ - bool isSelfSigned() const { return m_selfSigned; } - - /** - * Check whether this certificate is a CA certificate. - * @return true if this certificate is a CA certificate - */ - bool isCaCert() const; - - /** - * Get the key constraints as defined in the KeyUsage extension of this - * certificate. - * @return the key constraints - */ - Botan::Key_Constraints constraints() const; - - /** - * Get the key constraints as defined in the ExtendedKeyUsage - * extension of this - * certificate. - * @return the key constraints - */ - std::vector<std::string> exConstraints() const; - - /** - * Get the policies as defined in the CertificatePolicies extension - * of this certificate. - * @return the certificate policies - */ - std::vector<std::string> policies() const; - - /** - * Check to certificates for equality. - * @return true both certificates are (binary) equal - */ - bool operator==(const S60SymbianCertificatePrivate& other) const; - - /** - * Create a certificate from a file containing the DER or PEM - * encoded certificate. - * @param filename the name of the certificate file - */ - S60SymbianCertificatePrivate(const QByteArray &filename); - -private: - Botan::X509_DN createDn(const Botan::Data_Store& info) const; - -protected: - friend class X509_CA; - S60SymbianCertificatePrivate() {} - - void force_decode(); - -protected: - Botan::Data_Store m_subject; - Botan::Data_Store m_issuer; - bool m_selfSigned; -}; - -/* -* Lookup each OID in the vector -*/ -std::vector<std::string> lookup_oids(const std::vector<std::string>& in) -{ - std::vector<std::string> out; - - std::vector<std::string>::const_iterator i = in.begin(); - while(i != in.end()) - { - out.push_back(OIDS::lookup(OID(*i))); - ++i; - } - return out; -} - -/* -* S60SymbianCertificate Constructor -*/ -S60SymbianCertificatePrivate::S60SymbianCertificatePrivate(const QByteArray &in) : - X509_Object(in.constData(), "CERTIFICATE/X509 CERTIFICATE") -{ - m_selfSigned = false; - - do_decode(); -} - -/* -* Decode the TBSCertificate data -*/ -void S60SymbianCertificatePrivate::force_decode() -{ - size_t version; - BigInt serial_bn; - AlgorithmIdentifier sig_algo_inner; - X509_DN dn_issuer, dn_subject; - X509_Time start, end; - - BER_Decoder tbs_cert(tbs_bits); - - tbs_cert.decode_optional(version, ASN1_Tag(0), - ASN1_Tag(CONSTRUCTED | CONTEXT_SPECIFIC)) - .decode(serial_bn) - .decode(sig_algo_inner) - .decode(dn_issuer) - .start_cons(SEQUENCE) - .decode(start) - .decode(end) - .verify_end() - .end_cons() - .decode(dn_subject); - - if(version > 2) - throw Decoding_Error("Unknown X.509 cert version " + to_string(version)); - if(sig_algo != sig_algo_inner) - throw Decoding_Error("Algorithm identifier mismatch"); - - m_selfSigned = (dn_subject == dn_issuer); - - m_subject.add(dn_subject.contents()); - m_issuer.add(dn_issuer.contents()); - - BER_Object public_key = tbs_cert.get_next_object(); - if(public_key.type_tag != SEQUENCE || public_key.class_tag != CONSTRUCTED) - throw Decoding_Error("Unexpected tag for public key"); - - MemoryVector<byte> v2_issuer_key_id, v2_subject_key_id; - - tbs_cert.decode_optional_string(v2_issuer_key_id, BIT_STRING, 1); - tbs_cert.decode_optional_string(v2_subject_key_id, BIT_STRING, 2); - - BER_Object v3_exts_data = tbs_cert.get_next_object(); - if(v3_exts_data.type_tag == 3 && - v3_exts_data.class_tag == ASN1_Tag(CONSTRUCTED | CONTEXT_SPECIFIC)) - { - S60Extensions s60extensions(false); - - BER_Decoder(v3_exts_data.value).decode(s60extensions).verify_end(); - - s60extensions.contents_to(m_subject, m_issuer); - - Extensions extensions(false); - - BER_Decoder(v3_exts_data.value).decode(extensions).verify_end(); - - extensions.contents_to(m_subject, m_issuer); - } - else if(v3_exts_data.type_tag != NO_OBJECT) - throw Decoding_Error("Unknown tag in X.509 cert"); - - if(tbs_cert.more_items()) - throw Decoding_Error("TBSCertificate has more items that expected"); - - m_subject.add("X509.Certificate.version", version); - m_subject.add("X509.Certificate.serial", BigInt::encode(serial_bn)); - m_subject.add("X509.Certificate.start", start.readable_string()); - m_subject.add("X509.Certificate.end", end.readable_string()); - - m_issuer.add("X509.Certificate.v2.key_id", v2_issuer_key_id); - m_subject.add("X509.Certificate.v2.key_id", v2_subject_key_id); - - if(isCaCert() && - !m_subject.has_value("X509v3.BasicConstraints.path_constraint")) - { - u32bit limit = (x509Version() < 3) ? Cert_Extension::NO_CERT_PATH_LIMIT : 0; - m_subject.add("X509v3.BasicConstraints.path_constraint", limit); - } -} - -/* -* Return the X.509 version in use -*/ -u32bit S60SymbianCertificatePrivate::x509Version() const -{ - return (m_subject.get1_u32bit("X509.Certificate.version") + 1); -} - -/* -* Return the time this cert becomes valid -*/ -std::string S60SymbianCertificatePrivate::startTime() const -{ - return m_subject.get1("X509.Certificate.start"); -} - -/* -* Return the time this cert becomes invalid -*/ -std::string S60SymbianCertificatePrivate::endTime() const -{ - return m_subject.get1("X509.Certificate.end"); -} - -/* -* Return information about the subject -*/ -std::vector<std::string> -S60SymbianCertificatePrivate::subjectInfo(const std::string& what) const -{ - return m_subject.get(X509_DN::deref_info_field(what)); -} - -/* -* Return information about the issuer -*/ -std::vector<std::string> -S60SymbianCertificatePrivate::issuerInfo(const std::string& what) const -{ - return m_issuer.get(X509_DN::deref_info_field(what)); -} - -/* -* Check if the certificate is for a CA -*/ -bool S60SymbianCertificatePrivate::isCaCert() const -{ - if(!m_subject.get1_u32bit("X509v3.BasicConstraints.is_ca")) - return false; - if((constraints() & KEY_CERT_SIGN) || (constraints() == NO_CONSTRAINTS)) - return true; - return false; -} - -/* -* Return the key usage constraints -*/ -Key_Constraints S60SymbianCertificatePrivate::constraints() const -{ - return Key_Constraints(m_subject.get1_u32bit("X509v3.KeyUsage", - NO_CONSTRAINTS)); -} - -/* -* Return the list of extended key usage OIDs -*/ -std::vector<std::string> S60SymbianCertificatePrivate::exConstraints() const -{ - return lookup_oids(m_subject.get("X509v3.ExtendedKeyUsage")); -} - -/* -* Return the list of certificate policies -*/ -std::vector<std::string> S60SymbianCertificatePrivate::policies() const -{ - return lookup_oids(m_subject.get("X509v3.CertificatePolicies")); -} - -/* -* Return the certificate serial number -*/ -MemoryVector<byte> S60SymbianCertificatePrivate::serialNumber() const -{ - return m_subject.get1_memvec("X509.Certificate.serial"); -} - -/* -* Return the distinguished name of the issuer -*/ -X509_DN S60SymbianCertificatePrivate::issuerDn() const -{ - return createDn(m_issuer); -} - -/* -* Return the distinguished name of the subject -*/ -X509_DN S60SymbianCertificatePrivate::subjectDn() const -{ - return createDn(m_subject); -} - -/* -* Compare two certificates for equality -*/ -bool S60SymbianCertificatePrivate::operator==(const S60SymbianCertificatePrivate& other) const -{ - return (sig == other.sig && - sig_algo == other.sig_algo && - m_selfSigned == other.m_selfSigned && - m_issuer == other.m_issuer && - m_subject == other.m_subject); -} - -/* -* X.509 Certificate Comparison -*/ -bool operator!=(const S60SymbianCertificatePrivate& cert1, const S60SymbianCertificatePrivate& cert2) -{ - return !(cert1 == cert2); -} - -/* -* Create and populate a X509_DN -*/ -X509_DN S60SymbianCertificatePrivate::createDn(const Data_Store& info) const -{ - class DN_Matcher : public Data_Store::Matcher - { - public: - bool operator()(const std::string& key, const std::string&) const - { - if(key.find("X520.") != std::string::npos) - return true; - return false; - } - }; - - std::multimap<std::string, std::string> names = - info.search_with(DN_Matcher()); - - X509_DN dn; - - std::multimap<std::string, std::string>::iterator j; - for(j = names.begin(); j != names.end(); ++j) - dn.add_attribute(j->first, j->second); - - return dn; -} - -/* -* Create and populate an AlternativeName -*/ -AlternativeName create_alt_name(const Data_Store& info) -{ - class AltName_Matcher : public Data_Store::Matcher - { - public: - bool operator()(const std::string& key, const std::string&) const - { - for(u32bit j = 0; j != matches.size(); ++j) - if(key.compare(matches[j]) == 0) - return true; - return false; - } - - AltName_Matcher(const std::string& match_any_of) - { - matches = split_on(match_any_of, '/'); - } - private: - std::vector<std::string> matches; - }; - - std::multimap<std::string, std::string> names = - info.search_with(AltName_Matcher("RFC822/DNS/URI/IP")); - - AlternativeName alt_name; - - std::multimap<std::string, std::string>::iterator j; - for(j = names.begin(); j != names.end(); ++j) - alt_name.add_attribute(j->first, j->second); - - return alt_name; -} - -// ======== S60SymbianCertificate - -S60SymbianCertificate::S60SymbianCertificate(const QString &filename) : d(0) -{ - S60SymbianCertificatePrivate *certificate = 0; - try { - certificate = new S60SymbianCertificatePrivate(filename.toLatin1()); - d = certificate; - certificate = 0; - } catch (Botan::Exception &e) { - m_errorString = QLatin1String(e.what()); - } - delete certificate; -} - -S60SymbianCertificate::~S60SymbianCertificate() -{ - delete d; -} - -bool S60SymbianCertificate::isValid() const -{ - return d != 0; -} - -QString S60SymbianCertificate::errorString() const -{ - return m_errorString; -} - -QStringList S60SymbianCertificate::subjectInfo(const QString &name) -{ - Q_ASSERT(d); - QStringList result; - try { - std::vector<std::string> subjectInfo = - d->subjectInfo(name.toLatin1().constData()); - std::vector<std::string>::const_iterator i; - for (i = subjectInfo.begin(); i != subjectInfo.end(); ++i) - result << QString::fromLatin1(i->c_str()); - } catch (Botan::Exception &e) { - m_errorString = QString::fromLatin1(e.what()); - } - return result; -} - -QStringList S60SymbianCertificate::issuerInfo(const QString &name) -{ - Q_ASSERT(d); - QStringList result; - try { - std::vector<std::string> issuerInfo = - d->issuerInfo(name.toLatin1().constData()); - - std::vector<std::string>::const_iterator i; - for (i = issuerInfo.begin(); i != issuerInfo.end(); ++i) - result << QString::fromLatin1(i->c_str()); - } catch (Botan::Exception &e) { - m_errorString = QString::fromLatin1(e.what()); - } - return result; -} - -QDateTime S60SymbianCertificate::parseTime(const QByteArray &time) -{ - QDateTime result; - try { - const char * const CERTIFICATE_DATE_FORMAT = "yyyy/M/d h:mm:ss UTC"; - QDateTime dateTime = QDateTime::fromString(QString::fromLatin1(time), - QLatin1String(CERTIFICATE_DATE_FORMAT)); - result = QDateTime(dateTime.date(), dateTime.time(), Qt::UTC); - } catch (Botan::Exception &e) { - m_errorString = QString::fromLatin1(e.what()); - } - return result; -} - -QDateTime S60SymbianCertificate::startTime() -{ - Q_ASSERT(d); - return parseTime(d->startTime().c_str()); -} - -QDateTime S60SymbianCertificate::endTime() -{ - Q_ASSERT(d); - return parseTime(d->endTime().c_str()); -} - -quint32 S60SymbianCertificate::certificateVersion() -{ - Q_ASSERT(d); - quint32 version = 0; - try { - version = static_cast<quint32>(d->x509Version()); - } catch (Botan::Exception &e) { - m_errorString = QString::fromLatin1(e.what()); - } - return version; -} - -bool S60SymbianCertificate::isSelfSigned() -{ - Q_ASSERT(d); - return d->isSelfSigned(); -} - -bool S60SymbianCertificate::isCaCert() -{ - Q_ASSERT(d); - bool isCaCertificate = false; - try { - isCaCertificate = d->isCaCert(); - } catch (Botan::Exception &e) { - m_errorString = QString::fromLatin1(e.what()); - } - return isCaCertificate; -} diff --git a/src/plugins/qt4projectmanager/qt-s60/s60symbiancertificate.h b/src/plugins/qt4projectmanager/qt-s60/s60symbiancertificate.h deleted file mode 100644 index 2706209f1e9..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60symbiancertificate.h +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef S60SYMBIANCERTIFICATE_H -#define S60SYMBIANCERTIFICATE_H - -#include <QStringList> - -QT_FORWARD_DECLARE_CLASS(QDateTime) - -class S60SymbianCertificatePrivate; - -namespace Qt4ProjectManager { -namespace Internal { - -class S60SymbianCertificate -{ -public: - explicit S60SymbianCertificate(const QString &filename); - ~S60SymbianCertificate(); - - bool isValid() const; - - QString errorString() const; - - QStringList subjectInfo(const QString &name); - QStringList issuerInfo(const QString &name); - - QDateTime startTime(); - QDateTime endTime(); - - quint32 certificateVersion(); - bool isSelfSigned(); - bool isCaCert(); - -private: - QDateTime parseTime(const QByteArray &time); - -protected: - S60SymbianCertificatePrivate const *d; - QString m_errorString; -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // S60SYMBIANCERTIFICATE_H diff --git a/src/plugins/qt4projectmanager/qt-s60/sbsv2parser.cpp b/src/plugins/qt4projectmanager/qt-s60/sbsv2parser.cpp deleted file mode 100644 index 1b5e3965075..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/sbsv2parser.cpp +++ /dev/null @@ -1,251 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "sbsv2parser.h" - -#include <projectexplorer/projectexplorer.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/taskhub.h> - -using namespace Qt4ProjectManager; -using namespace ProjectExplorer; -using namespace ProjectExplorer::Constants; - -/* - * This parser takes a somewhat unusal approach of just eating most of its - * input :-) - * - * Only when the XML-based log file generated by SBSv2 is announced it will - * open that file and parse that. Tasks will then get generated by passing - * any CDATA found in the XML file on to its child parsers (using STDERR). - * - * In additon <error> and <warning> tags are reported, too. - */ - -SbsV2Parser::SbsV2Parser() : - m_hub(0) -{ - setObjectName(QLatin1String("SbsV2Parser")); - m_hub = ProjectExplorerPlugin::instance()->taskHub(); -} - -void SbsV2Parser::stdOutput(const QString &line) -{ - // Eat most output! - if (line.startsWith(QLatin1String("sbs: build log in "))) { - QString logfile = QDir::fromNativeSeparators(line.mid(18).trimmed()); - parseLogFile(logfile); - addTask(ProjectExplorer::Task(Task::Unknown, tr("SBSv2 build log"), - Utils::FileName::fromUserInput(logfile), -1, - Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); - } -} - -void SbsV2Parser::stdError(const QString &line) -{ - // Eat all output! - Q_UNUSED(line); -} - -void SbsV2Parser::taskAdded(const ProjectExplorer::Task &task) -{ - // Fix pathes: - ProjectExplorer::Task tmp(task); - const QString filename = tmp.file.toString(); - - if (!tmp.file.isEmpty()) { - QFileInfo fi(tmp.file.toFileInfo()); - if (!fi.isAbsolute()) { - if (m_currentSource.exists(filename)) - tmp.file = Utils::FileName::fromString(m_currentSource.absoluteFilePath(filename)); - else if (m_currentTarget.exists(filename)) - tmp.file = Utils::FileName::fromString(m_currentTarget.absoluteFilePath(filename)); - } - } - - // Do not report tasks from our children via the normal channel: - // We do not want them get registered with the Compile output window! - m_hub->addTask(tmp); -} - -void SbsV2Parser::parseLogFile(const QString &file) -{ - QFile logFile(file); - logFile.open(QIODevice::ReadOnly); - m_log.setDevice(&logFile); - - if (m_log.readNextStartElement()) { - if (m_log.name() == QLatin1String("buildlog")) - readBuildLog(); - else - m_log.raiseError(tr("The file '%1' is not a SBSv2 log file.").arg(file)); - } -} - -void SbsV2Parser::readBuildLog() -{ - Q_ASSERT(m_log.isStartElement() && m_log.name() == QLatin1String("buildlog")); - - while (m_log.readNextStartElement()) { - if (m_log.name() == QLatin1String("error")) - readError(); - else if (m_log.name() == QLatin1String("warning")) - readWarning(); - else if (m_log.name() == QLatin1String("recipe")) - readRecipe(); - else - m_log.skipCurrentElement(); - } -} - -void SbsV2Parser::readError() -{ - Q_ASSERT(m_log.isStartElement() && m_log.name() == QLatin1String("error")); - - QString error = m_log.readElementText(); - addTask(Task(Task::Error, error, Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))); -} - -void SbsV2Parser::readWarning() -{ - Q_ASSERT(m_log.isStartElement() && m_log.name() == QLatin1String("warning")); - - QString warning = m_log.readElementText(); - addTask(Task(Task::Warning, warning, Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))); -} - -void SbsV2Parser::readRecipe() -{ - Q_ASSERT(m_log.isStartElement() && m_log.name() == QLatin1String("recipe")); - - const QString name = m_log.attributes().value(QLatin1String("name")).toString(); - m_currentSource = QDir(m_log.attributes().value(QLatin1String("source")).toString()).absolutePath(); - m_currentTarget = QDir(m_log.attributes().value(QLatin1String("target")).toString()).absolutePath(); - - int returnCode = 0; - QString outputText; - QXmlStreamReader::TokenType tokenType = QXmlStreamReader::Invalid; - while ((tokenType = m_log.readNext()) != QXmlStreamReader::Invalid) { - if (tokenType == QXmlStreamReader::Characters) { - outputText.append(m_log.text()); - } else if (tokenType == QXmlStreamReader::StartElement) { - if (m_log.name() == QLatin1String("status")) { - if (m_log.attributes().value(QLatin1String("exit")) == QLatin1String("failed")) - returnCode = m_log.attributes().value(QLatin1String("code")).toString().toInt(); - } - } else if (tokenType == QXmlStreamReader::EndElement) { - if (m_log.name() == QLatin1String("recipe")) - break; - } - } - - QStringList output = outputText.split(QLatin1Char('\n')); - outputText.clear(); - foreach (const QString &line, output) { - if (line.isEmpty()) - continue; - if (line.startsWith(QLatin1Char('+'))) { - outputText.append(tr("Running command: %1\n").arg(line.mid(2))); - continue; - } - outputText.append(line); - outputText.append(QLatin1Char('\n')); - if (name == QLatin1String("compile") || name == QLatin1String("qmake_extra_pre_targetdep")) - IOutputParser::stdError(line); - } - - if (returnCode != 0) { - //: %1 is the SBSv2 build recipe name, %2 the return code of the failed command - QString description = tr("Recipe %1 failed with exit code %2.").arg(name).arg(returnCode); - m_hub->addTask(Task(Task::Error, description, Utils::FileName(), -1, - Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); - m_hub->addTask(Task(Task::Unknown, outputText, Utils::FileName(), -1, - Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); - } -} - -// Unit tests: - -#ifdef WITH_TESTS -# include <QTest> - -# include "qt4projectmanagerplugin.h" - -# include "projectexplorer/outputparser_test.h" - -using namespace Qt4ProjectManager::Internal; - -void Qt4ProjectManagerPlugin::testSbsV2OutputParsers_data() -{ - QTest::addColumn<QString>("input"); - QTest::addColumn<OutputParserTester::Channel>("inputChannel"); - QTest::addColumn<QString>("childStdOutLines"); - QTest::addColumn<QString>("childStdErrLines"); - QTest::addColumn<QList<ProjectExplorer::Task> >("tasks"); - QTest::addColumn<QString>("outputLines"); - - - QTest::newRow("eat stdout") - << QString::fromLatin1(" Sometext") << OutputParserTester::STDOUT - << QString() << QString() - << QList<ProjectExplorer::Task>() - << QString(); - QTest::newRow("eat stderr") - << QString::fromLatin1(" Sometext") << OutputParserTester::STDERR - << QString() << QString() - << QList<ProjectExplorer::Task>() - << QString(); - - QTest::newRow("build log") - << QString::fromLatin1("sbs: build log in X:/epoc32/build/Makefile.2010-08-10-15-25-52.log") << OutputParserTester::STDOUT - << QString() << QString() - << (QList<ProjectExplorer::Task>() - << ProjectExplorer::Task(Task::Unknown, QLatin1String("SBSv2 build log"), - Utils::FileName::fromUserInput("X:/epoc32/build/Makefile.2010-08-10-15-25-52.log"), -1, - Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))) - << QString(); -} - -void Qt4ProjectManagerPlugin::testSbsV2OutputParsers() -{ - OutputParserTester testbench; - testbench.appendOutputParser(new SbsV2Parser); - QFETCH(QString, input); - QFETCH(OutputParserTester::Channel, inputChannel); - QFETCH(QList<Task>, tasks); - QFETCH(QString, childStdOutLines); - QFETCH(QString, childStdErrLines); - QFETCH(QString, outputLines); - - testbench.testParsing(input, inputChannel, - tasks, childStdOutLines, childStdErrLines, - outputLines); -} -#endif diff --git a/src/plugins/qt4projectmanager/qt-s60/sbsv2parser.h b/src/plugins/qt4projectmanager/qt-s60/sbsv2parser.h deleted file mode 100644 index 5624843170d..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/sbsv2parser.h +++ /dev/null @@ -1,73 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef SBSV2PARSER_H -#define SBSV2PARSER_H - -#include <projectexplorer/ioutputparser.h> - -#include <QDir> -#include <QXmlStreamReader> - -namespace ProjectExplorer { -class TaskHub; -} - -namespace Qt4ProjectManager { - -class SbsV2Parser : public ProjectExplorer::IOutputParser -{ - Q_OBJECT - -public: - SbsV2Parser(); - - virtual void stdOutput(const QString & line); - virtual void stdError(const QString & line); - -public slots: - virtual void taskAdded(const ProjectExplorer::Task &task); - -private: - void parseLogFile(const QString &file); - void readBuildLog(); - void readError(); - void readWarning(); - void readRecipe(); - - QXmlStreamReader m_log; - QDir m_currentSource; - QDir m_currentTarget; - ProjectExplorer::TaskHub *m_hub; -}; - -} // namespace Qt4ProjectExplorer - -#endif // SBSV2PARSER_H diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianidevice.cpp b/src/plugins/qt4projectmanager/qt-s60/symbianidevice.cpp deleted file mode 100644 index b084ecdac61..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/symbianidevice.cpp +++ /dev/null @@ -1,252 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "symbianidevice.h" - -#include "symbianideviceconfigwidget.h" -#include "symbianidevicefactory.h" - -#include <symbianutils/symbiandevicemanager.h> - -#include <QCoreApplication> - -using namespace ProjectExplorer; - -namespace { -const char SERIAL_PORT_NAME_KEY[] = "Qt4ProjectManager.S60DeployConfiguration.SerialPortName"; -const char DEVICE_ADDRESS_KEY[] = "Qt4ProjectManager.S60DeployConfiguration.DeviceAddress"; -const char DEVICE_PORT_KEY[] = "Qt4ProjectManager.S60DeployConfiguration.DevicePort"; -const char COMMUNICATION_CHANNEL_KEY[] = "Qt4ProjectManager.S60DeployConfiguration.CommunicationChannel"; - -const char DEFAULT_CODA_TCP_PORT[] = "65029"; -} // namespace - -namespace Qt4ProjectManager { - -SymbianIDevice::SymbianIDevice() : - IDevice(Internal::SymbianIDeviceFactory::deviceType(), - IDevice::AutoDetected, - IDevice::Hardware, - Core::Id("Symbian Device")), - m_port(QLatin1String(DEFAULT_CODA_TCP_PORT)), - m_communicationChannel(CommunicationCodaSerialConnection) -{ - setDisplayName("Symbian Device"); - updateState(); -} - -SymbianIDevice::SymbianIDevice(const QVariantMap &map) -{ - fromMap(map); -} - -IDevice::DeviceInfo SymbianIDevice::deviceInformation() const -{ - IDevice::DeviceInfo result; - switch (communicationChannel()) { - case SymbianIDevice::CommunicationCodaSerialConnection: { - const SymbianUtils::SymbianDeviceManager *sdm = SymbianUtils::SymbianDeviceManager::instance(); - const int deviceIndex = sdm->findByPortName(serialPortName()); - if (deviceIndex == -1) { - result << IDevice::DeviceInfoItem( - QCoreApplication::translate("Qt4ProjectManager::SymbianIDevice", "Device"), - QCoreApplication::translate("Qt4ProjectManager::SymbianIDevice", "Not connected")); - } else { - // device connected - const SymbianUtils::SymbianDevice device = sdm->devices().at(deviceIndex); - result << IDevice::DeviceInfoItem( - QCoreApplication::translate("Qt4ProjectManager::SymbianIDevice", "Device"), - //: %1 device friendly name, %2 additional information - QCoreApplication::translate("Qt4ProjectManager::SymbianIDevice", "%1, %2") - .arg(device.friendlyName(), device.additionalInformation())); - } - } - break; - case SymbianIDevice::CommunicationCodaTcpConnection: { - if (!address().isEmpty() && !port().isEmpty()) { - result << IDevice::DeviceInfoItem( - QCoreApplication::translate("Qt4ProjectManager::SymbianIDevice", "IP address"), - QCoreApplication::translate("Qt4ProjectManager::SymbianIDevice", "%1:%2") - .arg(address(), port())); - } - } - break; - default: - break; - } - return result; -} - -SymbianIDevice::SymbianIDevice(const SymbianIDevice &other) : - IDevice(other) -{ - m_address = other.m_address; - m_communicationChannel = other.m_communicationChannel; - m_port = other.m_port; - m_serialPortName = other.m_serialPortName; -} - -IDevice::Ptr SymbianIDevice::clone() const -{ - return Ptr(new SymbianIDevice(*this)); -} - -QString SymbianIDevice::serialPortName() const -{ - return m_serialPortName; -} - -void SymbianIDevice::setSerialPortName(const QString &name) -{ - const QString &candidate = name.trimmed(); - if (m_serialPortName == candidate) - return; - m_serialPortName = candidate; - updateState(); -} - -QString SymbianIDevice::address() const -{ - return m_address; -} - -void SymbianIDevice::setAddress(const QString &address) -{ - if (m_address != address) { - m_address = address; - setDeviceState(IDevice::DeviceStateUnknown); - } -} - - -QString SymbianIDevice::port() const -{ - return m_port; -} - -void SymbianIDevice::setPort(const QString &port) -{ - if (m_port != port) { - if (port.isEmpty()) //setup the default CODA's port - m_port = QLatin1String(DEFAULT_CODA_TCP_PORT); - else - m_port = port; - setDeviceState(IDevice::DeviceStateUnknown); - } -} - -SymbianIDevice::CommunicationChannel SymbianIDevice::communicationChannel() const -{ - return m_communicationChannel; -} - -void SymbianIDevice::setCommunicationChannel(CommunicationChannel channel) -{ - if (m_communicationChannel != channel) { - m_communicationChannel = channel; - setDeviceState(IDevice::DeviceStateUnknown); - } - updateState(); -} - -void SymbianIDevice::fromMap(const QVariantMap &map) -{ - IDevice::fromMap(map); - m_serialPortName = map.value(QLatin1String(SERIAL_PORT_NAME_KEY)).toString().trimmed(); - m_address = map.value(QLatin1String(DEVICE_ADDRESS_KEY)).toString(); - m_port = map.value(QLatin1String(DEVICE_PORT_KEY), QString(QLatin1String(DEFAULT_CODA_TCP_PORT))).toString(); - m_communicationChannel = static_cast<CommunicationChannel>(map.value(QLatin1String(COMMUNICATION_CHANNEL_KEY), - QVariant(CommunicationCodaSerialConnection)).toInt()); - updateState(); -} - -QString SymbianIDevice::displayType() const -{ - return QCoreApplication::translate("Qt4ProjectManager::SymbianIDevice", "Symbian Device"); -} - -IDeviceWidget *SymbianIDevice::createWidget() -{ - return new Internal::SymbianIDeviceConfigurationWidget(sharedFromThis()); -} - -QList<Core::Id> SymbianIDevice::actionIds() const -{ - return QList<Core::Id>(); -} - -QString SymbianIDevice::displayNameForActionId(Core::Id actionId) const -{ - Q_UNUSED(actionId); - return QString(); -} - -void SymbianIDevice::executeAction(Core::Id actionId, QWidget *parent) const -{ - Q_UNUSED(actionId); - Q_UNUSED(parent); -} - -QVariantMap SymbianIDevice::toMap() const -{ - QVariantMap map = IDevice::toMap(); - map.insert(QLatin1String(SERIAL_PORT_NAME_KEY), m_serialPortName); - map.insert(QLatin1String(DEVICE_ADDRESS_KEY), QVariant(m_address)); - map.insert(QLatin1String(DEVICE_PORT_KEY), m_port); - map.insert(QLatin1String(COMMUNICATION_CHANNEL_KEY), QVariant(m_communicationChannel)); - return map; -} - -void SymbianIDevice::updateState() -{ - if (m_communicationChannel == CommunicationCodaSerialConnection) { - SymbianUtils::SymbianDeviceManager *sdm = SymbianUtils::SymbianDeviceManager::instance(); - if (m_serialPortName.isEmpty()) { - // Find first port in use: - SymbianUtils::SymbianDeviceManager::SymbianDeviceList deviceList - = sdm->devices(); - foreach (const SymbianUtils::SymbianDevice &d, deviceList) { - if (d.portName().isEmpty()) - continue; - - m_serialPortName = d.portName(); - break; - } - } - - setDeviceState(sdm->findByPortName(m_serialPortName) >= 0 - ? IDevice::DeviceReadyToUse - : IDevice::DeviceDisconnected); - } else { - setDeviceState(IDevice::DeviceStateUnknown); - } -} - -} // namespace qt4projectmanager diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianidevice.h b/src/plugins/qt4projectmanager/qt-s60/symbianidevice.h deleted file mode 100644 index 2a8ba273cf9..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/symbianidevice.h +++ /dev/null @@ -1,100 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef SYMBIANIDEVICE_H -#define SYMBIANIDEVICE_H - -#include "../qt4projectmanager_global.h" - -#include <projectexplorer/devicesupport/idevice.h> - -namespace Qt4ProjectManager { -namespace Internal { class S60Manager; } - -// TODO: Make the idevice interface powerful enough that this class is no longer -// needed in other plugins and then move this into Internal namespace and -// do not export it. -class QT4PROJECTMANAGER_EXPORT SymbianIDevice : public ProjectExplorer::IDevice -{ -public: - typedef QSharedPointer<const SymbianIDevice> ConstPtr; - - enum CommunicationChannel { - CommunicationCodaSerialConnection, - CommunicationCodaTcpConnection - }; - - SymbianIDevice(); - SymbianIDevice(const QVariantMap &map); - - DeviceInfo deviceInformation() const; - - ProjectExplorer::IDevice::Ptr clone() const; - - QString serialPortName() const; - void setSerialPortName(const QString &name); - - QString address() const; - void setAddress(const QString &address); - - void setPort(const QString &port); - QString port() const; - - void setCommunicationChannel(CommunicationChannel channel); - CommunicationChannel communicationChannel() const; - - void fromMap(const QVariantMap &map); - - QString displayType() const; - ProjectExplorer::IDeviceWidget* createWidget(); - QList<Core::Id> actionIds() const; - QString displayNameForActionId(Core::Id actionId) const; - void executeAction(Core::Id actionId, QWidget*parent) const; - -protected: - SymbianIDevice(const SymbianIDevice &other); - SymbianIDevice &operator=(const SymbianIDevice &); // no impl. - - QVariantMap toMap() const; - -private: - void updateState(); - - QString m_serialPortName; - QString m_address; - QString m_port; - CommunicationChannel m_communicationChannel; - - friend class Internal::S60Manager; -}; - -} // namespace Qt4ProjectManager - -#endif // SYMBIANIDEVICE_H diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianideviceconfigwidget.cpp b/src/plugins/qt4projectmanager/qt-s60/symbianideviceconfigwidget.cpp deleted file mode 100644 index a906cd0d6ec..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/symbianideviceconfigwidget.cpp +++ /dev/null @@ -1,624 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "symbianideviceconfigwidget.h" - -#include "symbianidevice.h" - -#include <symbianutils/symbiandevicemanager.h> -#include <codadevice.h> - -#include "codaruncontrol.h" - -#include <utils/detailswidget.h> -#include <utils/ipaddresslineedit.h> -#include <utils/qtcassert.h> -#include <utils/pathchooser.h> - -#include <QTimer> -#include <QLabel> -#include <QLineEdit> -#include <QComboBox> -#include <QVBoxLayout> -#include <QHBoxLayout> -#include <QFormLayout> -#include <QToolButton> -#include <QStyle> -#include <QApplication> -#include <QSpacerItem> -#include <QMessageBox> -#include <QCheckBox> -#include <QGroupBox> -#include <QRadioButton> -#include <QValidator> - -#include <QTcpSocket> - -Q_DECLARE_METATYPE(SymbianUtils::SymbianDevice) - -static const quint32 CODA_UID = 0x20021F96; - -static const quint32 QTMOBILITY_UID = 0x2002AC89; -static const quint32 QTCOMPONENTS_UID = 0x200346DE; -static const quint32 QMLVIEWER_UID = 0x20021317; - -static void startTable(QString &text) -{ - const char startTableC[] = "<html></head><body><table>"; - if (!text.contains(QLatin1String(startTableC))) - text.append(QLatin1String(startTableC)); -} - -static void finishTable(QString &text) -{ - const QString stopTable = QLatin1String("</table></body></html>"); - text.remove(stopTable); - text.append(stopTable); -} - -static void addToTable(QTextStream &stream, const QString &key, const QString &value) -{ - const char tableRowStartC[] = "<tr><td><b>"; - const char tableRowSeparatorC[] = "</b></td><td>"; - const char tableRowEndC[] = "</td></tr>"; - stream << tableRowStartC << key << tableRowSeparatorC << value << tableRowEndC; -} - -static void addErrorToTable(QTextStream &stream, const QString &key, const QString &value) -{ - const char tableRowStartC[] = "<tr><td><b>"; - const char tableRowSeparatorC[] = "</b></td><td>"; - const char tableRowEndC[] = "</td></tr>"; - const char errorSpanStartC[] = "<span style=\"font-weight:600; color:red; \">"; - const char errorSpanEndC[] = "</span>"; - stream << tableRowStartC << errorSpanStartC << key << tableRowSeparatorC << value << errorSpanEndC << tableRowEndC; -} - -namespace Qt4ProjectManager { -namespace Internal { - -SymbianIDeviceConfigurationWidget::SymbianIDeviceConfigurationWidget(const ProjectExplorer::IDevice::Ptr &device, - QWidget *parent) - : ProjectExplorer::IDeviceWidget(device, parent), - m_detailsWidget(new Utils::DetailsWidget), - m_serialPortsCombo(new QComboBox), - m_deviceInfoButton(new QToolButton), - m_deviceInfoDescriptionLabel(new QLabel(tr("Device:"))), - m_deviceInfoLabel(new QLabel), - m_serialRadioButton(new QRadioButton(tr("Serial:"))), - m_wlanRadioButton(new QRadioButton(tr("WLAN:"))), - m_ipAddress(new Utils::IpAddressLineEdit), - m_codaTimeout(new QTimer(this)) -{ - m_detailsWidget->setState(Utils::DetailsWidget::NoSummary); - - QVBoxLayout *mainBoxLayout = new QVBoxLayout(); - mainBoxLayout->setMargin(0); - setLayout(mainBoxLayout); - mainBoxLayout->addWidget(m_detailsWidget); - QWidget *detailsContainer = new QWidget; - m_detailsWidget->setWidget(detailsContainer); - - QFormLayout *detailsLayout = new QFormLayout(detailsContainer); - - updateSerialDevices(); - connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(updated()), - this, SLOT(updateSerialDevices())); - - bool usingTcp = symbianDevice()->communicationChannel() == SymbianIDevice::CommunicationCodaTcpConnection; - m_serialRadioButton->setChecked(!usingTcp); - m_wlanRadioButton->setChecked(usingTcp); - - detailsLayout->addRow(createCommunicationChannel()); - - // Device Info with button. Widgets are enabled in above call to updateSerialDevices() - QHBoxLayout *infoHBoxLayout = new QHBoxLayout; - m_deviceInfoLabel->setWordWrap(true); - m_deviceInfoLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); - m_deviceInfoLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); - infoHBoxLayout->addWidget(m_deviceInfoLabel); - infoHBoxLayout->addWidget(m_deviceInfoButton); - m_deviceInfoButton->setIcon(qApp->style()->standardIcon(QStyle::SP_MessageBoxInformation)); - m_deviceInfoButton->setToolTip(tr("Queries the device for information")); - connect(m_deviceInfoButton, SIGNAL(clicked()), this, SLOT(updateDeviceInfo())); - detailsLayout->addRow(m_deviceInfoDescriptionLabel, infoHBoxLayout); - - connect(this, SIGNAL(infoCollected()), - this, SLOT(collectingInfoFinished())); - - m_codaTimeout->setSingleShot(true); - connect(m_codaTimeout, SIGNAL(timeout()), this, SLOT(codaTimeout())); -} - -SymbianIDeviceConfigurationWidget::~SymbianIDeviceConfigurationWidget() -{ } - -QWidget *SymbianIDeviceConfigurationWidget::createCommunicationChannel() -{ - m_serialPortsCombo->setSizeAdjustPolicy(QComboBox::AdjustToContents); - connect(m_serialPortsCombo, SIGNAL(activated(int)), this, SLOT(setSerialPort(int))); - connect(m_serialRadioButton, SIGNAL(clicked()), this, SLOT(updateCommunicationChannel())); - connect(m_wlanRadioButton, SIGNAL(clicked()), this, SLOT(updateCommunicationChannel())); - connect(m_ipAddress, SIGNAL(validAddressChanged(QString)), this, SLOT(updateWlanAddress(QString))); - connect(m_ipAddress, SIGNAL(invalidAddressChanged()), this, SLOT(cleanWlanAddress())); - - QHBoxLayout *serialPortHBoxLayout = new QHBoxLayout; - serialPortHBoxLayout->addWidget(new QLabel(tr("Serial port:"))); - serialPortHBoxLayout->addWidget(m_serialPortsCombo); - serialPortHBoxLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored)); - -#if !defined(Q_OS_WIN) && !defined(Q_OS_MACX) - // Update device list: only needed on linux. - QToolButton *updateSerialDevicesButton(new QToolButton); - updateSerialDevicesButton->setIcon(qApp->style()->standardIcon(QStyle::SP_BrowserReload)); - connect(updateSerialDevicesButton, SIGNAL(clicked()), - SymbianUtils::SymbianDeviceManager::instance(), SLOT(update())); - serialPortHBoxLayout->addWidget(updateSerialDevicesButton); -#endif - - QGroupBox *communicationChannelGroupBox = new QGroupBox(tr("Communication Channel")); - QGridLayout *communicationChannelGridLayout = new QGridLayout; - communicationChannelGridLayout->addWidget(m_serialRadioButton, 0, 0); - communicationChannelGridLayout->addWidget(m_wlanRadioButton, 1, 0); - - m_ipAddress->setMinimumWidth(30); - m_ipAddress->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored); - - if (!symbianDevice()->address().isEmpty()) - m_ipAddress->setText(symbianDevice()->address() + QLatin1Char(':') - + symbianDevice()->port()); - - QHBoxLayout *wlanChannelLayout = new QHBoxLayout(); - wlanChannelLayout->addWidget(new QLabel(tr("Address:"))); - wlanChannelLayout->addWidget(m_ipAddress); - wlanChannelLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored)); - - communicationChannelGridLayout->addLayout(serialPortHBoxLayout, 0, 1); - communicationChannelGridLayout->addLayout(wlanChannelLayout, 1, 1); - - communicationChannelGroupBox->setLayout(communicationChannelGridLayout); - - updateCommunicationChannelUi(); - - return communicationChannelGroupBox; -} - -void SymbianIDeviceConfigurationWidget::updateSerialDevices() -{ - m_serialPortsCombo->clear(); - const QString previouPortName = symbianDevice()->serialPortName(); - const QList<SymbianUtils::SymbianDevice> devices = SymbianUtils::SymbianDeviceManager::instance()->devices(); - int newIndex = -1; - for (int i = 0; i < devices.size(); ++i) { - const SymbianUtils::SymbianDevice &device = devices.at(i); - m_serialPortsCombo->addItem(device.friendlyName(), qVariantFromValue(device)); - if (device.portName() == previouPortName) - newIndex = i; - } - - if (symbianDevice()->communicationChannel() - == SymbianIDevice::CommunicationCodaTcpConnection) { - m_deviceInfoButton->setEnabled(true); - return; - } - - clearDeviceInfo(); - // Set new index: prefer to keep old or set to 0, if available. - if (newIndex == -1 && !devices.empty()) - newIndex = 0; - m_serialPortsCombo->setCurrentIndex(newIndex); - if (newIndex == -1) { - m_deviceInfoButton->setEnabled(false); - symbianDevice()->setSerialPortName(QString()); - } else { - m_deviceInfoButton->setEnabled(true); - const QString newPortName = rawDevice(newIndex).portName(); - symbianDevice()->setSerialPortName(newPortName); - } -} - -SymbianUtils::SymbianDevice SymbianIDeviceConfigurationWidget::rawDevice(int i) const -{ - const QVariant data = m_serialPortsCombo->itemData(i); - if (data.isValid() && qVariantCanConvert<SymbianUtils::SymbianDevice>(data)) - return qVariantValue<SymbianUtils::SymbianDevice>(data); - return SymbianUtils::SymbianDevice(); -} - -SymbianUtils::SymbianDevice SymbianIDeviceConfigurationWidget::currentRawDevice() const -{ - return rawDevice(m_serialPortsCombo->currentIndex()); -} - -void SymbianIDeviceConfigurationWidget::setSerialPort(int index) -{ - const SymbianUtils::SymbianDevice d = rawDevice(index); - symbianDevice()->setSerialPortName(d.portName()); - m_deviceInfoButton->setEnabled(index >= 0); - clearDeviceInfo(); -} - -void SymbianIDeviceConfigurationWidget::updateCommunicationChannelUi() -{ - SymbianIDevice::CommunicationChannel channel = symbianDevice()->communicationChannel(); - if (channel == SymbianIDevice::CommunicationCodaTcpConnection) { - m_ipAddress->setDisabled(false); - m_serialPortsCombo->setDisabled(true); - m_deviceInfoButton->setEnabled(true); - } else { - m_ipAddress->setDisabled(true); - m_serialPortsCombo->setDisabled(false); - updateSerialDevices(); - } -} - -void SymbianIDeviceConfigurationWidget::updateCommunicationChannel() -{ - if (!m_wlanRadioButton->isChecked() && !m_serialRadioButton->isChecked()) - m_serialRadioButton->setChecked(true); - - if (m_wlanRadioButton->isChecked()) { - m_ipAddress->setDisabled(false); - m_serialPortsCombo->setDisabled(true); - symbianDevice()->setCommunicationChannel(SymbianIDevice::CommunicationCodaTcpConnection); - m_deviceInfoButton->setEnabled(true); - } else { - m_ipAddress->setDisabled(true); - m_serialPortsCombo->setDisabled(false); - symbianDevice()->setCommunicationChannel(SymbianIDevice::CommunicationCodaSerialConnection); - updateSerialDevices(); - } -} - -void SymbianIDeviceConfigurationWidget::updateWlanAddress(const QString &address) -{ - QStringList addressList = address.split(QLatin1String(":"), QString::SkipEmptyParts); - if (addressList.count() > 0) { - symbianDevice()->setAddress(addressList.at(0)); - if (addressList.count() > 1) - symbianDevice()->setPort(addressList.at(1)); - else - symbianDevice()->setPort(QString()); - } -} - -void SymbianIDeviceConfigurationWidget::cleanWlanAddress() -{ - if (!symbianDevice()->address().isEmpty()) - symbianDevice()->setAddress(QString()); - - if (!symbianDevice()->port().isEmpty()) - symbianDevice()->setPort(QString()); -} - -void SymbianIDeviceConfigurationWidget::clearDeviceInfo() -{ - // Restore text & color - m_deviceInfoLabel->clear(); - m_deviceInfoLabel->setStyleSheet(QString()); -} - -void SymbianIDeviceConfigurationWidget::setDeviceInfoLabel(const QString &message, bool isError) -{ - m_deviceInfoLabel->setStyleSheet(isError ? - QString(QLatin1String("background-color: red;")) : - QString()); - m_deviceInfoLabel->setText(message); - m_deviceInfoLabel->adjustSize(); -} - -void SymbianIDeviceConfigurationWidget::updateDeviceInfo() -{ - setDeviceInfoLabel(tr("Connecting")); - if (symbianDevice()->communicationChannel() == SymbianIDevice::CommunicationCodaSerialConnection) { - const SymbianUtils::SymbianDevice commDev = currentRawDevice(); - m_codaInfoDevice = SymbianUtils::SymbianDeviceManager::instance()->getCodaDevice(commDev.portName()); - if (m_codaInfoDevice.isNull()) { - setDeviceInfoLabel(tr("Unable to create CODA connection. Please try again."), true); - return; - } - if (!m_codaInfoDevice->device()->isOpen()) { - setDeviceInfoLabel(m_codaInfoDevice->device()->errorString(), true); - return; - } - //TODO error handling - for now just throw the command at coda - m_codaInfoDevice->sendSymbianOsDataGetQtVersionCommand(Coda::CodaCallback(this, &SymbianIDeviceConfigurationWidget::getQtVersionCommandResult)); - m_deviceInfoButton->setEnabled(false); - m_codaTimeout->start(1000); - } else if (symbianDevice()->communicationChannel() == SymbianIDevice::CommunicationCodaTcpConnection) { - // collectingInfoFinished, which deletes m_codaDevice, can get called from within a coda callback, so need to use deleteLater - m_codaInfoDevice = QSharedPointer<Coda::CodaDevice>(new Coda::CodaDevice, &QObject::deleteLater); - connect(m_codaInfoDevice.data(), SIGNAL(codaEvent(Coda::CodaEvent)), this, SLOT(codaEvent(Coda::CodaEvent))); - - const QSharedPointer<QTcpSocket> codaSocket(new QTcpSocket); - m_codaInfoDevice->setDevice(codaSocket); - codaSocket->connectToHost(symbianDevice()->address(), - symbianDevice()->port().toInt()); - m_deviceInfoButton->setEnabled(false); - m_codaTimeout->start(1500); - } else - setDeviceInfoLabel(tr("Currently there is no information about the device for this connection type."), true); -} - -void SymbianIDeviceConfigurationWidget::codaEvent(const Coda::CodaEvent &event) -{ - switch (event.type()) { - case Coda::CodaEvent::LocatorHello: // Commands accepted now - codaIncreaseProgress(); - if (m_codaInfoDevice) - m_codaInfoDevice->sendSymbianOsDataGetQtVersionCommand(Coda::CodaCallback(this, &SymbianIDeviceConfigurationWidget::getQtVersionCommandResult)); - break; - default: - break; - } -} - -void SymbianIDeviceConfigurationWidget::getQtVersionCommandResult(const Coda::CodaCommandResult &result) -{ - m_deviceInfo.clear(); - if (result.type == Coda::CodaCommandResult::FailReply) { - setDeviceInfoLabel(tr("No device information available"), true); - SymbianUtils::SymbianDeviceManager::instance()->releaseCodaDevice(m_codaInfoDevice); - m_deviceInfoButton->setEnabled(true); - m_codaTimeout->stop(); - return; - } else if (result.type == Coda::CodaCommandResult::CommandErrorReply){ - startTable(m_deviceInfo); - QTextStream str(&m_deviceInfo); - addErrorToTable(str, tr("Qt version: "), tr("Not installed on device")); - finishTable(m_deviceInfo); - } else { - if (result.values.count()) { - QHash<QString, QVariant> obj = result.values[0].toVariant().toHash(); - QString ver = obj.value(QLatin1String("qVersion")).toString(); - - startTable(m_deviceInfo); - QTextStream str(&m_deviceInfo); - addToTable(str, tr("Qt version:"), ver); - QString systemVersion; - - const int symVer = obj.value(QLatin1String("symbianVersion")).toInt(); - // Ugh why won't QSysInfo define these on non-symbian builds... - switch (symVer) { - case 10: - systemVersion.append(QLatin1String("Symbian OS v9.2")); - break; - case 20: - systemVersion.append(QLatin1String("Symbian OS v9.3")); - break; - case 30: - systemVersion.append(QLatin1String("Symbian OS v9.4 / Symbian^1")); - break; - case 40: - systemVersion.append(QLatin1String("Symbian^2")); - break; - case 50: - systemVersion.append(QLatin1String("Symbian^3")); - break; - case 60: - systemVersion.append(QLatin1String("Symbian^4")); - break; - case 70: - systemVersion.append(QLatin1String("Symbian^3")); // TODO: might change - break; - default: - systemVersion.append(tr("Unrecognised Symbian version 0x%1").arg(symVer, 0, 16)); - break; - } - systemVersion.append(QLatin1String(", ")); - int s60Ver = obj.value(QLatin1String("s60Version")).toInt(); - switch (s60Ver) { - case 10: - systemVersion.append(QLatin1String("S60 3rd Edition Feature Pack 1")); - break; - case 20: - systemVersion.append(QLatin1String("S60 3rd Edition Feature Pack 2")); - break; - case 30: - systemVersion.append(QLatin1String("S60 5th Edition")); - break; - case 40: - systemVersion.append(QLatin1String("S60 5th Edition Feature Pack 1")); - break; - case 50: - systemVersion.append(QLatin1String("S60 5th Edition Feature Pack 2")); - break; - case 70: - systemVersion.append(QLatin1String("S60 5th Edition Feature Pack 3")); // TODO: might change - break; - default: - systemVersion.append(tr("Unrecognised S60 version 0x%1").arg(symVer, 0, 16)); - break; - } - addToTable(str, tr("OS version:"), systemVersion); - finishTable(m_deviceInfo); - } - } - codaIncreaseProgress(); - if (m_codaInfoDevice) - m_codaInfoDevice->sendSymbianOsDataGetRomInfoCommand(Coda::CodaCallback(this, &SymbianIDeviceConfigurationWidget::getRomInfoResult)); -} - -void SymbianIDeviceConfigurationWidget::getRomInfoResult(const Coda::CodaCommandResult &result) -{ - codaIncreaseProgress(); - if (result.type == Coda::CodaCommandResult::SuccessReply && result.values.count()) { - startTable(m_deviceInfo); - QTextStream str(&m_deviceInfo); - - QVariantHash obj = result.values[0].toVariant().toHash(); - QString romVersion = obj.value(QLatin1String("romVersion"), tr("unknown")).toString(); - romVersion.replace(QLatin1Char('\n'), QLatin1Char(' ')); // The ROM string is split across multiple lines, for some reason. - addToTable(str, tr("ROM version:"), romVersion); - - QString pr = obj.value(QLatin1String("prInfo")).toString(); - if (pr.length()) - addToTable(str, tr("Release:"), pr); - finishTable(m_deviceInfo); - } - - QList<quint32> packagesOfInterest; - packagesOfInterest.append(CODA_UID); - packagesOfInterest.append(QTMOBILITY_UID); - packagesOfInterest.append(QTCOMPONENTS_UID); - packagesOfInterest.append(QMLVIEWER_UID); - if (m_codaInfoDevice) - m_codaInfoDevice->sendSymbianInstallGetPackageInfoCommand(Coda::CodaCallback(this, &SymbianIDeviceConfigurationWidget::getInstalledPackagesResult), packagesOfInterest); -} - -void SymbianIDeviceConfigurationWidget::getInstalledPackagesResult(const Coda::CodaCommandResult &result) -{ - codaIncreaseProgress(); - if (result.type == Coda::CodaCommandResult::SuccessReply && result.values.count()) { - startTable(m_deviceInfo); - QTextStream str(&m_deviceInfo); - - QVariantList resultsList = result.values[0].toVariant().toList(); - const QString uidKey = QLatin1String("uid"); - const QString errorKey = QLatin1String("error"); - const QString versionKey = QLatin1String("version"); - foreach (const QVariant &var, resultsList) { - QVariantHash obj = var.toHash(); - bool ok = false; - uint uid = obj.value(uidKey).toString().toUInt(&ok, 16); - if (ok) { - const bool error = !obj.value(errorKey).isNull(); - QString versionString; - if (!error) { - QVariantList version = obj.value(versionKey).toList(); - versionString = QString::fromLatin1("%1.%2.%3").arg(version[0].toInt()) - .arg(version[1].toInt()) - .arg(version[2].toInt()); - } - switch (uid) { - case CODA_UID: { - if (error) { - // How can coda not be installed? Presumably some UID wrongness... - addErrorToTable(str, tr("CODA version: "), tr("Error reading CODA version")); - } else - addToTable(str, tr("CODA version: "), versionString); - } - break; - case QTMOBILITY_UID: { - if (error) - addErrorToTable(str, tr("Qt Mobility version: "), tr("Error reading Qt Mobility version")); - else - addToTable(str, tr("Qt Mobility version: "), versionString); - } - break; - case QTCOMPONENTS_UID: { - addToTable(str, tr("Qt Quick components version: "), error ? tr("Not installed") : versionString); - } - break; - case QMLVIEWER_UID: { - addToTable(str, tr("QML Viewer version: "), error ? tr("Not installed") : versionString); - } - break; - default: break; - } - } - } - finishTable(m_deviceInfo); - } - - QStringList keys; - keys << QLatin1String("EDisplayXPixels"); - keys << QLatin1String("EDisplayYPixels"); - - if (m_codaInfoDevice) - m_codaInfoDevice->sendSymbianOsDataGetHalInfoCommand(Coda::CodaCallback(this, &SymbianIDeviceConfigurationWidget::getHalResult), keys); -} - -void SymbianIDeviceConfigurationWidget::getHalResult(const Coda::CodaCommandResult &result) -{ - codaIncreaseProgress(); - if (result.type == Coda::CodaCommandResult::SuccessReply && result.values.count()) { - QVariantList resultsList = result.values[0].toVariant().toList(); - int x = 0; - int y = 0; - const QString nameKey = QLatin1String("name"); - const QString valueKey = QLatin1String("value"); - foreach (const QVariant &var, resultsList) { - QVariantHash obj = var.toHash(); - const QString name = obj.value(nameKey).toString(); - if (name == QLatin1String("EDisplayXPixels")) - x = obj.value(valueKey).toInt(); - else if (name == QLatin1String("EDisplayYPixels")) - y = obj.value(valueKey).toInt(); - } - if (x && y) { - startTable(m_deviceInfo); - QTextStream str(&m_deviceInfo); - addToTable(str, tr("Screen size:"), QString::number(x) + QLatin1Char('x') + QString::number(y)); - finishTable(m_deviceInfo); - } - } - - // Done with collecting info - emit infoCollected(); -} - -void SymbianIDeviceConfigurationWidget::codaIncreaseProgress() -{ - m_codaTimeout->start(); - setDeviceInfoLabel(m_deviceInfoLabel->text() + QLatin1Char('.')); -} - -SymbianIDevice *SymbianIDeviceConfigurationWidget::symbianDevice() const -{ - return dynamic_cast<SymbianIDevice *>(device().data()); -} - -void SymbianIDeviceConfigurationWidget::collectingInfoFinished() -{ - m_codaTimeout->stop(); - emit codaConnected(); - m_deviceInfoButton->setEnabled(true); - setDeviceInfoLabel(m_deviceInfo); - SymbianUtils::SymbianDeviceManager::instance()->releaseCodaDevice(m_codaInfoDevice); -} - -void SymbianIDeviceConfigurationWidget::codaTimeout() -{ - QMessageBox *mb = CodaRunControl::createCodaWaitingMessageBox(this); - connect(this, SIGNAL(codaConnected()), mb, SLOT(close())); - connect(mb, SIGNAL(finished(int)), this, SLOT(codaCanceled())); - mb->open(); -} - -void SymbianIDeviceConfigurationWidget::codaCanceled() -{ - clearDeviceInfo(); - m_deviceInfoButton->setEnabled(true); - SymbianUtils::SymbianDeviceManager::instance()->releaseCodaDevice(m_codaInfoDevice); -} - -} // namespace Internal -} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianideviceconfigwidget.h b/src/plugins/qt4projectmanager/qt-s60/symbianideviceconfigwidget.h deleted file mode 100644 index ece06eccc31..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/symbianideviceconfigwidget.h +++ /dev/null @@ -1,127 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef SYMBIANIDEVICECONFIGURATIONWIDGET_H -#define SYMBIANIDEVICECONFIGURATIONWIDGET_H - -#include <projectexplorer/devicesupport/idevicewidget.h> - -#include <QWidget> -#include <QPointer> - -QT_BEGIN_NAMESPACE -class QLabel; -class QLineEdit; -class QComboBox; -class QToolButton; -class QCheckBox; -class QRadioButton; -QT_END_NAMESPACE - -namespace Utils { - class DetailsWidget; - class IpAddressLineEdit; -} - -namespace SymbianUtils { -class SymbianDevice; -} - -namespace Coda { - class CodaDevice; - class CodaEvent; - struct CodaCommandResult; -} - -namespace Qt4ProjectManager { - -class SymbianIDevice; - -namespace Internal { - -class SymbianIDeviceConfigurationWidget : public ProjectExplorer::IDeviceWidget -{ - Q_OBJECT - -public: - explicit SymbianIDeviceConfigurationWidget(const ProjectExplorer::IDevice::Ptr &rawDevice, QWidget *parent = 0); - ~SymbianIDeviceConfigurationWidget(); - -signals: - void infoCollected(); - void codaConnected(); - -private slots: - void updateSerialDevices(); - void setSerialPort(int index); - void updateDeviceInfo(); - void clearDeviceInfo(); - void updateCommunicationChannel(); - void updateCommunicationChannelUi(); - void updateWlanAddress(const QString &address); - void cleanWlanAddress(); - void codaEvent(const Coda::CodaEvent &event); - void collectingInfoFinished(); - void codaTimeout(); - void codaCanceled(); - void codaIncreaseProgress(); - -private: - SymbianIDevice *symbianDevice() const; - - inline SymbianUtils::SymbianDevice rawDevice(int i) const; - inline SymbianUtils::SymbianDevice currentRawDevice() const; - - void setDeviceInfoLabel(const QString &message, bool isError = false); - - QWidget *createCommunicationChannel(); - - void getQtVersionCommandResult(const Coda::CodaCommandResult &result); - void getRomInfoResult(const Coda::CodaCommandResult &result); - void getInstalledPackagesResult(const Coda::CodaCommandResult &result); - void getHalResult(const Coda::CodaCommandResult &result); - - Utils::DetailsWidget *m_detailsWidget; - QComboBox *m_serialPortsCombo; - QToolButton *m_deviceInfoButton; - QLabel *m_deviceInfoDescriptionLabel; - QLabel *m_deviceInfoLabel; - QRadioButton *m_serialRadioButton; - QRadioButton *m_wlanRadioButton; - Utils::IpAddressLineEdit *m_ipAddress; - QSharedPointer<Coda::CodaDevice> m_codaInfoDevice; - QString m_deviceInfo; - QTimer *m_codaTimeout; -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // SYMBIANIDEVICECONFIGURATIONWIDGET_H diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianidevicefactory.cpp b/src/plugins/qt4projectmanager/qt-s60/symbianidevicefactory.cpp deleted file mode 100644 index df4424ba2fe..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/symbianidevicefactory.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "symbianidevicefactory.h" - -#include "symbianidevice.h" - -#include <utils/qtcassert.h> - -namespace Qt4ProjectManager { -namespace Internal { - -SymbianIDeviceFactory::SymbianIDeviceFactory(QObject *parent) : IDeviceFactory(parent) -{ } - -QString SymbianIDeviceFactory::displayNameForId(Core::Id type) const -{ - if (type == deviceType()) - return tr("Symbian Device"); - return QString(); -} - -QList<Core::Id> SymbianIDeviceFactory::availableCreationIds() const -{ - return QList<Core::Id>() << deviceType(); -} - -bool SymbianIDeviceFactory::canCreate() const -{ - return false; -} - -ProjectExplorer::IDevice::Ptr SymbianIDeviceFactory::create(Core::Id id) const -{ - Q_UNUSED(id); - return ProjectExplorer::IDevice::Ptr(); -} - -bool SymbianIDeviceFactory::canRestore(const QVariantMap &map) const -{ - return ProjectExplorer::IDevice::typeFromMap(map) == deviceType(); -} - -ProjectExplorer::IDevice::Ptr SymbianIDeviceFactory::restore(const QVariantMap &map) const -{ - QTC_ASSERT(canRestore(map), return ProjectExplorer::IDevice::Ptr()); - SymbianIDevice *dev = new SymbianIDevice(map); - return ProjectExplorer::IDevice::Ptr(dev); -} - -Core::Id SymbianIDeviceFactory::deviceType() -{ - return Core::Id("Qt4ProjectManager.SymbianDevice"); -} - -} // namespace internal -} // namespace qt4projectmanager diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianidevicefactory.h b/src/plugins/qt4projectmanager/qt-s60/symbianidevicefactory.h deleted file mode 100644 index 5fe3edde320..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/symbianidevicefactory.h +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef SYMBIANIDEVICEFACTORY_H -#define SYMBIANIDEVICEFACTORY_H - -#include <projectexplorer/devicesupport/idevicefactory.h> - -namespace Qt4ProjectManager { -namespace Internal { - -class SymbianIDeviceFactory : public ProjectExplorer::IDeviceFactory -{ - Q_OBJECT - -public: - SymbianIDeviceFactory(QObject *parent = 0); - - QString displayNameForId(Core::Id type) const; - QList<Core::Id> availableCreationIds() const; - - bool canCreate() const; - ProjectExplorer::IDevice::Ptr create(Core::Id id) const; - bool canRestore(const QVariantMap &map) const; - ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const; - - static Core::Id deviceType(); -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // SYMBIANIDEVICEFACTORY_H diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.cpp b/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.cpp deleted file mode 100644 index c2c87bf19a7..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.cpp +++ /dev/null @@ -1,330 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "qt4projectmanagerconstants.h" -#include "symbianqtversion.h" -#include "qt-s60/sbsv2parser.h" -#include "qt-s60/abldparser.h" - -#include <projectexplorer/gnumakeparser.h> -#include <projectexplorer/profileinformation.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/toolchain.h> -#include <projectexplorer/toolchainmanager.h> -#include <qtsupport/qtsupportconstants.h> -#include <utils/pathchooser.h> -#include <utils/environment.h> -#include <proparser/profileevaluator.h> - -#include <QCoreApplication> -#include <QDir> -#include <QSettings> -#include <QLabel> -#include <QFormLayout> - -using namespace Qt4ProjectManager; -using namespace Qt4ProjectManager::Internal; - -SymbianQtVersion::SymbianQtVersion() - : BaseQtVersion() -{ -} - -SymbianQtVersion::SymbianQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource) - : BaseQtVersion(path, isAutodetected, autodetectionSource) -{ - -} - -SymbianQtVersion::~SymbianQtVersion() -{ - -} - -SymbianQtVersion *SymbianQtVersion::clone() const -{ - return new SymbianQtVersion(*this); -} - -bool SymbianQtVersion::equals(BaseQtVersion *other) -{ - if (!BaseQtVersion::equals(other)) - return false; - SymbianQtVersion *o = static_cast<SymbianQtVersion *>(other); - return m_sbsV2Directory == o->m_sbsV2Directory; -} - -QString SymbianQtVersion::type() const -{ - return QLatin1String(QtSupport::Constants::SYMBIANQT); -} - -bool SymbianQtVersion::isValid() const -{ - if (!BaseQtVersion::isValid()) - return false; - if (isBuildWithSymbianSbsV2() && (m_sbsV2Directory.isEmpty() || !QFileInfo(m_sbsV2Directory + QLatin1String("/sbs")).exists())) - return false; - return true; -} - -QString SymbianQtVersion::invalidReason() const -{ - QString tmp = BaseQtVersion::invalidReason(); - if (isBuildWithSymbianSbsV2() - && (m_sbsV2Directory.isEmpty() || !QFileInfo(m_sbsV2Directory + QLatin1String("/sbs")).exists())) - return QCoreApplication::translate("QtVersion", "SBS was not found."); - - return tmp; -} - -void SymbianQtVersion::restoreLegacySettings(QSettings *s) -{ - setSbsV2Directory(QDir::fromNativeSeparators(s->value(QLatin1String("SBSv2Directory")).toString())); -} - -void SymbianQtVersion::fromMap(const QVariantMap &map) -{ - BaseQtVersion::fromMap(map); - setSbsV2Directory(QDir::fromNativeSeparators(map.value(QLatin1String("SBSv2Directory")).toString())); -} - -QVariantMap SymbianQtVersion::toMap() const -{ - QVariantMap result = BaseQtVersion::toMap(); - result.insert(QLatin1String("SBSv2Directory"), sbsV2Directory()); - return result; -} - -QList<ProjectExplorer::Abi> SymbianQtVersion::detectQtAbis() const -{ - return QList<ProjectExplorer::Abi>() - << ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::SymbianOS, - ProjectExplorer::Abi::UnknownFlavor, - ProjectExplorer::Abi::ElfFormat, - 32); -} - -QString SymbianQtVersion::description() const -{ - return QCoreApplication::translate("QtVersion", "Symbian", "Qt Version is meant for Symbian"); -} - - -bool SymbianQtVersion::supportsShadowBuilds() const -{ - return false; -} - -bool SymbianQtVersion::supportsBinaryDebuggingHelper() const -{ - return false; -} - -static const char *S60_EPOC_HEADERS[] = { - "include", "mkspecs/common/symbian", "epoc32/include", - "epoc32/include/osextensions/stdapis", "epoc32/include/osextensions/stdapis/sys", - "epoc32/include/stdapis", "epoc32/include/stdapis/sys", - "epoc32/include/osextensions/stdapis/stlport", "epoc32/include/stdapis/stlport", - "epoc32/include/oem", "epoc32/include/middleware", "epoc32/include/domain/middleware", - "epoc32/include/osextensions", "epoc32/include/domain/osextensions", - "epoc32/include/domain/osextensions/loc", "epoc32/include/domain/middleware/loc", - "epoc32/include/domain/osextensions/loc/sc", "epoc32/include/domain/middleware/loc/sc", - "epoc32/include/mw", "epoc32/include/app", - "epoc32/include/platform", "epoc32/include/platform/mw", - "epoc32/include/platform/app", "epoc32/include/platform/loc", - "epoc32/include/platform/mw/loc", "epoc32/include/platform/app/loc", - "epoc32/include/platform/loc/sc", "epoc32/include/platform/app/loc/sc", - "epoc32/include/platform/mw/loc/sc" -}; - -void SymbianQtVersion::addToEnvironment(const ProjectExplorer::Profile *p, Utils::Environment &env) const -{ - BaseQtVersion::addToEnvironment(p, env); - // Generic Symbian environment: - QString epocRootPath = ProjectExplorer::SysRootProfileInformation::sysRoot(p).toString(); - QDir epocDir(epocRootPath); - - // Clean up epoc root path for the environment: - if (!epocRootPath.endsWith(QLatin1Char('/'))) - epocRootPath.append(QLatin1Char('/')); - if (!isBuildWithSymbianSbsV2()) { -#ifdef Q_OS_WIN - if (epocRootPath.count() > 2 - && epocRootPath.at(0).toLower() >= QLatin1Char('a') - && epocRootPath.at(0).toLower() <= QLatin1Char('z') - && epocRootPath.at(1) == QLatin1Char(':')) { - epocRootPath = epocRootPath.mid(2); - } -#endif - } - env.set(QLatin1String("EPOCROOT"), QDir::toNativeSeparators(epocRootPath)); - - env.prependOrSetPath(epocDir.filePath(QLatin1String("epoc32/tools"))); // e.g. make.exe - // Windows only: - if (ProjectExplorer::Abi::hostAbi().os() == ProjectExplorer::Abi::WindowsOS) { - QString winDir = QLatin1String(qgetenv("WINDIR")); - if (!winDir.isEmpty()) - env.prependOrSetPath(QDir(winDir).filePath(QLatin1String("system32"))); - - if (epocDir.exists(QLatin1String("epoc32/gcc/bin"))) - env.prependOrSetPath(epocDir.filePath(QLatin1String("epoc32/gcc/bin"))); // e.g. cpp.exe, *NOT* gcc.exe - // Find perl in the special Symbian flavour: - if (epocDir.exists(QLatin1String("../../tools/perl/bin"))) { - epocDir.cd(QLatin1String("../../tools/perl/bin")); - env.prependOrSetPath(epocDir.absolutePath()); - } else { - env.prependOrSetPath(epocDir.filePath(QLatin1String("perl/bin"))); - } - } - - // SBSv2: - if (isBuildWithSymbianSbsV2()) { - QString sbsHome(env.value(QLatin1String("SBS_HOME"))); - QString sbsConfig = sbsV2Directory(); - if (!sbsConfig.isEmpty()) { - env.prependOrSetPath(sbsConfig); - // SBS_HOME is the path minus the trailing /bin: - env.set(QLatin1String("SBS_HOME"), - QDir::toNativeSeparators(sbsConfig.left(sbsConfig.count() - 4))); // We need this for Qt 4.6.3 compatibility - } else if (!sbsHome.isEmpty()) { - env.prependOrSetPath(sbsHome + QLatin1String("/bin")); - } - } -} - -QList<ProjectExplorer::HeaderPath> SymbianQtVersion::systemHeaderPathes(const ProjectExplorer::Profile *p) const -{ - QList<ProjectExplorer::HeaderPath> result; - QString root = ProjectExplorer::SysRootProfileInformation::sysRoot(p).toString() + QLatin1Char('/'); - const int count = sizeof(S60_EPOC_HEADERS) / sizeof(const char *); - for (int i = 0; i < count; ++i) { - const QDir dir(root + QLatin1String(S60_EPOC_HEADERS[i])); - if (dir.exists()) - result.append(ProjectExplorer::HeaderPath(dir.absolutePath(), - ProjectExplorer::HeaderPath::GlobalHeaderPath)); - } - result.append(BaseQtVersion::systemHeaderPathes(p)); - return result; -} - -ProjectExplorer::IOutputParser *SymbianQtVersion::createOutputParser() const -{ - if (isBuildWithSymbianSbsV2()) { - return new SbsV2Parser; - } else { - ProjectExplorer::IOutputParser *parser = new AbldParser; - parser->appendOutputParser(new ProjectExplorer::GnuMakeParser); - return parser; - } -} - -QString SymbianQtVersion::sbsV2Directory() const -{ - return m_sbsV2Directory; -} - -void SymbianQtVersion::setSbsV2Directory(const QString &directory) -{ - QDir dir(directory); - const QString sbs = QLatin1String("sbs"); - if (dir.exists(sbs)) { - m_sbsV2Directory = dir.absolutePath(); - return; - } - dir.cd(QLatin1String("bin")); - if (dir.exists(sbs)) { - m_sbsV2Directory = dir.absolutePath(); - return; - } - m_sbsV2Directory = directory; -} - -bool SymbianQtVersion::isBuildWithSymbianSbsV2() const -{ - ensureMkSpecParsed(); - return m_isBuildUsingSbsV2; -} - -void SymbianQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const -{ - QString makefileGenerator = evaluator->value(QLatin1String("MAKEFILE_GENERATOR")); - m_isBuildUsingSbsV2 = (makefileGenerator == QLatin1String("SYMBIAN_SBSV2")); - BaseQtVersion::parseMkSpec(evaluator); -} - -Core::FeatureSet SymbianQtVersion::availableFeatures() const -{ - Core::FeatureSet features = QtSupport::BaseQtVersion::availableFeatures(); - if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 4)) //no reliable test for components, yet. - features |= Core::FeatureSet(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_SYMBIAN); - features |= Core::FeatureSet(QtSupport::Constants::FEATURE_MOBILE); - - return features; -} - -QString SymbianQtVersion::platformName() const -{ - return QLatin1String(QtSupport::Constants::SYMBIAN_PLATFORM); -} - -QString SymbianQtVersion::platformDisplayName() const -{ - return QLatin1String(QtSupport::Constants::SYMBIAN_PLATFORM_TR); -} - -QtSupport::QtConfigWidget *SymbianQtVersion::createConfigurationWidget() const -{ - return new SymbianQtConfigWidget(const_cast<SymbianQtVersion *>(this)); -} - -SymbianQtConfigWidget::SymbianQtConfigWidget(SymbianQtVersion *version) - : m_version(version) -{ - QFormLayout *fl = new QFormLayout(); - fl->setMargin(0); - setLayout(fl); - - if (version->isBuildWithSymbianSbsV2()) { - Utils::PathChooser *sbsV2Path = new Utils::PathChooser; - sbsV2Path->setExpectedKind(Utils::PathChooser::ExistingDirectory); - fl->addRow(tr("SBS v2 directory:"), sbsV2Path); - sbsV2Path->setPath(QDir::toNativeSeparators(version->sbsV2Directory())); - sbsV2Path->setEnabled(version->isBuildWithSymbianSbsV2()); - connect(sbsV2Path, SIGNAL(changed(QString)), - this, SLOT(updateCurrentSbsV2Directory(QString))); - } -} - -void SymbianQtConfigWidget::updateCurrentSbsV2Directory(const QString &path) -{ - m_version->setSbsV2Directory(QDir::fromNativeSeparators(path)); - emit changed(); -} diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.h b/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.h deleted file mode 100644 index c2ead8fb530..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/symbianqtversion.h +++ /dev/null @@ -1,104 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef SYMBIANQTVERSION_H -#define SYMBIANQTVERSION_H - -#include <qtsupport/baseqtversion.h> - -namespace Qt4ProjectManager { -namespace Internal { - -class SymbianQtVersion : public QtSupport::BaseQtVersion -{ -public: - SymbianQtVersion(); - SymbianQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString()); - SymbianQtVersion *clone() const; - ~SymbianQtVersion(); - - bool equals(BaseQtVersion *other); - - QString type() const; - - bool isValid() const; - QString invalidReason() const; - - void restoreLegacySettings(QSettings *s); - void fromMap(const QVariantMap &map); - QVariantMap toMap() const; - - QList<ProjectExplorer::Abi> detectQtAbis() const; - - QString description() const; - - bool supportsShadowBuilds() const; - bool supportsBinaryDebuggingHelper() const; - void addToEnvironment(const ProjectExplorer::Profile *p, Utils::Environment &env) const; - QList<ProjectExplorer::HeaderPath> systemHeaderPathes(const ProjectExplorer::Profile *p) const; - - ProjectExplorer::IOutputParser *createOutputParser() const; - - bool isBuildWithSymbianSbsV2() const; - - QString sbsV2Directory() const; - void setSbsV2Directory(const QString &directory); - - QtSupport::QtConfigWidget *createConfigurationWidget() const; - - Core::FeatureSet availableFeatures() const; - QString platformName() const; - QString platformDisplayName() const; - -protected: - void parseMkSpec(ProFileEvaluator *) const; -private: - QString m_sbsV2Directory; - mutable bool m_isBuildUsingSbsV2; -}; - -class SymbianQtConfigWidget : public QtSupport::QtConfigWidget -{ - Q_OBJECT - -public: - SymbianQtConfigWidget(SymbianQtVersion *version); - -public slots: - void updateCurrentSbsV2Directory(const QString &path); - -private: - SymbianQtVersion *m_version; -}; - -} -} - -#endif // SYMBIANQTVERSION_H diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianqtversionfactory.cpp b/src/plugins/qt4projectmanager/qt-s60/symbianqtversionfactory.cpp deleted file mode 100644 index 3e3b524489d..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/symbianqtversionfactory.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#include "symbianqtversionfactory.h" - -#include "qt4projectmanagerconstants.h" -#include "symbianqtversion.h" - -#include <qtsupport/profilereader.h> -#include <qtsupport/qtsupportconstants.h> - -#include <QFileInfo> - -using namespace Qt4ProjectManager; -using namespace Qt4ProjectManager::Internal; - -SymbianQtVersionFactory::SymbianQtVersionFactory(QObject *parent) - : QtVersionFactory(parent) -{ - -} - -SymbianQtVersionFactory::~SymbianQtVersionFactory() -{ - -} - -bool SymbianQtVersionFactory::canRestore(const QString &type) -{ - return type == QLatin1String(QtSupport::Constants::SYMBIANQT); -} - -QtSupport::BaseQtVersion *SymbianQtVersionFactory::restore(const QString &type, const QVariantMap &data) -{ - if (!canRestore(type)) - return 0; - SymbianQtVersion *v = new SymbianQtVersion; - v->fromMap(data); - return v; -} - -int SymbianQtVersionFactory::priority() const -{ - return 50; -} - -QtSupport::BaseQtVersion *SymbianQtVersionFactory::create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource) -{ - QFileInfo fi = qmakePath.toFileInfo(); - if (!fi.exists() || !fi.isExecutable() || !fi.isFile()) - return 0; - - QString makefileGenerator = evaluator->value(QLatin1String("MAKEFILE_GENERATOR")); - if (makefileGenerator == QLatin1String("SYMBIAN_ABLD") || - makefileGenerator == QLatin1String("SYMBIAN_SBSV2") || - makefileGenerator == QLatin1String("SYMBIAN_UNIX")) { - return new SymbianQtVersion(qmakePath, isAutoDetected, autoDetectionSource); - } - - return 0; -} diff --git a/src/plugins/qt4projectmanager/qt-s60/symbianqtversionfactory.h b/src/plugins/qt4projectmanager/qt-s60/symbianqtversionfactory.h deleted file mode 100644 index f44b1f1bacb..00000000000 --- a/src/plugins/qt4projectmanager/qt-s60/symbianqtversionfactory.h +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: http://www.qt-project.org/ -** -** -** GNU Lesser General Public License Usage -** -** 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. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -**************************************************************************/ - -#ifndef SYMBIANQTVERSIONFACTORY_H -#define SYMBIANQTVERSIONFACTORY_H - -#include <qtsupport/qtversionfactory.h> - -namespace Qt4ProjectManager { -namespace Internal { - -class SymbianQtVersionFactory : public QtSupport::QtVersionFactory -{ -public: - explicit SymbianQtVersionFactory(QObject *parent = 0); - ~SymbianQtVersionFactory(); - - virtual bool canRestore(const QString &type); - virtual QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data); - - virtual int priority() const; - virtual QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString()); -}; - -} // Internal -} // Qt4ProjectManager - -#endif // SYMBIANQTVERSION_H diff --git a/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp b/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp index 58d5984ed0c..a72fb505a3a 100644 --- a/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt4buildconfiguration.cpp @@ -268,24 +268,14 @@ void Qt4BuildConfiguration::setShadowBuildAndDirectory(bool shadowBuild, const Q emitEvaluateBuildSystem(); } -static inline QString symbianMakeTarget(QtSupport::BaseQtVersion::QmakeBuildConfigs buildConfig, - const QString &type) -{ - QString rc = (buildConfig & QtSupport::BaseQtVersion::DebugBuild) ? - QLatin1String("debug-") : QLatin1String("release-"); - rc += type; - return rc; -} - QString Qt4BuildConfiguration::defaultMakeTarget() const { ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(target()->profile()); QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile()); - if (!tc || !version || version->type() != QtSupport::Constants::SYMBIANQT) + if (!tc || !version) return QString(); - const QtSupport::BaseQtVersion::QmakeBuildConfigs buildConfig = qmakeBuildConfiguration(); - return symbianMakeTarget(buildConfig, tc->defaultMakeTarget()); + return tc->defaultMakeTarget(); } QString Qt4BuildConfiguration::makefile() const @@ -324,11 +314,6 @@ void Qt4BuildConfiguration::emitBuildDirectoryInitialized() emit buildDirectoryInitialized(); } -void Qt4BuildConfiguration::emitS60CreatesSmartInstallerChanged() -{ - emit s60CreatesSmartInstallerChanged(); -} - QStringList Qt4BuildConfiguration::configCommandLineArguments() const { QStringList result; diff --git a/src/plugins/qt4projectmanager/qt4buildconfiguration.h b/src/plugins/qt4projectmanager/qt4buildconfiguration.h index 92cddb898f5..f99852f2306 100644 --- a/src/plugins/qt4projectmanager/qt4buildconfiguration.h +++ b/src/plugins/qt4projectmanager/qt4buildconfiguration.h @@ -81,9 +81,6 @@ public: // used by qmake step to notify that the build directory was initialized // not really nice void emitBuildDirectoryInitialized(); - // used by S60CreatePackageStep to notify that the smart installer property changed - // not really nice - void emitS60CreatesSmartInstallerChanged(); QStringList configCommandLineArguments() const; @@ -133,8 +130,6 @@ signals: /// emitted for setQMakeBuildConfig, not emitted for Qt version changes, even /// if those change the qmakebuildconfig void qmakeBuildConfigurationChanged(); - /// emitted when smart installer property of S60 create package step changes - void s60CreatesSmartInstallerChanged(); private slots: void profileChanged(); diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp index 2959f928d49..3d0a61171f6 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -796,25 +796,6 @@ void Qt4PriFileNode::folderChanged(const QString &folder) contents.updateSubFolders(this, this); m_project->updateFileList(); m_project->updateCodeModels(); - - // The files to be packaged are listed inside the symbian build system. - // We need to regenerate that list by running qmake - // Other platforms do not have a explicit list of files to package, but package - // directories - foreach (const ProjectExplorer::Target *target, m_project->targets()) { - QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target->profile()); - if (version && version->type() == QtSupport::Constants::SYMBIANQT) { - foreach (ProjectExplorer::BuildConfiguration *bc, target->buildConfigurations()) { - Qt4BuildConfiguration *qt4bc = qobject_cast<Qt4BuildConfiguration *>(bc); - if (qt4bc) { - QMakeStep *qmakeStep = qt4bc->qmakeStep(); - if (qmakeStep) - qmakeStep->setForced(true); - } - } - } - } - } bool Qt4PriFileNode::deploysFolder(const QString &folder) const @@ -1414,49 +1395,6 @@ QString Qt4ProFileNode::makefile() const return m_varValues[Makefile].first(); } -QStringList Qt4ProFileNode::symbianCapabilities() const -{ - QStringList lowerCasedResult; - - QStringList all; - all << QLatin1String("LocalServices") << QLatin1String("UserEnvironment") << QLatin1String("NetworkServices") - << QLatin1String("ReadUserData") << QLatin1String("WriteUserData") << QLatin1String("Location") << QLatin1String("SwEvent") - << QLatin1String("SurroundingsDD") << QLatin1String("ProtServ") << QLatin1String("PowerMgmt") << QLatin1String("ReadDeviceData") - << QLatin1String("WriteDeviceData") << QLatin1String("TrustedUI") << QLatin1String("NetworkControl") - << QLatin1String("MultimediaDD")<< QLatin1String("CommDD") << QLatin1String("DiskAdmin") << QLatin1String("AllFiles") - << QLatin1String("DRM") << QLatin1String("TCB"); - - foreach (const QString &cap, m_varValues[SymbianCapabilities]) { - QString capability = cap.toLower(); - if (capability.startsWith(QLatin1Char('-'))) { - lowerCasedResult.removeAll(capability.mid(1)); - } else if (capability == QLatin1String("all")) { - foreach (const QString &a, all) - if (!lowerCasedResult.contains(a, Qt::CaseInsensitive)) - lowerCasedResult << a.toLower(); - } else { - lowerCasedResult << cap; - } - } - QStringList result; //let's make the result pretty - int index = -1; - foreach (const QString &lowerCase, lowerCasedResult) { - for (int i = 0; i < all.count(); ++i) { - index = -1; - if (QString::compare(lowerCase, all.at(i), - Qt::CaseInsensitive) == 0) { - index = i; - break; - } - } - if (index != -1) - result << all.at(index); - else - result << lowerCase; //strange capability! - } - return result; -} - QString Qt4ProFileNode::objectExtension() const { if (m_varValues[ObjectExt].isEmpty()) { @@ -2004,7 +1942,6 @@ void Qt4ProFileNode::applyEvaluate(EvalResult evalResult, bool async) newVarValues[QmlImportPathVar] = m_readerExact->absolutePathValues( QLatin1String("QML_IMPORT_PATH"), m_projectDir); newVarValues[Makefile] = m_readerExact->values(QLatin1String("MAKEFILE")); - newVarValues[SymbianCapabilities] = m_readerExact->values(QLatin1String("TARGET.CAPABILITY")); newVarValues[QtVar] = m_readerExact->values(QLatin1String("QT")); newVarValues[ObjectExt] = m_readerExact->values(QLatin1String("QMAKE_EXT_OBJ")); newVarValues[ObjectsDir] = m_readerExact->values(QLatin1String("OBJECTS_DIR")); diff --git a/src/plugins/qt4projectmanager/qt4nodes.h b/src/plugins/qt4projectmanager/qt4nodes.h index 11b456dbd41..ad1dcc38bae 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.h +++ b/src/plugins/qt4projectmanager/qt4nodes.h @@ -93,7 +93,6 @@ enum Qt4Variable { QtVar, QmlImportPathVar, Makefile, - SymbianCapabilities, ObjectExt, ObjectsDir }; @@ -380,7 +379,6 @@ public: ProjectVersion projectVersion() const { return m_projectVersion; } QString makefile() const; - QStringList symbianCapabilities() const; QString objectExtension() const; QString objectsDirectory() const; QByteArray cxxDefines() const; diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.pro b/src/plugins/qt4projectmanager/qt4projectmanager.pro index 158e8e001f0..1cbefd10ae9 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.pro +++ b/src/plugins/qt4projectmanager/qt4projectmanager.pro @@ -143,7 +143,6 @@ FORMS += makestep.ui \ wizards/html5appwizardsourcespage.ui \ wizards/mobilelibrarywizardoptionpage.ui \ wizards/mobileappwizardgenericoptionspage.ui \ - wizards/mobileappwizardsymbianoptionspage.ui \ wizards/mobileappwizardmaemooptionspage.ui \ wizards/mobileappwizardharmattanoptionspage.ui \ wizards/qtquickcomponentsetoptionspage.ui @@ -151,7 +150,6 @@ FORMS += makestep.ui \ RESOURCES += qt4projectmanager.qrc \ wizards/wizards.qrc -include(qt-s60/qt-s60.pri) include(qt-desktop/qt-desktop.pri) include(customwidgetwizard/customwidgetwizard.pri) diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.qbs b/src/plugins/qt4projectmanager/qt4projectmanager.qbs index 836195851a0..0d83c6f9515 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.qbs +++ b/src/plugins/qt4projectmanager/qt4projectmanager.qbs @@ -11,7 +11,6 @@ QtcPlugin { Depends { name: "QtSupport" } Depends { name: "CppTools" } Depends { name: "Debugger" } - Depends { name: "symbianutils" } Depends { name: "QmlJS" } Depends { name: "Botan" } Depends { name: "CPlusPlus" } @@ -33,7 +32,6 @@ QtcPlugin { "customwidgetwizard", "../../libs", "../../shared", - "../../shared/symbianutils" ] files: [ @@ -139,83 +137,6 @@ QtcPlugin { "qt-desktop/simulatorqtversion.h", "qt-desktop/simulatorqtversionfactory.cpp", "qt-desktop/simulatorqtversionfactory.h", - "qt-s60/abldparser.cpp", - "qt-s60/abldparser.h", - "qt-s60/certificatepathchooser.cpp", - "qt-s60/certificatepathchooser.h", - "qt-s60/gccetoolchain.cpp", - "qt-s60/gccetoolchain.h", - "qt-s60/passphraseforkeydialog.cpp", - "qt-s60/passphraseforkeydialog.h", - "qt-s60/rvctparser.cpp", - "qt-s60/rvctparser.h", - "qt-s60/rvcttoolchain.cpp", - "qt-s60/rvcttoolchain.h", - "qt-s60/s60certificatedetailsdialog.cpp", - "qt-s60/s60certificatedetailsdialog.h", - "qt-s60/s60certificatedetailsdialog.ui", - "qt-s60/s60certificateinfo.cpp", - "qt-s60/s60certificateinfo.h", - "qt-s60/s60createpackageparser.cpp", - "qt-s60/s60createpackageparser.h", - "qt-s60/s60createpackagestep.cpp", - "qt-s60/s60createpackagestep.h", - "qt-s60/s60createpackagestep.ui", - "qt-s60/s60deployconfiguration.cpp", - "qt-s60/s60deployconfiguration.h", - "qt-s60/s60deployconfigurationwidget.cpp", - "qt-s60/s60deployconfigurationwidget.h", - "qt-s60/s60devicerunconfiguration.cpp", - "qt-s60/s60devicerunconfiguration.h", - "qt-s60/s60devicerunconfigurationwidget.cpp", - "qt-s60/s60devicerunconfigurationwidget.h", - "qt-s60/s60manager.h", - "qt-s60/s60publisherovi.cpp", - "qt-s60/s60publisherovi.h", - "qt-s60/s60publishingbuildsettingspageovi.cpp", - "qt-s60/s60publishingbuildsettingspageovi.h", - "qt-s60/s60publishingbuildsettingspageovi.ui", - "qt-s60/s60publishingresultspageovi.cpp", - "qt-s60/s60publishingresultspageovi.h", - "qt-s60/s60publishingresultspageovi.ui", - "qt-s60/s60publishingsissettingspageovi.cpp", - "qt-s60/s60publishingsissettingspageovi.h", - "qt-s60/s60publishingsissettingspageovi.ui", - "qt-s60/s60publishingwizardfactories.cpp", - "qt-s60/s60publishingwizardfactories.h", - "qt-s60/s60publishingwizardovi.cpp", - "qt-s60/s60publishingwizardovi.h", - "qt-s60/s60symbiancertificate.cpp", - "qt-s60/s60symbiancertificate.h", - "qt-s60/sbsv2parser.cpp", - "qt-s60/sbsv2parser.h", - "qt-s60/symbianidevice.cpp", - "qt-s60/symbianidevice.h", - "qt-s60/symbianideviceconfigwidget.cpp", - "qt-s60/symbianideviceconfigwidget.h", - "qt-s60/symbianidevicefactory.cpp", - "qt-s60/symbianidevicefactory.h", - "qt-s60/symbianqtversion.cpp", - "qt-s60/symbianqtversion.h", - "qt-s60/symbianqtversionfactory.cpp", - "qt-s60/symbianqtversionfactory.h", - "qt-s60/symbianidevice.cpp", - "qt-s60/symbianidevice.h", - "qt-s60/symbianidevicefactory.cpp", - "qt-s60/symbianidevicefactory.h", - "qt-s60/symbianideviceconfigwidget.cpp", - "qt-s60/symbianideviceconfigwidget.h", - "qt-s60/codaruncontrol.cpp", - "qt-s60/codaruncontrol.h", - "qt-s60/s60deploystep.cpp", - "qt-s60/s60deploystep.h", - "qt-s60/s60devicedebugruncontrol.cpp", - "qt-s60/s60devicedebugruncontrol.h", - "qt-s60/s60manager.cpp", - "qt-s60/s60runcontrolbase.cpp", - "qt-s60/s60runcontrolbase.h", - "qt-s60/s60runcontrolfactory.cpp", - "qt-s60/s60runcontrolfactory.h", "wizards/targetsetuppage.ui", "wizards/testwizardpage.ui", "wizards/wizards.qrc", @@ -258,7 +179,6 @@ QtcPlugin { "wizards/mobileappwizardmaemooptionspage.ui", "wizards/mobileappwizardpages.cpp", "wizards/mobileappwizardpages.h", - "wizards/mobileappwizardsymbianoptionspage.ui", "wizards/mobilelibraryparameters.cpp", "wizards/mobilelibraryparameters.h", "wizards/mobilelibrarywizardoptionpage.cpp", diff --git a/src/plugins/qt4projectmanager/qt4projectmanager_dependencies.pri b/src/plugins/qt4projectmanager/qt4projectmanager_dependencies.pri index a5cc9ca447d..298cf1cb8a9 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager_dependencies.pri +++ b/src/plugins/qt4projectmanager/qt4projectmanager_dependencies.pri @@ -2,6 +2,5 @@ include(../../plugins/projectexplorer/projectexplorer.pri) include(../../plugins/qtsupport/qtsupport.pri) include(../../plugins/cpptools/cpptools.pri) include(../../plugins/debugger/debugger.pri) -include(../../libs/symbianutils/symbianutils.pri) include(../../libs/qmljs/qmljs.pri) include(../../libs/3rdparty/botan/botan.pri) diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp index bfb96cd8d59..f59247e3c83 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp @@ -52,7 +52,6 @@ #include "profileeditor.h" #include "externaleditors.h" #include "profilecompletionassist.h" -#include "qt-s60/s60manager.h" #include "qt-desktop/qt4runconfiguration.h" #include "qt-desktop/desktopqtversionfactory.h" #include "qt-desktop/simulatorqtversionfactory.h" @@ -161,8 +160,6 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString * #endif addAutoReleasedObject(new LinguistExternalEditor); - addAutoReleasedObject(new S60Manager); - addAutoReleasedObject(new DesktopQtVersionFactory); addAutoReleasedObject(new SimulatorQtVersionFactory); addAutoReleasedObject(new WinCeQtVersionFactory); @@ -308,7 +305,6 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString * void Qt4ProjectManagerPlugin::extensionsInitialized() { m_qt4ProjectManager->init(); - S60Manager::instance()->extensionsInitialize(); } void Qt4ProjectManagerPlugin::startupProjectChanged() diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h index f16bccb725e..478566c69f0 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h +++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h @@ -76,12 +76,6 @@ private slots: void buildStateChanged(ProjectExplorer::Project *pro); #ifdef WITH_TESTS - void testAbldOutputParsers_data(); - void testAbldOutputParsers(); - void testSbsV2OutputParsers_data(); - void testSbsV2OutputParsers(); - void testRvctOutputParser_data(); - void testRvctOutputParser(); void testQmakeOutputParsers_data(); void testQmakeOutputParsers(); #endif diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp b/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp index 2bfc698a9f4..ae7dd00d238 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp @@ -64,24 +64,12 @@ AbstractMobileApp::AbstractMobileApp() : QObject() , m_canSupportMeegoBooster(false) , m_orientation(ScreenOrientationAuto) - , m_networkEnabled(true) , m_supportsMeegoBooster(false) { } AbstractMobileApp::~AbstractMobileApp() { } -QString AbstractMobileApp::symbianUidForPath(const QString &path) -{ - quint32 hash = 5381; - for (int i = 0; i < path.size(); ++i) { - const char c = path.at(i).toAscii(); - hash ^= c + ((c - i) << i % 20) + ((c + i) << (i + 5) % 20) + ((c - 2 * i) << (i + 10) % 20) + ((c + 2 * i) << (i + 15) % 20); - } - return QString::fromLatin1("0xE") - + QString::fromLatin1("%1").arg(hash, 7, 16, QLatin1Char('0')).right(7).toUpper(); -} - void AbstractMobileApp::setOrientation(ScreenOrientation orientation) { m_orientation = orientation; @@ -107,16 +95,6 @@ void AbstractMobileApp::setProjectPath(const QString &path) m_projectPath.setFile(path); } -void AbstractMobileApp::setSymbianSvgIcon(const QString &icon) -{ - m_symbianSvgIcon = icon; -} - -QString AbstractMobileApp::symbianSvgIcon() const -{ - return path(SymbianSvgIconOrigin); -} - void AbstractMobileApp::setPngIcon64(const QString &icon) { m_pngIcon64 = icon; @@ -137,33 +115,11 @@ QString AbstractMobileApp::pngIcon80() const return path(PngIconOrigin80); } -void AbstractMobileApp::setSymbianTargetUid(const QString &uid) -{ - m_symbianTargetUid = uid; -} - -QString AbstractMobileApp::symbianTargetUid() const -{ - return !m_symbianTargetUid.isEmpty() ? m_symbianTargetUid - : symbianUidForPath(path(AppPro)); -} - -void AbstractMobileApp::setNetworkEnabled(bool enabled) -{ - m_networkEnabled = enabled; -} - -bool AbstractMobileApp::networkEnabled() const -{ - return m_networkEnabled; -} - QString AbstractMobileApp::path(int fileType) const { const QString originsRootApp = originsRoot(); const QString originsRootShared = templatesRoot() + QLatin1String("shared/"); const QString mainCppFileName = QLatin1String("main.cpp"); - const QString symbianIconFileName = QLatin1String("symbianicon.svg"); switch (fileType) { case MainCpp: return outputPathBase() + mainCppFileName; case MainCppOrigin: return originsRootApp + mainCppFileName; @@ -175,9 +131,6 @@ QString AbstractMobileApp::path(int fileType) const case DesktopOrigin: return originsRootShared + QLatin1String("app.desktop"); case DeploymentPri: return outputPathBase() + DeploymentPriFileName; case DeploymentPriOrigin: return originsRootShared + DeploymentPriFileName; - case SymbianSvgIcon: return outputPathBase() + m_projectName + QLatin1String(".svg"); - case SymbianSvgIconOrigin: return !m_symbianSvgIcon.isEmpty() ? m_symbianSvgIcon - : originsRootShared + symbianIconFileName; case PngIcon64: return outputPathBase() + m_projectName + QLatin1String("64.png"); case PngIconOrigin64: return !m_pngIcon64.isEmpty() ? m_pngIcon64 : originsRootShared + QLatin1String("icon64.png"); @@ -279,12 +232,7 @@ QByteArray AbstractMobileApp::generateProFile(QString *errorMessage) const bool commentOutNextLine = false; QString line; while (!(line = in.readLine()).isNull()) { - if (line.contains(QLatin1String("# TARGETUID3"))) { - valueOnNextLine = symbianTargetUid(); - } else if (line.contains(QLatin1String("# NETWORKACCESS")) - && !networkEnabled()) { - commentOutNextLine = true; - } else if (line.contains(QLatin1String("# DEPLOYMENTFOLDERS"))) { + if (line.contains(QLatin1String("# DEPLOYMENTFOLDERS"))) { // Eat lines QString nextLine; while (!(nextLine = in.readLine()).isNull() @@ -405,7 +353,6 @@ Core::GeneratedFiles AbstractMobileApp::generateFiles(QString *errorMessage) con files << file(generateFile(AbstractGeneratedFileInfo::AppProFile, errorMessage), path(AppPro)); files.last().setAttributes(Core::GeneratedFile::OpenProjectAttribute); files << file(generateFile(AbstractGeneratedFileInfo::MainCppFile, errorMessage), path(MainCpp)); - files << file(generateFile(AbstractGeneratedFileInfo::SymbianSvgIconFile, errorMessage), path(SymbianSvgIcon)); files << file(generateFile(AbstractGeneratedFileInfo::PngIcon64File, errorMessage), path(PngIcon64)); files << file(generateFile(AbstractGeneratedFileInfo::PngIcon80File, errorMessage), path(PngIcon80)); files << file(generateFile(AbstractGeneratedFileInfo::DesktopFremantleFile, errorMessage), path(DesktopFremantle)); @@ -458,9 +405,6 @@ QByteArray AbstractMobileApp::generateFile(int fileType, data = generateProFile(errorMessage); comment = ProFileComment; break; - case AbstractGeneratedFileInfo::SymbianSvgIconFile: - data = readBlob(path(SymbianSvgIconOrigin), errorMessage); - break; case AbstractGeneratedFileInfo::PngIcon64File: data = readBlob(path(PngIconOrigin64), errorMessage); break; diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileapp.h b/src/plugins/qt4projectmanager/wizards/abstractmobileapp.h index 5ec6573273f..ae3986226c6 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileapp.h +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileapp.h @@ -54,7 +54,6 @@ struct MainCppFile, AppProFile, DeploymentPriFile, - SymbianSvgIconFile, PngIcon64File, PngIcon80File, DesktopFremantleFile, @@ -88,7 +87,7 @@ public: ScreenOrientationLockLandscape, ScreenOrientationLockPortrait, ScreenOrientationAuto, - ScreenOrientationImplicit // Don't set in application at all (used by Symbian components) + ScreenOrientationImplicit // Don't set in application at all }; enum FileType { @@ -102,8 +101,6 @@ public: DesktopOrigin, DeploymentPri, DeploymentPriOrigin, - SymbianSvgIcon, - SymbianSvgIconOrigin, PngIcon64, PngIconOrigin64, PngIcon80, @@ -118,16 +115,10 @@ public: void setProjectName(const QString &name); QString projectName() const; void setProjectPath(const QString &path); - void setSymbianSvgIcon(const QString &icon); - QString symbianSvgIcon() const; void setPngIcon64(const QString &icon); QString pngIcon64() const; void setPngIcon80(const QString &icon); QString pngIcon80() const; - void setSymbianTargetUid(const QString &uid); - QString symbianTargetUid() const; - void setNetworkEnabled(bool enabled); - bool networkEnabled() const; QString path(int fileType) const; QString error() const; @@ -141,7 +132,6 @@ public: bool generateFiles(QString *errorMessage) const; #endif // CREATORLESSTEST - static QString symbianUidForPath(const QString &path); static int makeStubVersion(int minor); QList<AbstractGeneratedFileInfo> fileUpdates(const QString &mainProFile) const; bool updateFiles(const QList<AbstractGeneratedFileInfo> &list, QString &error) const; @@ -192,12 +182,9 @@ private: QString m_projectName; QFileInfo m_projectPath; - QString m_symbianSvgIcon; QString m_pngIcon64; QString m_pngIcon80; - QString m_symbianTargetUid; ScreenOrientation m_orientation; - bool m_networkEnabled; bool m_supportsMeegoBooster; }; diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp index ecaabb2c351..252102136b4 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp @@ -56,14 +56,12 @@ AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent, : ProjectExplorer::BaseProjectWizardDialog(parent, parameters) , m_targetsPage(0) , m_genericOptionsPageId(-1) - , m_symbianOptionsPageId(-1) , m_maemoOptionsPageId(-1) , m_harmattanOptionsPageId(-1) , m_targetsPageId(-1) , m_ignoreGeneralOptions(false) , m_targetItem(0) , m_genericItem(0) - , m_symbianItem(0) , m_maemoItem(0) , m_harmattanItem(0) , m_profileIds(parameters.extraValues().value(ProjectExplorer::Constants::PROJECT_PROFILE_IDS).value<QList<Core::Id> >()) @@ -78,7 +76,6 @@ AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent, } m_genericOptionsPage = new Internal::MobileAppWizardGenericOptionsPage; - m_symbianOptionsPage = new Internal::MobileAppWizardSymbianOptionsPage; m_maemoOptionsPage = new Internal::MobileAppWizardMaemoOptionsPage; m_harmattanOptionsPage = new Internal::MobileAppWizardHarmattanOptionsPage; } @@ -91,10 +88,7 @@ void AbstractMobileAppWizardDialog::addMobilePages() } const bool shouldAddGenericPage = m_targetsPage - || (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM) && !m_ignoreGeneralOptions) || isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM); - const bool shouldAddSymbianPage = m_targetsPage - || isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM); const bool shouldAddMaemoPage = m_targetsPage || isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM); const bool shouldAddHarmattanPage = m_targetsPage @@ -106,12 +100,6 @@ void AbstractMobileAppWizardDialog::addMobilePages() m_genericItem = wizardProgress()->item(m_genericOptionsPageId); } - if (shouldAddSymbianPage) { - m_symbianOptionsPageId = addPageWithTitle(m_symbianOptionsPage, - QLatin1String(" ") + tr("Symbian Specific")); - m_symbianItem = wizardProgress()->item(m_symbianOptionsPageId); - } - if (shouldAddMaemoPage) { m_maemoOptionsPageId = addPageWithTitle(m_maemoOptionsPage, QLatin1String(" ") + tr("Maemo5 And MeeGo Specific")); @@ -144,26 +132,13 @@ int AbstractMobileAppWizardDialog::nextId() const { if (m_targetsPage) { if (currentPage() == m_targetsPage) { - if ((isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM) && !m_ignoreGeneralOptions) || - isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)) + if (isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)) return m_genericOptionsPageId; - // If Symbian target and Qt Quick components for Symbian, skip the mobile options page. - else if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM) && m_ignoreGeneralOptions) - return m_symbianOptionsPageId; else if (isQtPlatformSelected(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM)) return m_harmattanOptionsPageId; else return idOfNextGenericPage(); } else if (currentPage() == m_genericOptionsPage) { - if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM)) - return m_symbianOptionsPageId; - else if (isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)) - return m_maemoOptionsPageId; - else if (isQtPlatformSelected(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM)) - return m_harmattanOptionsPageId; - else - return idOfNextGenericPage(); - } else if (currentPage() == m_symbianOptionsPage) { if (isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)) return m_maemoOptionsPageId; else if (isQtPlatformSelected(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM)) @@ -185,20 +160,15 @@ void AbstractMobileAppWizardDialog::initializePage(int id) if (m_targetItem) { if (id == startId()) { m_targetItem->setNextItems(QList<Utils::WizardProgressItem *>() - << m_genericItem << m_symbianItem << m_maemoItem << m_harmattanItem << itemOfNextGenericPage()); + << m_genericItem << m_maemoItem << m_harmattanItem << itemOfNextGenericPage()); m_genericItem->setNextItems(QList<Utils::WizardProgressItem *>() - << m_symbianItem << m_maemoItem); - m_symbianItem->setNextItems(QList<Utils::WizardProgressItem *>() - << m_maemoItem << m_harmattanItem << itemOfNextGenericPage()); + << m_maemoItem); m_maemoItem->setNextItems(QList<Utils::WizardProgressItem *>() << m_harmattanItem << itemOfNextGenericPage()); } else if (id == m_genericOptionsPageId - || id == m_symbianOptionsPageId || id == m_maemoOptionsPageId) { QList<Utils::WizardProgressItem *> order; order << m_genericItem; - if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM)) - order << m_symbianItem; if (isQtPlatformSelected(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)) order << m_maemoItem; if (isQtPlatformSelected(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM)) @@ -266,8 +236,6 @@ QWizard *AbstractMobileAppWizard::createWizardDialog(QWidget *parent, = createWizardDialogInternal(parent, wizardDialogParameters); wdlg->setProjectName(ProjectExplorer::BaseProjectWizardDialog::uniqueProjectName(wizardDialogParameters.defaultPath())); wdlg->m_genericOptionsPage->setOrientation(app()->orientation()); - wdlg->m_symbianOptionsPage->setSvgIcon(app()->symbianSvgIcon()); - wdlg->m_symbianOptionsPage->setNetworkEnabled(app()->networkEnabled()); wdlg->m_maemoOptionsPage->setPngIcon(app()->pngIcon64()); wdlg->m_harmattanOptionsPage->setPngIcon(app()->pngIcon80()); wdlg->m_harmattanOptionsPage->setBoosterOptionEnabled(app()->canSupportMeegoBooster()); @@ -284,9 +252,6 @@ Core::GeneratedFiles AbstractMobileAppWizard::generateFiles(const QWizard *wizar const AbstractMobileAppWizardDialog *wdlg = qobject_cast<const AbstractMobileAppWizardDialog*>(wizard); app()->setOrientation(wdlg->m_genericOptionsPage->orientation()); - app()->setSymbianTargetUid(wdlg->m_symbianOptionsPage->symbianUid()); - app()->setSymbianSvgIcon(wdlg->m_symbianOptionsPage->svgIcon()); - app()->setNetworkEnabled(wdlg->m_symbianOptionsPage->networkEnabled()); app()->setPngIcon64(wdlg->m_maemoOptionsPage->pngIcon()); app()->setPngIcon80(wdlg->m_harmattanOptionsPage->pngIcon()); if (wdlg->isQtPlatformSelected(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM)) @@ -326,7 +291,6 @@ bool AbstractMobileAppWizard::postGenerateFiles(const QWizard *w, void AbstractMobileAppWizard::useProjectPath(const QString &projectName, const QString &projectPath) { - wizardDialog()->m_symbianOptionsPage->setSymbianUid(app()->symbianUidForPath(projectPath + projectName)); app()->setProjectName(projectName); app()->setProjectPath(projectPath); if (wizardDialog()->m_targetsPage) diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h index 86c35c0da14..75c76676084 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h @@ -44,7 +44,6 @@ class TargetSetupPage; namespace Internal { class MobileAppWizardGenericOptionsPage; -class MobileAppWizardSymbianOptionsPage; class MobileAppWizardMaemoOptionsPage; class MobileAppWizardHarmattanOptionsPage; } @@ -78,20 +77,17 @@ private: QList<Core::Id> selectedProfiles() const; Internal::MobileAppWizardGenericOptionsPage *m_genericOptionsPage; - Internal::MobileAppWizardSymbianOptionsPage *m_symbianOptionsPage; Internal::MobileAppWizardMaemoOptionsPage *m_maemoOptionsPage; Internal::MobileAppWizardHarmattanOptionsPage *m_harmattanOptionsPage; TargetSetupPage *m_targetsPage; int m_genericOptionsPageId; - int m_symbianOptionsPageId; int m_maemoOptionsPageId; int m_harmattanOptionsPageId; int m_targetsPageId; bool m_ignoreGeneralOptions; // If true, do not show generic mobile options page. Utils::WizardProgressItem *m_targetItem; Utils::WizardProgressItem *m_genericItem; - Utils::WizardProgressItem *m_symbianItem; Utils::WizardProgressItem *m_maemoItem; Utils::WizardProgressItem *m_harmattanItem; QList<Core::Id> m_profileIds; diff --git a/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp b/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp index 33c80c24b23..b6fba3759d2 100644 --- a/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp @@ -53,11 +53,7 @@ static const char mainSourceFileC[] = "main"; static const char mainSourceShowC[] = " w.show();\n"; -static const char mainSourceMobilityShowC[] = "#if defined(Q_WS_S60)\n" -" w.showMaximized();\n" -"#else\n" -" w.show();\n" -"#endif\n"; +static const char mainSourceMobilityShowC[] = " w.show();\n"; static const char mainWindowUiContentsC[] = "\n <widget class=\"QMenuBar\" name=\"menuBar\" />" @@ -228,17 +224,9 @@ Core::GeneratedFiles GuiAppWizard::generateFiles(const QWizard *w, if (params.designerForm) proStr << "\n\nFORMS += " << QFileInfo(form->path()).fileName(); if (params.isMobileApplication) { - // Generate a development Symbian UID for the application: - QString uid3String = QLatin1String("0xe") + QUuid::createUuid().toString().mid(1, 7); - proStr << "\n\nCONFIG += mobility" << "\nMOBILITY = " - << "\n\nsymbian {" - << "\n TARGET.UID3 = " << uid3String - << "\n # TARGET.CAPABILITY += " - << "\n TARGET.EPOCSTACKSIZE = 0x14000" - << "\n TARGET.EPOCHEAPSIZE = 0x020000 0x800000" - << "\n}"; + << "\n"; } proStr << '\n'; } diff --git a/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp b/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp index 21fc31d7928..3a92ce9ebc1 100644 --- a/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp +++ b/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp @@ -120,9 +120,6 @@ GuiAppParameters GuiAppWizardDialog::parameters() const || isQtPlatformSelected(QLatin1String(QtSupport::Constants::ANDROID_PLATFORM))) { rc.widgetWidth = 800; rc.widgetHeight = 480; - } else if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM)) { - rc.widgetWidth = 360; - rc.widgetHeight = 640; } else { rc.isMobileApplication = false; rc.widgetWidth = 400; diff --git a/src/plugins/qt4projectmanager/wizards/html5appwizard.cpp b/src/plugins/qt4projectmanager/wizards/html5appwizard.cpp index 71bbc5482ac..8e02eb60d8b 100644 --- a/src/plugins/qt4projectmanager/wizards/html5appwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/html5appwizard.cpp @@ -108,9 +108,7 @@ Core::BaseFileWizardParameters Html5AppWizard::parameters() parameters.setDescription(tr("Creates an HTML5 application project that can contain " "both HTML5 and C++ code and includes a WebKit view.\n\n" "You can build the application and deploy it on desktop and " - "mobile target platforms. For example, you can create signed " - "Symbian Installation System (SIS) packages for this type of " - "projects.")); + "mobile target platforms.")); parameters.setCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY)); parameters.setDisplayCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY)); return parameters; diff --git a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp index 0e642197e07..15ba5592ad0 100644 --- a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp +++ b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp @@ -156,8 +156,6 @@ LibraryWizardDialog::LibraryWizardDialog(const QString &templateName, if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS)) { m_targetPageId = addTargetSetupPage(); m_mobilePageId = addPage(m_mobilePage); - } else if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM)) { - m_mobilePageId = addPage(m_mobilePage); } m_modulesPageId = addModulesPage(); @@ -176,7 +174,6 @@ LibraryWizardDialog::LibraryWizardDialog(const QString &templateName, } if (m_mobilePageId != -1) { mobileItem = wizardProgress()->item(m_mobilePageId); - mobileItem->setTitle(QLatin1String(" ") + tr("Symbian Specific")); } Utils::WizardProgressItem *modulesItem = wizardProgress()->item(m_modulesPageId); Utils::WizardProgressItem *filesItem = wizardProgress()->item(m_filesPageId); @@ -216,11 +213,6 @@ void LibraryWizardDialog::setLowerCaseFiles(bool l) m_filesPage->setLowerCaseFiles(l); } -void LibraryWizardDialog::setSymbianUid(const QString &uid) -{ - m_mobilePage->setSymbianUid(uid); -} - QtProjectParameters::Type LibraryWizardDialog::type() const { return static_cast<const LibraryIntroPage*>(introPage())->type(); @@ -247,15 +239,6 @@ int LibraryWizardDialog::nextId() const int next = m_modulesPageId; - const bool symbianTargetEnabled = isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM); - - // If there was no Symbian target defined we omit "Symbian specific" step - // We also omit this step if the library type is not dll - if (symbianTargetEnabled - && (type() == QtProjectParameters::SharedLibrary - || type() == QtProjectParameters::Qt4Plugin)) - next = m_mobilePageId; - if (next == m_modulesPageId) return skipModulesPageIfNeeded(); @@ -264,8 +247,6 @@ int LibraryWizardDialog::nextId() const return skipModulesPageIfNeeded(); } } else if (currentId() == startId()) { - if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM)) - return m_mobilePageId; return skipModulesPageIfNeeded(); } else if (currentId() == m_mobilePageId) { return skipModulesPageIfNeeded(); @@ -328,8 +309,7 @@ void LibraryWizardDialog::slotCurrentIdChanged(int id) if (id == m_filesPageId) setupFilesPage();// Switching to files page: Set up base class accordingly (plugin) else if (id == m_mobilePageId - || (m_mobilePage->symbianUid().isEmpty() - && currentPage() && currentPage()->isFinalPage())) + || (currentPage() && currentPage()->isFinalPage())) setupMobilePage(); } @@ -365,8 +345,6 @@ void LibraryWizardDialog::setupFilesPage() void LibraryWizardDialog::setupMobilePage() { - m_mobilePage->setSymbianUid(AbstractMobileApp::symbianUidForPath(path()+projectName())); - if (type() == QtProjectParameters::Qt4Plugin) m_mobilePage->setQtPluginDirectory(projectName()); m_mobilePage->setLibraryType(type()); @@ -392,14 +370,8 @@ MobileLibraryParameters LibraryWizardDialog::mobileLibraryParameters() const mlp.libraryType = type(); mlp.fileName = projectName(); - //Symbian and Maemo stuff should always be added to pro file. Even if no mobile target is specified - mlp.type |= MobileLibraryParameters::Symbian|MobileLibraryParameters::Maemo; - - if (mlp.type & MobileLibraryParameters::Symbian) { - mlp.symbianUid = m_mobilePage->symbianUid(); - mlp.qtPluginDirectory = m_mobilePage->qtPluginDirectory(); - mlp.symbianCapabilities |= m_mobilePage->networkEnabled()?MobileLibraryParameters::NetworkServices:0; - } + // Maemo stuff should always be added to pro file. Even if no mobile target is specified + mlp.type |= MobileLibraryParameters::Maemo; return mlp; } diff --git a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.h b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.h index e460019972f..f7da19d1200 100644 --- a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.h +++ b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.h @@ -57,7 +57,6 @@ public: void setSuffixes(const QString &header, const QString &source, const QString &form= QString()); void setLowerCaseFiles(bool); - void setSymbianUid(const QString &uid); QtProjectParameters parameters() const; LibraryParameters libraryParameters() const; diff --git a/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.cpp b/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.cpp index 9444da6b986..9265111eb78 100644 --- a/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.cpp +++ b/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.cpp @@ -32,7 +32,6 @@ #include "ui_mobileappwizardgenericoptionspage.h" #include "ui_mobileappwizardmaemooptionspage.h" #include "ui_mobileappwizardharmattanoptionspage.h" -#include "ui_mobileappwizardsymbianoptionspage.h" #include <coreplugin/coreconstants.h> #include <utils/fileutils.h> @@ -51,13 +50,6 @@ class MobileAppWizardGenericOptionsPagePrivate friend class MobileAppWizardGenericOptionsPage; }; -class MobileAppWizardSymbianOptionsPagePrivate -{ - Ui::MobileAppWizardSymbianOptionsPage ui; - QString svgIcon; - friend class MobileAppWizardSymbianOptionsPage; -}; - class MobileAppWizardMaemoOptionsPagePrivate { Ui::MobileAppWizardMaemoOptionsPage ui; @@ -111,69 +103,6 @@ AbstractMobileApp::ScreenOrientation MobileAppWizardGenericOptionsPage::orientat } -MobileAppWizardSymbianOptionsPage::MobileAppWizardSymbianOptionsPage(QWidget *parent) - : QWizardPage(parent) - , d(new MobileAppWizardSymbianOptionsPagePrivate) -{ - d->ui.setupUi(this); - const QIcon open = QApplication::style()->standardIcon(QStyle::SP_DirOpenIcon); - d->ui.appIconLoadToolButton->setIcon(open); - connect(d->ui.appIconLoadToolButton, SIGNAL(clicked()), SLOT(openSvgIcon())); -} - -MobileAppWizardSymbianOptionsPage::~MobileAppWizardSymbianOptionsPage() -{ - delete d; -} - -QString MobileAppWizardSymbianOptionsPage::svgIcon() const -{ - return d->svgIcon; -} - -void MobileAppWizardSymbianOptionsPage::setSvgIcon(const QString &icon) -{ - QPixmap iconPixmap(icon); - if (!iconPixmap.isNull()) { - const int symbianIconSize = 44; - if (iconPixmap.height() > symbianIconSize || iconPixmap.width() > symbianIconSize) - iconPixmap = iconPixmap.scaledToHeight(symbianIconSize, Qt::SmoothTransformation); - d->ui.appIconPreview->setPixmap(iconPixmap); - d->svgIcon = icon; - } -} - -QString MobileAppWizardSymbianOptionsPage::symbianUid() const -{ - return d->ui.uid3LineEdit->text(); -} - -void MobileAppWizardSymbianOptionsPage::setSymbianUid(const QString &uid) -{ - d->ui.uid3LineEdit->setText(uid); -} - -void MobileAppWizardSymbianOptionsPage::setNetworkEnabled(bool enableIt) -{ - d->ui.enableNetworkCheckBox->setChecked(enableIt); -} - -bool MobileAppWizardSymbianOptionsPage::networkEnabled() const -{ - return d->ui.enableNetworkCheckBox->isChecked(); -} - -void MobileAppWizardSymbianOptionsPage::openSvgIcon() -{ - const QString svgIcon = QFileDialog::getOpenFileName( - this, - d->ui.appIconLabel->text(), - QDesktopServices::storageLocation(QDesktopServices::PicturesLocation), - QLatin1String("*.svg")); - if (!svgIcon.isEmpty()) - setSvgIcon(svgIcon); -} - MobileAppWizardMaemoOptionsPage::MobileAppWizardMaemoOptionsPage(QWidget *parent) : QWizardPage(parent) , d(new MobileAppWizardMaemoOptionsPagePrivate) diff --git a/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h b/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h index f3757c45a60..c1070aa92f3 100644 --- a/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h +++ b/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h @@ -53,28 +53,6 @@ private: class MobileAppWizardGenericOptionsPagePrivate *d; }; -class MobileAppWizardSymbianOptionsPage : public QWizardPage -{ - Q_OBJECT - -public: - explicit MobileAppWizardSymbianOptionsPage(QWidget *parent = 0); - virtual ~MobileAppWizardSymbianOptionsPage(); - - QString svgIcon() const; - void setSvgIcon(const QString &icon); - QString symbianUid() const; - void setNetworkEnabled(bool enableIt); - bool networkEnabled() const; - void setSymbianUid(const QString &uid); - -private slots: - void openSvgIcon(); // Via file open dialog - -private: - class MobileAppWizardSymbianOptionsPagePrivate *d; -}; - class MobileAppWizardMaemoOptionsPage : public QWizardPage { Q_OBJECT diff --git a/src/plugins/qt4projectmanager/wizards/mobileappwizardsymbianoptionspage.ui b/src/plugins/qt4projectmanager/wizards/mobileappwizardsymbianoptionspage.ui deleted file mode 100644 index 2a900fc8bcd..00000000000 --- a/src/plugins/qt4projectmanager/wizards/mobileappwizardsymbianoptionspage.ui +++ /dev/null @@ -1,126 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Qt4ProjectManager::Internal::MobileAppWizardSymbianOptionsPage</class> - <widget class="QWizardPage" name="Qt4ProjectManager::Internal::MobileAppWizardSymbianOptionsPage"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>315</width> - <height>125</height> - </rect> - </property> - <property name="windowTitle"> - <string>WizardPage</string> - </property> - <layout class="QFormLayout" name="formLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="appIconLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Application icon (.svg):</string> - </property> - <property name="buddy"> - <cstring>appIconLoadToolButton</cstring> - </property> - </widget> - </item> - <item row="0" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLabel" name="appIconPreview"> - <property name="minimumSize"> - <size> - <width>45</width> - <height>45</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>45</width> - <height>45</height> - </size> - </property> - <property name="frameShape"> - <enum>QFrame::Panel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Sunken</enum> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="appIconLoadToolButton"> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="symbianTargetUid3Label"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Target UID3:</string> - </property> - <property name="buddy"> - <cstring>uid3LineEdit</cstring> - </property> - </widget> - </item> - <item row="1" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QLineEdit" name="uid3LineEdit"/> - </item> - <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item row="2" column="0" colspan="2"> - <widget class="QCheckBox" name="enableNetworkCheckBox"> - <property name="text"> - <string>Enable network access</string> - </property> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.cpp b/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.cpp index 875c83ad308..f2a2da4712a 100644 --- a/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.cpp +++ b/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.cpp @@ -37,88 +37,17 @@ namespace Qt4ProjectManager { namespace Internal { -struct SymbianCapability { - const char *name; - const int value; -}; - -static const SymbianCapability symbianCapability[] = -{ - { "LocalServices", MobileLibraryParameters::LocalServices }, - { "Location", MobileLibraryParameters::Location }, - { "NetworkServices", MobileLibraryParameters::NetworkServices }, - { "ReadUserData", MobileLibraryParameters::ReadUserData }, - { "UserEnvironment", MobileLibraryParameters::UserEnvironment }, - { "WriteUserData", MobileLibraryParameters::WriteUserData }, - { "PowerMgmt", MobileLibraryParameters::PowerMgmt }, - { "ProtServ", MobileLibraryParameters::ProtServ }, - { "ReadDeviceData", MobileLibraryParameters::ReadDeviceData }, - { "SurroundingsDD", MobileLibraryParameters::SurroundingsDD }, - { "SwEvent", MobileLibraryParameters::SwEvent }, - { "TrustedUI", MobileLibraryParameters::TrustedUI }, - { "WriteDeviceData", MobileLibraryParameters::WriteDeviceData }, - { "CommDD", MobileLibraryParameters::CommDD }, - { "DiskAdmin", MobileLibraryParameters::DiskAdmin }, - { "NetworkControl", MobileLibraryParameters::NetworkControl }, - { "MultimediaDD", MobileLibraryParameters::MultimediaDD }, - { "AllFiles", MobileLibraryParameters::AllFiles }, - { "DRM", MobileLibraryParameters::DRM }, - { "TCB", MobileLibraryParameters::TCB }, - -}; - -QString generateCapabilitySet(uint capabilities) -{ - const int capabilityCount = sizeof(symbianCapability)/sizeof(symbianCapability[0]); - QString capabilitySet; - for(int i = 0; i < capabilityCount; ++i) - if (capabilities&symbianCapability[i].value) - capabilitySet += QLatin1String(symbianCapability[i].name) + QLatin1Char(' '); - return capabilitySet; -} - MobileLibraryParameters::MobileLibraryParameters() : - type(0), libraryType(TypeNone), symbianCapabilities(CapabilityNone) + type(0), libraryType(TypeNone) { } void MobileLibraryParameters::writeProFile(QTextStream &str) const { - if (type&Symbian) - writeSymbianProFile(str); if (type&Maemo) writeMaemoProFile(str); } -void MobileLibraryParameters::writeSymbianProFile(QTextStream &str) const -{ - if (libraryType == QtProjectParameters::SharedLibrary) { - str << "\n" - "symbian {\n" - " MMP_RULES += EXPORTUNFROZEN\n" - " TARGET.UID3 = " << symbianUid << "\n" - " TARGET.CAPABILITY = " << generateCapabilitySet(symbianCapabilities) << "\n" - " TARGET.EPOCALLOWDLLDATA = 1\n" - " addFiles.sources = " << fileName << ".dll\n" - " addFiles.path = !:/sys/bin\n" - " DEPLOYMENT += addFiles\n" - "}\n"; - } else if (libraryType == QtProjectParameters::Qt4Plugin) { - str << "\n" - "symbian {\n" - "# Load predefined include paths (e.g. QT_PLUGINS_BASE_DIR) to be used in the pro-files\n" - " load(data_caging_paths)\n" - " MMP_RULES += EXPORTUNFROZEN\n" - " TARGET.UID3 = " << symbianUid << "\n" - " TARGET.CAPABILITY = " << generateCapabilitySet(symbianCapabilities) << "\n" - " TARGET.EPOCALLOWDLLDATA = 1\n" - " pluginDeploy.sources = " << fileName << ".dll\n" - " pluginDeploy.path = $$QT_PLUGINS_BASE_DIR/" << QDir::fromNativeSeparators(qtPluginDirectory) << "\n" - " DEPLOYMENT += pluginDeploy\n" - "}\n"; - } -} - void MobileLibraryParameters::writeMaemoProFile(QTextStream &str) const { str << "\n" diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.h b/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.h index 00bdf42df8d..bcc0f4bcb85 100644 --- a/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.h +++ b/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.h @@ -43,46 +43,19 @@ namespace Internal { // Additional parameters required for creating mobile // libraries struct MobileLibraryParameters { - enum Type { TypeNone = 0, Symbian = 0x1, Maemo = 0x2 }; - enum Capability { - CapabilityNone = 0, - LocalServices = 1 << 0, - Location = 1 << 1, - NetworkServices = 1 << 2, - ReadUserData = 1 << 3, - UserEnvironment = 1 << 4, - WriteUserData = 1 << 5, - PowerMgmt = 1 << 6, - ProtServ = 1 << 7, - ReadDeviceData = 1 << 8, - SurroundingsDD = 1 << 9, - SwEvent = 1 << 10, - TrustedUI = 1 << 11, - WriteDeviceData = 1 << 12, - CommDD = 1 << 13, - DiskAdmin = 1 << 14, - NetworkControl = 1 << 15, - MultimediaDD = 1 << 16, - AllFiles = 1 << 17, - DRM = 1 << 18, - TCB = 1 << 19 - }; + enum Type { TypeNone = 0, Maemo = 0x1 }; MobileLibraryParameters(); void writeProFile(QTextStream &str) const; private: - void writeSymbianProFile(QTextStream &str) const; void writeMaemoProFile(QTextStream &str) const; public: uint type; uint libraryType; QString fileName; - - QString symbianUid; QString qtPluginDirectory; - uint symbianCapabilities; }; } // namespace Internal diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.cpp b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.cpp index 703f23f9c2e..f93fe504201 100644 --- a/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.cpp +++ b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.cpp @@ -61,26 +61,6 @@ MobileLibraryWizardOptionPage::~MobileLibraryWizardOptionPage() delete d; } -QString MobileLibraryWizardOptionPage::symbianUid() const -{ - return d->ui.symbianTargetUid3LineEdit->text(); -} - -void MobileLibraryWizardOptionPage::setSymbianUid(const QString &uid) -{ - d->ui.symbianTargetUid3LineEdit->setText(uid); -} - -void MobileLibraryWizardOptionPage::setNetworkEnabled(bool enableIt) -{ - d->ui.symbianEnableNetworkCheckBox->setChecked(enableIt); -} - -bool MobileLibraryWizardOptionPage::networkEnabled() const -{ - return d->ui.symbianEnableNetworkCheckBox->isChecked(); -} - QString MobileLibraryWizardOptionPage::qtPluginDirectory() const { return d->ui.qtPluginLocationLineEdit->text(); @@ -98,9 +78,9 @@ void MobileLibraryWizardOptionPage::setLibraryType(int type) if (type != QtProjectParameters::Qt4Plugin) { d->ui.qtPluginLocationLineEdit->setVisible(false); d->ui.qtPluginLocationLabel->setVisible(false); - d->ui.formLayout_2->removeItem(d->ui.horizontalLayout_2); - delete d->ui.horizontalLayout_2; - d->ui.horizontalLayout_2 = 0; + d->ui.formLayout->removeItem(d->ui.horizontalLayout); + delete d->ui.horizontalLayout; + d->ui.horizontalLayout = 0; } } diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.h b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.h index aeccc0415b3..c1562fae34f 100644 --- a/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.h +++ b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.h @@ -44,10 +44,6 @@ public: explicit MobileLibraryWizardOptionPage(QWidget *parent = 0); virtual ~MobileLibraryWizardOptionPage(); - void setSymbianUid(const QString &uid); - QString symbianUid() const; - void setNetworkEnabled(bool enableIt); - bool networkEnabled() const; QString qtPluginDirectory() const; void setQtPluginDirectory(const QString &directory); void setLibraryType(int type); diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.ui b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.ui index 429b1face44..3708eebf85f 100644 --- a/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.ui +++ b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>404</width> - <height>131</height> + <height>66</height> </rect> </property> <property name="windowTitle"> @@ -22,82 +22,31 @@ <property name="frameShadow"> <enum>QFrame::Raised</enum> </property> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <item> - <layout class="QFormLayout" name="formLayout_2"> - <item row="0" column="0"> - <widget class="QLabel" name="symbianTargetUid3Label"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Target UID3:</string> - </property> - <property name="buddy"> - <cstring>symbianTargetUid3LineEdit</cstring> - </property> - </widget> - </item> - <item row="0" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QLineEdit" name="symbianTargetUid3LineEdit"/> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> + <layout class="QFormLayout" name="formLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="qtPluginLocationLabel"> + <property name="text"> + <string>Plugin's directory name:</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLineEdit" name="qtPluginLocationLineEdit"/> </item> - <item row="1" column="0"> - <widget class="QLabel" name="qtPluginLocationLabel"> - <property name="text"> - <string>Plugin's directory name:</string> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> - </widget> - </item> - <item row="1" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_7"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QLineEdit" name="qtPluginLocationLineEdit"/> - </item> - <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> - </item> - <item row="2" column="0"> - <widget class="QCheckBox" name="symbianEnableNetworkCheckBox"> - <property name="text"> - <string>Enable network access</string> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> </property> - </widget> + </spacer> </item> </layout> </item> diff --git a/src/plugins/qt4projectmanager/wizards/qtquickapp.cpp b/src/plugins/qt4projectmanager/wizards/qtquickapp.cpp index 68e12e8c3dc..91849d5ab37 100644 --- a/src/plugins/qt4projectmanager/wizards/qtquickapp.cpp +++ b/src/plugins/qt4projectmanager/wizards/qtquickapp.cpp @@ -256,11 +256,6 @@ void QtQuickApp::handleCurrentProFileTemplateLine(const QString &line, } proFile << endl; - } else if (line.contains(QLatin1String("# QTQUICKCOMPONENTS"))) { - QString nextLine = proFileTemplate.readLine(); // eats '# CONFIG += qtquickcomponents' - if (componentSet() == Symbian11Components) - nextLine.remove(0, 2); // remove comment - proFile << nextLine << endl; } else if (line.contains(QLatin1String("# HARMATTAN_BOOSTABLE"))) { QString nextLine = proFileTemplate.readLine(); // eats '# CONFIG += qdeclarative-boostable' if (supportsMeegoBooster()) @@ -352,8 +347,7 @@ Core::GeneratedFiles QtQuickApp::generateFiles(QString *errorMessage) const Core::GeneratedFiles files = AbstractMobileApp::generateFiles(errorMessage); if (!useExistingMainQml()) { files.append(file(generateFile(QtQuickAppGeneratedFileInfo::MainQmlFile, errorMessage), path(MainQml))); - if ((componentSet() == QtQuickApp::Symbian11Components) - || (componentSet() == QtQuickApp::Meego10Components)) + if ((componentSet() == QtQuickApp::Meego10Components)) files.append(file(generateFile(QtQuickAppGeneratedFileInfo::MainPageQmlFile, errorMessage), path(MainPageQml))); files.last().setAttributes(Core::GeneratedFile::OpenEditorAttribute); } @@ -453,8 +447,6 @@ QList<DeploymentFolder> QtQuickApp::deploymentFolders() const QString QtQuickApp::componentSetDir(ComponentSet componentSet) const { switch (componentSet) { - case Symbian11Components: - return QLatin1String("symbian11"); case Meego10Components: return QLatin1String("meego10"); case QtQuick10Components: diff --git a/src/plugins/qt4projectmanager/wizards/qtquickapp.h b/src/plugins/qt4projectmanager/wizards/qtquickapp.h index 3ea532d4ed4..6696aafa492 100644 --- a/src/plugins/qt4projectmanager/wizards/qtquickapp.h +++ b/src/plugins/qt4projectmanager/wizards/qtquickapp.h @@ -115,7 +115,6 @@ public: enum ComponentSet { QtQuick10Components, - Symbian11Components, Meego10Components }; diff --git a/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp b/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp index 8d85f94ff19..f599a17d064 100644 --- a/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp @@ -151,17 +151,6 @@ void QtQuickAppWizard::createInstances(ExtensionSystem::IPlugin *plugin) list << parameter; parameter = base; - parameter.setDisplayName(tr("Qt Quick Application for Symbian")); - parameter.setDescription(basicDescription + tr("The Qt Quick Components for Symbian are a set of " - "ready-made components that are designed with specific " - "native appearance for the Symbian platform.\n\nRequires " - "<b>Qt 4.7.4</b> or newer, and the component set installed for " - "your Qt version.")); - parameter.setRequiredFeatures(basicFeatures | Core::Feature(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_SYMBIAN) - | QtSupport::Constants::FEATURE_QT_QUICK_1_1); - list << parameter; - - parameter = base; parameter.setDisplayName(tr("Qt Quick Application for MeeGo Harmattan")); parameter.setDescription(basicDescription + tr("The Qt Quick Components for MeeGo Harmattan are " "a set of ready-made components that are designed " @@ -184,7 +173,7 @@ void QtQuickAppWizard::createInstances(ExtensionSystem::IPlugin *plugin) QList<QtQuickAppWizard*> wizardList = Core::createMultipleBaseFileWizardInstances<QtQuickAppWizard>(list, plugin); - Q_ASSERT(wizardList.count() == 4); + Q_ASSERT(wizardList.count() == 3); for (int i = 0; i < wizardList.count(); i++) { wizardList.at(i)->setQtQuickKind(Kind(i)); @@ -212,10 +201,6 @@ AbstractMobileAppWizardDialog *QtQuickAppWizard::createWizardDialogInternal(QWid d->app->setComponentSet(QtQuickApp::QtQuick10Components); d->app->setMainQml(QtQuickApp::ModeGenerate); break; - case SymbianComponents: - d->app->setComponentSet(QtQuickApp::Symbian11Components); - d->app->setMainQml(QtQuickApp::ModeGenerate); - break; case MeegoComponents: d->app->setComponentSet(QtQuickApp::Meego10Components); d->app->setMainQml(QtQuickApp::ModeGenerate); diff --git a/src/plugins/qt4projectmanager/wizards/qtquickappwizard.h b/src/plugins/qt4projectmanager/wizards/qtquickappwizard.h index f1a5394d09f..ae337b6912e 100644 --- a/src/plugins/qt4projectmanager/wizards/qtquickappwizard.h +++ b/src/plugins/qt4projectmanager/wizards/qtquickappwizard.h @@ -43,9 +43,8 @@ public: enum Kind { QtQuick1_1 = 0, - SymbianComponents = 1, - MeegoComponents = 2, - ImportQml = 3 + MeegoComponents = 1, + ImportQml = 2 }; QtQuickAppWizard(); diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index abe8d65b470..fbb33dd891e 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -333,11 +333,6 @@ void BaseQtVersion::setId(int id) m_id = id; } -void BaseQtVersion::restoreLegacySettings(QSettings *s) -{ - Q_UNUSED(s); -} - void BaseQtVersion::fromMap(const QVariantMap &map) { m_id = map.value(QLatin1String(QTVERSIONID)).toInt(); diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index 8051e6d147b..36c833f76c0 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -100,8 +100,6 @@ public: virtual ~BaseQtVersion(); virtual void fromMap(const QVariantMap &map); - // pre 2.3 settings, only used by SymbianQt - virtual void restoreLegacySettings(QSettings *s); virtual BaseQtVersion *clone() const = 0; virtual bool equals(BaseQtVersion *other); diff --git a/src/plugins/qtsupport/debugginghelperbuildtask.cpp b/src/plugins/qtsupport/debugginghelperbuildtask.cpp index e180cc19ef3..a8330b1c3eb 100644 --- a/src/plugins/qtsupport/debugginghelperbuildtask.cpp +++ b/src/plugins/qtsupport/debugginghelperbuildtask.cpp @@ -98,14 +98,8 @@ DebuggingHelperBuildTask::DebuggingHelperBuildTask(const BaseQtVersion *version, if (toolChain->targetAbi().os() == Abi::LinuxOS && Abi::hostAbi().os() == Abi::WindowsOS) m_target = QLatin1String("-unix"); - if (toolChain->targetAbi().os() == Abi::SymbianOS) { - m_makeArguments << QLatin1String("debug-") + toolChain->defaultMakeTarget(); - m_makeArguments << QLatin1String("release-") + toolChain->defaultMakeTarget(); - m_makeArguments << QLatin1String("-k"); - } else { - m_makeArguments << QLatin1String("all") - << QLatin1String("-k"); - } + m_makeArguments << QLatin1String("all") + << QLatin1String("-k"); m_qmakeCommand = version->qmakeCommand(); m_qmakeArguments = QStringList() << QLatin1String("-nocache"); if (toolChain->targetAbi().os() == Abi::MacOS diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index 245d6443587..aba338421a8 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -371,9 +371,6 @@ QtOptionsPageWidget::ValidityInfo QtOptionsPageWidget::validInformation(const Ba QStringList missingToolChains; int abiCount = 0; foreach (const ProjectExplorer::Abi &a, version->qtAbis()) { - // Ignore symbian emulator since we do not support it. - if (a.osFlavor() == ProjectExplorer::Abi::SymbianEmulatorFlavor) - continue; if (ProjectExplorer::ToolChainManager::instance()->findToolChains(a).isEmpty()) missingToolChains.append(a.toString()); ++abiCount; @@ -414,9 +411,6 @@ QList<ProjectExplorer::ToolChain*> QtOptionsPageWidget::toolChains(const BaseQtV return toolChains.values(); foreach (const ProjectExplorer::Abi &a, version->qtAbis()) { - // Ignore symbian emulator since we do not support it. - if (a.osFlavor() == ProjectExplorer::Abi::SymbianEmulatorFlavor) - continue; foreach (ProjectExplorer::ToolChain *tc, ProjectExplorer::ToolChainManager::instance()->findToolChains(a)) { toolChains.insert(tc->id(), tc); @@ -1113,13 +1107,6 @@ QString QtOptionsPageWidget::searchKeywords() const << sep << m_debuggingHelperUi->qmlDumpLabel->text() << sep << m_debuggingHelperUi->qmlObserverLabel->text(); - // Symbian specific, could be factored out to the factory - // checking m_configurationWidget is not enough, we want them to be a keyword - // regardless of which Qt versions configuration widget is currently active - ts << sep << tr("S60 SDK:") - << sep << tr("SBS v2 directory:"); - - rc.remove(QLatin1Char('&')); return rc; } diff --git a/src/plugins/qtsupport/qtsupportconstants.h b/src/plugins/qtsupport/qtsupportconstants.h index fbe4bf1e882..8034ed3eeb1 100644 --- a/src/plugins/qtsupport/qtsupportconstants.h +++ b/src/plugins/qtsupport/qtsupportconstants.h @@ -39,7 +39,6 @@ const char QTVERSION_SETTINGS_PAGE_ID[] = "H.Qt Versions"; const char QTVERSION_SETTINGS_PAGE_NAME[] = QT_TRANSLATE_NOOP("Qt4ProjectManager", "Qt Versions"); // QtVersions -const char SYMBIANQT[] = "Qt4ProjectManager.QtVersion.Symbian"; const char MAEMOQT[] = "Qt4ProjectManager.QtVersion.Maemo"; const char DESKTOPQT[] = "Qt4ProjectManager.QtVersion.Desktop"; const char SIMULATORQT[] = "Qt4ProjectManager.QtVersion.Simulator"; @@ -55,7 +54,6 @@ const char FEATURE_QT_QUICK_1_1[] = "QtSupport.Wizards.FeatureQtQuick.1.1"; const char FEATURE_QT_QUICK_2[] = "QtSupport.Wizards.FeatureQtQuick.2"; const char FEATURE_QT_WEBKIT[] = "QtSupport.Wizards.FeatureQtWebkit"; const char FEATURE_QT_CONSOLE[] = "QtSupport.Wizards.FeatureQtConsole"; -const char FEATURE_QTQUICK_COMPONENTS_SYMBIAN[] = "QtSupport.Wizards.FeatureQtQuickComponentsSymbian"; const char FEATURE_QTQUICK_COMPONENTS_MEEGO[] = "QtSupport.Wizards.FeatureQtQuickComponentsMeego"; const char FEATURE_MOBILE[] = "QtSupport.Wizards.FeatureMobile"; const char FEATURE_DESKTOP[] = "QtSupport.Wizards.FeatureDesktop"; @@ -63,7 +61,6 @@ const char FEATURE_DESKTOP[] = "QtSupport.Wizards.FeatureDesktop"; // Platforms const char MEEGO_HARMATTAN_PLATFORM[] = "MeeGo/Harmattan"; const char MAEMO_FREMANTLE_PLATFORM[] = "Maemo/Fremantle"; -const char SYMBIAN_PLATFORM[] = "Symbian"; const char DESKTOP_PLATFORM[] = "Desktop"; const char EMBEDDED_LINUX_PLATFORM[] = "Embedded Linux"; const char WINDOWS_CE_PLATFORM[] = "Windows CE"; @@ -71,7 +68,6 @@ const char ANDROID_PLATFORM[] = "Android"; const char MEEGO_HARMATTAN_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "MeeGo/Harmattan"); const char MAEMO_FREMANTLE_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Maemo/Fremantle"); -const char SYMBIAN_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Symbian"); const char DESKTOP_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Desktop"); const char EMBEDDED_LINUX_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Embedded Linux"); const char WINDOWS_CE_PLATFORM_TR[] = QT_TRANSLATE_NOOP("QtSupport", "Windows CE"); diff --git a/src/plugins/qtsupport/qtversionfactory.cpp b/src/plugins/qtsupport/qtversionfactory.cpp index 1587aa821cf..8335c0e7d05 100644 --- a/src/plugins/qtsupport/qtversionfactory.cpp +++ b/src/plugins/qtsupport/qtversionfactory.cpp @@ -55,17 +55,6 @@ bool sortByPriority(QtVersionFactory *a, QtVersionFactory *b) return a->priority() > b->priority(); } -BaseQtVersion *QtVersionFactory::createQtVersionFromLegacySettings(const Utils::FileName &qmakePath, int id, QSettings *s) -{ - BaseQtVersion *v = createQtVersionFromQMakePath(qmakePath); - if (!v) - return 0; - v->setId(id); - v->setDisplayName(s->value(QLatin1String("Name")).toString()); - v->restoreLegacySettings(s); - return v; -} - BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath(const Utils::FileName &qmakePath, bool isAutoDetected, const QString &autoDetectionSource) { QHash<QString, QString> versionInfo; diff --git a/src/plugins/qtsupport/qtversionfactory.h b/src/plugins/qtsupport/qtversionfactory.h index c9ee1c40aae..f826756d5fc 100644 --- a/src/plugins/qtsupport/qtversionfactory.h +++ b/src/plugins/qtsupport/qtversionfactory.h @@ -64,7 +64,6 @@ public: virtual BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString()) = 0; static BaseQtVersion *createQtVersionFromQMakePath(const Utils::FileName &qmakePath, bool isAutoDetected = false, const QString &autoDetectionSource = QString()); - static BaseQtVersion *createQtVersionFromLegacySettings(const Utils::FileName &qmakePath, int id, QSettings *s); }; } // namespace QtSupport diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index 0139a3e8dc6..43bd1b3de8e 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -135,8 +135,6 @@ QtVersionManager::QtVersionManager() : void QtVersionManager::extensionsInitialized() { bool success = restoreQtVersions(); - if (!success) - success = legacyRestore(); updateFromInstaller(); if (!success) { // We did neither restore our settings or upgraded @@ -386,67 +384,6 @@ void QtVersionManager::findSystemQt() m_versions.insert(version->uniqueId(), version); } -bool QtVersionManager::legacyRestore() -{ - QSettings *s = Core::ICore::settings(); - const QString qtVersionSection = QLatin1String(QtVersionsSectionName); - if (!s->contains(qtVersionSection + QLatin1String("/size"))) - return false; - int size = s->beginReadArray(qtVersionSection); - for (int i = 0; i < size; ++i) { - s->setArrayIndex(i); - // Find the right id - // Either something saved or something generated - // Note: This code assumes that either all ids are read from the settings - // or generated on the fly. - int id = s->value(QLatin1String("Id"), -1).toInt(); - if (id == -1) - id = getUniqueId(); - else if (m_idcount < id) - m_idcount = id + 1; - - Utils::FileName qmakePath = Utils::FileName::fromString(s->value(QLatin1String("QMakePath")).toString()); - if (qmakePath.isEmpty()) - continue; //skip this version - - BaseQtVersion *version = QtVersionFactory::createQtVersionFromLegacySettings(qmakePath, id, s); - if (!version) // Likely to be a invalid version - continue; - - if (m_versions.contains(version->uniqueId())) { - // oh uh; - delete version; - } else { - m_versions.insert(version->uniqueId(), version); - } - // Update from 2.1 or earlier: - QString mingwDir = s->value(QLatin1String("MingwDirectory")).toString(); - if (!mingwDir.isEmpty()) { - QFileInfo fi(mingwDir + QLatin1String("/bin/g++.exe")); - if (fi.exists() && fi.isExecutable()) { - ProjectExplorer::MingwToolChain *tc = createToolChain<ProjectExplorer::MingwToolChain>(QLatin1String(ProjectExplorer::Constants::MINGW_TOOLCHAIN_ID)); - if (tc) { - tc->setCompilerCommand(Utils::FileName(fi)); - tc->setDisplayName(tr("MinGW from %1").arg(version->displayName())); - // The debugger is set later in the autoDetect method of the MinGw tool chain factory - // as the default debuggers are not yet registered. - ProjectExplorer::ToolChainManager::instance()->registerToolChain(tc); - } - } - } - const QString mwcDir = s->value(QLatin1String("MwcDirectory")).toString(); - if (!mwcDir.isEmpty()) - m_pendingMwcUpdates.append(mwcDir); - const QString gcceDir = s->value(QLatin1String("GcceDirectory")).toString(); - if (!gcceDir.isEmpty()) - m_pendingGcceUpdates.append(gcceDir); - - } - s->endArray(); - s->remove(qtVersionSection); - return true; -} - void QtVersionManager::addVersion(BaseQtVersion *version) { QTC_ASSERT(version != 0, return); diff --git a/src/plugins/valgrind/valgrind.qbs b/src/plugins/valgrind/valgrind.qbs index fbe239f0dfc..dfdc6d65827 100644 --- a/src/plugins/valgrind/valgrind.qbs +++ b/src/plugins/valgrind/valgrind.qbs @@ -11,7 +11,6 @@ QtcPlugin { Depends { name: "ProjectExplorer" } Depends { name: "TextEditor" } Depends { name: "RemoteLinux" } - Depends { name: "symbianutils"} Depends { name: "CPlusPlus"} Depends { name: "cpp" } |