summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/scripting.qdoc9
-rw-r--r--examples/testapp/config/config.xml2
-rw-r--r--installerbuilder/installerbuilder.pro2
-rw-r--r--installerbuilder/libinstaller/extractarchiveoperation.cpp4
-rw-r--r--installerbuilder/libinstaller/init.cpp2
-rw-r--r--installerbuilder/libinstaller/lazyplaintextedit.cpp12
-rw-r--r--installerbuilder/libinstaller/libinstaller.pro2
-rw-r--r--installerbuilder/libinstaller/registerqtv2operation.cpp188
-rw-r--r--installerbuilder/libinstaller/registerqtv2operation.h48
-rw-r--r--installerfw.pro10
10 files changed, 265 insertions, 14 deletions
diff --git a/doc/scripting.qdoc b/doc/scripting.qdoc
index ece1e0fce..5a94aba8c 100644
--- a/doc/scripting.qdoc
+++ b/doc/scripting.qdoc
@@ -202,6 +202,15 @@
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 33264d385..efbcaddce 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>@rootDir@/testinstall</TargetDir>
+ <TargetDir>f:/testinstall</TargetDir>
</Installer>
diff --git a/installerbuilder/installerbuilder.pro b/installerbuilder/installerbuilder.pro
index 77499994c..09276ca4e 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 9c2121f7b..0a6422f22 100644
--- a/installerbuilder/libinstaller/extractarchiveoperation.cpp
+++ b/installerbuilder/libinstaller/extractarchiveoperation.cpp
@@ -75,7 +75,8 @@ bool ExtractArchiveOperation::performOperation()
Receiver receiver;
Callback callback;
- connect( &callback, SIGNAL(progressChanged(QString)), this, SLOT(slotProgressChanged(QString)), Qt::QueuedConnection );
+ //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(int)), this, SIGNAL(progressChanged(int)), Qt::QueuedConnection );
if(QInstaller::Installer *installer = this->value( QLatin1String( "installer" )).value<QInstaller::Installer*>()) {
@@ -189,6 +190,7 @@ 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 df4f89477..150a0bd65 100644
--- a/installerbuilder/libinstaller/init.cpp
+++ b/installerbuilder/libinstaller/init.cpp
@@ -55,6 +55,7 @@
#include "linereplaceoperation.h"
#include "registerdocumentationoperation.h"
#include "registerqtoperation.h"
+#include "registerqtv2operation.h"
#include "setqtcreatorvalueoperation.h"
#include "simplemovefileoperation.h"
#include "registertoolchainoperation.h"
@@ -176,6 +177,7 @@ 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 930e05ca8..40b8dcdf5 100644
--- a/installerbuilder/libinstaller/lazyplaintextedit.cpp
+++ b/installerbuilder/libinstaller/lazyplaintextedit.cpp
@@ -34,7 +34,7 @@
#include <QScrollBar>
-#define TIMER_TIME 10
+#define TIMER_TIME 20
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()) {
+ if (isVisible() && m_timerId == 0) {
m_timerId = startTimer(TIMER_TIME);
}
}
diff --git a/installerbuilder/libinstaller/libinstaller.pro b/installerbuilder/libinstaller/libinstaller.pro
index c5f71fbc4..2440caa9f 100644
--- a/installerbuilder/libinstaller/libinstaller.pro
+++ b/installerbuilder/libinstaller/libinstaller.pro
@@ -58,6 +58,7 @@ HEADERS += $$PWD/qinstaller.h \
linereplaceoperation.h \
registerdocumentationoperation.h \
registerqtoperation.h \
+ registerqtv2operation.h \
registertoolchainoperation.h \
setqtcreatorvalueoperation.h \
copydirectoryoperation.h \
@@ -121,6 +122,7 @@ 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
new file mode 100644
index 000000000..42b1f28e1
--- /dev/null
+++ b/installerbuilder/libinstaller/registerqtv2operation.cpp
@@ -0,0 +1,188 @@
+/**************************************************************************
+**
+** 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
new file mode 100644
index 000000000..86cb7a16a
--- /dev/null
+++ b/installerbuilder/libinstaller/registerqtv2operation.h
@@ -0,0 +1,48 @@
+/**************************************************************************
+**
+** 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 7009c613f..c97211e53 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