diff options
author | Tim Jenssen <tim.jenssen@nokia.com> | 2011-05-06 11:21:06 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@nokia.com> | 2011-05-06 11:21:06 +0200 |
commit | 210e7936b0ff742cfb29461d5cbcfd63cd950205 (patch) | |
tree | b007891bbbdf9e075bb398d05e60b430dc6ceff9 | |
parent | 10fe04128a5d848b22764989b4a0744d69efd903 (diff) |
Revert "added new registerqtv2operation"
This reverts commit 10fe04128a5d848b22764989b4a0744d69efd903.
-rw-r--r-- | doc/scripting.qdoc | 9 | ||||
-rw-r--r-- | examples/testapp/config/config.xml | 2 | ||||
-rw-r--r-- | installerbuilder/installerbuilder.pro | 2 | ||||
-rw-r--r-- | installerbuilder/libinstaller/extractarchiveoperation.cpp | 4 | ||||
-rw-r--r-- | installerbuilder/libinstaller/init.cpp | 2 | ||||
-rw-r--r-- | installerbuilder/libinstaller/lazyplaintextedit.cpp | 12 | ||||
-rw-r--r-- | installerbuilder/libinstaller/libinstaller.pro | 2 | ||||
-rw-r--r-- | installerbuilder/libinstaller/registerqtv2operation.cpp | 188 | ||||
-rw-r--r-- | installerbuilder/libinstaller/registerqtv2operation.h | 48 | ||||
-rw-r--r-- | installerfw.pro | 10 |
10 files changed, 14 insertions, 265 deletions
diff --git a/doc/scripting.qdoc b/doc/scripting.qdoc index 5a94aba8c..ece1e0fce 100644 --- a/doc/scripting.qdoc +++ b/doc/scripting.qdoc @@ -202,15 +202,6 @@ a \a description, a \a contentType and an \a icon. This is currently only supported on Windows. - \section2 RegisterQtInCreatorV2 - - \bold Syntax: "RegisterQtInCreatorV2", \a displayname, \a qt_or_qmake_path, [\a system_root, [\a sbs_path]]. - - Registers the Qt version \a displayname to Qt Creator with \a qt_or_qmake_path (if the path does not end with the qmake binary, it will add bin/qmake to the path automatically). Optionally, you can specify a\ system_root which. For Symbian SDKs the instance root will be where Qt Creator will find the Symbian SDK root (EPOCROOT). For Symbian SDKs supporting sbs, you add the \a sbs_path . - - \note The minimum Qt Creator version it supports is 2.2 - - \section1 Custom Operations It is possible to register custom installation operations in the Installer. This works by deriving KDUpdater::UpdateOperation. diff --git a/examples/testapp/config/config.xml b/examples/testapp/config/config.xml index efbcaddce..33264d385 100644 --- a/examples/testapp/config/config.xml +++ b/examples/testapp/config/config.xml @@ -27,5 +27,5 @@ </PublicKey> <!-- @homeDir@ and @rootDir@ are some of the supported vars --> - <TargetDir>f:/testinstall</TargetDir> + <TargetDir>@rootDir@/testinstall</TargetDir> </Installer> diff --git a/installerbuilder/installerbuilder.pro b/installerbuilder/installerbuilder.pro index 09276ca4e..77499994c 100644 --- a/installerbuilder/installerbuilder.pro +++ b/installerbuilder/installerbuilder.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs CONFIG += ordered -SUBDIRS += libinstaller installerbase binarycreator #repogen archivegen tests +SUBDIRS += libinstaller installerbase binarycreator repogen archivegen tests #test.commands=(cd tests && $(MAKE) test) diff --git a/installerbuilder/libinstaller/extractarchiveoperation.cpp b/installerbuilder/libinstaller/extractarchiveoperation.cpp index 0a6422f22..9c2121f7b 100644 --- a/installerbuilder/libinstaller/extractarchiveoperation.cpp +++ b/installerbuilder/libinstaller/extractarchiveoperation.cpp @@ -75,8 +75,7 @@ bool ExtractArchiveOperation::performOperation() Receiver receiver; Callback callback; - //usually we have to connect it as queued connection but then some blocking work is in the main thread - connect( &callback, SIGNAL(progressChanged(QString)), this, SLOT(slotProgressChanged(QString)), Qt::DirectConnection ); + connect( &callback, SIGNAL(progressChanged(QString)), this, SLOT(slotProgressChanged(QString)), Qt::QueuedConnection ); connect( &callback, SIGNAL(progressChanged(int)), this, SIGNAL(progressChanged(int)), Qt::QueuedConnection ); if(QInstaller::Installer *installer = this->value( QLatin1String( "installer" )).value<QInstaller::Installer*>()) { @@ -190,7 +189,6 @@ ExtractArchiveOperation* ExtractArchiveOperation::clone() const return new ExtractArchiveOperation(); } -//this slot is direct connected to the caller so please don't call it from another thread in the same time void ExtractArchiveOperation::slotProgressChanged( const QString& filename ) { QStringList m_files = value( QLatin1String( "files" ) ).toStringList(); diff --git a/installerbuilder/libinstaller/init.cpp b/installerbuilder/libinstaller/init.cpp index 150a0bd65..df4f89477 100644 --- a/installerbuilder/libinstaller/init.cpp +++ b/installerbuilder/libinstaller/init.cpp @@ -55,7 +55,6 @@ #include "linereplaceoperation.h" #include "registerdocumentationoperation.h" #include "registerqtoperation.h" -#include "registerqtv2operation.h" #include "setqtcreatorvalueoperation.h" #include "simplemovefileoperation.h" #include "registertoolchainoperation.h" @@ -177,7 +176,6 @@ void QInstaller::init() KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation< QInstaller::CopyDirectoryOperation >( QLatin1String( "CopyDirectory") ); KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation< QInstaller::RegisterDocumentationOperation >( QLatin1String( "RegisterDocumentation") ); KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation< QInstaller::RegisterQtInCreatorOperation>( QLatin1String( "RegisterQtInCreator") ); - KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation< QInstaller::RegisterQtInCreatorV2Operation>( QLatin1String( "RegisterQtInCreatorV2") ); KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation< QInstaller::RegisterToolChainOperation>( QLatin1String( "RegisterToolChain") ); KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation< QInstaller::SetDemosPathOnQtOperation>( QLatin1String( "SetDemosPathOnQt") ); KDUpdater::UpdateOperationFactory::instance().registerUpdateOperation< QInstaller::SetExamplesPathOnQtOperation>( QLatin1String( "SetExamplesPathOnQt") ); diff --git a/installerbuilder/libinstaller/lazyplaintextedit.cpp b/installerbuilder/libinstaller/lazyplaintextedit.cpp index 40b8dcdf5..930e05ca8 100644 --- a/installerbuilder/libinstaller/lazyplaintextedit.cpp +++ b/installerbuilder/libinstaller/lazyplaintextedit.cpp @@ -34,7 +34,7 @@ #include <QScrollBar> -#define TIMER_TIME 20 +#define TIMER_TIME 10 LazyPlainTextEdit::LazyPlainTextEdit(QWidget *parent) : QPlainTextEdit(parent), m_timerId(0) @@ -55,12 +55,12 @@ void LazyPlainTextEdit::timerEvent(QTimerEvent *event) void LazyPlainTextEdit::append(const QString &text) { - //if (m_timerId) { - // killTimer(m_timerId); - // m_timerId = 0; - //} + if (m_timerId) { + killTimer(m_timerId); + m_timerId = 0; + } m_chachedOutput.append(text + QLatin1String("\n")); - if (isVisible() && m_timerId == 0) { + if (isVisible()) { m_timerId = startTimer(TIMER_TIME); } } diff --git a/installerbuilder/libinstaller/libinstaller.pro b/installerbuilder/libinstaller/libinstaller.pro index 2440caa9f..c5f71fbc4 100644 --- a/installerbuilder/libinstaller/libinstaller.pro +++ b/installerbuilder/libinstaller/libinstaller.pro @@ -58,7 +58,6 @@ HEADERS += $$PWD/qinstaller.h \ linereplaceoperation.h \ registerdocumentationoperation.h \ registerqtoperation.h \ - registerqtv2operation.h \ registertoolchainoperation.h \ setqtcreatorvalueoperation.h \ copydirectoryoperation.h \ @@ -122,7 +121,6 @@ SOURCES += $$PWD/qinstaller.cpp \ linereplaceoperation.cpp \ registerdocumentationoperation.cpp \ registerqtoperation.cpp \ - registerqtv2operation.cpp \ registertoolchainoperation.cpp \ setqtcreatorvalueoperation.cpp \ copydirectoryoperation.cpp \ diff --git a/installerbuilder/libinstaller/registerqtv2operation.cpp b/installerbuilder/libinstaller/registerqtv2operation.cpp deleted file mode 100644 index 42b1f28e1..000000000 --- a/installerbuilder/libinstaller/registerqtv2operation.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt SDK** -** -** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).* -** -** Contact: Nokia Corporation qt-info@nokia.com** -** -** No Commercial Usage -** -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception version -** 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you are unsure which license is appropriate for your use, please contact -** (qt-info@nokia.com). -** -**************************************************************************/ -#include "registerqtv2operation.h" -#include "qinstaller.h" - -#include <QString> -#include <QFileInfo> -#include <QDir> -#include <QSettings> -#include <QDebug> - -using namespace QInstaller; - -#if defined ( Q_OS_MAC ) - static const char *QtCreatorSettingsSuffixPath = - "/Qt Creator.app/Contents/Resources/Nokia/QtCreator.ini"; -#else - static const char *QtCreatorSettingsSuffixPath = - "/QtCreator/share/qtcreator/Nokia/QtCreator.ini"; -#endif - -RegisterQtInCreatorV2Operation::RegisterQtInCreatorV2Operation() -{ - setName(QLatin1String("RegisterQtInCreatorV2")); -} - -RegisterQtInCreatorV2Operation::~RegisterQtInCreatorV2Operation() -{ -} - -void RegisterQtInCreatorV2Operation::backup() -{ -} - -bool RegisterQtInCreatorV2Operation::performOperation() -{ - const QStringList args = arguments(); - - if( args.count() < 2) { - setError( InvalidArguments ); - setErrorString( tr("Invalid arguments in %0: %1 arguments given, minimum 2 expected.") - .arg(name()).arg( args.count() ) ); - return false; - } - - const Installer* const installer = qVariantValue< Installer* >( value( QLatin1String( "installer" ) ) ); - const QString &rootInstallPath = installer->value(QLatin1String("TargetDir")); - - int argCounter = 0; - const QString &versionName = args.value(argCounter++); - const QString &path = args.value(argCounter++); - QString qmakePath = QDir(path).absolutePath(); - if ( !qmakePath.endsWith(QLatin1String("qmake")) - || !qmakePath.endsWith(QLatin1String("qmake.exe"))) - { -#if defined ( Q_OS_WIN ) - qmakePath.append(QLatin1String("/bin/qmake.exe")); -#elif defined( Q_OS_UNIX ) - qmakePath.append(QLatin1String("/bin/qmake")); -#endif - } - - const QString &systemRoot = args.value(argCounter++); //Symbian SDK root for example - const QString &sbsPath = args.value(argCounter++); - - QSettings settings(rootInstallPath + QLatin1String(QtCreatorSettingsSuffixPath), - QSettings::IniFormat); - - QString newVersions; - QStringList oldNewQtVersions = settings.value(QLatin1String("NewQtVersions") - ).toString().split(QLatin1String(";")); - - //remove not existing Qt versions and the current new one(because its added after this) - if (!oldNewQtVersions.isEmpty()) { - foreach (const QString &qtVersion, oldNewQtVersions) { - QStringList splitedQtConfiguration = qtVersion.split(QLatin1String("=")); - if (splitedQtConfiguration.value(1).contains(QLatin1String("qmake"), - Qt::CaseInsensitive)) { - QString foundVersionName = splitedQtConfiguration.at(0); - QString foundQmakePath = splitedQtConfiguration.at(1); - if (qmakePath != foundQmakePath && versionName != foundVersionName - && QFile::exists(foundQmakePath)) { - newVersions.append(qtVersion + QLatin1String(";")); - } - } - } - } - - QString addedVersion = versionName; - - addedVersion += QLatin1Char('=') + qmakePath; - addedVersion += QLatin1Char('=') + systemRoot; - addedVersion += QLatin1Char('=') + sbsPath; - newVersions += addedVersion; - settings.setValue(QLatin1String("NewQtVersions"), newVersions); - - return true; -} - -bool RegisterQtInCreatorV2Operation::undoOperation() -{ - const QStringList args = arguments(); - - if( args.count() < 3) { - setError( InvalidArguments ); - setErrorString( tr("Invalid arguments in %0: %1 arguments given, minimum 3 expected.") - .arg(name()).arg( args.count() ) ); - return false; - } - - const QString &rootInstallPath = args.value(0); //for example "C:\\QtSDK\\" - const QString &versionName = args.value(1); - const QString &path = args.value(2); - QString qmakePath = QDir(path).absolutePath(); - if (!qmakePath.endsWith(QLatin1String("qmake")) - || !qmakePath.endsWith(QLatin1String("qmake.exe"))) { - #if defined ( Q_OS_WIN ) - qmakePath.append(QLatin1String("bin/qmake.exe")); - #elif defined( Q_OS_UNIX ) - qmakePath.append(QLatin1String("bin/qmake")); - #endif - } - - QSettings settings( rootInstallPath + QLatin1String(QtCreatorSettingsSuffixPath), - QSettings::IniFormat ); - - QString newVersions; - QStringList oldNewQtVersions = settings.value(QLatin1String("NewQtVersions") - ).toString().split(QLatin1String(";")); - - //remove the removed Qt version from "NewQtVersions" setting - if (!oldNewQtVersions.isEmpty()) { - foreach (const QString &qtVersion, oldNewQtVersions) { - QStringList splitedQtConfiguration = qtVersion.split(QLatin1String("=")); - if (splitedQtConfiguration.value(1).contains(QLatin1String("qmake"), - Qt::CaseInsensitive)) { - QString foundVersionName = splitedQtConfiguration.at(0); - QString foundQmakePath = splitedQtConfiguration.at(1); - if (qmakePath != foundQmakePath &&versionName != foundVersionName - && QFile::exists(foundQmakePath)) { - newVersions.append(qtVersion + QLatin1String(";")); - } - } - } - } - settings.setValue(QLatin1String("NewQtVersions"), newVersions); - return true; -} - -bool RegisterQtInCreatorV2Operation::testOperation() -{ - return true; -} - -KDUpdater::UpdateOperation* RegisterQtInCreatorV2Operation::clone() const -{ - return new RegisterQtInCreatorV2Operation(); -} diff --git a/installerbuilder/libinstaller/registerqtv2operation.h b/installerbuilder/libinstaller/registerqtv2operation.h deleted file mode 100644 index 86cb7a16a..000000000 --- a/installerbuilder/libinstaller/registerqtv2operation.h +++ /dev/null @@ -1,48 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt SDK** -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).* -** -** Contact: Nokia Corporation qt-info@nokia.com** -** -** 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. -** -** If you are unsure which license is appropriate for your use, please contact -** (qt-info@nokia.com). -** -**************************************************************************/ -#ifndef REGISTERQTINCREATORV2OPERATION_H -#define REGISTERQTINCREATORV2OPERATION_H - -#include <KDUpdater/UpdateOperation> - -namespace QInstaller { - -class RegisterQtInCreatorV2Operation : public KDUpdater::UpdateOperation -{ -public: - RegisterQtInCreatorV2Operation(); - ~RegisterQtInCreatorV2Operation(); - - void backup(); - bool performOperation(); - bool undoOperation(); - bool testOperation(); - KDUpdater::UpdateOperation* clone() const; -}; - -}; // namespace - -#endif // REGISTERQTINCREATORV2OPERATION_H diff --git a/installerfw.pro b/installerfw.pro index c97211e53..7009c613f 100644 --- a/installerfw.pro +++ b/installerfw.pro @@ -1,10 +1,10 @@ TEMPLATE=subdirs CONFIG += ordered -SUBDIRS += installerbuilder #examples +SUBDIRS += installerbuilder examples -#test.target=test -#test.commands=(cd installerbuilder && $(MAKE) test) -#test.depends = $(TARGET) -#QMAKE_EXTRA_TARGETS += test +test.target=test +test.commands=(cd installerbuilder && $(MAKE) test) +test.depends = $(TARGET) +QMAKE_EXTRA_TARGETS += test |