diff options
Diffstat (limited to 'src/plugins')
129 files changed, 23 insertions, 14866 deletions
diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 99ece70f58..672fefdb6d 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -272,7 +272,7 @@ signals: void stackFrameCompleted(); /* * For "external" clients of a debugger run control that needs to do - * further setup before the debugger is started (e.g. Maemo). + * further setup before the debugger is started (e.g. RemoteLinux). * Afterwards, notifyEngineRemoteSetupDone() or notifyEngineRemoteSetupFailed() * must be called to continue or abort debugging, respectively. * This signal is only emitted if the start parameters indicate that diff --git a/src/plugins/debugger/debuggerrunner.h b/src/plugins/debugger/debuggerrunner.h index 18e57313bf..3399aa60a2 100644 --- a/src/plugins/debugger/debuggerrunner.h +++ b/src/plugins/debugger/debuggerrunner.h @@ -72,7 +72,7 @@ public: void startFailed(); void debuggingFinished(); ProjectExplorer::RunConfiguration *runConfiguration() const; - DebuggerEngine *engine(); // FIXME: Remove. Only used by Maemo support. + DebuggerEngine *engine(); void showMessage(const QString &msg, int channel); diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.h b/src/plugins/debugger/gdb/remotegdbserveradapter.h index e70b00ba40..27c6a2509c 100644 --- a/src/plugins/debugger/gdb/remotegdbserveradapter.h +++ b/src/plugins/debugger/gdb/remotegdbserveradapter.h @@ -60,7 +60,7 @@ private: signals: /* * For "external" clients of a debugger run control that need to do - * further setup before the debugger is started (e.g. Maemo). + * further setup before the debugger is started (e.g. RemoteLinux). * Afterwards, handleSetupDone() or handleSetupFailed() must be called * to continue or abort debugging, respectively. * This signal is only emitted if the start parameters indicate that diff --git a/src/plugins/madde/Madde.pluginspec.in b/src/plugins/madde/Madde.pluginspec.in deleted file mode 100644 index 295a7d7e5c..0000000000 --- a/src/plugins/madde/Madde.pluginspec.in +++ /dev/null @@ -1,17 +0,0 @@ -<plugin name=\"Madde\" version=\"$$QTCREATOR_VERSION\" compatVersion=\"$$QTCREATOR_COMPAT_VERSION\" disabledByDefault=\"true\"> - <vendor>Digia Plc</vendor> - <copyright>(C) 2013 Digia Plc</copyright> - <license> -Commercial Usage - -Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Digia. - -GNU Lesser General Public License Usage - -Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. 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. - </license> - <description>Support for MADDE-based platforms, including Fremantle and MeeGo 1.2 Harmattan.</description> - <category>Device Support</category> - <url>http://www.qt-project.org</url> - $$dependencyList -</plugin> diff --git a/src/plugins/madde/debianmanager.cpp b/src/plugins/madde/debianmanager.cpp deleted file mode 100644 index c0573c925d..0000000000 --- a/src/plugins/madde/debianmanager.cpp +++ /dev/null @@ -1,729 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "debianmanager.h" - -#include "maddedevice.h" -#include "maemoconstants.h" -#include "maemoglobal.h" -#include "maemopackagecreationstep.h" - -#include <coreplugin/documentmanager.h> -#include <projectexplorer/project.h> -#include <projectexplorer/target.h> -#include <qt4projectmanager/qt4buildconfiguration.h> -#include <qtsupport/qtkitinformation.h> -#include <utils/filesystemwatcher.h> -#include <utils/qtcassert.h> - -#include <QBuffer> -#include <QByteArray> -#include <QDateTime> -#include <QDir> -#include <QProcess> - -#include <QMessageBox> - -#include <ctype.h> - -// ----------------------------------------------------------------------- -// Helpers: -// ----------------------------------------------------------------------- - -namespace { - -const char IconFieldName[] = "XB-Maemo-Icon-26"; -const char NameFieldName[] = "Package"; -const char ShortDescriptionFieldName[] = "Description"; - -const char PackagingDirName[] = "qtc_packaging"; - -// The QDateTime API can only deliver these in localized form... -QString shortMonthName(const QDateTime &dt) -{ - switch (dt.date().month()) { - case 1: return QLatin1String("Jan"); - case 2: return QLatin1String("Feb"); - case 3: return QLatin1String("Mar"); - case 4: return QLatin1String("Apr"); - case 5: return QLatin1String("May"); - case 6: return QLatin1String("Jun"); - case 7: return QLatin1String("Jul"); - case 8: return QLatin1String("Aug"); - case 9: return QLatin1String("Sep"); - case 10: return QLatin1String("Oct"); - case 11: return QLatin1String("Nov"); - case 12: return QLatin1String("Dec"); - default: QTC_ASSERT(false, return QString()); - } -} - -QString shortDayOfWeekName(const QDateTime &dt) -{ - switch (dt.date().dayOfWeek()) { - case Qt::Monday: return QLatin1String("Mon"); - case Qt::Tuesday: return QLatin1String("Tue"); - case Qt::Wednesday: return QLatin1String("Wed"); - case Qt::Thursday: return QLatin1String("Thu"); - case Qt::Friday: return QLatin1String("Fri"); - case Qt::Saturday: return QLatin1String("Sat"); - case Qt::Sunday: return QLatin1String("Sun"); - default: QTC_ASSERT(false, return QString()); - } -} - -QByteArray packageManagerNameFieldName(Core::Id deviceType) -{ - if (deviceType == Madde::Internal::Maemo5OsType) - return QByteArray("XB-Maemo-Display-Name"); - return QByteArray("XSBC-Maemo-Display-Name"); -} - -QList<QPair<QByteArray, QByteArray> > additionalFields(Core::Id deviceType, const QString &projectName) -{ - QList<QPair<QByteArray, QByteArray> > fields; - if (deviceType == Madde::Internal::HarmattanOsType) - fields << qMakePair(QByteArray("XB-Maemo-Flags"), QByteArray("visible")) - << qMakePair(QByteArray("XB-MeeGo-Desktop-Entry-Filename"), - QString::fromLatin1("%1_harmattan").arg(projectName).toUtf8()) - << qMakePair(QByteArray("XB-MeeGo-Desktop-Entry"), - QString::fromLatin1("\n [Desktop Entry]\n Type=Application\n Name=%1\n Icon=/usr/share/icons/hicolor/80x80/apps/%1%2.png") - .arg(projectName).arg(80).toUtf8()); - return fields; -} - -QByteArray section(Core::Id deviceType) -{ - if (deviceType == Madde::Internal::Maemo5OsType) - return "user/hidden"; - if (deviceType == Madde::Internal::HarmattanOsType) - return "user/other"; - return QByteArray(); -} - -void raiseError(const QString &reason) -{ - QMessageBox::critical(0, Madde::Internal::DebianManager::tr("Error Creating Debian Project Templates"), reason); -} - -QString defaultPackageFileName(ProjectExplorer::Project *project) -{ - QString packageName = project->displayName().toLower(); - - // We also replace dots later, because OVI store chokes on them (for the N900). - QRegExp illegalLetter(QLatin1String("[^a-z0-9+-]"), Qt::CaseSensitive, QRegExp::WildcardUnix); - - return packageName.replace(illegalLetter, QLatin1String("-")); -} - -bool adaptTagValue(QByteArray &document, const QByteArray &fieldName, - const QByteArray &newFieldValue, bool caseSensitive) -{ - QByteArray adaptedLine = fieldName + ": " + newFieldValue; - const QByteArray completeTag = fieldName + ':'; - const int lineOffset = caseSensitive ? document.indexOf(completeTag) - : document.toLower().indexOf(completeTag.toLower()); - if (lineOffset == -1) { - document.append(adaptedLine).append('\n'); - return true; - } - - int newlineOffset = document.indexOf('\n', lineOffset); - bool updated = false; - if (newlineOffset == -1) { - newlineOffset = document.length(); - adaptedLine += '\n'; - updated = true; - } - const int replaceCount = newlineOffset - lineOffset; - if (!updated && document.mid(lineOffset, replaceCount) != adaptedLine) - updated = true; - if (updated) - document.replace(lineOffset, replaceCount, adaptedLine); - return updated; -} - -QByteArray controlFileFieldValue(const Utils::FileName &control, const QString &key, bool multiLine) -{ - QByteArray value; - Utils::FileReader reader; - if (!reader.fetch(control.toString())) - return value; - const QByteArray &contents = reader.data(); - const int keyPos = contents.indexOf(key.toUtf8() + ':'); - if (keyPos == -1) - return value; - int valueStartPos = keyPos + key.length() + 1; - int valueEndPos = contents.indexOf('\n', keyPos); - if (valueEndPos == -1) - valueEndPos = contents.count(); - value = contents.mid(valueStartPos, valueEndPos - valueStartPos).trimmed(); - if (multiLine) { - Q_FOREVER { - valueStartPos = valueEndPos + 1; - if (valueStartPos >= contents.count()) - break; - const char firstChar = contents.at(valueStartPos); - if (firstChar == '#' || isspace(firstChar)) { - valueEndPos = contents.indexOf('\n', valueStartPos); - if (valueEndPos == -1) - valueEndPos = contents.count(); - if (firstChar != '#') { - value += contents.mid(valueStartPos, - valueEndPos - valueStartPos).trimmed(); - } - } else { - break; - } - } - } - return value; -} - -bool setControlFieldValue(const Utils::FileName &control, const QByteArray &fieldName, - const QByteArray &fieldValue) -{ - Utils::FileReader reader; - if (!reader.fetch(control.toString())) - return false; - QByteArray contents = reader.data(); - if (!adaptTagValue(contents, fieldName, fieldValue, true)) - return false; - Core::FileChangeBlocker update(control.toString()); - Utils::FileSaver saver(control.toString()); - saver.write(contents); - return saver.finalize(); -} - -bool adaptRulesFile(const Utils::FileName &rulesPath) -{ - Utils::FileReader reader; - if (!reader.fetch(rulesPath.toString())) { - raiseError(reader.errorString()); - return false; - } - QByteArray rulesContents = reader.data(); - const QByteArray comment("# Uncomment this line for use without Qt Creator"); - rulesContents.replace("DESTDIR", "INSTALL_ROOT"); - rulesContents.replace("dh_shlibdeps", "# dh_shlibdeps " + comment); - rulesContents.replace("# Add here commands to configure the package.", - "# qmake PREFIX=/usr" + comment); - rulesContents.replace("$(MAKE)\n", "# $(MAKE) " + comment + '\n'); - - // Would be the right solution, but does not work (on Windows), - // because dpkg-genchanges doesn't know about it (and can't be told). - // rulesContents.replace("dh_builddeb", "dh_builddeb --destdir=."); - - Utils::FileSaver saver(rulesPath.toString()); - saver.write(rulesContents); - if (!saver.finalize()) { - raiseError(saver.errorString()); - return false; - } - return true; -} - -bool adaptControlFile(const Utils::FileName &controlPath, Qt4ProjectManager::Qt4BuildConfiguration *bc, - const QByteArray §ion, const QByteArray &packageManagerNameField, - QList<QPair<QByteArray, QByteArray> > additionalFields) -{ - Utils::FileReader reader; - if (!reader.fetch(controlPath.toString())) { - raiseError(reader.errorString()); - return false; - } - QByteArray controlContents = reader.data(); - - adaptTagValue(controlContents, "Section", section, true); - adaptTagValue(controlContents, "Priority", "optional", true); - adaptTagValue(controlContents, packageManagerNameField, - bc->target()->project()->displayName().toUtf8(), true); - const int buildDependsOffset = controlContents.indexOf("Build-Depends:"); - if (buildDependsOffset == -1) { - qDebug("Unexpected: no Build-Depends field in debian control file."); - } else { - int buildDependsNewlineOffset - = controlContents.indexOf('\n', buildDependsOffset); - if (buildDependsNewlineOffset == -1) { - controlContents += '\n'; - buildDependsNewlineOffset = controlContents.length() - 1; - } - controlContents.insert(buildDependsNewlineOffset, - ", libqt4-dev"); - } - - for (int i = 0; i < additionalFields.count(); ++i) - adaptTagValue(controlContents, additionalFields.at(i).first, additionalFields.at(i).second, true); - - Utils::FileSaver saver(controlPath.toString()); - saver.write(controlContents); - if (!saver.finalize()) { - raiseError(saver.errorString()); - return false; - } - return true; -} - -} // namespace - -namespace Madde { -namespace Internal { - -// ----------------------------------------------------------------------- -// DebianManager: -// ----------------------------------------------------------------------- - -DebianManager *DebianManager::m_instance = 0; - -DebianManager::DebianManager(QObject *parent) : - QObject(parent), - m_watcher(new Utils::FileSystemWatcher(this)) -{ - m_instance = this; - - m_watcher->setObjectName(QLatin1String("Madde::DebianManager")); - connect(m_watcher, SIGNAL(directoryChanged(QString)), - this, SLOT(directoryWasChanged(QString))); -} - -DebianManager::~DebianManager() -{ } - -DebianManager *DebianManager::instance() -{ - return m_instance; -} - -void DebianManager::monitor(const Utils::FileName &debianDir) -{ - QFileInfo fi = debianDir.toFileInfo(); - if (!fi.isDir()) - return; - - if (!m_watches.contains(debianDir)) { - m_watches.insert(debianDir, 1); - m_watcher->addDirectory(debianDir.toString(), Utils::FileSystemWatcher::WatchAllChanges); - - WatchableFile *controlFile = new WatchableFile(controlFilePath(debianDir).toString(), this); - connect(controlFile, SIGNAL(modified()), this, SLOT(controlWasChanged())); - WatchableFile *changelogFile = new WatchableFile(changelogFilePath(debianDir).toString(), this); - connect(changelogFile, SIGNAL(modified()), SLOT(changelogWasChanged())); - Core::DocumentManager::addDocuments(QList<Core::IDocument *>() << controlFile << changelogFile); - } -} - -bool DebianManager::isMonitoring(const Utils::FileName &debianDir) -{ - return m_watches.contains(debianDir); -} - -void DebianManager::ignore(const Utils::FileName &debianDir) -{ - int count = m_watches.value(debianDir, 0) - 1; - if (count < 0) - return; - if (count > 0) { - m_watches[debianDir] = 0; - } else { - m_watches.remove(debianDir); - m_watcher->removeDirectory(debianDir.toString()); - } -} - -QString DebianManager::projectVersion(const Utils::FileName &debianDir, QString *error) -{ - Utils::FileName path = changelogFilePath(debianDir); - QFile changelog(path.toString()); - if (!changelog.open(QIODevice::ReadOnly)) { - if (error) - *error = tr("Failed to open debian changelog \"%1\" file for reading.").arg(path.toUserOutput()); - return QString(); - } - - const QByteArray &firstLine = changelog.readLine(); - const int openParenPos = firstLine.indexOf('('); - if (openParenPos == -1) { - if (error) - *error = tr("Debian changelog file '%1' has unexpected format.").arg(path.toUserOutput()); - return QString(); - } - const int closeParenPos = firstLine.indexOf(')', openParenPos); - if (closeParenPos == -1) { - if (error) - *error = tr("Debian changelog file '%1' has unexpected format.").arg(path.toUserOutput()); - return QString(); - } - return QString::fromUtf8(firstLine.mid(openParenPos + 1, closeParenPos - openParenPos - 1).data()); -} - -bool DebianManager::setProjectVersion(const Utils::FileName &debianDir, const QString &version, QString *error) -{ - const Utils::FileName filePath = changelogFilePath(debianDir); - Utils::FileReader reader; - if (!reader.fetch(filePath.toString(), error)) - return false; - QString content = QString::fromUtf8(reader.data()); - if (content.contains(QLatin1Char('(') + version + QLatin1Char(')'))) { - if (error) - *error = tr("Refusing to update changelog file: Already contains version '%1'.").arg(version); - return false; - } - - int maintainerOffset = content.indexOf(QLatin1String("\n -- ")); - const int eolOffset = content.indexOf(QLatin1Char('\n'), maintainerOffset + 1); - if (maintainerOffset == -1 || eolOffset == -1) { - if (error) - *error = tr("Cannot update changelog: Invalid format (no maintainer entry found)."); - return false; - } - - ++maintainerOffset; - const QDateTime currentDateTime = QDateTime::currentDateTime(); - QDateTime utcDateTime = QDateTime(currentDateTime); - utcDateTime.setTimeSpec(Qt::UTC); - int utcOffsetSeconds = currentDateTime.secsTo(utcDateTime); - QChar sign; - if (utcOffsetSeconds < 0) { - utcOffsetSeconds = -utcOffsetSeconds; - sign = QLatin1Char('-'); - } else { - sign = QLatin1Char('+'); - } - const int utcOffsetMinutes = (utcOffsetSeconds / 60) % 60; - const int utcOffsetHours = utcOffsetSeconds / 3600; - const QString dateString = QString::fromLatin1("%1, %2 %3 %4 %5%6%7") - .arg(shortDayOfWeekName(currentDateTime)) - .arg(currentDateTime.toString(QLatin1String("dd"))) - .arg(shortMonthName(currentDateTime)) - .arg(currentDateTime.toString(QLatin1String("yyyy hh:mm:ss"))).arg(sign) - .arg(utcOffsetHours, 2, 10, QLatin1Char('0')) - .arg(utcOffsetMinutes, 2, 10, QLatin1Char('0')); - const QString maintainerLine = content.mid(maintainerOffset, eolOffset - maintainerOffset + 1) - .replace(QRegExp(QLatin1String("> [^\\n]*\n")), - QString::fromLatin1("> %1").arg(dateString)); - QString versionLine = content.left(content.indexOf(QLatin1Char('\n'))) - .replace(QRegExp(QLatin1String("\\([a-zA-Z0-9_\\.]+\\)")), - QLatin1Char('(') + version + QLatin1Char(')')); - const QString newEntry = versionLine + QLatin1String("\n * <Add change description here>\n\n") - + maintainerLine + QLatin1String("\n\n"); - content.prepend(newEntry); - Core::FileChangeBlocker update(filePath.toString()); - Utils::FileSaver saver(filePath.toString()); - saver.write(content.toUtf8()); - return saver.finalize(error); -} - -QString DebianManager::packageName(const Utils::FileName &debianDir) -{ - return QString::fromUtf8(controlFileFieldValue(controlFilePath(debianDir), QLatin1String(NameFieldName), false)); -} - -bool DebianManager::setPackageName(const Utils::FileName &debianDir, const QString &newName) -{ - const QString oldPackageName = packageName(debianDir); - - Utils::FileName controlPath = controlFilePath(debianDir); - if (!setControlFieldValue(controlPath, NameFieldName, newName.toUtf8())) - return false; - if (!setControlFieldValue(controlPath, "Source", newName.toUtf8())) - return false; - - Utils::FileName changelogPath = changelogFilePath(debianDir); - Utils::FileReader reader; - if (!reader.fetch(changelogPath.toString())) - return false; - QString changelogContents = QString::fromUtf8(reader.data()); - QRegExp pattern(QLatin1String("[^\\s]+( \\(\\d\\.\\d\\.\\d\\))")); - changelogContents.replace(pattern, newName + QLatin1String("\\1")); - Core::FileChangeBlocker updateChangelog(changelogPath.toString()); - Utils::FileSaver saver(changelogPath.toString()); - saver.write(changelogContents.toUtf8()); - if (!saver.finalize()) - return false; - - Utils::FileName rulesPath = rulesFilePath(debianDir); - if (!reader.fetch(rulesPath.toString())) - return false; - - QByteArray rulesContents = reader.data(); - const QString oldString = QLatin1String("debian/") + oldPackageName; - const QString newString = QLatin1String("debian/") + newName; - rulesContents.replace(oldString.toUtf8(), newString.toUtf8()); - - Core::FileChangeBlocker updateRules(rulesPath.toString()); - Utils::FileSaver rulesSaver(rulesPath.toString()); - rulesSaver.write(rulesContents); - return rulesSaver.finalize(); -} - -QString DebianManager::shortDescription(const Utils::FileName &debianDir) -{ - return QString::fromUtf8(controlFileFieldValue(controlFilePath(debianDir), - QLatin1String(ShortDescriptionFieldName), false)); -} - -bool DebianManager::setShortDescription(const Utils::FileName &debianDir, const QString &description) -{ - return setControlFieldValue(controlFilePath(debianDir), ShortDescriptionFieldName, description.toUtf8()); -} - -QString DebianManager::packageManagerName(const Utils::FileName &debianDir, Core::Id deviceType) -{ - return QString::fromUtf8(controlFileFieldValue(controlFilePath(debianDir), - QLatin1String(packageManagerNameFieldName(deviceType)), false)); -} - -bool DebianManager::setPackageManagerName(const Utils::FileName &debianDir, Core::Id deviceType, const QString &name) -{ - return setControlFieldValue(controlFilePath(debianDir), packageManagerNameFieldName(deviceType), - name.toUtf8()); -} - -QIcon DebianManager::packageManagerIcon(const Utils::FileName &debianDir, QString *error) -{ - const QByteArray &base64Icon - = controlFileFieldValue(controlFilePath(debianDir), QLatin1String(IconFieldName), true); - if (base64Icon.isEmpty()) - return QIcon(); - QPixmap pixmap; - if (!pixmap.loadFromData(QByteArray::fromBase64(base64Icon))) { - if (error) - *error = tr("Invalid icon data in Debian control file."); - return QIcon(); - } - return QIcon(pixmap); -} - -bool DebianManager::setPackageManagerIcon(const Utils::FileName &debianDir, Core::Id deviceType, - const Utils::FileName &iconPath, QString *error) -{ - const Utils::FileName filePath = controlFilePath(debianDir); - Utils::FileReader reader; - if (!reader.fetch(filePath.toString(), error)) - return false; - const QPixmap pixmap(iconPath.toString()); - if (pixmap.isNull()) { - if (error) - *error = tr("Could not read image file '%1'.").arg(iconPath.toUserOutput()); - return false; - } - - QByteArray iconAsBase64; - QBuffer buffer(&iconAsBase64); - buffer.open(QIODevice::WriteOnly); - if (!pixmap.scaled(MaddeDevice::packageManagerIconSize(deviceType)) - .save(&buffer, iconPath.toFileInfo().suffix().toLatin1())) { - if (error) - *error = tr("Could not export image file '%1'.").arg(iconPath.toUserOutput()); - return false; - } - buffer.close(); - iconAsBase64 = iconAsBase64.toBase64(); - QByteArray contents = reader.data(); - const QByteArray iconFieldNameWithColon = QByteArray(IconFieldName) + ':'; - const int iconFieldPos = contents.startsWith(iconFieldNameWithColon) - ? 0 : contents.indexOf('\n' + iconFieldNameWithColon); - if (iconFieldPos == -1) { - if (!contents.endsWith('\n')) - contents += '\n'; - contents.append(iconFieldNameWithColon).append(' ').append(iconAsBase64) - .append('\n'); - } else { - const int oldIconStartPos = (iconFieldPos != 0) + iconFieldPos - + iconFieldNameWithColon.length(); - int nextEolPos = contents.indexOf('\n', oldIconStartPos); - while (nextEolPos != -1 && nextEolPos != contents.length() - 1 - && contents.at(nextEolPos + 1) != '\n' - && (contents.at(nextEolPos + 1) == '#' - || isspace(contents.at(nextEolPos + 1)))) - nextEolPos = contents.indexOf('\n', nextEolPos + 1); - if (nextEolPos == -1) - nextEolPos = contents.length(); - contents.replace(oldIconStartPos, nextEolPos - oldIconStartPos, - ' ' + iconAsBase64); - } - Core::FileChangeBlocker update(filePath.toString()); - Utils::FileSaver saver(filePath.toString()); - saver.write(contents); - return saver.finalize(error); -} - -bool DebianManager::hasPackageManagerIcon(const Utils::FileName &debianDir) -{ - return !packageManagerIcon(debianDir).isNull(); -} - -Utils::FileName DebianManager::packageFileName(const Utils::FileName &debianDir) -{ - return Utils::FileName::fromString(packageName(debianDir) - + QLatin1Char('_') + projectVersion(debianDir) - + QLatin1String("_armel.deb")); -} - -DebianManager::ActionStatus DebianManager::createTemplate(Qt4ProjectManager::Qt4BuildConfiguration *bc, - const Utils::FileName &debianDir) -{ - if (debianDir.toFileInfo().exists()) - return NoActionRequired; - - Utils::FileName location = debianDir.parentDir(); - if (!location.toFileInfo().isDir()) { - if (!QDir::home().mkpath(location.toString())) { - raiseError(tr("Failed to create directory \"%1\".") - .arg(location.toUserOutput())); - return ActionFailed; - } - } - - QProcess dh_makeProc; - QString error; - AbstractMaemoPackageCreationStep::preparePackagingProcess(&dh_makeProc, bc, location.toString()); - const QString packageName = defaultPackageFileName(bc->target()->project()); - - const QStringList dh_makeArgs = - QStringList() << QLatin1String("dh_make") - << QLatin1String("-s") << QLatin1String("-n") << QLatin1String("-p") - << (packageName + QLatin1Char('_') - + AbstractMaemoPackageCreationStep::DefaultVersionNumber); - - QtSupport::BaseQtVersion *lqt = QtSupport::QtKitInformation::qtVersion(bc->target()->kit()); - if (!lqt) { - raiseError(tr("Unable to create Debian templates: No Qt version set.")); - return ActionFailed; - } - - if (!MaemoGlobal::callMad(dh_makeProc, dh_makeArgs, lqt->qmakeCommand().toString(), true) - || !dh_makeProc.waitForStarted()) { - raiseError(tr("Unable to create Debian templates: dh_make failed (%1).") - .arg(dh_makeProc.errorString())); - return ActionFailed; - } - - dh_makeProc.write("\n"); // Needs user input. - dh_makeProc.waitForFinished(-1); - if (dh_makeProc.error() != QProcess::UnknownError - || dh_makeProc.exitCode() != 0) { - raiseError(tr("Unable to create debian templates: dh_make failed (%1).") - .arg(dh_makeProc.errorString())); - return ActionFailed; - } - - if (!QFile::rename(location.appendPath(QLatin1String("debian")).toString(), debianDir.toString())) { - raiseError(tr("Unable to move new debian directory to '%1'.").arg(debianDir.toUserOutput())); - Utils::FileUtils::removeRecursively(location, &error); - return ActionFailed; - } - - QDir debian(debianDir.toString()); - const QStringList &files = debian.entryList(QDir::Files); - foreach (const QString &fileName, files) { - if (fileName.endsWith(QLatin1String(".ex"), Qt::CaseInsensitive) - || fileName.compare(QLatin1String("README.debian"), Qt::CaseInsensitive) == 0 - || fileName.compare(QLatin1String("dirs"), Qt::CaseInsensitive) == 0 - || fileName.compare(QLatin1String("docs"), Qt::CaseInsensitive) == 0) { - debian.remove(fileName); - } - } - - setPackageName(debianDir, packageName); - - Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(bc->target()->kit()); - - const QByteArray sec = section(deviceType); - const QByteArray nameField = packageManagerNameFieldName(deviceType); - QList<QPair<QByteArray, QByteArray> > fields - = additionalFields(deviceType, bc->target()->project()->displayName()); - - return adaptRulesFile(rulesFilePath(debianDir)) - && adaptControlFile(controlFilePath(debianDir), bc, sec, nameField, fields) - ? ActionSuccessful : ActionFailed; -} - -QStringList DebianManager::debianFiles(const Utils::FileName &debianDir) -{ - return QDir(debianDir.toString()).entryList(QDir::Files, QDir::Name | QDir::IgnoreCase); -} - -Utils::FileName DebianManager::debianDirectory(ProjectExplorer::Target *target) -{ - Utils::FileName path = Utils::FileName::fromString(target->project()->projectDirectory()); - path.appendPath(QLatin1String(PackagingDirName)); - Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target->kit()); - if (deviceType == HarmattanOsType) - path.appendPath(QLatin1String("debian_harmattan")); - else if (deviceType == Maemo5OsType) - path.appendPath(QLatin1String("debian_fremantle")); - else - path.clear(); - return path; -} - -void DebianManager::directoryWasChanged(const QString &path) -{ - Utils::FileName fn = Utils::FileName::fromString(path); - QTC_ASSERT(m_watches.contains(fn), return); - emit debianDirectoryChanged(fn); -} - -void DebianManager::controlWasChanged() -{ - WatchableFile *file = qobject_cast<WatchableFile *>(sender()); - if (!file) - return; - emit controlChanged(Utils::FileName::fromString(file->filePath()).parentDir()); -} - -void DebianManager::changelogWasChanged() -{ - WatchableFile *file = qobject_cast<WatchableFile *>(sender()); - if (!file) - return; - emit changelogChanged(Utils::FileName::fromString(file->filePath()).parentDir()); -} - -Utils::FileName DebianManager::changelogFilePath(const Utils::FileName &debianDir) -{ - Utils::FileName result = debianDir; - return result.appendPath(QLatin1String("changelog")); -} - -Utils::FileName DebianManager::controlFilePath(const Utils::FileName &debianDir) -{ - Utils::FileName result = debianDir; - return result.appendPath(QLatin1String("control")); -} - -Utils::FileName DebianManager::rulesFilePath(const Utils::FileName &debianDir) -{ - Utils::FileName result = debianDir; - return result.appendPath(QLatin1String("rules")); -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/debianmanager.h b/src/plugins/madde/debianmanager.h deleted file mode 100644 index 1f2bc05489..0000000000 --- a/src/plugins/madde/debianmanager.h +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef DEBIANMANAGER_H -#define DEBIANMANAGER_H - -#include <coreplugin/id.h> -#include <utils/fileutils.h> - -#include <QObject> -#include <QHash> - -namespace Utils { class FileSystemWatcher; } -namespace ProjectExplorer { class Target; } -namespace Qt4ProjectManager { class Qt4BuildConfiguration; } - -namespace Madde { -namespace Internal { -class MaddePlugin; - -class DebianManager : public QObject -{ - Q_OBJECT -public: - ~DebianManager(); - - static DebianManager *instance(); - - // ref counted: - void monitor(const Utils::FileName &debianDir); - bool isMonitoring(const Utils::FileName &debianDir); - void ignore(const Utils::FileName &debianDir); - - static QString projectVersion(const Utils::FileName &debianDir, QString *error = 0); - static bool setProjectVersion(const Utils::FileName &debianDir, const QString &version, QString *error = 0); - static QString packageName(const Utils::FileName &debianDir); - static bool setPackageName(const Utils::FileName &debianDir, const QString &packageName); - static QString shortDescription(const Utils::FileName &debianDir); - static bool setShortDescription(const Utils::FileName &debianDir, const QString &description); - static QString packageManagerName(const Utils::FileName &debianDir, Core::Id deviceType); - static bool setPackageManagerName(const Utils::FileName &debianDir, Core::Id deviceType, const QString &name); - static QIcon packageManagerIcon(const Utils::FileName &debianDir, QString *error = 0); - static bool setPackageManagerIcon(const Utils::FileName &debianDir, Core::Id deviceType, - const Utils::FileName &iconPath, QString *error = 0); - static bool hasPackageManagerIcon(const Utils::FileName &debianDir); - - static Utils::FileName packageFileName(const Utils::FileName &debianDir); - - enum ActionStatus { NoActionRequired, ActionSuccessful, ActionFailed }; - // will not start to monitor this new dir! - static ActionStatus createTemplate(Qt4ProjectManager::Qt4BuildConfiguration *bc, - const Utils::FileName &debianDir); - - static QStringList debianFiles(const Utils::FileName &debianDir); - - static Utils::FileName debianDirectory(ProjectExplorer::Target *target); - -signals: - void debianDirectoryChanged(const Utils::FileName &dir); - void changelogChanged(const Utils::FileName &dir); - void controlChanged(const Utils::FileName &dir); - -private slots: - void directoryWasChanged(const QString &path); - void controlWasChanged(); - void changelogWasChanged(); - -private: - explicit DebianManager(QObject *parent = 0); - - static Utils::FileName changelogFilePath(const Utils::FileName &debianDir); - static Utils::FileName controlFilePath(const Utils::FileName &debianDir); - static Utils::FileName rulesFilePath(const Utils::FileName &debianDir); - - Utils::FileSystemWatcher *m_watcher; - QHash<Utils::FileName, int> m_watches; - static DebianManager *m_instance; - - friend class MaddePlugin; -}; - -} // namespace Internal -} // namespace Madde - -#endif // DEBIANMANAGER_H diff --git a/src/plugins/madde/images/qemu-run.png b/src/plugins/madde/images/qemu-run.png Binary files differdeleted file mode 100644 index c65d15faf7..0000000000 --- a/src/plugins/madde/images/qemu-run.png +++ /dev/null diff --git a/src/plugins/madde/images/qemu-stop.png b/src/plugins/madde/images/qemu-stop.png Binary files differdeleted file mode 100644 index 97bc159599..0000000000 --- a/src/plugins/madde/images/qemu-stop.png +++ /dev/null diff --git a/src/plugins/madde/madde.pro b/src/plugins/madde/madde.pro deleted file mode 100644 index 0212ac0da3..0000000000 --- a/src/plugins/madde/madde.pro +++ /dev/null @@ -1,107 +0,0 @@ -QT += network - -include(../../qtcreatorplugin.pri) - -HEADERS += \ - maddeplugin.h \ - debianmanager.h \ - maemoconstants.h \ - maemorunconfigurationwidget.h \ - maemorunfactories.h \ - maemosettingspages.h \ - maemopackagecreationstep.h \ - maemopackagecreationfactory.h \ - maemopackagecreationwidget.h \ - maemoqemumanager.h \ - maemodeploystepfactory.h \ - maemoglobal.h \ - maemoremotemountsmodel.h \ - maemomountspecification.h \ - maemoremotemounter.h \ - maemopublishingwizardfactories.h \ - maemopublishingbuildsettingspagefremantlefree.h \ - maemopublishingfileselectiondialog.h \ - maemopublishedprojectmodel.h \ - maemopublishinguploadsettingspagefremantlefree.h \ - maemopublishingwizardfremantlefree.h \ - maemopublishingresultpagefremantlefree.h \ - maemopublisherfremantlefree.h \ - maemoqemuruntime.h \ - maemoqemuruntimeparser.h \ - maemoqemusettingswidget.h \ - maemoqemusettings.h \ - qt4maemodeployconfiguration.h \ - maemodeviceconfigwizard.h \ - maemoinstalltosysrootstep.h \ - maemodeploymentmounter.h \ - maemopackageinstaller.h \ - maemoremotecopyfacility.h \ - maemoqtversionfactory.h \ - maemoqtversion.h \ - maemorunconfiguration.h \ - maddeuploadandinstallpackagesteps.h \ - maemodeploybymountsteps.h \ - maddedevicetester.h \ - maddedeviceconfigurationfactory.h \ - maddedevice.h \ - maemoapplicationrunnerhelperactions.h \ - maddeqemustartstep.h - -SOURCES += \ - maddeplugin.cpp \ - debianmanager.cpp \ - maemorunconfigurationwidget.cpp \ - maemorunfactories.cpp \ - maemosettingspages.cpp \ - maemopackagecreationstep.cpp \ - maemopackagecreationfactory.cpp \ - maemopackagecreationwidget.cpp \ - maemoqemumanager.cpp \ - maemodeploystepfactory.cpp \ - maemoglobal.cpp \ - maemoremotemountsmodel.cpp \ - maemomountspecification.cpp \ - maemoremotemounter.cpp \ - maemopublishingwizardfactories.cpp \ - maemopublishingbuildsettingspagefremantlefree.cpp \ - maemopublishingfileselectiondialog.cpp \ - maemopublishedprojectmodel.cpp \ - maemopublishinguploadsettingspagefremantlefree.cpp \ - maemopublishingwizardfremantlefree.cpp \ - maemopublishingresultpagefremantlefree.cpp \ - maemopublisherfremantlefree.cpp \ - maemoqemuruntimeparser.cpp \ - maemoqemusettingswidget.cpp \ - maemoqemusettings.cpp \ - qt4maemodeployconfiguration.cpp \ - maemodeviceconfigwizard.cpp \ - maemoinstalltosysrootstep.cpp \ - maemodeploymentmounter.cpp \ - maemopackageinstaller.cpp \ - maemoremotecopyfacility.cpp \ - maemoqtversionfactory.cpp \ - maemoqtversion.cpp \ - maddedeviceconfigurationfactory.cpp \ - maddeuploadandinstallpackagesteps.cpp \ - maemodeploybymountsteps.cpp \ - maddedevicetester.cpp \ - maemorunconfiguration.cpp \ - maddedevice.cpp \ - maemoapplicationrunnerhelperactions.cpp \ - maddeqemustartstep.cpp - -FORMS += \ - maemopackagecreationwidget.ui \ - maemopublishingbuildsettingspagefremantlefree.ui \ - maemopublishingfileselectiondialog.ui \ - maemopublishinguploadsettingspagefremantlefree.ui \ - maemopublishingresultpagefremantlefree.ui \ - maemoqemusettingswidget.ui \ - maemodeviceconfigwizardstartpage.ui \ - maemodeviceconfigwizardpreviouskeysetupcheckpage.ui \ - maemodeviceconfigwizardreusekeyscheckpage.ui \ - maemodeviceconfigwizardkeycreationpage.ui \ - maemodeviceconfigwizardkeydeploymentpage.ui - -RESOURCES += qt-maemo.qrc -DEFINES += MADDE_LIBRARY diff --git a/src/plugins/madde/madde.qbs b/src/plugins/madde/madde.qbs deleted file mode 100644 index 1761381b42..0000000000 --- a/src/plugins/madde/madde.qbs +++ /dev/null @@ -1,114 +0,0 @@ -import qbs.base 1.0 - -import QtcPlugin - -QtcPlugin { - name: "Madde" - - Depends { name: "Utils" } - Depends { name: "Debugger" } - Depends { name: "ProjectExplorer" } - Depends { name: "Qt4ProjectManager" } - Depends { name: "QtSupport" } - Depends { name: "RemoteLinux" } - Depends { name: "Qt.gui" } - - files: [ - "debianmanager.cpp", - "debianmanager.h", - "maddedevice.cpp", - "maddedevice.h", - "maddedeviceconfigurationfactory.cpp", - "maddedeviceconfigurationfactory.h", - "maddedevicetester.cpp", - "maddedevicetester.h", - "maddeplugin.cpp", - "maddeplugin.h", - "maddeqemustartstep.cpp", - "maddeqemustartstep.h", - "maddeuploadandinstallpackagesteps.cpp", - "maddeuploadandinstallpackagesteps.h", - "maemoapplicationrunnerhelperactions.cpp", - "maemoapplicationrunnerhelperactions.h", - "maemoconstants.h", - "maemodeploybymountsteps.cpp", - "maemodeploybymountsteps.h", - "maemodeploymentmounter.cpp", - "maemodeploymentmounter.h", - "maemodeploystepfactory.cpp", - "maemodeploystepfactory.h", - "maemodeviceconfigwizard.cpp", - "maemodeviceconfigwizard.h", - "maemodeviceconfigwizardkeycreationpage.ui", - "maemodeviceconfigwizardkeydeploymentpage.ui", - "maemodeviceconfigwizardpreviouskeysetupcheckpage.ui", - "maemodeviceconfigwizardreusekeyscheckpage.ui", - "maemodeviceconfigwizardstartpage.ui", - "maemoglobal.cpp", - "maemoglobal.h", - "maemoinstalltosysrootstep.cpp", - "maemoinstalltosysrootstep.h", - "maemomountspecification.cpp", - "maemomountspecification.h", - "maemopackagecreationfactory.cpp", - "maemopackagecreationfactory.h", - "maemopackagecreationstep.cpp", - "maemopackagecreationstep.h", - "maemopackagecreationwidget.cpp", - "maemopackagecreationwidget.h", - "maemopackagecreationwidget.ui", - "maemopackageinstaller.cpp", - "maemopackageinstaller.h", - "maemopublishedprojectmodel.cpp", - "maemopublishedprojectmodel.h", - "maemopublisherfremantlefree.cpp", - "maemopublisherfremantlefree.h", - "maemopublishingbuildsettingspagefremantlefree.cpp", - "maemopublishingbuildsettingspagefremantlefree.h", - "maemopublishingbuildsettingspagefremantlefree.ui", - "maemopublishingfileselectiondialog.cpp", - "maemopublishingfileselectiondialog.h", - "maemopublishingfileselectiondialog.ui", - "maemopublishingresultpagefremantlefree.cpp", - "maemopublishingresultpagefremantlefree.h", - "maemopublishingresultpagefremantlefree.ui", - "maemopublishinguploadsettingspagefremantlefree.cpp", - "maemopublishinguploadsettingspagefremantlefree.h", - "maemopublishinguploadsettingspagefremantlefree.ui", - "maemopublishingwizardfactories.cpp", - "maemopublishingwizardfactories.h", - "maemopublishingwizardfremantlefree.cpp", - "maemopublishingwizardfremantlefree.h", - "maemoqemumanager.cpp", - "maemoqemumanager.h", - "maemoqemuruntime.h", - "maemoqemuruntimeparser.cpp", - "maemoqemuruntimeparser.h", - "maemoqemusettings.cpp", - "maemoqemusettings.h", - "maemoqemusettingswidget.cpp", - "maemoqemusettingswidget.h", - "maemoqemusettingswidget.ui", - "maemoqtversion.cpp", - "maemoqtversion.h", - "maemoqtversionfactory.cpp", - "maemoqtversionfactory.h", - "maemoremotecopyfacility.cpp", - "maemoremotecopyfacility.h", - "maemoremotemounter.cpp", - "maemoremotemounter.h", - "maemoremotemountsmodel.cpp", - "maemoremotemountsmodel.h", - "maemorunconfiguration.cpp", - "maemorunconfiguration.h", - "maemorunconfigurationwidget.cpp", - "maemorunconfigurationwidget.h", - "maemorunfactories.cpp", - "maemorunfactories.h", - "maemosettingspages.cpp", - "maemosettingspages.h", - "qt-maemo.qrc", - "qt4maemodeployconfiguration.cpp", - "qt4maemodeployconfiguration.h", - ] -} diff --git a/src/plugins/madde/madde_dependencies.pri b/src/plugins/madde/madde_dependencies.pri deleted file mode 100644 index d2676a133a..0000000000 --- a/src/plugins/madde/madde_dependencies.pri +++ /dev/null @@ -1,8 +0,0 @@ -QTC_PLUGIN_NAME = Madde -QTC_PLUGIN_DEPENDS += \ - coreplugin \ - debugger \ - projectexplorer \ - qt4projectmanager \ - qtsupport \ - remotelinux diff --git a/src/plugins/madde/maddedevice.cpp b/src/plugins/madde/maddedevice.cpp deleted file mode 100644 index b055872adb..0000000000 --- a/src/plugins/madde/maddedevice.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maddedevice.h" - -#include "maddedevicetester.h" -#include "maemoconstants.h" - -#include <remotelinux/linuxdeviceprocess.h> -#include <remotelinux/publickeydeploymentdialog.h> -#include <remotelinux/remotelinux_constants.h> -#include <utils/qtcassert.h> - -#include <QStringList> - -using namespace ProjectExplorer; -using namespace RemoteLinux; - -namespace Madde { -namespace Internal { - -MaddeDevice::Ptr MaddeDevice::create() -{ - return Ptr(new MaddeDevice); -} - -MaddeDevice::Ptr MaddeDevice::create(const QString &name, Core::Id type, - MachineType machineType, Origin origin, Core::Id id) -{ - return Ptr(new MaddeDevice(name, type, machineType, origin, id)); -} - -MaddeDevice::MaddeDevice() -{ -} - -MaddeDevice::MaddeDevice(const QString &name, Core::Id type, MachineType machineType, - Origin origin, Core::Id id) - : LinuxDevice(name, type, machineType, origin, id) -{ -} - -MaddeDevice::MaddeDevice(const MaddeDevice &other) : LinuxDevice(other) -{ -} - -ProjectExplorer::IDevice::Ptr MaddeDevice::clone() const -{ - return Ptr(new MaddeDevice(*this)); -} - -QString MaddeDevice::displayType() const -{ - return maddeDisplayType(type()); -} - -QString MaddeDevice::maddeDisplayType(Core::Id type) -{ - if (type == Maemo5OsType) - return tr("Maemo5/Fremantle"); - if (type == HarmattanOsType) - return tr("MeeGo 1.2 Harmattan"); - QTC_ASSERT(false, return QString()); - return QString(); // For crappy compilers. -} - -bool MaddeDevice::allowsRemoteMounts(Core::Id type) -{ - return type == Maemo5OsType; -} - -bool MaddeDevice::allowsPackagingDisabling(Core::Id type) -{ - return type == Maemo5OsType; -} - -bool MaddeDevice::allowsQmlDebugging(Core::Id type) -{ - return type == HarmattanOsType; -} - -QSize MaddeDevice::packageManagerIconSize(Core::Id type) -{ - if (type == Maemo5OsType) - return QSize(48, 48); - if (type == HarmattanOsType) - return QSize(64, 64); - return QSize(); -} - -DeviceTester *MaddeDevice::createDeviceTester() const -{ - return new MaddeDeviceTester; -} - -DeviceProcess *MaddeDevice::createProcess(QObject *parent) const -{ - LinuxDeviceProcess * const proc - = static_cast<LinuxDeviceProcess *>(LinuxDevice::createProcess(parent)); - proc->setRcFilesToSource(QStringList() << QLatin1String("/etc/profile") - << QLatin1String("/home/user/.profile") << QLatin1String("~/.profile")); - return proc; -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maddedevice.h b/src/plugins/madde/maddedevice.h deleted file mode 100644 index a0bb80ca6d..0000000000 --- a/src/plugins/madde/maddedevice.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MADDEDEVICE_H -#define MADDEDEVICE_H - -#include <remotelinux/linuxdevice.h> - -#include <QCoreApplication> - -namespace Madde { -namespace Internal { - -class MaddeDevice : public RemoteLinux::LinuxDevice -{ - Q_DECLARE_TR_FUNCTIONS(Madde::Internal::MaddeDevice) -public: - typedef QSharedPointer<MaddeDevice> Ptr; - typedef QSharedPointer<const MaddeDevice> ConstPtr; - - static Ptr create(); - static Ptr create(const QString &name, Core::Id type, MachineType machineType, - Origin origin = ManuallyAdded, Core::Id id = Core::Id()); - - QString displayType() const; - ProjectExplorer::IDevice::Ptr clone() const; - static QString maddeDisplayType(Core::Id type); - - static bool allowsRemoteMounts(Core::Id type); - static bool allowsPackagingDisabling(Core::Id type); - static bool allowsQmlDebugging(Core::Id type); - - static QSize packageManagerIconSize(Core::Id type); - - ProjectExplorer::DeviceTester *createDeviceTester() const; - ProjectExplorer::DeviceProcess *createProcess(QObject *parent) const; - -private: - MaddeDevice(); - MaddeDevice(const QString &name, Core::Id type, MachineType machineType, - Origin origin, Core::Id id); - - MaddeDevice(const MaddeDevice &other); -}; - -} // namespace Internal -} // namespace Madde - -#endif // MADDEDEVICE_H diff --git a/src/plugins/madde/maddedeviceconfigurationfactory.cpp b/src/plugins/madde/maddedeviceconfigurationfactory.cpp deleted file mode 100644 index 8386c86b2b..0000000000 --- a/src/plugins/madde/maddedeviceconfigurationfactory.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maddedeviceconfigurationfactory.h" - -#include "maddedevice.h" -#include "maemoconstants.h" -#include "maemodeviceconfigwizard.h" - -#include <utils/qtcassert.h> - -using namespace ProjectExplorer; -using namespace RemoteLinux; - -namespace Madde { -namespace Internal { - -MaddeDeviceConfigurationFactory::MaddeDeviceConfigurationFactory(QObject *parent) - : IDeviceFactory(parent) -{ -} - -QString MaddeDeviceConfigurationFactory::displayNameForId(Core::Id type) const -{ - return MaddeDevice::maddeDisplayType(type); -} - -QList<Core::Id> MaddeDeviceConfigurationFactory::availableCreationIds() const -{ - return QList<Core::Id>() << Core::Id(Maemo5OsType) << Core::Id(HarmattanOsType); -} - -IDevice::Ptr MaddeDeviceConfigurationFactory::create(Core::Id id) const -{ - MaemoDeviceConfigWizard wizard(id); - if (wizard.exec() != QDialog::Accepted) - return IDevice::Ptr(); - return wizard.device(); -} - -bool MaddeDeviceConfigurationFactory::canRestore(const QVariantMap &map) const -{ - const Core::Id type = IDevice::typeFromMap(map); - return type == Maemo5OsType || type == HarmattanOsType; -} - -IDevice::Ptr MaddeDeviceConfigurationFactory::restore(const QVariantMap &map) const -{ - QTC_ASSERT(canRestore(map), return MaddeDevice::Ptr()); - const MaddeDevice::Ptr device = MaddeDevice::create(); - device->fromMap(map); - return device; -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maddedeviceconfigurationfactory.h b/src/plugins/madde/maddedeviceconfigurationfactory.h deleted file mode 100644 index cc1dd81cd5..0000000000 --- a/src/plugins/madde/maddedeviceconfigurationfactory.h +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#ifndef MADDEDEVICECONFIGURATIONFACTORY_H -#define MADDEDEVICECONFIGURATIONFACTORY_H - -#include <projectexplorer/devicesupport/idevicefactory.h> - -namespace Madde { -namespace Internal { - -class MaddeDeviceConfigurationFactory : public ProjectExplorer::IDeviceFactory -{ - Q_OBJECT -public: - MaddeDeviceConfigurationFactory(QObject *parent = 0); - - QString displayNameForId(Core::Id type) const; - QList<Core::Id> availableCreationIds() const; - - ProjectExplorer::IDevice::Ptr create(Core::Id id) const; - bool canRestore(const QVariantMap &map) const; - ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MADDEDEVICECONFIGURATIONFACTORY_H diff --git a/src/plugins/madde/maddedevicetester.cpp b/src/plugins/madde/maddedevicetester.cpp deleted file mode 100644 index 29b7d888f8..0000000000 --- a/src/plugins/madde/maddedevicetester.cpp +++ /dev/null @@ -1,255 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maddedevicetester.h" - -#include "maemoconstants.h" -#include "maemoglobal.h" - -#include <remotelinux/linuxdevice.h> -#include <utils/qtcassert.h> -#include <ssh/sshremoteprocessrunner.h> - -#include <QRegExp> - -using namespace RemoteLinux; -using namespace QSsh; - -namespace Madde { -namespace Internal { -namespace { -const char QmlToolingDirectory[] = "/usr/lib/qt4/plugins/qmltooling"; -} // anonymous namespace - -MaddeDeviceTester::MaddeDeviceTester(QObject *parent) - : ProjectExplorer::DeviceTester(parent), - m_genericTester(new GenericLinuxDeviceTester(this)), - m_state(Inactive), - m_processRunner(0) -{ -} - -MaddeDeviceTester::~MaddeDeviceTester() -{ -} - -void MaddeDeviceTester::testDevice(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration) -{ - QTC_ASSERT(m_state == Inactive, return); - - m_deviceConfiguration = deviceConfiguration; - m_result = TestSuccess; - - m_state = GenericTest; - connect(m_genericTester, SIGNAL(progressMessage(QString)), SIGNAL(progressMessage(QString))); - connect(m_genericTester, SIGNAL(errorMessage(QString)), SIGNAL(errorMessage(QString))); - connect(m_genericTester, SIGNAL(finished(ProjectExplorer::DeviceTester::TestResult)), - SLOT(handleGenericTestFinished(ProjectExplorer::DeviceTester::TestResult))); - m_genericTester->testDevice(deviceConfiguration); -} - -void MaddeDeviceTester::stopTest() -{ - QTC_ASSERT(m_state != Inactive, return); - - switch (m_state) { - case Inactive: - break; - case GenericTest: - m_genericTester->stopTest(); - break; - case QtTest: - case MadDeveloperTest: - case QmlToolingTest: - m_processRunner->cancel(); - break; - } - - m_result = TestFailure; - setFinished(); -} - -void MaddeDeviceTester::handleGenericTestFinished(TestResult result) -{ - QTC_ASSERT(m_state == GenericTest, return); - - if (result == TestFailure) { - m_result = TestFailure; - setFinished(); - return; - } - - if (!m_processRunner) - m_processRunner = new SshRemoteProcessRunner(this); - connect(m_processRunner, SIGNAL(connectionError()), SLOT(handleConnectionError())); - connect(m_processRunner, SIGNAL(processClosed(int)), SLOT(handleProcessFinished(int))); - - const QString qtInfoCmd = QLatin1String("dpkg-query -W -f " - "'${Package} ${Version} ${Status}\n' 'libqt*' |grep ' installed$'"); - emit progressMessage(tr("Checking for Qt libraries...")); - m_state = QtTest; - m_processRunner->run(qtInfoCmd.toUtf8(), m_deviceConfiguration->sshParameters()); -} - -void MaddeDeviceTester::handleConnectionError() -{ - QTC_ASSERT(m_state != Inactive, return); - - emit errorMessage(tr("SSH connection error: %1\n") - .arg(m_processRunner->lastConnectionErrorString())); - m_result = TestFailure; - setFinished(); -} - -void MaddeDeviceTester::handleProcessFinished(int exitStatus) -{ - switch (m_state) { - case QtTest: - handleQtTestFinished(exitStatus); - break; - case MadDeveloperTest: - handleMadDeveloperTestFinished(exitStatus); - break; - case QmlToolingTest: - handleQmlToolingTestFinished(exitStatus); - break; - default: - qWarning("%s: Unexpected state %d.", Q_FUNC_INFO, m_state); - } -} - -void MaddeDeviceTester::handleQtTestFinished(int exitStatus) -{ - if (exitStatus != SshRemoteProcess::NormalExit - || m_processRunner->processExitCode() != 0) { - const QByteArray stdErr = m_processRunner->readAllStandardError(); - if (!stdErr.isEmpty()) { - emit errorMessage(tr("Error checking for Qt libraries: %1\n") - .arg(QString::fromUtf8(stdErr))); - } else { - emit errorMessage(tr("Error checking for Qt libraries.\n")); - } - - m_result = TestFailure; - } else { - emit progressMessage(processedQtLibsList()); - } - - emit progressMessage(tr("Checking for connectivity support...")); - m_state = MadDeveloperTest; - m_processRunner->run(QString(QLatin1String("test -x") + MaemoGlobal::devrootshPath()).toUtf8(), - m_deviceConfiguration->sshParameters()); -} - -void MaddeDeviceTester::handleMadDeveloperTestFinished(int exitStatus) -{ - if (exitStatus != SshRemoteProcess::NormalExit) { - const QByteArray stdErr = m_processRunner->readAllStandardError(); - if (!stdErr.isEmpty()) { - emit errorMessage(tr("Error checking for connectivity tool: %1\n") - .arg(QString::fromUtf8(stdErr))); - } else { - emit errorMessage(tr("Error checking for connectivity tool.\n")); - } - m_result = TestFailure; - } else if (m_processRunner->processExitCode() != 0) { - QString message = tr("Connectivity tool not installed on device. " - "Deployment currently not possible."); - if (m_deviceConfiguration->type() == HarmattanOsType) { - message += tr("Please switch the device to developer mode " - "via Settings -> Security."); - } - emit errorMessage(message + QLatin1Char('\n')); - m_result = TestFailure; - } else { - emit progressMessage(tr("Connectivity tool present.\n")); - } - - if (m_deviceConfiguration->type() != HarmattanOsType) { - setFinished(); - return; - } - - emit progressMessage(tr("Checking for QML tooling support...")); - m_state = QmlToolingTest; - m_processRunner->run(QString(QLatin1String("test -d ") - + QLatin1String(QmlToolingDirectory)).toUtf8(), m_deviceConfiguration->sshParameters()); -} - -void MaddeDeviceTester::handleQmlToolingTestFinished(int exitStatus) -{ - if (exitStatus != SshRemoteProcess::NormalExit) { - const QByteArray stdErr = m_processRunner->readAllStandardError(); - if (!stdErr.isEmpty()) { - emit errorMessage(tr("Error checking for QML tooling support: %1\n") - .arg(QString::fromUtf8(stdErr))); - } else { - emit errorMessage(tr("Error checking for QML tooling support.\n")); - } - m_result = TestFailure; - } else if (m_processRunner->processExitCode() != 0) { - emit errorMessage(tr("Missing directory '%1'. You will not be able to do " - "QML debugging on this device.\n").arg(QLatin1String(QmlToolingDirectory))); - m_result = TestFailure; - } else { - emit progressMessage(tr("QML tooling support present.\n")); - } - - setFinished(); -} - -QString MaddeDeviceTester::processedQtLibsList() -{ - QString unfilteredLibs = QString::fromUtf8(m_processRunner->readAllStandardOutput()); - QString filteredLibs; - const QString patternString - = QLatin1String("(\\S+) (\\S*(\\d+)\\.(\\d+)\\.(\\d+)\\S*) \\S+ \\S+ \\S+"); - QRegExp packagePattern(patternString); - int index = packagePattern.indexIn(unfilteredLibs); - if (index == -1) - return tr("No Qt packages installed."); - - do { - filteredLibs += QLatin1String(" ") + packagePattern.cap(1) + QLatin1String(": ") - + packagePattern.cap(2) + QLatin1Char('\n'); - index = packagePattern.indexIn(unfilteredLibs, index + packagePattern.cap(0).length()); - } while (index != -1); - return filteredLibs; -} - - void MaddeDeviceTester::setFinished() -{ - m_state = Inactive; - disconnect(m_genericTester, 0, this, 0); - if (m_processRunner) - disconnect(m_processRunner, 0, this, 0); - emit finished(m_result); -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maddedevicetester.h b/src/plugins/madde/maddedevicetester.h deleted file mode 100644 index 98461f0beb..0000000000 --- a/src/plugins/madde/maddedevicetester.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#ifndef MADDEDEVICETESTER_H -#define MADDEDEVICETESTER_H - -#include <remotelinux/linuxdevicetester.h> - -namespace QSsh { -class SshRemoteProcessRunner; -} - -namespace Madde { -namespace Internal { - -class MaddeDeviceTester : public ProjectExplorer::DeviceTester -{ - Q_OBJECT - -public: - explicit MaddeDeviceTester(QObject *parent = 0); - ~MaddeDeviceTester(); - - void testDevice(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration); - void stopTest(); - -private slots: - void handleGenericTestFinished(ProjectExplorer::DeviceTester::TestResult result); - void handleConnectionError(); - void handleProcessFinished(int exitStatus); - -private: - enum State { Inactive, GenericTest, QtTest, MadDeveloperTest, QmlToolingTest }; - - void handleQtTestFinished(int exitStatus); - void handleMadDeveloperTestFinished(int exitStatus); - void handleQmlToolingTestFinished(int exitStatus); - - QString processedQtLibsList(); - void setFinished(); - - RemoteLinux::GenericLinuxDeviceTester * const m_genericTester; - State m_state; - ProjectExplorer::DeviceTester::TestResult m_result; - QSsh::SshRemoteProcessRunner *m_processRunner; - ProjectExplorer::IDevice::ConstPtr m_deviceConfiguration; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MADDEDEVICETESTER_H diff --git a/src/plugins/madde/maddeplugin.cpp b/src/plugins/madde/maddeplugin.cpp deleted file mode 100644 index 18dd4fdd9f..0000000000 --- a/src/plugins/madde/maddeplugin.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maddeplugin.h" - -#include "debianmanager.h" -#include "maddedeviceconfigurationfactory.h" -#include "maemoconstants.h" -#include "maemodeploystepfactory.h" -#include "maemopackagecreationfactory.h" -#include "maemopublishingwizardfactories.h" -#include "maemoqemumanager.h" -#include "maemorunfactories.h" -#include "maemosettingspages.h" -#include "qt4maemodeployconfiguration.h" -#include "maemoqtversionfactory.h" - -#include <QtPlugin> - -namespace Madde { -namespace Internal { - -MaddePlugin::MaddePlugin() -{ -} - -MaddePlugin::~MaddePlugin() -{ -} - -bool MaddePlugin::initialize(const QStringList &arguments, QString *error_message) -{ - Q_UNUSED(arguments) - Q_UNUSED(error_message) - - MaemoQemuManager::instance(this); - - addAutoReleasedObject(new MaemoRunControlFactory); - addAutoReleasedObject(new MaemoRunConfigurationFactory); - addAutoReleasedObject(new Qt4MaemoDeployConfigurationFactory); - addAutoReleasedObject(new MaemoPackageCreationFactory); - addAutoReleasedObject(new MaemoDeployStepFactory); - addAutoReleasedObject(new MaemoQemuSettingsPage); - addAutoReleasedObject(new MaemoPublishingWizardFactoryFremantleFree); - addAutoReleasedObject(new MaemoQtVersionFactory); - addAutoReleasedObject(new MaddeDeviceConfigurationFactory); - - new DebianManager(this); - - return true; -} - -void MaddePlugin::extensionsInitialized() -{ -} - -} // namespace Internal -} // namespace Madde - -Q_EXPORT_PLUGIN(Madde::Internal::MaddePlugin) diff --git a/src/plugins/madde/maddeplugin.h b/src/plugins/madde/maddeplugin.h deleted file mode 100644 index b8d7630fd7..0000000000 --- a/src/plugins/madde/maddeplugin.h +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MADDEPLUGIN_H -#define MADDEPLUGIN_H - -#include <extensionsystem/iplugin.h> - -namespace Madde { -namespace Internal { - -class MaddePlugin : public ExtensionSystem::IPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Madde.json") - -public: - MaddePlugin(); - ~MaddePlugin(); - - bool initialize(const QStringList &arguments, QString *error_message); - void extensionsInitialized(); -}; - -} // namespace Internal -} // namespace Madde - -#endif // MADDEPLUGIN_H diff --git a/src/plugins/madde/maddeqemustartstep.cpp b/src/plugins/madde/maddeqemustartstep.cpp deleted file mode 100644 index 1226fbc560..0000000000 --- a/src/plugins/madde/maddeqemustartstep.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maddeqemustartstep.h" - -#include "maemoqemumanager.h" - -#include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> -#include <remotelinux/abstractremotelinuxdeployservice.h> -#include <utils/qtcassert.h> - -using namespace ProjectExplorer; -using namespace RemoteLinux; - -namespace Madde { -namespace Internal { -class MaddeQemuStartService : public AbstractRemoteLinuxDeployService -{ - Q_OBJECT -public: - MaddeQemuStartService(QObject *parent = 0) : AbstractRemoteLinuxDeployService(parent) {} - -private: - bool isDeploymentNecessary() const { return true; } - - void doDeviceSetup() - { - emit progressMessage(tr("Checking whether to start Qemu...")); - if (deviceConfiguration()->machineType() == IDevice::Hardware) { - emit progressMessage(tr("Target device is not an emulator. Nothing to do.")); - handleDeviceSetupDone(true); - return; - } - - if (MaemoQemuManager::instance().qemuIsRunning()) { - emit progressMessage(tr("Qemu is already running. Nothing to do.")); - handleDeviceSetupDone(true); - return; - } - - MaemoQemuRuntime rt; - const int qtId = QtSupport::QtKitInformation::qtVersionId(profile()); - if (MaemoQemuManager::instance().runtimeForQtVersion(qtId, &rt)) { - MaemoQemuManager::instance().startRuntime(); - emit errorMessage(tr("Cannot deploy: Qemu was not running. " - "It has now been started up for you, but it will take " - "a bit of time until it is ready. Please try again then.")); - } else { - emit errorMessage(tr("Cannot deploy: You want to deploy to Qemu, but it is not enabled " - "for this Qt version.")); - } - handleDeviceSetupDone(false); - } - - void stopDeviceSetup() { handleDeviceSetupDone(false); } - void doDeploy() { handleDeploymentDone(); } - void stopDeployment() { handleDeploymentDone(); } -}; - -MaddeQemuStartStep::MaddeQemuStartStep(BuildStepList *bsl) - : AbstractRemoteLinuxDeployStep(bsl, stepId()) -{ - ctor(); - setDefaultDisplayName(stepDisplayName()); -} - -MaddeQemuStartStep::MaddeQemuStartStep(BuildStepList *bsl, MaddeQemuStartStep *other) - : AbstractRemoteLinuxDeployStep(bsl, other) -{ - ctor(); -} - -AbstractRemoteLinuxDeployService *MaddeQemuStartStep::deployService() const -{ - return m_service; -} - -bool MaddeQemuStartStep::initInternal(QString *error) -{ - return deployService()->isDeploymentPossible(error); -} - -void MaddeQemuStartStep::ctor() -{ - m_service = new MaddeQemuStartService(this); -} - -Core::Id MaddeQemuStartStep::stepId() -{ - return "Madde.MaddeQemuCheckStep"; -} - -QString MaddeQemuStartStep::stepDisplayName() -{ - return tr("Start Qemu, if necessary"); -} - -} // namespace Internal -} // namespace Madde - -#include "maddeqemustartstep.moc" diff --git a/src/plugins/madde/maddeqemustartstep.h b/src/plugins/madde/maddeqemustartstep.h deleted file mode 100644 index f7e2b3180e..0000000000 --- a/src/plugins/madde/maddeqemustartstep.h +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#ifndef MADDEQEMUSTARTSTEP_H -#define MADDEQEMUSTARTSTEP_H - -#include <remotelinux/abstractremotelinuxdeploystep.h> - -namespace Madde { -namespace Internal { -class MaddeQemuStartService; - -class MaddeQemuStartStep : public RemoteLinux::AbstractRemoteLinuxDeployStep -{ - Q_OBJECT -public: - MaddeQemuStartStep(ProjectExplorer::BuildStepList *bsl); - MaddeQemuStartStep(ProjectExplorer::BuildStepList *bsl, MaddeQemuStartStep *other); - - static Core::Id stepId(); - static QString stepDisplayName(); - -private: - void ctor(); - - RemoteLinux::AbstractRemoteLinuxDeployService *deployService() const; - bool initInternal(QString *error = 0); - - MaddeQemuStartService *m_service; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MADDEQEMUSTARTSTEP_H diff --git a/src/plugins/madde/maddeuploadandinstallpackagesteps.cpp b/src/plugins/madde/maddeuploadandinstallpackagesteps.cpp deleted file mode 100644 index 6d3f5d29dc..0000000000 --- a/src/plugins/madde/maddeuploadandinstallpackagesteps.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maddeuploadandinstallpackagesteps.h" - -#include "maemopackagecreationstep.h" -#include "maemopackageinstaller.h" -#include "maemoqemumanager.h" - -#include <projectexplorer/target.h> -#include <qtsupport/qtkitinformation.h> -#include <remotelinux/abstractuploadandinstallpackageservice.h> -#include <remotelinux/remotelinuxdeployconfiguration.h> -#include <ssh/sshconnection.h> - -using namespace ProjectExplorer; -using namespace RemoteLinux; - -namespace Madde { -namespace Internal { -namespace { -class AbstractMaddeUploadAndInstallPackageAction : public AbstractUploadAndInstallPackageService -{ - Q_OBJECT - -protected: - explicit AbstractMaddeUploadAndInstallPackageAction(AbstractRemoteLinuxDeployStep *step) - : AbstractUploadAndInstallPackageService(step) - { - } - -private: - QString uploadDir() const - { - const QString uname = deviceConfiguration()->sshParameters().userName; - return uname == QLatin1String("root") - ? QString::fromLatin1("/root") : QLatin1String("/home/") + uname; - } -}; - -class MaemoUploadAndInstallPackageAction : public AbstractMaddeUploadAndInstallPackageAction -{ - Q_OBJECT - -public: - MaemoUploadAndInstallPackageAction(AbstractRemoteLinuxDeployStep *step) - : AbstractMaddeUploadAndInstallPackageAction(step), - m_installer(new MaemoDebianPackageInstaller(this)) - { - } - - AbstractRemoteLinuxPackageInstaller *packageInstaller() const { return m_installer; } - -private: - MaemoDebianPackageInstaller * const m_installer; -}; - -class HarmattanUploadAndInstallPackageAction : public AbstractMaddeUploadAndInstallPackageAction -{ - Q_OBJECT - -public: - HarmattanUploadAndInstallPackageAction(AbstractRemoteLinuxDeployStep *step) - : AbstractMaddeUploadAndInstallPackageAction(step), - m_installer(new HarmattanPackageInstaller(this)) - { - } - - AbstractRemoteLinuxPackageInstaller *packageInstaller() const { return m_installer; } - -private: - HarmattanPackageInstaller * const m_installer; -}; - -} // anonymous namespace - - -MaemoUploadAndInstallPackageStep::MaemoUploadAndInstallPackageStep(ProjectExplorer::BuildStepList *bsl) - : AbstractRemoteLinuxDeployStep(bsl, stepId()) -{ - ctor(); -} - -MaemoUploadAndInstallPackageStep::MaemoUploadAndInstallPackageStep(ProjectExplorer::BuildStepList *bsl, - MaemoUploadAndInstallPackageStep *other) : AbstractRemoteLinuxDeployStep(bsl, other) -{ - ctor(); -} - -void MaemoUploadAndInstallPackageStep::ctor() -{ - setDefaultDisplayName(displayName()); - Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit()); - if (deviceType == HarmattanOsType) - m_deployService = new HarmattanUploadAndInstallPackageAction(this); - else - m_deployService = new MaemoUploadAndInstallPackageAction(this); -} - -AbstractRemoteLinuxDeployService *MaemoUploadAndInstallPackageStep::deployService() const -{ - return m_deployService; -} - -bool MaemoUploadAndInstallPackageStep::initInternal(QString *error) -{ - const AbstractMaemoPackageCreationStep * const pStep - = deployConfiguration()->earlierBuildStep<MaemoDebianPackageCreationStep>(this); - if (!pStep) { - if (error) - *error = tr("No Debian package creation step found."); - return false; - } - m_deployService->setPackageFilePath(pStep->packageFilePath()); - return deployService()->isDeploymentPossible(error); -} - -Core::Id MaemoUploadAndInstallPackageStep::stepId() -{ - return "MaemoUploadAndInstallDpkgPackageStep"; -} - -QString MaemoUploadAndInstallPackageStep::displayName() -{ - return tr("Deploy Debian package via SFTP upload"); -} - -} // namespace Internal -} // namespace Madde - -#include "maddeuploadandinstallpackagesteps.moc" diff --git a/src/plugins/madde/maddeuploadandinstallpackagesteps.h b/src/plugins/madde/maddeuploadandinstallpackagesteps.h deleted file mode 100644 index ed271103a2..0000000000 --- a/src/plugins/madde/maddeuploadandinstallpackagesteps.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#ifndef MADDEUPLOADANDINSTALLPACKAGESTEPS_H -#define MADDEUPLOADANDINSTALLPACKAGESTEPS_H - -#include <remotelinux/abstractremotelinuxdeploystep.h> - -namespace RemoteLinux { -class AbstractUploadAndInstallPackageService; -} - -namespace Madde { -namespace Internal { - -class MaemoUploadAndInstallPackageStep : public RemoteLinux::AbstractRemoteLinuxDeployStep -{ - Q_OBJECT -public: - MaemoUploadAndInstallPackageStep(ProjectExplorer::BuildStepList *bsl); - MaemoUploadAndInstallPackageStep(ProjectExplorer::BuildStepList *bsl, - MaemoUploadAndInstallPackageStep *other); - - bool initInternal(QString *error = 0); - - static Core::Id stepId(); - static QString displayName(); - -private: - RemoteLinux::AbstractRemoteLinuxDeployService *deployService() const; - - void ctor(); - - RemoteLinux::AbstractUploadAndInstallPackageService *m_deployService; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MADDEUPLOADANDINSTALLPACKAGESTEPS_H diff --git a/src/plugins/madde/maemoapplicationrunnerhelperactions.cpp b/src/plugins/madde/maemoapplicationrunnerhelperactions.cpp deleted file mode 100644 index 60035de1c9..0000000000 --- a/src/plugins/madde/maemoapplicationrunnerhelperactions.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maemoapplicationrunnerhelperactions.h" - -#include "maemomountspecification.h" -#include "maemoremotemounter.h" - -#include <utils/qtcassert.h> - -using namespace ProjectExplorer; -using namespace Utils; - -namespace Madde { -namespace Internal { - -MaemoPreRunAction::MaemoPreRunAction(const IDevice::ConstPtr &device, const FileName &maddeRoot, - const QList<MaemoMountSpecification> &mountSpecs, QObject *parent) - : DeviceApplicationHelperAction(parent), - m_mounter(new MaemoRemoteMounter(this)), - m_isRunning(false) -{ - m_mounter->setParameters(device, maddeRoot); - foreach (const MaemoMountSpecification &m, mountSpecs) - m_mounter->addMountSpecification(m, false); -} - -void MaemoPreRunAction::handleMounted() -{ - QTC_ASSERT(m_isRunning, return); - - setFinished(true); -} - -void MaemoPreRunAction::handleError(const QString &message) -{ - if (!m_isRunning) - return; - - emit reportError(message); - setFinished(false); -} - -void MaemoPreRunAction::start() -{ - QTC_ASSERT(!m_isRunning, return); - - m_isRunning = true; - if (!m_mounter->hasValidMountSpecifications()) { - setFinished(true); - return; - } - - connect(m_mounter, SIGNAL(debugOutput(QString)), SIGNAL(reportProgress(QString))); - connect(m_mounter, SIGNAL(reportProgress(QString)), SIGNAL(reportProgress(QString))); - connect(m_mounter, SIGNAL(mounted()), SLOT(handleMounted())); - connect(m_mounter, SIGNAL(error(QString)), SLOT(handleError(QString))); - m_mounter->mount(); -} - -void MaemoPreRunAction::stop() -{ - QTC_ASSERT(m_isRunning, return); - - if (m_mounter->hasValidMountSpecifications()) - m_mounter->stop(); - setFinished(false); -} - -void MaemoPreRunAction::setFinished(bool success) -{ - QTC_ASSERT(m_isRunning, return); - - m_mounter->disconnect(this); - m_isRunning = false; - emit finished(success); -} - -MaemoPostRunAction::MaemoPostRunAction(MaemoRemoteMounter *mounter, QObject *parent) - : DeviceApplicationHelperAction(parent), m_mounter(mounter), m_isRunning(false) -{ -} - -void MaemoPostRunAction::handleUnmounted() -{ - QTC_ASSERT(m_isRunning, return); - - setFinished(true); -} - -void MaemoPostRunAction::handleError(const QString &message) -{ - if (!m_isRunning) - return; - - emit reportError(message); - setFinished(false); -} - -void MaemoPostRunAction::start() -{ - QTC_ASSERT(!m_isRunning, return); - - m_isRunning = true; - if (!m_mounter->hasValidMountSpecifications()) { - setFinished(true); - return; - } - - connect(m_mounter, SIGNAL(debugOutput(QString)), SIGNAL(reportProgress(QString))); - connect(m_mounter, SIGNAL(reportProgress(QString)), SIGNAL(reportProgress(QString))); - connect(m_mounter, SIGNAL(unmounted()), SLOT(handleUnmounted())); - connect(m_mounter, SIGNAL(error(QString)), SLOT(handleError(QString))); - m_mounter->unmount(); -} - -void MaemoPostRunAction::stop() -{ - QTC_ASSERT(m_isRunning, return); - - m_mounter->stop(); - setFinished(false); -} - -void MaemoPostRunAction::setFinished(bool success) -{ - QTC_ASSERT(m_isRunning, return); - - if (m_mounter->hasValidMountSpecifications()) { - m_mounter->disconnect(this); - m_isRunning = false; - } - emit finished(success); -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemoapplicationrunnerhelperactions.h b/src/plugins/madde/maemoapplicationrunnerhelperactions.h deleted file mode 100644 index e06d8e18f2..0000000000 --- a/src/plugins/madde/maemoapplicationrunnerhelperactions.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#ifndef MAEMOAPPLICATIONRUNNERHELPERACTIONS_H -#define MAEMOAPPLICATIONRUNNERHELPERACTIONS_H - -#include <projectexplorer/devicesupport/deviceapplicationrunner.h> - -#include <QList> - -namespace Utils { class FileName; } - -namespace Madde { -namespace Internal { -class MaemoMountSpecification; -class MaemoRemoteMounter; - -class MaemoPreRunAction : public ProjectExplorer::DeviceApplicationHelperAction -{ - Q_OBJECT -public: - MaemoPreRunAction(const ProjectExplorer::IDevice::ConstPtr &device, - const Utils::FileName &maddeRoot, const QList<MaemoMountSpecification> &mountSpecs, - QObject *parent = 0); - - MaemoRemoteMounter *mounter() const { return m_mounter; } - -private slots: - void handleMounted(); - void handleError(const QString &message); - -private: - void start(); - void stop(); - - void setFinished(bool success); - - MaemoRemoteMounter * const m_mounter; - bool m_isRunning; -}; - -class MaemoPostRunAction : public ProjectExplorer::DeviceApplicationHelperAction -{ - Q_OBJECT -public: - MaemoPostRunAction(MaemoRemoteMounter *mounter, QObject *parent = 0); - -private slots: - void handleUnmounted(); - void handleError(const QString &message); - -private: - void start(); - void stop(); - - void setFinished(bool success); - - MaemoRemoteMounter * const m_mounter; - bool m_isRunning; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOAPPLICATIONRUNNERHELPERACTIONS_H diff --git a/src/plugins/madde/maemoconstants.h b/src/plugins/madde/maemoconstants.h deleted file mode 100644 index 54208ec323..0000000000 --- a/src/plugins/madde/maemoconstants.h +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOCONSTANTS_H -#define MAEMOCONSTANTS_H - -#include <QLatin1String> - -namespace Madde { -namespace Internal { - -const char Maemo5OsType[] = "Maemo5OsType"; -const char HarmattanOsType[] = "HarmattanOsType"; - -#define PREFIX "Qt4ProjectManager.MaemoRunConfiguration" - -static const char MAEMO_RC_ID_PREFIX[] = PREFIX ":"; - -static const QLatin1String LastDeployedHostsKey(PREFIX ".LastDeployedHosts"); -static const QLatin1String LastDeployedFilesKey(PREFIX ".LastDeployedFiles"); -static const QLatin1String LastDeployedRemotePathsKey(PREFIX ".LastDeployedRemotePaths"); -static const QLatin1String LastDeployedTimesKey(PREFIX ".LastDeployedTimes"); -static const QLatin1String ExportedLocalDirsKey(PREFIX ".ExportedLocalDirs"); -static const QLatin1String RemoteMountPointsKey(PREFIX ".RemoteMountPoints"); - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOCONSTANTS_H diff --git a/src/plugins/madde/maemodeploybymountsteps.cpp b/src/plugins/madde/maemodeploybymountsteps.cpp deleted file mode 100644 index b0089ff746..0000000000 --- a/src/plugins/madde/maemodeploybymountsteps.cpp +++ /dev/null @@ -1,465 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maemodeploybymountsteps.h" - -#include "maemodeploymentmounter.h" -#include "maemoglobal.h" -#include "maemomountspecification.h" -#include "maemopackagecreationstep.h" -#include "maemopackageinstaller.h" -#include "maemoqemumanager.h" -#include "maemoremotecopyfacility.h" -#include "qt4maemodeployconfiguration.h" - -#include <projectexplorer/deploymentdata.h> -#include <projectexplorer/project.h> -#include <projectexplorer/target.h> -#include <qt4projectmanager/qt4buildconfiguration.h> -#include <remotelinux/abstractremotelinuxdeployservice.h> -#include <remotelinux/linuxdevice.h> -#include <utils/hostosinfo.h> -#include <utils/qtcassert.h> -#include <ssh/sshconnection.h> - -#include <QFileInfo> -#include <QList> - -using namespace ProjectExplorer; -using namespace RemoteLinux; - -namespace Madde { -namespace Internal { -class AbstractMaemoDeployByMountService : public AbstractRemoteLinuxDeployService -{ - Q_OBJECT - Q_DISABLE_COPY(AbstractMaemoDeployByMountService) -protected: - AbstractMaemoDeployByMountService(QObject *parent); - - QString deployMountPoint() const; - -private slots: - void handleMounted(); - void handleUnmounted(); - void handleMountError(const QString &errorMsg); - void handleInstallationFinished(const QString &errorMsg); - -private: - virtual QList<MaemoMountSpecification> mountSpecifications() const=0; - virtual void doInstall() = 0; - virtual void cancelInstallation() = 0; - virtual void handleInstallationSuccess() = 0; - - void doDeviceSetup(); - void stopDeviceSetup(); - void doDeploy(); - void stopDeployment(); - - void unmount(); - void setFinished(); - - MaemoDeploymentMounter * const m_mounter; - enum State { Inactive, Mounting, Installing, Unmounting } m_state; - bool m_stopRequested; -}; - -class MaemoMountAndInstallPackageService : public AbstractMaemoDeployByMountService -{ - Q_OBJECT - -public: - MaemoMountAndInstallPackageService(QObject *parent); - - void setPackageFilePath(const QString &filePath) { m_packageFilePath = filePath; } - -private: - bool isDeploymentNecessary() const; - - QList<MaemoMountSpecification> mountSpecifications() const; - void doInstall(); - void cancelInstallation(); - void handleInstallationSuccess(); - - MaemoDebianPackageInstaller * const m_installer; - QString m_packageFilePath; -}; - -class MaemoMountAndCopyFilesService : public AbstractMaemoDeployByMountService -{ - Q_OBJECT - -public: - MaemoMountAndCopyFilesService(QObject *parent); - - void setDeployableFiles(const QList<DeployableFile> &deployableFiles) { - m_deployableFiles = deployableFiles; - } - -private: - bool isDeploymentNecessary() const; - - QList<MaemoMountSpecification> mountSpecifications() const; - void doInstall(); - void cancelInstallation(); - void handleInstallationSuccess(); - - Q_SLOT void handleFileCopied(const ProjectExplorer::DeployableFile &deployable); - - MaemoRemoteCopyFacility * const m_copyFacility; - mutable QList<DeployableFile> m_filesToCopy; - QList<DeployableFile> m_deployableFiles; -}; - - -AbstractMaemoDeployByMountService::AbstractMaemoDeployByMountService(QObject *parent) - : AbstractRemoteLinuxDeployService(parent), - m_mounter(new MaemoDeploymentMounter(this)), - m_state(Inactive), - m_stopRequested(false) -{ - connect(m_mounter, SIGNAL(setupDone()), SLOT(handleMounted())); - connect(m_mounter, SIGNAL(tearDownDone()), SLOT(handleUnmounted())); - connect(m_mounter, SIGNAL(error(QString)), SLOT(handleMountError(QString))); - connect(m_mounter, SIGNAL(reportProgress(QString)), SIGNAL(progressMessage(QString))); - connect(m_mounter, SIGNAL(debugOutput(QString)), SIGNAL(stdErrData(QString))); -} - -void AbstractMaemoDeployByMountService::doDeviceSetup() -{ - QTC_ASSERT(m_state == Inactive, return); - - handleDeviceSetupDone(true); -} - -void AbstractMaemoDeployByMountService::stopDeviceSetup() -{ - QTC_ASSERT(m_state == Inactive, return); - - handleDeviceSetupDone(false); -} - -void AbstractMaemoDeployByMountService::doDeploy() -{ - QTC_ASSERT(m_state == Inactive, return); - - if (!target()) { - emit errorMessage(tr("Missing target.")); - setFinished(); - return; - } - - m_state = Mounting; - m_mounter->setupMounts(connection(), mountSpecifications(), profile()); -} - -void AbstractMaemoDeployByMountService::stopDeployment() -{ - switch (m_state) { - case Installing: - m_stopRequested = true; - cancelInstallation(); - - // TODO: Possibly unsafe, because the mount point may still be in use if the - // application did not exit immediately. - unmount(); - break; - case Mounting: - case Unmounting: - m_stopRequested = true; - break; - case Inactive: - qWarning("%s: Unexpected state 'Inactive'.", Q_FUNC_INFO); - break; - } -} - -void AbstractMaemoDeployByMountService::unmount() -{ - m_state = Unmounting; - m_mounter->tearDownMounts(); -} - -void AbstractMaemoDeployByMountService::handleMounted() -{ - QTC_ASSERT(m_state == Mounting, return); - - if (m_stopRequested) { - unmount(); - return; - } - - m_state = Installing; - doInstall(); -} - -void AbstractMaemoDeployByMountService::handleUnmounted() -{ - QTC_ASSERT(m_state == Unmounting, return); - - setFinished(); -} - -void AbstractMaemoDeployByMountService::handleMountError(const QString &errorMsg) -{ - QTC_ASSERT(m_state == Mounting, return); - - emit errorMessage(errorMsg); - setFinished(); -} - -void AbstractMaemoDeployByMountService::handleInstallationFinished(const QString &errorMsg) -{ - QTC_ASSERT(m_state == Installing, return); - - if (errorMsg.isEmpty()) - handleInstallationSuccess(); - else - emit errorMessage(errorMsg); - unmount(); -} - -void AbstractMaemoDeployByMountService::setFinished() -{ - m_state = Inactive; - m_stopRequested = false; - handleDeploymentDone(); -} - -QString AbstractMaemoDeployByMountService::deployMountPoint() const -{ - return MaemoGlobal::homeDirOnDevice(deviceConfiguration()->sshParameters().userName) - + QLatin1String("/deployMountPoint_") - + target()->project()->displayName(); -} - - -MaemoMountAndInstallPackageService::MaemoMountAndInstallPackageService(QObject *parent) - : AbstractMaemoDeployByMountService(parent), m_installer(new MaemoDebianPackageInstaller(this)) -{ - connect(m_installer, SIGNAL(stdoutData(QString)), SIGNAL(stdOutData(QString))); - connect(m_installer, SIGNAL(stderrData(QString)), SIGNAL(stdErrData(QString))); - connect(m_installer, SIGNAL(finished(QString)), SLOT(handleInstallationFinished(QString))); -} - -bool MaemoMountAndInstallPackageService::isDeploymentNecessary() const -{ - return hasChangedSinceLastDeployment(DeployableFile(m_packageFilePath, QString())); -} - -QList<MaemoMountSpecification> MaemoMountAndInstallPackageService::mountSpecifications() const -{ - const QString localDir = QFileInfo(m_packageFilePath).absolutePath(); - return QList<MaemoMountSpecification>() - << MaemoMountSpecification(localDir, deployMountPoint()); -} - -void MaemoMountAndInstallPackageService::doInstall() -{ - const QString remoteFilePath = deployMountPoint() + QLatin1Char('/') - + QFileInfo(m_packageFilePath).fileName(); - m_installer->installPackage(deviceConfiguration(), remoteFilePath, false); -} - -void MaemoMountAndInstallPackageService::cancelInstallation() -{ - m_installer->cancelInstallation(); -} - -void MaemoMountAndInstallPackageService::handleInstallationSuccess() -{ - saveDeploymentTimeStamp(DeployableFile(m_packageFilePath, QString())); - emit progressMessage(tr("Package installed.")); -} - - -MaemoMountAndCopyFilesService::MaemoMountAndCopyFilesService(QObject *parent) - : AbstractMaemoDeployByMountService(parent), m_copyFacility(new MaemoRemoteCopyFacility(this)) -{ - connect(m_copyFacility, SIGNAL(stdoutData(QString)), SIGNAL(stdOutData(QString))); - connect(m_copyFacility, SIGNAL(stderrData(QString)), SIGNAL(stdErrData(QString))); - connect(m_copyFacility, SIGNAL(progress(QString)), SIGNAL(progressMessage(QString))); - connect(m_copyFacility, SIGNAL(fileCopied(ProjectExplorer::DeployableFile)), - SLOT(handleFileCopied(ProjectExplorer::DeployableFile))); - connect(m_copyFacility, SIGNAL(finished(QString)), SLOT(handleInstallationFinished(QString))); -} - -bool MaemoMountAndCopyFilesService::isDeploymentNecessary() const -{ - m_filesToCopy.clear(); - for (int i = 0; i < m_deployableFiles.count(); ++i) { - const DeployableFile &d = m_deployableFiles.at(i); - if (hasChangedSinceLastDeployment(d) || d.localFilePath().toFileInfo().isDir()) - m_filesToCopy << d; - } - return !m_filesToCopy.isEmpty(); -} - -QList<MaemoMountSpecification> MaemoMountAndCopyFilesService::mountSpecifications() const -{ - QList<MaemoMountSpecification> mountSpecs; - if (Utils::HostOsInfo::isWindowsHost()) { - bool drivesToMount[26]; - qFill(drivesToMount, drivesToMount + sizeof drivesToMount / sizeof drivesToMount[0], false); - for (int i = 0; i < m_filesToCopy.count(); ++i) { - const QString localDir - = m_filesToCopy.at(i).localFilePath().toFileInfo().canonicalPath(); - const char driveLetter = localDir.at(0).toLower().toLatin1(); - if (driveLetter < 'a' || driveLetter > 'z') { - qWarning("Weird: drive letter is '%c'.", driveLetter); - continue; - } - - const int index = driveLetter - 'a'; - if (drivesToMount[index]) - continue; - - const QString mountPoint = deployMountPoint() + QLatin1Char('/') - + QLatin1Char(driveLetter); - const MaemoMountSpecification mountSpec(localDir.left(3), mountPoint); - mountSpecs << mountSpec; - drivesToMount[index] = true; - } - } else { - mountSpecs << MaemoMountSpecification(QLatin1String("/"), deployMountPoint()); - } - return mountSpecs; -} - -void MaemoMountAndCopyFilesService::doInstall() -{ - m_copyFacility->copyFiles(deviceConfiguration(), m_filesToCopy, deployMountPoint()); -} - -void MaemoMountAndCopyFilesService::cancelInstallation() -{ - m_copyFacility->cancel(); -} - -void MaemoMountAndCopyFilesService::handleInstallationSuccess() -{ - emit progressMessage(tr("All files copied.")); -} - -void MaemoMountAndCopyFilesService::handleFileCopied(const DeployableFile &deployable) -{ - saveDeploymentTimeStamp(deployable); -} - -MaemoInstallPackageViaMountStep::MaemoInstallPackageViaMountStep(BuildStepList *bsl) - : AbstractRemoteLinuxDeployStep(bsl, stepId()) -{ - ctor(); -} - -MaemoInstallPackageViaMountStep::MaemoInstallPackageViaMountStep(BuildStepList *bsl, - MaemoInstallPackageViaMountStep *other) - : AbstractRemoteLinuxDeployStep(bsl, other) -{ - ctor(); -} - -void MaemoInstallPackageViaMountStep::ctor() -{ - m_deployService = new MaemoMountAndInstallPackageService(this); - setDefaultDisplayName(displayName()); -} - -AbstractRemoteLinuxDeployService *MaemoInstallPackageViaMountStep::deployService() const -{ - return m_deployService; -} - -bool MaemoInstallPackageViaMountStep::initInternal(QString *error) -{ - const AbstractMaemoPackageCreationStep * const pStep - = deployConfiguration()->earlierBuildStep<MaemoDebianPackageCreationStep>(this); - if (!pStep) { - if (error) - *error = tr("No Debian package creation step found."); - return false; - } - m_deployService->setPackageFilePath(pStep->packageFilePath()); - return deployService()->isDeploymentPossible(error); -} - -Core::Id MaemoInstallPackageViaMountStep::stepId() -{ - return "MaemoMountAndInstallDeployStep"; -} - -QString MaemoInstallPackageViaMountStep::displayName() -{ - return tr("Deploy package via UTFS mount"); -} - - -MaemoCopyFilesViaMountStep::MaemoCopyFilesViaMountStep(BuildStepList *bsl) - : AbstractRemoteLinuxDeployStep(bsl, stepId()) -{ - ctor(); -} - -MaemoCopyFilesViaMountStep::MaemoCopyFilesViaMountStep(BuildStepList *bsl, - MaemoCopyFilesViaMountStep *other) - : AbstractRemoteLinuxDeployStep(bsl, other) -{ - ctor(); -} - -void MaemoCopyFilesViaMountStep::ctor() -{ - m_deployService = new MaemoMountAndCopyFilesService(this); - setDefaultDisplayName(displayName()); -} - -AbstractRemoteLinuxDeployService *MaemoCopyFilesViaMountStep::deployService() const -{ - return m_deployService; -} - -bool MaemoCopyFilesViaMountStep::initInternal(QString *error) -{ - m_deployService->setDeployableFiles(target()->deploymentData().allFiles()); - return deployService()->isDeploymentPossible(error); -} - -Core::Id MaemoCopyFilesViaMountStep::stepId() -{ - return "MaemoMountAndCopyDeployStep"; -} - -QString MaemoCopyFilesViaMountStep::displayName() -{ - return tr("Deploy files via UTFS mount"); -} - -} // namespace Internal -} // namespace Madde - -#include "maemodeploybymountsteps.moc" diff --git a/src/plugins/madde/maemodeploybymountsteps.h b/src/plugins/madde/maemodeploybymountsteps.h deleted file mode 100644 index 78091d4f60..0000000000 --- a/src/plugins/madde/maemodeploybymountsteps.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#ifndef MAEMODEPLOYBYMOUNTSTEPS_H -#define MAEMODEPLOYBYMOUNTSTEPS_H - -#include <remotelinux/abstractremotelinuxdeploystep.h> - -namespace Madde { -namespace Internal { -class MaemoMountAndInstallPackageService; -class MaemoMountAndCopyFilesService; - -class MaemoInstallPackageViaMountStep : public RemoteLinux::AbstractRemoteLinuxDeployStep -{ - Q_OBJECT - -public: - MaemoInstallPackageViaMountStep(ProjectExplorer::BuildStepList *bsl); - MaemoInstallPackageViaMountStep(ProjectExplorer::BuildStepList *bsl, - MaemoInstallPackageViaMountStep *other); - - bool initInternal(QString *error = 0); - - static Core::Id stepId(); - static QString displayName(); - -private: - RemoteLinux::AbstractRemoteLinuxDeployService *deployService() const; - - void ctor(); - - MaemoMountAndInstallPackageService *m_deployService; -}; - - -class MaemoCopyFilesViaMountStep : public RemoteLinux::AbstractRemoteLinuxDeployStep -{ - Q_OBJECT - -public: - MaemoCopyFilesViaMountStep(ProjectExplorer::BuildStepList *bsl); - MaemoCopyFilesViaMountStep(ProjectExplorer::BuildStepList *bsl, - MaemoCopyFilesViaMountStep *other); - - bool initInternal(QString *error = 0); - - static Core::Id stepId(); - static QString displayName(); - -private: - RemoteLinux::AbstractRemoteLinuxDeployService *deployService() const; - - void ctor(); - - MaemoMountAndCopyFilesService *m_deployService; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMODEPLOYBYMOUNTSTEPS_H diff --git a/src/plugins/madde/maemodeploymentmounter.cpp b/src/plugins/madde/maemodeploymentmounter.cpp deleted file mode 100644 index 0062dc55ff..0000000000 --- a/src/plugins/madde/maemodeploymentmounter.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemodeploymentmounter.h" - -#include "maemoglobal.h" -#include "maemoremotemounter.h" - -#include <projectexplorer/target.h> -#include <projectexplorer/kitinformation.h> -#include <projectexplorer/devicesupport/deviceusedportsgatherer.h> -#include <utils/qtcassert.h> -#include <ssh/sshconnection.h> - -using namespace ProjectExplorer; -using namespace QSsh; - -namespace Madde { -namespace Internal { - -MaemoDeploymentMounter::MaemoDeploymentMounter(QObject *parent) - : QObject(parent), - m_state(Inactive), - m_mounter(new MaemoRemoteMounter(this)) -{ - connect(m_mounter, SIGNAL(error(QString)), SLOT(handleMountError(QString))); - connect(m_mounter, SIGNAL(mounted()), SLOT(handleMounted())); - connect(m_mounter, SIGNAL(unmounted()), SLOT(handleUnmounted())); - connect(m_mounter, SIGNAL(reportProgress(QString)), - SIGNAL(reportProgress(QString))); - connect(m_mounter, SIGNAL(debugOutput(QString)), - SIGNAL(debugOutput(QString))); -} - -MaemoDeploymentMounter::~MaemoDeploymentMounter() {} - -void MaemoDeploymentMounter::setupMounts(SshConnection *connection, - const QList<MaemoMountSpecification> &mountSpecs, - const Kit *k) -{ - QTC_ASSERT(m_state == Inactive, return); - - m_mountSpecs = mountSpecs; - m_connection = connection; - m_kit = k; - m_devConf = DeviceKitInformation::device(k); - m_mounter->setParameters(m_devConf, MaemoGlobal::maddeRoot(k)); - connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionError())); - setState(UnmountingOldDirs); - unmount(); -} - -void MaemoDeploymentMounter::tearDownMounts() -{ - QTC_ASSERT(m_state == Mounted, return); - - setState(UnmountingCurrentMounts); - unmount(); -} - -void MaemoDeploymentMounter::setupMounter() -{ - QTC_ASSERT(m_state == UnmountingOldDirs, return); - - setState(UnmountingCurrentDirs); - - m_mounter->resetMountSpecifications(); - foreach (const MaemoMountSpecification &mountSpec, m_mountSpecs) - m_mounter->addMountSpecification(mountSpec, true); - unmount(); -} - -void MaemoDeploymentMounter::unmount() -{ - QTC_ASSERT(m_state == UnmountingOldDirs || m_state == UnmountingCurrentDirs - || m_state == UnmountingCurrentMounts, return); - - if (m_mounter->hasValidMountSpecifications()) - m_mounter->unmount(); - else - handleUnmounted(); -} - -void MaemoDeploymentMounter::handleMounted() -{ - QTC_ASSERT(m_state == Mounting || m_state == Inactive, return); - - if (m_state == Inactive) - return; - - setState(Mounted); - emit setupDone(); -} - -void MaemoDeploymentMounter::handleUnmounted() -{ - QTC_ASSERT(m_state == UnmountingOldDirs || m_state == UnmountingCurrentDirs - || m_state == UnmountingCurrentMounts || m_state == Inactive, return); - - switch (m_state) { - case UnmountingOldDirs: - setupMounter(); - break; - case UnmountingCurrentDirs: - setState(Mounting); - m_mounter->mount(); - break; - case UnmountingCurrentMounts: - setState(Inactive); - emit tearDownDone(); - break; - case Inactive: - default: - break; - } -} - -void MaemoDeploymentMounter::handleMountError(const QString &errorMsg) -{ - QTC_ASSERT(m_state == UnmountingOldDirs || m_state == UnmountingCurrentDirs - || m_state == UnmountingCurrentMounts || m_state == Mounting || m_state == Mounted - || m_state == Inactive, return); - - if (m_state == Inactive) - return; - - setState(Inactive); - emit error(errorMsg); -} - -void MaemoDeploymentMounter::handleConnectionError() -{ - if (m_state == Inactive) - return; - - setState(Inactive); - emit error(tr("Connection failed: %1").arg(m_connection->errorString())); -} - -void MaemoDeploymentMounter::setState(State newState) -{ - if (m_state == newState) - return; - if (newState == Inactive && m_connection) { - disconnect(m_connection, 0, this, 0); - m_connection = 0; - } - m_state = newState; -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemodeploymentmounter.h b/src/plugins/madde/maemodeploymentmounter.h deleted file mode 100644 index 744e68fdd3..0000000000 --- a/src/plugins/madde/maemodeploymentmounter.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMODEPLOYMENTMOUNTER_H -#define MAEMODEPLOYMENTMOUNTER_H - -#include "maemomountspecification.h" - -#include <projectexplorer/devicesupport/idevice.h> -#include <utils/portlist.h> - -namespace ProjectExplorer { class Kit; } -namespace QSsh { class SshConnection; } -namespace Utils { class FileName; } - -namespace Madde { -namespace Internal { -class MaemoRemoteMounter; - -class MaemoDeploymentMounter : public QObject -{ - Q_OBJECT - -public: - explicit MaemoDeploymentMounter(QObject *parent = 0); - ~MaemoDeploymentMounter(); - - // Connection must be in connected state. - void setupMounts(QSsh::SshConnection *connection, - const QList<MaemoMountSpecification> &mountSpecs, - const ProjectExplorer::Kit *k); - void tearDownMounts(); - -signals: - void debugOutput(const QString &output); - void setupDone(); - void tearDownDone(); - void error(const QString &error); - void reportProgress(const QString &message); - -private slots: - void handleMounted(); - void handleUnmounted(); - void handleMountError(const QString &errorMsg); - void handleConnectionError(); - -private: - enum State { - Inactive, UnmountingOldDirs, UnmountingCurrentDirs, - Mounting, Mounted, UnmountingCurrentMounts - }; - - void unmount(); - void setupMounter(); - void setState(State newState); - - State m_state; - QSsh::SshConnection *m_connection; - ProjectExplorer::IDevice::ConstPtr m_devConf; - MaemoRemoteMounter * const m_mounter; - QList<MaemoMountSpecification> m_mountSpecs; - const ProjectExplorer::Kit *m_kit; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMODEPLOYMENTMOUNTER_H diff --git a/src/plugins/madde/maemodeploystepfactory.cpp b/src/plugins/madde/maemodeploystepfactory.cpp deleted file mode 100644 index 27ef1559e6..0000000000 --- a/src/plugins/madde/maemodeploystepfactory.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemodeploystepfactory.h" - -#include "maemoconstants.h" -#include "maddeqemustartstep.h" -#include "maddeuploadandinstallpackagesteps.h" -#include "maemodeploybymountsteps.h" -#include "maemoinstalltosysrootstep.h" -#include "qt4maemodeployconfiguration.h" - -#include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/buildsteplist.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/target.h> -#include <qtsupport/qtkitinformation.h> -#include <qtsupport/qtsupportconstants.h> -#include <remotelinux/genericdirectuploadstep.h> -#include <remotelinux/remotelinuxcheckforfreediskspacestep.h> -#include <remotelinux/uploadandinstalltarpackagestep.h> - -#include <QCoreApplication> - -using namespace ProjectExplorer; -using namespace RemoteLinux; - -namespace Madde { -namespace Internal { - -const char OldMaemoDeployStepId[] = "Qt4ProjectManager.MaemoDeployStep"; - -MaemoDeployStepFactory::MaemoDeployStepFactory(QObject *parent) - : IBuildStepFactory(parent) -{ -} - -QList<Core::Id> MaemoDeployStepFactory::availableCreationIds(BuildStepList *parent) const -{ - QList<Core::Id> ids; - if (!qobject_cast<Qt4MaemoDeployConfiguration *>(parent->parent())) - return ids; - - QString platform; - QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(parent->target()->kit()); - if (version) - platform = version->platformName(); - - if (platform == QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)) { - ids << MaemoMakeInstallToSysrootStep::Id - << MaemoInstallDebianPackageToSysrootStep::Id - << MaemoUploadAndInstallPackageStep::stepId() - << MaemoInstallPackageViaMountStep::stepId() - << MaemoCopyFilesViaMountStep::stepId() - << MaddeQemuStartStep::stepId(); - } else if (platform == QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM)) { - ids << MaemoMakeInstallToSysrootStep::Id - << MaemoInstallDebianPackageToSysrootStep::Id - << MaemoUploadAndInstallPackageStep::stepId() - << GenericDirectUploadStep::stepId() - << MaddeQemuStartStep::stepId(); - } - - return ids; -} - -QString MaemoDeployStepFactory::displayNameForId(const Core::Id id) const -{ - if (id == MaemoInstallPackageViaMountStep::stepId()) - return MaemoInstallPackageViaMountStep::displayName(); - if (id == MaemoCopyFilesViaMountStep::stepId()) - return MaemoCopyFilesViaMountStep::displayName(); - if (id == MaemoUploadAndInstallPackageStep::stepId()) - return MaemoUploadAndInstallPackageStep::displayName(); - if (id == MaemoInstallDebianPackageToSysrootStep::Id) - return MaemoInstallDebianPackageToSysrootStep::displayName(); - if (id == MaemoCopyToSysrootStep::Id) - return MaemoCopyToSysrootStep::displayName(); - if (id == MaemoMakeInstallToSysrootStep::Id) - return MaemoMakeInstallToSysrootStep::displayName(); - if (id == GenericDirectUploadStep::stepId()) - return GenericDirectUploadStep::displayName(); - if (id == RemoteLinuxCheckForFreeDiskSpaceStep::stepId()) - return RemoteLinuxCheckForFreeDiskSpaceStep::stepDisplayName(); - if (id == MaddeQemuStartStep::stepId()) - return MaddeQemuStartStep::stepDisplayName(); - return QString(); -} - -bool MaemoDeployStepFactory::canCreate(BuildStepList *parent, const Core::Id id) const -{ - return availableCreationIds(parent).contains(id) && !parent->contains(id); -} - -BuildStep *MaemoDeployStepFactory::create(BuildStepList *parent, const Core::Id id) -{ - Core::Id deviceType = DeviceTypeKitInformation::deviceTypeId(parent->target()->kit()); - - if (id == MaemoInstallDebianPackageToSysrootStep::Id) - return new MaemoInstallDebianPackageToSysrootStep(parent); - if (id == MaemoCopyToSysrootStep::Id) - return new MaemoCopyToSysrootStep(parent); - if (id == MaemoMakeInstallToSysrootStep::Id) - return new MaemoMakeInstallToSysrootStep(parent); - if (id == MaemoInstallPackageViaMountStep::stepId() - || (id == OldMaemoDeployStepId && deviceType == Maemo5OsType)) - return new MaemoInstallPackageViaMountStep(parent); - if (id == MaemoCopyFilesViaMountStep::stepId()) - return new MaemoCopyFilesViaMountStep(parent); - if (id == MaemoUploadAndInstallPackageStep::stepId() - || (id == OldMaemoDeployStepId && deviceType == HarmattanOsType)) - return new MaemoUploadAndInstallPackageStep(parent); - if (id == GenericDirectUploadStep::stepId()) - return new GenericDirectUploadStep(parent, id); - if (id == RemoteLinuxCheckForFreeDiskSpaceStep::stepId()) - return new RemoteLinuxCheckForFreeDiskSpaceStep(parent); - if (id == MaddeQemuStartStep::stepId()) - return new MaddeQemuStartStep(parent); - return 0; -} - -bool MaemoDeployStepFactory::canRestore(BuildStepList *parent, const QVariantMap &map) const -{ - return canCreate(parent, idFromMap(map)) || idFromMap(map) == OldMaemoDeployStepId; -} - -BuildStep *MaemoDeployStepFactory::restore(BuildStepList *parent, const QVariantMap &map) -{ - Q_ASSERT(canRestore(parent, map)); - BuildStep * const step = create(parent, idFromMap(map)); - if (!step->fromMap(map)) { - delete step; - return 0; - } - return step; -} - -bool MaemoDeployStepFactory::canClone(BuildStepList *parent, BuildStep *product) const -{ - return canCreate(parent, product->id()); -} - -BuildStep *MaemoDeployStepFactory::clone(BuildStepList *parent, BuildStep *product) -{ - Q_ASSERT(canClone(parent, product)); - if (product->id() == MaemoInstallPackageViaMountStep::stepId()) { - return new MaemoInstallPackageViaMountStep(parent, - qobject_cast<MaemoInstallPackageViaMountStep *>(product)); - } else if (product->id() == MaemoCopyFilesViaMountStep::stepId()) { - return new MaemoCopyFilesViaMountStep(parent, - qobject_cast<MaemoCopyFilesViaMountStep *>(product)); - } else if (product->id() == MaemoUploadAndInstallPackageStep::stepId()) { - return new MaemoUploadAndInstallPackageStep(parent, - qobject_cast<MaemoUploadAndInstallPackageStep*>(product)); - } else if (product->id() == MaemoInstallDebianPackageToSysrootStep::Id) { - return new MaemoInstallDebianPackageToSysrootStep(parent, - qobject_cast<MaemoInstallDebianPackageToSysrootStep *>(product)); - } else if (product->id() == MaemoCopyToSysrootStep::Id) { - return new MaemoCopyToSysrootStep(parent, - qobject_cast<MaemoCopyToSysrootStep *>(product)); - } else if (product->id() == MaemoMakeInstallToSysrootStep::Id) { - return new MaemoMakeInstallToSysrootStep(parent, - qobject_cast<MaemoMakeInstallToSysrootStep *>(product)); - } else if (product->id() == GenericDirectUploadStep::stepId()) { - return new GenericDirectUploadStep(parent, - qobject_cast<GenericDirectUploadStep *>(product)); - } else if (RemoteLinuxCheckForFreeDiskSpaceStep * const other = qobject_cast<RemoteLinuxCheckForFreeDiskSpaceStep *>(product)) { - return new RemoteLinuxCheckForFreeDiskSpaceStep(parent, other); - } else if (MaddeQemuStartStep * const other = qobject_cast<MaddeQemuStartStep *>(product)) { - return new MaddeQemuStartStep(parent, other); - } - - return 0; -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemodeploystepfactory.h b/src/plugins/madde/maemodeploystepfactory.h deleted file mode 100644 index a0beb306c9..0000000000 --- a/src/plugins/madde/maemodeploystepfactory.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMODEPLOYSTEPFACTORY_H -#define MAEMODEPLOYSTEPFACTORY_H - -#include <projectexplorer/buildstep.h> - -namespace Madde { -namespace Internal { - -class MaemoDeployStepFactory : public ProjectExplorer::IBuildStepFactory -{ -public: - MaemoDeployStepFactory(QObject *parent = 0); - - QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const; - 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); - - 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); -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMODEPLOYSTEPFACTORY_H diff --git a/src/plugins/madde/maemodeviceconfigwizard.cpp b/src/plugins/madde/maemodeviceconfigwizard.cpp deleted file mode 100644 index f3f8c311d9..0000000000 --- a/src/plugins/madde/maemodeviceconfigwizard.cpp +++ /dev/null @@ -1,627 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemodeviceconfigwizard.h" -#include "ui_maemodeviceconfigwizardkeycreationpage.h" -#include "ui_maemodeviceconfigwizardkeydeploymentpage.h" -#include "ui_maemodeviceconfigwizardpreviouskeysetupcheckpage.h" -#include "ui_maemodeviceconfigwizardreusekeyscheckpage.h" -#include "ui_maemodeviceconfigwizardstartpage.h" - -#include "maddedevice.h" -#include "maddedevicetester.h" -#include "maemoconstants.h" -#include "maemoglobal.h" - -#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h> -#include <remotelinux/sshkeydeployer.h> -#include <utils/fileutils.h> -#include <ssh/sshkeygenerator.h> - -#include <QDir> -#include <QFile> -#include <QButtonGroup> -#include <QDesktopServices> -#include <QMessageBox> -#include <QWizardPage> - -using namespace ProjectExplorer; -using namespace RemoteLinux; -using namespace QSsh; -using namespace Utils; - -namespace Madde { -namespace Internal { -namespace { - -QString defaultUser() -{ - return QLatin1String("developer"); -} - -QString defaultHost(IDevice::MachineType type) -{ - return QLatin1String(type == IDevice::Hardware ? "192.168.2.15" : "localhost"); -} - -struct WizardData -{ - QString configName; - QString hostName; - Core::Id deviceType; - SshConnectionParameters::AuthenticationType authType; - IDevice::MachineType machineType; - QString privateKeyFilePath; - QString publicKeyFilePath; - QString userName; - QString password; - int sshPort; -}; - -enum PageId { - StartPageId, PreviousKeySetupCheckPageId, ReuseKeysCheckPageId, KeyCreationPageId, - KeyDeploymentPageId, FinalPageId -}; - -class MaemoDeviceConfigWizardStartPage : public QWizardPage -{ - Q_OBJECT - -public: - explicit MaemoDeviceConfigWizardStartPage(QWidget *parent = 0) - : QWizardPage(parent), m_ui(new Ui::MaemoDeviceConfigWizardStartPage) - { - m_ui->setupUi(this); - setTitle(tr("General Information")); - setSubTitle(QLatin1String(" ")); // For Qt bug (background color) - - QButtonGroup *buttonGroup = new QButtonGroup(this); - buttonGroup->setExclusive(true); - buttonGroup->addButton(m_ui->hwButton); - buttonGroup->addButton(m_ui->emulatorButton); - connect(buttonGroup, SIGNAL(buttonClicked(int)), SLOT(handleMachineTypeChanged())); - - m_ui->nameLineEdit->setText(tr("MeeGo Device")); - m_ui->hwButton->setChecked(true); - handleMachineTypeChanged(); - m_ui->hostNameLineEdit->setText(defaultHost(machineType())); - m_ui->sshPortSpinBox->setMinimum(1); - m_ui->sshPortSpinBox->setMaximum(65535); - m_ui->sshPortSpinBox->setValue(22); - connect(m_ui->nameLineEdit, SIGNAL(textChanged(QString)), this, - SIGNAL(completeChanged())); - connect(m_ui->hostNameLineEdit, SIGNAL(textChanged(QString)), this, - SIGNAL(completeChanged())); - } - - void setDeviceType(Core::Id type) - { - m_deviceType = type; - m_ui->nameLineEdit->setText(tr("%1 Device").arg(MaddeDevice::maddeDisplayType(m_deviceType))); - } - - virtual bool isComplete() const - { - return !configName().isEmpty() && !hostName().isEmpty(); - } - - QString configName() const { return m_ui->nameLineEdit->text().trimmed(); } - - QString hostName() const - { - return machineType() == IDevice::Emulator - ? defaultHost(IDevice::Emulator) - : m_ui->hostNameLineEdit->text().trimmed(); - } - - Core::Id deviceType() const - { - return m_deviceType; - } - - IDevice::MachineType machineType() const - { - return m_ui->hwButton->isChecked() ? IDevice::Hardware : IDevice::Emulator; - } - - int sshPort() const - { - return machineType() == IDevice::Emulator ? 6666 : m_ui->sshPortSpinBox->value(); - } - -private slots: - void handleMachineTypeChanged() - { - const bool enable = machineType() == IDevice::Hardware; - m_ui->hostNameLabel->setEnabled(enable); - m_ui->hostNameLineEdit->setEnabled(enable); - m_ui->sshPortLabel->setEnabled(enable); - m_ui->sshPortSpinBox->setEnabled(enable); - } - -private: - const QScopedPointer<Ui::MaemoDeviceConfigWizardStartPage> m_ui; - Core::Id m_deviceType; -}; - -class MaemoDeviceConfigWizardPreviousKeySetupCheckPage : public QWizardPage -{ - Q_OBJECT -public: - MaemoDeviceConfigWizardPreviousKeySetupCheckPage(QWidget *parent) - : QWizardPage(parent), - m_ui(new Ui::MaemoDeviceConfigWizardCheckPreviousKeySetupPage) - { - m_ui->setupUi(this); - m_ui->privateKeyFilePathChooser->setExpectedKind(PathChooser::File); - setTitle(tr("Device Status Check")); - setSubTitle(QLatin1String(" ")); // For Qt bug (background color) - QButtonGroup * const buttonGroup = new QButtonGroup(this); - buttonGroup->setExclusive(true); - buttonGroup->addButton(m_ui->keyWasSetUpButton); - buttonGroup->addButton(m_ui->keyWasNotSetUpButton); - connect(buttonGroup, SIGNAL(buttonClicked(int)), - SLOT(handleSelectionChanged())); - connect(m_ui->privateKeyFilePathChooser, SIGNAL(changed(QString)), - this, SIGNAL(completeChanged())); - } - - virtual bool isComplete() const - { - return !keyBasedLoginWasSetup() - || m_ui->privateKeyFilePathChooser->isValid(); - } - - virtual void initializePage() - { - m_ui->keyWasNotSetUpButton->setChecked(true); - m_ui->privateKeyFilePathChooser->setPath(IDevice::defaultPrivateKeyFilePath()); - handleSelectionChanged(); - } - - bool keyBasedLoginWasSetup() const { - return m_ui->keyWasSetUpButton->isChecked(); - } - - QString privateKeyFilePath() const { - return m_ui->privateKeyFilePathChooser->path(); - } - -private: - Q_SLOT void handleSelectionChanged() - { - m_ui->privateKeyFilePathChooser->setEnabled(keyBasedLoginWasSetup()); - emit completeChanged(); - } - - const QScopedPointer<Ui::MaemoDeviceConfigWizardCheckPreviousKeySetupPage> m_ui; -}; - -class MaemoDeviceConfigWizardReuseKeysCheckPage : public QWizardPage -{ - Q_OBJECT -public: - MaemoDeviceConfigWizardReuseKeysCheckPage(QWidget *parent) - : QWizardPage(parent), - m_ui(new Ui::MaemoDeviceConfigWizardReuseKeysCheckPage) - { - m_ui->setupUi(this); - setTitle(tr("Existing Keys Check")); - setSubTitle(QLatin1String(" ")); // For Qt bug (background color) - m_ui->publicKeyFilePathChooser->setExpectedKind(PathChooser::File); - m_ui->privateKeyFilePathChooser->setExpectedKind(PathChooser::File); - QButtonGroup * const buttonGroup = new QButtonGroup(this); - buttonGroup->setExclusive(true); - buttonGroup->addButton(m_ui->reuseButton); - buttonGroup->addButton(m_ui->dontReuseButton); - connect(buttonGroup, SIGNAL(buttonClicked(int)), - SLOT(handleSelectionChanged())); - connect(m_ui->privateKeyFilePathChooser, SIGNAL(changed(QString)), - this, SIGNAL(completeChanged())); - connect(m_ui->publicKeyFilePathChooser, SIGNAL(changed(QString)), - this, SIGNAL(completeChanged())); - } - - virtual bool isComplete() const - { - return !reuseKeys() || (m_ui->publicKeyFilePathChooser->isValid() - && m_ui->privateKeyFilePathChooser->isValid()); - } - - virtual void initializePage() - { - m_ui->dontReuseButton->setChecked(true); - m_ui->privateKeyFilePathChooser->setPath(IDevice::defaultPrivateKeyFilePath()); - m_ui->publicKeyFilePathChooser->setPath(IDevice::defaultPublicKeyFilePath()); - handleSelectionChanged(); - } - - bool reuseKeys() const { return m_ui->reuseButton->isChecked(); } - - QString privateKeyFilePath() const { - return m_ui->privateKeyFilePathChooser->path(); - } - - QString publicKeyFilePath() const { - return m_ui->publicKeyFilePathChooser->path(); - } - -private: - Q_SLOT void handleSelectionChanged() - { - m_ui->privateKeyFilePathLabel->setEnabled(reuseKeys()); - m_ui->privateKeyFilePathChooser->setEnabled(reuseKeys()); - m_ui->publicKeyFilePathLabel->setEnabled(reuseKeys()); - m_ui->publicKeyFilePathChooser->setEnabled(reuseKeys()); - emit completeChanged(); - } - - const QScopedPointer<Ui::MaemoDeviceConfigWizardReuseKeysCheckPage> m_ui; -}; - -class MaemoDeviceConfigWizardKeyCreationPage : public QWizardPage -{ - Q_OBJECT -public: - MaemoDeviceConfigWizardKeyCreationPage(QWidget *parent) - : QWizardPage(parent), - m_ui(new Ui::MaemoDeviceConfigWizardKeyCreationPage) - { - m_ui->setupUi(this); - setTitle(tr("Key Creation")); - setSubTitle(QLatin1String(" ")); // For Qt bug (background color) - connect(m_ui->createKeysButton, SIGNAL(clicked()), SLOT(createKeys())); - } - - QString privateKeyFilePath() const { - return m_ui->keyDirPathChooser->path() + QLatin1String("/qtc_id_rsa"); - } - - QString publicKeyFilePath() const { - return privateKeyFilePath() + QLatin1String(".pub"); - } - - virtual void initializePage() - { - m_isComplete = false; - const QString &dir = QDesktopServices::storageLocation(QDesktopServices::HomeLocation) - + QLatin1String("/.ssh"); - m_ui->keyDirPathChooser->setPath(dir); - enableInput(); - } - - virtual bool isComplete() const { return m_isComplete; } - -private: - - Q_SLOT void createKeys() - { - const QString &dirPath = m_ui->keyDirPathChooser->path(); - QFileInfo fi(dirPath); - if (fi.exists() && !fi.isDir()) { - QMessageBox::critical(this, tr("Cannot Create Keys"), - tr("The path you have entered is not a directory.")); - return; - } - if (!fi.exists() && !QDir::root().mkpath(dirPath)) { - QMessageBox::critical(this, tr("Cannot Create Keys"), - tr("The directory you have entered does not exist and " - "cannot be created.")); - return; - } - - m_ui->keyDirPathChooser->setEnabled(false); - m_ui->createKeysButton->setEnabled(false); - m_ui->statusLabel->setText(tr("Creating keys...")); - SshKeyGenerator keyGenerator; - if (!keyGenerator.generateKeys(SshKeyGenerator::Rsa, - SshKeyGenerator::Mixed, 1024)) { - QMessageBox::critical(this, tr("Cannot Create Keys"), - tr("Key creation failed: %1").arg(keyGenerator.error())); - enableInput(); - return; - } - - if (!saveFile(privateKeyFilePath(), keyGenerator.privateKey()) - || !saveFile(publicKeyFilePath(), keyGenerator.publicKey())) { - enableInput(); - return; - } - QFile::setPermissions(privateKeyFilePath(), - QFile::ReadOwner | QFile::WriteOwner); - - m_ui->statusLabel->setText(m_ui->statusLabel->text() + tr("Done.")); - m_isComplete = true; - emit completeChanged(); - } - - bool saveFile(const QString &filePath, const QByteArray &data) - { - Utils::FileSaver saver(filePath); - saver.write(data); - if (!saver.finalize()) { - QMessageBox::critical(this, tr("Could Not Save Key File"), saver.errorString()); - return false; - } - return true; - } - - void enableInput() - { - m_ui->keyDirPathChooser->setEnabled(true); - m_ui->createKeysButton->setEnabled(true); - m_ui->statusLabel->clear(); - } - - const QScopedPointer<Ui::MaemoDeviceConfigWizardKeyCreationPage> m_ui; - bool m_isComplete; -}; - -class MaemoDeviceConfigWizardKeyDeploymentPage : public QWizardPage -{ - Q_OBJECT -public: - MaemoDeviceConfigWizardKeyDeploymentPage(const WizardData &wizardData, - QWidget *parent = 0) - : QWizardPage(parent), - m_ui(new Ui::MaemoDeviceConfigWizardKeyDeploymentPage), - m_wizardData(wizardData), - m_keyDeployer(new SshKeyDeployer(this)) - { - m_ui->setupUi(this); - m_instructionTextTemplate = m_ui->instructionLabel->text(); - setTitle(tr("Key Deployment")); - setSubTitle(QLatin1String(" ")); // For Qt bug (background color) - connect(m_ui->deviceAddressLineEdit, SIGNAL(textChanged(QString)), - SLOT(enableOrDisableButton())); - connect(m_ui->passwordLineEdit, SIGNAL(textChanged(QString)), - SLOT(enableOrDisableButton())); - connect(m_ui->deployButton, SIGNAL(clicked()), SLOT(deployKey())); - connect(m_keyDeployer, SIGNAL(error(QString)), - SLOT(handleKeyDeploymentError(QString))); - connect(m_keyDeployer, SIGNAL(finishedSuccessfully()), - SLOT(handleKeyDeploymentSuccess())); - } - - virtual void initializePage() - { - m_isComplete = false; - m_ui->deviceAddressLineEdit->setText(m_wizardData.hostName); - m_ui->instructionLabel->setText(QString(m_instructionTextTemplate) - .replace(QLatin1String("%%%maddev%%%"), - MaemoGlobal::madDeveloperUiName(m_wizardData.deviceType))); - m_ui->passwordLineEdit->clear(); - enableInput(); - } - - virtual bool isComplete() const { return m_isComplete; } - - QString hostAddress() const { - return m_ui->deviceAddressLineEdit->text().trimmed(); - } - -private: - Q_SLOT void enableOrDisableButton() - { - m_ui->deployButton->setEnabled(!hostAddress().isEmpty() - && !password().isEmpty()); - } - - Q_SLOT void deployKey() - { - using namespace QSsh; - m_ui->deviceAddressLineEdit->setEnabled(false); - m_ui->passwordLineEdit->setEnabled(false); - m_ui->deployButton->setEnabled(false); - SshConnectionParameters sshParams; - sshParams.authenticationType = SshConnectionParameters::AuthenticationTypePassword; - sshParams.host = hostAddress(); - sshParams.port = m_wizardData.sshPort; - sshParams.password = password(); - sshParams.timeout = 10; - sshParams.userName = defaultUser(); - m_ui->statusLabel->setText(tr("Deploying...")); - m_keyDeployer->deployPublicKey(sshParams, m_wizardData.publicKeyFilePath); - } - - Q_SLOT void handleKeyDeploymentError(const QString&errorMsg) - { - QMessageBox::critical(this, tr("Key Deployment Failure"), errorMsg); - enableInput(); - } - - Q_SLOT void handleKeyDeploymentSuccess() - { - QMessageBox::information(this, tr("Key Deployment Success"), - tr("The key was successfully deployed. You may now close " - "the \"%1\" application and continue.") - .arg(MaemoGlobal::madDeveloperUiName(m_wizardData.deviceType))); - m_ui->statusLabel->setText(m_ui->statusLabel->text() + tr("Done.")); - m_isComplete = true; - emit completeChanged(); - } - - void enableInput() - { - m_ui->deviceAddressLineEdit->setEnabled(true); - m_ui->passwordLineEdit->setEnabled(true); - m_ui->statusLabel->clear(); - enableOrDisableButton(); - } - - QString password() const { - return m_ui->passwordLineEdit->text().trimmed(); - } - - - const QScopedPointer<Ui::MaemoDeviceConfigWizardKeyDeploymentPage> m_ui; - bool m_isComplete; - const WizardData &m_wizardData; - SshKeyDeployer * const m_keyDeployer; - QString m_instructionTextTemplate; -}; - -class MaemoDeviceConfigWizardFinalPage : public GenericLinuxDeviceConfigurationWizardFinalPage -{ - Q_OBJECT -public: - MaemoDeviceConfigWizardFinalPage(const WizardData &wizardData, QWidget *parent) - : GenericLinuxDeviceConfigurationWizardFinalPage(parent), m_wizardData(wizardData) - { - } - -private: - QString infoText() const - { - if (m_wizardData.machineType == IDevice::Emulator) - return tr("The new device configuration will now be created."); - return GenericLinuxDeviceConfigurationWizardFinalPage::infoText(); - } - - const WizardData &m_wizardData; -}; - -} // anonymous namespace - -struct MaemoDeviceConfigWizardPrivate -{ - MaemoDeviceConfigWizardPrivate(QWidget *parent) - : startPage(parent), - previousKeySetupPage(parent), - reuseKeysCheckPage(parent), - keyCreationPage(parent), - keyDeploymentPage(wizardData, parent), - finalPage(wizardData, parent) - { - } - - WizardData wizardData; - MaemoDeviceConfigWizardStartPage startPage; - MaemoDeviceConfigWizardPreviousKeySetupCheckPage previousKeySetupPage; - MaemoDeviceConfigWizardReuseKeysCheckPage reuseKeysCheckPage; - MaemoDeviceConfigWizardKeyCreationPage keyCreationPage; - MaemoDeviceConfigWizardKeyDeploymentPage keyDeploymentPage; - MaemoDeviceConfigWizardFinalPage finalPage; -}; - - -MaemoDeviceConfigWizard::MaemoDeviceConfigWizard(Core::Id id, QWidget *parent) - : QWizard(parent), d(new MaemoDeviceConfigWizardPrivate(this)) -{ - setWindowTitle(tr("New Device Configuration Setup")); - setPage(StartPageId, &d->startPage); - d->startPage.setDeviceType(id); - setPage(PreviousKeySetupCheckPageId, &d->previousKeySetupPage); - setPage(ReuseKeysCheckPageId, &d->reuseKeysCheckPage); - setPage(KeyCreationPageId, &d->keyCreationPage); - setPage(KeyDeploymentPageId, &d->keyDeploymentPage); - setPage(FinalPageId, &d->finalPage); - d->finalPage.setCommitPage(true); -} - -MaemoDeviceConfigWizard::~MaemoDeviceConfigWizard() -{ - delete d; -} - -IDevice::Ptr MaemoDeviceConfigWizard::device() -{ - QString freePortsSpec; - QSsh::SshConnectionParameters sshParams; - sshParams.userName = defaultUser(); - sshParams.host = d->wizardData.hostName; - sshParams.port = d->wizardData.sshPort; - if (d->wizardData.machineType == IDevice::Emulator) { - sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationTypePassword; - sshParams.password.clear(); - sshParams.timeout = 30; - freePortsSpec = QLatin1String("13219,14168"); - } else { - sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationTypePublicKey; - sshParams.privateKeyFile = d->wizardData.privateKeyFilePath; - sshParams.timeout = 10; - freePortsSpec = QLatin1String("10000-10100"); - } - const MaddeDevice::Ptr device = MaddeDevice::create(d->wizardData.configName, - d->wizardData.deviceType, d->wizardData.machineType); - device->setFreePorts(PortList::fromString(freePortsSpec)); - device->setSshParameters(sshParams); - return device; -} - -int MaemoDeviceConfigWizard::nextId() const -{ - switch (currentId()) { - case StartPageId: - d->wizardData.configName = d->startPage.configName(); - d->wizardData.deviceType = d->startPage.deviceType(); - d->wizardData.machineType = d->startPage.machineType(); - d->wizardData.hostName = d->startPage.hostName(); - d->wizardData.sshPort = d->startPage.sshPort(); - if (d->wizardData.machineType == IDevice::Emulator) - return FinalPageId; - return PreviousKeySetupCheckPageId; - case PreviousKeySetupCheckPageId: - if (d->previousKeySetupPage.keyBasedLoginWasSetup()) { - d->wizardData.privateKeyFilePath - = d->previousKeySetupPage.privateKeyFilePath(); - return FinalPageId; - } else { - return ReuseKeysCheckPageId; - } - case ReuseKeysCheckPageId: - if (d->reuseKeysCheckPage.reuseKeys()) { - d->wizardData.privateKeyFilePath - = d->reuseKeysCheckPage.privateKeyFilePath(); - d->wizardData.publicKeyFilePath - = d->reuseKeysCheckPage.publicKeyFilePath(); - return KeyDeploymentPageId; - } else { - return KeyCreationPageId; - } - case KeyCreationPageId: - d->wizardData.privateKeyFilePath - = d->keyCreationPage.privateKeyFilePath(); - d->wizardData.publicKeyFilePath - = d->keyCreationPage.publicKeyFilePath(); - return KeyDeploymentPageId; - case KeyDeploymentPageId: - d->wizardData.hostName = d->keyDeploymentPage.hostAddress(); - return FinalPageId; - case FinalPageId: return -1; - default: - Q_ASSERT(false); - return -1; - } -} - -} // namespace Internal -} // namespace Madde - -#include "maemodeviceconfigwizard.moc" diff --git a/src/plugins/madde/maemodeviceconfigwizard.h b/src/plugins/madde/maemodeviceconfigwizard.h deleted file mode 100644 index 9a232fa716..0000000000 --- a/src/plugins/madde/maemodeviceconfigwizard.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMODEVICECONFIGWIZARD_H -#define MAEMODEVICECONFIGWIZARD_H - -#include <projectexplorer/devicesupport/idevice.h> - -#include <QWizard> - -namespace Madde { -namespace Internal { - -struct MaemoDeviceConfigWizardPrivate; - -class MaemoDeviceConfigWizard : public QWizard -{ - Q_OBJECT - -public: - explicit MaemoDeviceConfigWizard(Core::Id id, QWidget *parent = 0); - ~MaemoDeviceConfigWizard(); - - ProjectExplorer::IDevice::Ptr device(); - - virtual int nextId() const; - -private: - MaemoDeviceConfigWizardPrivate *d; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMODEVICECONFIGWIZARD_H diff --git a/src/plugins/madde/maemodeviceconfigwizardkeycreationpage.ui b/src/plugins/madde/maemodeviceconfigwizardkeycreationpage.ui deleted file mode 100644 index 3d968d8b3b..0000000000 --- a/src/plugins/madde/maemodeviceconfigwizardkeycreationpage.ui +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Madde::Internal::MaemoDeviceConfigWizardKeyCreationPage</class> - <widget class="QWizardPage" name="Madde::Internal::MaemoDeviceConfigWizardKeyCreationPage"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>447</width> - <height>115</height> - </rect> - </property> - <property name="windowTitle"> - <string>WizardPage</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QLabel" name="explanationLabel"> - <property name="text"> - <string>Qt Creator will now generate a new pair of keys. Please enter the directory to save the key files in and then press "Create Keys".</string> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLabel" name="directoryLabel"> - <property name="text"> - <string>Directory:</string> - </property> - </widget> - </item> - <item> - <widget class="Utils::PathChooser" name="keyDirPathChooser" native="true"/> - </item> - <item> - <widget class="QPushButton" name="createKeysButton"> - <property name="text"> - <string>Create Keys</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QLabel" name="statusLabel"> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</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> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/src/plugins/madde/maemodeviceconfigwizardkeydeploymentpage.ui b/src/plugins/madde/maemodeviceconfigwizardkeydeploymentpage.ui deleted file mode 100644 index 9bbc07258e..0000000000 --- a/src/plugins/madde/maemodeviceconfigwizardkeydeploymentpage.ui +++ /dev/null @@ -1,159 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Madde::Internal::MaemoDeviceConfigWizardKeyDeploymentPage</class> - <widget class="QWizardPage" name="Madde::Internal::MaemoDeviceConfigWizardKeyDeploymentPage"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>470</width> - <height>322</height> - </rect> - </property> - <property name="windowTitle"> - <string>WizardPage</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QLabel" name="instructionLabel"> - <property name="text"> - <string>To deploy the public key to your device, please execute the following steps: -<ul> -<li>Connect the device to your computer (unless you plan to connect via WLAN).</li> -<li>On the device, start the "%%%maddev%%%" application.</li> -<li>In "%%%maddev%%%", configure the device's IP address to the one shown below (or edit the field below to match the address you have configured).</li> -<li>In "%%%maddev%%%", press "Developer Password" and enter it in the field below.</li> -<li>Click "Deploy Key"</li> -</string> - </property> - <property name="textFormat"> - <enum>Qt::RichText</enum> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QFormLayout" name="formLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="DeviceAddressLabel"> - <property name="text"> - <string>Device address:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLineEdit" name="deviceAddressLineEdit"/> - </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="passwordLabel"> - <property name="text"> - <string>Password:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QLineEdit" name="passwordLineEdit"/> - </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> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QPushButton" name="deployButton"> - <property name="text"> - <string>Deploy Key</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="statusLabel"> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_3"> - <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>20</width> - <height>0</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/src/plugins/madde/maemodeviceconfigwizardpreviouskeysetupcheckpage.ui b/src/plugins/madde/maemodeviceconfigwizardpreviouskeysetupcheckpage.ui deleted file mode 100644 index 23f0d1a2d6..0000000000 --- a/src/plugins/madde/maemodeviceconfigwizardpreviouskeysetupcheckpage.ui +++ /dev/null @@ -1,101 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Madde::Internal::MaemoDeviceConfigWizardCheckPreviousKeySetupPage</class> - <widget class="QWizardPage" name="Madde::Internal::MaemoDeviceConfigWizardCheckPreviousKeySetupPage"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>621</width> - <height>121</height> - </rect> - </property> - <property name="windowTitle"> - <string>WizardPage</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QLabel" name="questionLabel"> - <property name="text"> - <string>Has a passwordless (key-based) login already been set up for this device?</string> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QRadioButton" name="keyWasSetUpButton"> - <property name="text"> - <string>Yes, and the private key is located at</string> - </property> - </widget> - </item> - <item> - <widget class="Utils::PathChooser" name="privateKeyFilePathChooser" native="true"/> - </item> - </layout> - </item> - <item> - <widget class="QRadioButton" name="keyWasNotSetUpButton"> - <property name="text"> - <string>No</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>44</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> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/src/plugins/madde/maemodeviceconfigwizardreusekeyscheckpage.ui b/src/plugins/madde/maemodeviceconfigwizardreusekeyscheckpage.ui deleted file mode 100644 index f0a2681f89..0000000000 --- a/src/plugins/madde/maemodeviceconfigwizardreusekeyscheckpage.ui +++ /dev/null @@ -1,138 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Madde::Internal::MaemoDeviceConfigWizardReuseKeysCheckPage</class> - <widget class="QWizardPage" name="Madde::Internal::MaemoDeviceConfigWizardReuseKeysCheckPage"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>574</width> - <height>185</height> - </rect> - </property> - <property name="windowTitle"> - <string>WizardPage</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QLabel" name="questionLabel"> - <property name="text"> - <string>Do you want to re-use an existing pair of keys or should a new one be created?</string> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QRadioButton" name="reuseButton"> - <property name="text"> - <string>Re-use existing keys</string> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QFormLayout" name="formLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="publicKeyFilePathLabel"> - <property name="text"> - <string>File containing the public key:</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="privateKeyFilePathLabel"> - <property name="text"> - <string>File containing the private key:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="Utils::PathChooser" name="publicKeyFilePathChooser" native="true"/> - </item> - <item row="1" column="1"> - <widget class="Utils::PathChooser" name="privateKeyFilePathChooser" native="true"/> - </item> - </layout> - </item> - </layout> - </item> - <item> - <widget class="QRadioButton" name="dontReuseButton"> - <property name="text"> - <string>Create new keys</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</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> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/src/plugins/madde/maemodeviceconfigwizardstartpage.ui b/src/plugins/madde/maemodeviceconfigwizardstartpage.ui deleted file mode 100644 index 370fc5baea..0000000000 --- a/src/plugins/madde/maemodeviceconfigwizardstartpage.ui +++ /dev/null @@ -1,109 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Madde::Internal::MaemoDeviceConfigWizardStartPage</class> - <widget class="QWizardPage" name="Madde::Internal::MaemoDeviceConfigWizardStartPage"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>721</width> - <height>136</height> - </rect> - </property> - <property name="windowTitle"> - <string>WizardPage</string> - </property> - <layout class="QFormLayout" name="formLayout"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::AllNonFixedFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="nameLabel"> - <property name="text"> - <string>The name to identify this configuration:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="nameLineEdit"/> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="typeLabel"> - <property name="text"> - <string>The kind of device:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QRadioButton" name="emulatorButton"> - <property name="text"> - <string>Emulator</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="hwButton"> - <property name="text"> - <string>Hardware Device</string> - </property> - </widget> - </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"> - <widget class="QLabel" name="hostNameLabel"> - <property name="text"> - <string>The device's host name or IP address:</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="hostNameLineEdit"/> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="sshPortLabel"> - <property name="text"> - <string>The SSH server port:</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QSpinBox" name="sshPortSpinBox"/> - </item> - <item> - <spacer name="horizontalSpacer_3"> - <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> - </widget> - <resources/> - <connections/> -</ui> diff --git a/src/plugins/madde/maemoglobal.cpp b/src/plugins/madde/maemoglobal.cpp deleted file mode 100644 index ea748457a1..0000000000 --- a/src/plugins/madde/maemoglobal.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maemoglobal.h" - -#include "maemoconstants.h" -#include "maemoqemumanager.h" - -#include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitinformation.h> -#include <projectexplorer/target.h> -#include <qt4projectmanager/qt4projectmanagerconstants.h> -#include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> -#include <remotelinux/remotelinux_constants.h> -#include <utils/environment.h> -#include <utils/hostosinfo.h> - -#include <QDir> -#include <QFileInfo> -#include <QProcess> -#include <QString> -#include <QDesktopServices> - -using namespace ProjectExplorer; -using namespace Qt4ProjectManager; -using namespace Qt4ProjectManager::Constants; -using namespace RemoteLinux; -using namespace Utils; - -namespace Madde { -namespace Internal { -static const QString binQmake = QLatin1String("/bin/qmake" QTC_HOST_EXE_SUFFIX); - -bool MaemoGlobal::hasMaemoDevice(const Kit *k) -{ - IDevice::ConstPtr dev = DeviceKitInformation::device(k); - if (dev.isNull()) - return false; - - const Core::Id type = dev->type(); - return type == Maemo5OsType || type == HarmattanOsType; -} - -bool MaemoGlobal::supportsMaemoDevice(const Kit *k) -{ - const Core::Id type = DeviceTypeKitInformation::deviceTypeId(k); - return type == Maemo5OsType || type == HarmattanOsType; -} - -bool MaemoGlobal::isValidMaemo5QtVersion(const QString &qmakePath) -{ - return isValidMaemoQtVersion(qmakePath, Core::Id(Maemo5OsType)); -} - -bool MaemoGlobal::isValidHarmattanQtVersion(const QString &qmakePath) -{ - return isValidMaemoQtVersion(qmakePath, Core::Id(HarmattanOsType)); -} - -bool MaemoGlobal::isValidMaemoQtVersion(const QString &qmakePath, Core::Id deviceType) -{ - if (MaemoGlobal::deviceType(qmakePath) != deviceType) - return false; - QProcess madAdminProc; - const QStringList arguments(QLatin1String("list")); - if (!callMadAdmin(madAdminProc, arguments, qmakePath, false)) - return false; - if (!madAdminProc.waitForStarted() || !madAdminProc.waitForFinished()) - return false; - - madAdminProc.setReadChannel(QProcess::StandardOutput); - const QByteArray tgtName = targetName(qmakePath).toLatin1(); - while (madAdminProc.canReadLine()) { - const QByteArray &line = madAdminProc.readLine(); - if (line.contains(tgtName) - && (line.contains("(installed)") || line.contains("(default)"))) - return true; - } - return false; -} - - -QString MaemoGlobal::homeDirOnDevice(const QString &uname) -{ - return uname == QLatin1String("root") - ? QString::fromLatin1("/root") - : QLatin1String("/home/") + uname; -} - -QString MaemoGlobal::devrootshPath() -{ - return QLatin1String("/usr/lib/mad-developer/devrootsh"); -} - -int MaemoGlobal::applicationIconSize(const Target *target) -{ - Core::Id deviceType = DeviceTypeKitInformation::deviceTypeId(target->kit()); - return deviceType == HarmattanOsType ? 80 : 64; -} - -QString MaemoGlobal::remoteSudo(Core::Id deviceType, const QString &uname) -{ - if (uname == QLatin1String("root")) - return QString(); - if (deviceType == Maemo5OsType || deviceType == HarmattanOsType) - return devrootshPath(); - return QString(); // Using sudo would open a can of worms. -} - -QString MaemoGlobal::remoteSourceProfilesCommand() -{ - const QList<QByteArray> profiles = QList<QByteArray>() << "/etc/profile" - << "/home/user/.profile" << "~/.profile"; - QByteArray remoteCall(":"); - foreach (const QByteArray &profile, profiles) - remoteCall += "; test -f " + profile + " && source " + profile; - return QString::fromLatin1(remoteCall); -} - -PortList MaemoGlobal::freePorts(const Kit *k) -{ - IDevice::ConstPtr device = DeviceKitInformation::device(k); - QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(k); - - if (!device || !qtVersion) - return PortList(); - if (device->machineType() == IDevice::Emulator) { - MaemoQemuRuntime rt; - const int id = qtVersion->uniqueId(); - if (MaemoQemuManager::instance().runtimeForQtVersion(id, &rt)) - return rt.m_freePorts; - } - return device->freePorts(); -} - -QString MaemoGlobal::maddeRoot(const QString &qmakePath) -{ - QDir dir(targetRoot(qmakePath)); - dir.cdUp(); dir.cdUp(); - return dir.absolutePath(); -} - -FileName MaemoGlobal::maddeRoot(const Kit *k) -{ - return SysRootKitInformation::sysRoot(k).parentDir().parentDir(); -} - -QString MaemoGlobal::targetRoot(const QString &qmakePath) -{ - return QDir::cleanPath(qmakePath).remove(binQmake, HostOsInfo::fileNameCaseSensitivity()); -} - -QString MaemoGlobal::targetName(const QString &qmakePath) -{ - return QDir(targetRoot(qmakePath)).dirName(); -} - -QString MaemoGlobal::madAdminCommand(const QString &qmakePath) -{ - return maddeRoot(qmakePath) + QLatin1String("/bin/mad-admin"); -} - -QString MaemoGlobal::madCommand(const QString &qmakePath) -{ - return maddeRoot(qmakePath) + QLatin1String("/bin/mad"); -} - -QString MaemoGlobal::madDeveloperUiName(Core::Id deviceType) -{ - return deviceType == HarmattanOsType - ? tr("SDK Connectivity") : tr("Mad Developer"); -} - -Core::Id MaemoGlobal::deviceType(const QString &qmakePath) -{ - const QString &name = targetName(qmakePath); - if (name.startsWith(QLatin1String("fremantle"))) - return Core::Id(Maemo5OsType); - if (name.startsWith(QLatin1String("harmattan"))) - return Core::Id(HarmattanOsType); - return Core::Id(RemoteLinux::Constants::GenericLinuxOsType); -} - -QString MaemoGlobal::architecture(const QString &qmakePath) -{ - QProcess proc; - const QStringList args = QStringList() << QLatin1String("uname") - << QLatin1String("-m"); - if (!callMad(proc, args, qmakePath, true)) - return QString(); - if (!proc.waitForFinished()) - return QString(); - QString arch = QString::fromUtf8(proc.readAllStandardOutput()); - arch.chop(1); // Newline - return arch; -} - -void MaemoGlobal::addMaddeEnvironment(Environment &env, const QString &qmakePath) -{ - Environment maddeEnv; - if (HostOsInfo::isWindowsHost()) { - const QString root = maddeRoot(qmakePath); - env.prependOrSetPath(root + QLatin1String("/bin")); - env.prependOrSet(QLatin1String("HOME"), - QDesktopServices::storageLocation(QDesktopServices::HomeLocation)); - } - for (Environment::const_iterator it = maddeEnv.constBegin(); it != maddeEnv.constEnd(); ++it) - env.prependOrSet(it.key(), it.value()); -} - -void MaemoGlobal::transformMaddeCall(QString &command, QStringList &args, const QString &qmakePath) -{ - if (HostOsInfo::isWindowsHost()) { - const QString root = maddeRoot(qmakePath); - args.prepend(command); - command = root + QLatin1String("/bin/sh.exe"); - } -} - -bool MaemoGlobal::callMad(QProcess &proc, const QStringList &args, - const QString &qmakePath, bool useTarget) -{ - return callMaddeShellScript(proc, qmakePath, madCommand(qmakePath), args, - useTarget); -} - -bool MaemoGlobal::callMadAdmin(QProcess &proc, const QStringList &args, - const QString &qmakePath, bool useTarget) -{ - return callMaddeShellScript(proc, qmakePath, madAdminCommand(qmakePath), - args, useTarget); -} - -bool MaemoGlobal::callMaddeShellScript(QProcess &proc, - const QString &qmakePath, const QString &command, const QStringList &args, - bool useTarget) -{ - if (!QFileInfo(command).exists()) - return false; - QString actualCommand = command; - QStringList actualArgs = targetArgs(qmakePath, useTarget) + args; - Environment env(proc.systemEnvironment()); - addMaddeEnvironment(env, qmakePath); - proc.setEnvironment(env.toStringList()); - transformMaddeCall(actualCommand, actualArgs, qmakePath); - proc.start(actualCommand, actualArgs); - return true; -} - -QStringList MaemoGlobal::targetArgs(const QString &qmakePath, bool useTarget) -{ - QStringList args; - if (useTarget) - args << QLatin1String("-t") << targetName(qmakePath); - return args; -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemoglobal.h b/src/plugins/madde/maemoglobal.h deleted file mode 100644 index feaeb4b6a1..0000000000 --- a/src/plugins/madde/maemoglobal.h +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOGLOBAL_H -#define MAEMOGLOBAL_H - -#include <coreplugin/id.h> -#include <coreplugin/idocument.h> -#include <utils/fileutils.h> -#include <utils/portlist.h> -#include <utils/environment.h> - -#include <QCoreApplication> -#include <QSharedPointer> - -QT_BEGIN_NAMESPACE -class QProcess; -QT_END_NAMESPACE - -namespace ProjectExplorer { -class Kit; -class Target; -} // namespace ProjectExplorer - -namespace Madde { -namespace Internal { - -class WatchableFile : public Core::IDocument -{ - Q_OBJECT -public: - WatchableFile(const QString &fileName, QObject *parent = 0) - : Core::IDocument(parent) - { - setFilePath(fileName); - } - - bool save(QString *, const QString &, bool) { return false; } - QString defaultPath() const { return QString(); } - QString suggestedFileName() const { return QString(); } - QString mimeType() const { return QLatin1String("text/plain"); } - bool isModified() const { return false; } - bool isSaveAsAllowed() const { return false; } - ReloadBehavior reloadBehavior(ChangeTrigger, ChangeType) const { return BehaviorSilent; } - bool reload(QString *, ReloadFlag, ChangeType) { emit modified(); return true; } - -signals: - void modified(); -}; - -class MaemoGlobal -{ - Q_DECLARE_TR_FUNCTIONS(RemoteLinux::Internal::MaemoGlobal) -public: - static bool hasMaemoDevice(const ProjectExplorer::Kit *k); - static bool supportsMaemoDevice(const ProjectExplorer::Kit *k); - static bool isValidMaemo5QtVersion(const QString &qmakePath); - static bool isValidHarmattanQtVersion(const QString &qmakePath); - - static QString homeDirOnDevice(const QString &uname); - static QString devrootshPath(); - static int applicationIconSize(const ProjectExplorer::Target *target); - static QString remoteSudo(Core::Id deviceType, const QString &uname); - static QString remoteSourceProfilesCommand(); - static Utils::PortList freePorts(const ProjectExplorer::Kit *k); - - static void addMaddeEnvironment(Utils::Environment &env, const QString &qmakePath); - static void transformMaddeCall(QString &command, QStringList &args, const QString &qmakePath); - static QString maddeRoot(const QString &qmakePath); - static Utils::FileName maddeRoot(const ProjectExplorer::Kit *k); - static QString targetRoot(const QString &qmakePath); - static QString targetName(const QString &qmakePath); - static QString madCommand(const QString &qmakePath); - static QString madDeveloperUiName(Core::Id deviceType); - static Core::Id deviceType(const QString &qmakePath); - - // TODO: IS this still needed with Qt Version having an Abi? - static QString architecture(const QString &qmakePath); - - static bool callMad(QProcess &proc, const QStringList &args, - const QString &qmakePath, bool useTarget); - static bool callMadAdmin(QProcess &proc, const QStringList &args, - const QString &qmakePath, bool useTarget); - - static bool isValidMaemoQtVersion(const QString &qmakePath, Core::Id deviceType); -private: - static QString madAdminCommand(const QString &qmakePath); - static bool callMaddeShellScript(QProcess &proc, const QString &qmakePath, - const QString &command, const QStringList &args, bool useTarget); - static QStringList targetArgs(const QString &qmakePath, bool useTarget); -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOGLOBAL_H diff --git a/src/plugins/madde/maemoinstalltosysrootstep.cpp b/src/plugins/madde/maemoinstalltosysrootstep.cpp deleted file mode 100644 index 85daa541e7..0000000000 --- a/src/plugins/madde/maemoinstalltosysrootstep.cpp +++ /dev/null @@ -1,388 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemoinstalltosysrootstep.h" - -#include "maemoglobal.h" -#include "maemoconstants.h" -#include "maemopackagecreationstep.h" -#include "maemoqtversion.h" - -#include <projectexplorer/deploymentdata.h> -#include <projectexplorer/target.h> -#include <qt4projectmanager/qt4buildconfiguration.h> -#include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> -#include <remotelinux/remotelinuxdeployconfiguration.h> -#include <utils/fileutils.h> - -#include <QDir> -#include <QFileInfo> -#include <QLatin1Char> -#include <QPointer> -#include <QProcess> - -using namespace ProjectExplorer; -using namespace Qt4ProjectManager; -using namespace RemoteLinux; - -namespace Madde { -namespace Internal { - -class AbstractMaemoInstallPackageToSysrootWidget : public BuildStepConfigWidget -{ - Q_OBJECT -public: - AbstractMaemoInstallPackageToSysrootWidget(AbstractMaemoInstallPackageToSysrootStep *step) - : m_step(step) - { - BuildStepList * const list - = qobject_cast<BuildStepList *>(m_step->parent()); - connect(list, SIGNAL(stepInserted(int)), SIGNAL(updateSummary())); - connect(list, SIGNAL(stepMoved(int,int)), SIGNAL(updateSummary())); - connect(list, SIGNAL(aboutToRemoveStep(int)), SLOT(handleStepToBeRemoved(int))); - connect(list, SIGNAL(stepRemoved(int)), SIGNAL(updateSummary())); - } - - virtual QString summaryText() const - { - if (!m_step->deployConfiguration()->earlierBuildStep<AbstractMaemoPackageCreationStep>(m_step)) { - return QLatin1String("<font color=\"red\">") - + tr("Cannot deploy to sysroot: No packaging step found.") - + QLatin1String("</font>"); - } - return QLatin1String("<b>") + displayName() + QLatin1String("</b>"); - } - - virtual bool showWidget() const { return false; } - -private: - Q_SLOT void handleStepToBeRemoved(int step) - { - BuildStepList * const list - = qobject_cast<BuildStepList *>(m_step->parent()); - if (list->steps().at(step) == m_step) - disconnect(list, 0, this, 0); - } - - const AbstractMaemoInstallPackageToSysrootStep * const m_step; -}; - - -class MaemoInstallDebianPackageToSysrootWidget : public AbstractMaemoInstallPackageToSysrootWidget -{ - Q_OBJECT -public: - MaemoInstallDebianPackageToSysrootWidget(AbstractMaemoInstallPackageToSysrootStep *step) - : AbstractMaemoInstallPackageToSysrootWidget(step) {} - - virtual QString displayName() const { return MaemoInstallDebianPackageToSysrootStep::displayName(); } -}; - - -class MaemoCopyFilesToSysrootWidget : public BuildStepConfigWidget -{ - Q_OBJECT -public: - MaemoCopyFilesToSysrootWidget(BuildStep *buildStep) - : m_buildStep(buildStep) - { - if (m_buildStep) { - connect(m_buildStep.data(), SIGNAL(displayNameChanged()), - SIGNAL(updateSummary())); - } - } - virtual QString summaryText() const { - return QLatin1String("<b>") + displayName() + QLatin1String("</b>"); } - virtual QString displayName() const { - return m_buildStep ? m_buildStep.data()->displayName() : QString(); - } - virtual bool showWidget() const { return false; } -private: - const QPointer<BuildStep> m_buildStep; -}; - - -AbstractMaemoInstallPackageToSysrootStep::AbstractMaemoInstallPackageToSysrootStep(BuildStepList *bsl, - Core::Id id) - : BuildStep(bsl, id) -{ -} - -AbstractMaemoInstallPackageToSysrootStep::AbstractMaemoInstallPackageToSysrootStep(BuildStepList *bsl, - AbstractMaemoInstallPackageToSysrootStep *other) - : BuildStep(bsl, other) -{ -} - -RemoteLinuxDeployConfiguration *AbstractMaemoInstallPackageToSysrootStep::deployConfiguration() const -{ - return qobject_cast<RemoteLinuxDeployConfiguration *>(BuildStep::deployConfiguration()); -} - -bool AbstractMaemoInstallPackageToSysrootStep::init() -{ - const AbstractMaemoPackageCreationStep * const pStep - = deployConfiguration()->earlierBuildStep<AbstractMaemoPackageCreationStep>(this); - if (!pStep) { - addOutput(tr("Cannot install package to sysroot without packaging step."), - ErrorMessageOutput); - return false; - } - - QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit()); - if (!version) { - addOutput(tr("Cannot install package to sysroot without a Qt version."), - ErrorMessageOutput); - return false; - } - - m_qmakeCommand = version->qmakeCommand().toString(); - m_packageFilePath = pStep->packageFilePath(); - return true; -} - -void AbstractMaemoInstallPackageToSysrootStep::run(QFutureInterface<bool> &fi) -{ - m_installerProcess = new QProcess; - connect(m_installerProcess, SIGNAL(readyReadStandardOutput()), - SLOT(handleInstallerStdout())); - connect(m_installerProcess, SIGNAL(readyReadStandardError()), - SLOT(handleInstallerStderr())); - - emit addOutput(tr("Installing package to sysroot..."), MessageOutput); - const int packageFileSize = QFileInfo(m_packageFilePath).size() / (1024*1024); - const QStringList args = madArguments() << m_packageFilePath; - MaemoGlobal::callMadAdmin(*m_installerProcess, args, m_qmakeCommand, true); - if (!m_installerProcess->waitForFinished((2*packageFileSize + 10)*1000) - || m_installerProcess->exitStatus() != QProcess::NormalExit - || m_installerProcess->exitCode() != 0) { - emit addOutput(tr("Installation to sysroot failed, continuing anyway."), - ErrorMessageOutput); - if (m_installerProcess->state() != QProcess::NotRunning) { - m_installerProcess->terminate(); - m_installerProcess->waitForFinished(); - m_installerProcess->kill(); - } - fi.reportResult(true); - return; - } - - fi.reportResult(true); - m_installerProcess->deleteLater(); - m_installerProcess = 0; -} - -void AbstractMaemoInstallPackageToSysrootStep::handleInstallerStdout() -{ - if (m_installerProcess) - emit addOutput(QString::fromLocal8Bit(m_installerProcess->readAllStandardOutput()), NormalOutput); -} - -void AbstractMaemoInstallPackageToSysrootStep::handleInstallerStderr() -{ - if (m_installerProcess) - emit addOutput(QString::fromLocal8Bit(m_installerProcess->readAllStandardError()), ErrorOutput); -} - - -MaemoInstallDebianPackageToSysrootStep::MaemoInstallDebianPackageToSysrootStep(BuildStepList *bsl) - : AbstractMaemoInstallPackageToSysrootStep(bsl, Id) -{ - setDisplayName(displayName()); -} - -MaemoInstallDebianPackageToSysrootStep::MaemoInstallDebianPackageToSysrootStep(BuildStepList *bsl, - MaemoInstallDebianPackageToSysrootStep *other) - : AbstractMaemoInstallPackageToSysrootStep(bsl, other) -{ - setDisplayName(displayName()); -} - -BuildStepConfigWidget *MaemoInstallDebianPackageToSysrootStep::createConfigWidget() -{ - return new MaemoInstallDebianPackageToSysrootWidget(this); -} - -QStringList MaemoInstallDebianPackageToSysrootStep::madArguments() const -{ - QStringList args; - args << QLatin1String("xdpkg"); - Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit()); - if (deviceType == HarmattanOsType) - args << QLatin1String("--no-force-downgrade"); - args << QLatin1String("-i"); - return args; -} - -const Core::Id MaemoInstallDebianPackageToSysrootStep::Id - = "MaemoInstallDebianPackageToSysrootStep"; - -QString MaemoInstallDebianPackageToSysrootStep::displayName() -{ - return tr("Install Debian package to sysroot"); -} - -MaemoCopyToSysrootStep::MaemoCopyToSysrootStep(BuildStepList *bsl) - : BuildStep(bsl, Id) -{ - setDisplayName(displayName()); -} - -MaemoCopyToSysrootStep::MaemoCopyToSysrootStep(BuildStepList *bsl, - MaemoCopyToSysrootStep *other) - : BuildStep(bsl, other) -{ - setDisplayName(displayName()); -} - -bool MaemoCopyToSysrootStep::init() -{ - const BuildConfiguration * const bc = target()->activeBuildConfiguration(); - if (!bc) { - addOutput(tr("Cannot copy to sysroot without build configuration."), - ErrorMessageOutput); - return false; - } - - const MaemoQtVersion *const qtVersion - = dynamic_cast<MaemoQtVersion *>(QtSupport::QtKitInformation::qtVersion(target()->kit())); - if (!qtVersion) { - addOutput(tr("Cannot copy to sysroot without valid Qt version."), - ErrorMessageOutput); - return false; - } - m_systemRoot = ProjectExplorer::SysRootKitInformation::sysRoot(target()->kit()).toString(); - - m_files = target()->deploymentData().allFiles(); - - return true; -} - -void MaemoCopyToSysrootStep::run(QFutureInterface<bool> &fi) -{ - emit addOutput(tr("Copying files to sysroot..."), MessageOutput); - QDir sysrootDir(m_systemRoot); - - const QChar sep = QLatin1Char('/'); - foreach (const DeployableFile &deployable, m_files) { - const QFileInfo localFileInfo = deployable.localFilePath().toFileInfo(); - const QString targetFilePath = m_systemRoot + sep - + deployable.remoteDirectory() + sep + localFileInfo.fileName(); - sysrootDir.mkpath(deployable.remoteDirectory().mid(1)); - QString errorMsg; - Utils::FileUtils::removeRecursively(Utils::FileName::fromString(targetFilePath), &errorMsg); - if (!Utils::FileUtils::copyRecursively(deployable.localFilePath(), - Utils::FileName::fromString(targetFilePath), &errorMsg)) { - emit addOutput(tr("Sysroot installation failed: %1\n" - " Continuing anyway.").arg(errorMsg), ErrorMessageOutput); - } - if (fi.isCanceled()) { - fi.reportResult(false); - return; - } - } - fi.reportResult(true); -} - -BuildStepConfigWidget *MaemoCopyToSysrootStep::createConfigWidget() -{ - return new MaemoCopyFilesToSysrootWidget(this); -} - -const Core::Id MaemoCopyToSysrootStep::Id - = "MaemoCopyToSysrootStep"; -QString MaemoCopyToSysrootStep::displayName() -{ - return tr("Copy files to sysroot"); -} - -MaemoMakeInstallToSysrootStep::MaemoMakeInstallToSysrootStep(BuildStepList *bsl) - : AbstractProcessStep(bsl, Id) -{ - setDefaultDisplayName(displayName()); -} - -MaemoMakeInstallToSysrootStep::MaemoMakeInstallToSysrootStep(BuildStepList *bsl, - MaemoMakeInstallToSysrootStep *other) - : AbstractProcessStep(bsl, other) -{ - setDefaultDisplayName(displayName()); -} - -bool MaemoMakeInstallToSysrootStep::init() -{ - const Qt4BuildConfiguration * const bc - = qobject_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration()); - if (!bc) { - addOutput(tr("Cannot deploy: No active build configuration."), - ErrorMessageOutput); - return false; - } - const QtSupport::BaseQtVersion *const qtVersion - = QtSupport::QtKitInformation::qtVersion(target()->kit()); - if (!qtVersion) { - addOutput(tr("Cannot deploy: Unusable build configuration."), - ErrorMessageOutput); - return false; - - } - Utils::Environment env = bc->environment(); - MaemoGlobal::addMaddeEnvironment(env, qtVersion->qmakeCommand().toString()); - QString command = MaemoGlobal::madCommand(qtVersion->qmakeCommand().toString()); - QString systemRoot; - if (ProjectExplorer::SysRootKitInformation::hasSysRoot(target()->kit())) - systemRoot = ProjectExplorer::SysRootKitInformation::sysRoot(target()->kit()).toString(); - QStringList args = QStringList() << QLatin1String("-t") - << MaemoGlobal::targetName(qtVersion->qmakeCommand().toString()) << QLatin1String("make") - << QLatin1String("install") << (QLatin1String("INSTALL_ROOT=") + systemRoot); - MaemoGlobal::transformMaddeCall(command, args, qtVersion->qmakeCommand().toString()); - processParameters()->setCommand(command); - processParameters()->setArguments(args.join(QLatin1String(" "))); - processParameters()->setEnvironment(env); - processParameters()->setWorkingDirectory(bc->buildDirectory().toString()); - return true; -} - -BuildStepConfigWidget *MaemoMakeInstallToSysrootStep::createConfigWidget() -{ - return new MaemoCopyFilesToSysrootWidget(this); -} - -const Core::Id MaemoMakeInstallToSysrootStep::Id - = "MaemoMakeInstallToSysrootStep"; -QString MaemoMakeInstallToSysrootStep::displayName() -{ - return tr("Copy files to sysroot"); -} - -} // namespace Internal -} // namespace Madde - -#include "maemoinstalltosysrootstep.moc" diff --git a/src/plugins/madde/maemoinstalltosysrootstep.h b/src/plugins/madde/maemoinstalltosysrootstep.h deleted file mode 100644 index 1ab18e1dea..0000000000 --- a/src/plugins/madde/maemoinstalltosysrootstep.h +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOINSTALLTOSYSROOTSTEP_H -#define MAEMOINSTALLTOSYSROOTSTEP_H - -#include <projectexplorer/abstractprocessstep.h> -#include <projectexplorer/buildstep.h> -#include <projectexplorer/deployablefile.h> - -#include <QStringList> - -QT_FORWARD_DECLARE_CLASS(QProcess) - -namespace RemoteLinux { -class RemoteLinuxDeployConfiguration; -} - -namespace Madde { -namespace Internal { - -class AbstractMaemoInstallPackageToSysrootStep : public ProjectExplorer::BuildStep -{ - Q_OBJECT -public: - virtual bool init(); - virtual void run(QFutureInterface<bool> &fi); - - RemoteLinux::RemoteLinuxDeployConfiguration *deployConfiguration() const; - -protected: - AbstractMaemoInstallPackageToSysrootStep(ProjectExplorer::BuildStepList *bsl, - Core::Id id); - AbstractMaemoInstallPackageToSysrootStep(ProjectExplorer::BuildStepList *bsl, - AbstractMaemoInstallPackageToSysrootStep *other); - -private slots: - void handleInstallerStdout(); - void handleInstallerStderr(); - -private: - virtual QStringList madArguments() const = 0; - - QProcess *m_installerProcess; - QString m_qmakeCommand; - QString m_packageFilePath; -}; - -class MaemoInstallDebianPackageToSysrootStep : public AbstractMaemoInstallPackageToSysrootStep -{ - Q_OBJECT -public: - explicit MaemoInstallDebianPackageToSysrootStep(ProjectExplorer::BuildStepList *bsl); - MaemoInstallDebianPackageToSysrootStep(ProjectExplorer::BuildStepList *bsl, - MaemoInstallDebianPackageToSysrootStep *other); - - virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); - - static const Core::Id Id; - static QString displayName(); -private: - virtual QStringList madArguments() const; -}; - -class MaemoCopyToSysrootStep : public ProjectExplorer::BuildStep -{ - Q_OBJECT -public: - explicit MaemoCopyToSysrootStep(ProjectExplorer::BuildStepList *bsl); - MaemoCopyToSysrootStep(ProjectExplorer::BuildStepList *bsl, - MaemoCopyToSysrootStep *other); - - virtual bool init(); - virtual void run(QFutureInterface<bool> &fi); - virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); - - static const Core::Id Id; - static QString displayName(); -private: - QString m_systemRoot; - QList<ProjectExplorer::DeployableFile> m_files; -}; - -class MaemoMakeInstallToSysrootStep : public ProjectExplorer::AbstractProcessStep -{ - Q_OBJECT -public: - explicit MaemoMakeInstallToSysrootStep(ProjectExplorer::BuildStepList *bsl); - MaemoMakeInstallToSysrootStep(ProjectExplorer::BuildStepList *bsl, - MaemoMakeInstallToSysrootStep *other); - - virtual bool immutable() const { return false; } - virtual bool init(); - virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); - - static const Core::Id Id; - static QString displayName(); -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOINSTALLTOSYSROOTSTEP_H diff --git a/src/plugins/madde/maemomountspecification.cpp b/src/plugins/madde/maemomountspecification.cpp deleted file mode 100644 index 4f2e28500b..0000000000 --- a/src/plugins/madde/maemomountspecification.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemomountspecification.h" - -namespace Madde { -namespace Internal { - -const QLatin1String MaemoMountSpecification::InvalidMountPoint("/"); - -MaemoMountSpecification::MaemoMountSpecification(const QString &localDir, - const QString &remoteDir) - : localDir(localDir), remoteMountPoint(remoteDir) -{ -} - -} // namespace Internal -} // namespace Madde - diff --git a/src/plugins/madde/maemomountspecification.h b/src/plugins/madde/maemomountspecification.h deleted file mode 100644 index 6e4169e8de..0000000000 --- a/src/plugins/madde/maemomountspecification.h +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#ifndef MAEMOMOUNTSPECIFICATION_H -#define MAEMOMOUNTSPECIFICATION_H - -#include <QString> - -namespace Madde { -namespace Internal { - -class MaemoMountSpecification { -public: - MaemoMountSpecification(const QString &localDir, const QString &remoteDir); - bool isValid() const { return remoteMountPoint != InvalidMountPoint; } - - static const QLatin1String InvalidMountPoint; - - QString localDir; - QString remoteMountPoint; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOMOUNTSPECIFICATION_H diff --git a/src/plugins/madde/maemopackagecreationfactory.cpp b/src/plugins/madde/maemopackagecreationfactory.cpp deleted file mode 100644 index b179d355ed..0000000000 --- a/src/plugins/madde/maemopackagecreationfactory.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemopackagecreationfactory.h" - -#include "maemopackagecreationstep.h" -#include "maddedevice.h" -#include "qt4maemodeployconfiguration.h" - -#include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/buildsteplist.h> -#include <projectexplorer/deployconfiguration.h> -#include <projectexplorer/kitinformation.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/target.h> -#include <utils/qtcassert.h> - -#include <QCoreApplication> - -using ProjectExplorer::BuildStepList; -using ProjectExplorer::BuildStep; - -namespace Madde { -namespace Internal { -namespace { -const char OldCreatePackageId[] = "Qt4ProjectManager.MaemoPackageCreationStep"; -} // anonymous namespace - -MaemoPackageCreationFactory::MaemoPackageCreationFactory(QObject *parent) - : ProjectExplorer::IBuildStepFactory(parent) -{ -} - -QList<Core::Id> MaemoPackageCreationFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const -{ - QList<Core::Id> ids; - if (!qobject_cast<Qt4MaemoDeployConfiguration *>(parent->parent())) - return ids; - if (!parent->contains(MaemoDebianPackageCreationStep::CreatePackageId)) - ids << MaemoDebianPackageCreationStep::CreatePackageId; - return ids; -} - -QString MaemoPackageCreationFactory::displayNameForId(const Core::Id id) const -{ - if (id == MaemoDebianPackageCreationStep::CreatePackageId) { - return QCoreApplication::translate("RemoteLinux::Internal::MaemoPackageCreationFactory", - "Create Debian Package"); - } - return QString(); -} - -bool MaemoPackageCreationFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const -{ - return availableCreationIds(parent).contains(id); -} - -BuildStep *MaemoPackageCreationFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id) -{ - Q_ASSERT(canCreate(parent, id)); - if (id == MaemoDebianPackageCreationStep::CreatePackageId) - return new MaemoDebianPackageCreationStep(parent); - return 0; -} - -bool MaemoPackageCreationFactory::canRestore(ProjectExplorer::BuildStepList *parent, - const QVariantMap &map) const -{ - const Core::Id id = ProjectExplorer::idFromMap(map); - return canCreate(parent, id) || id == OldCreatePackageId; -} - -BuildStep *MaemoPackageCreationFactory::restore(ProjectExplorer::BuildStepList *parent, - const QVariantMap &map) -{ - Q_ASSERT(canRestore(parent, map)); - BuildStep * step = 0; - const Core::Id id = ProjectExplorer::idFromMap(map); - if (id == MaemoDebianPackageCreationStep::CreatePackageId) - step = new MaemoDebianPackageCreationStep(parent); - QTC_ASSERT(step, return 0); - - if (!step->fromMap(map)) { - delete step; - return 0; - } - return step; -} - -bool MaemoPackageCreationFactory::canClone(ProjectExplorer::BuildStepList *parent, - ProjectExplorer::BuildStep *product) const -{ - return canCreate(parent, product->id()); -} - -BuildStep *MaemoPackageCreationFactory::clone(ProjectExplorer::BuildStepList *parent, - ProjectExplorer::BuildStep *product) -{ - Q_ASSERT(canClone(parent, product)); - if (MaemoDebianPackageCreationStep * const debianStep - = qobject_cast<MaemoDebianPackageCreationStep *>(product)) { - return new MaemoDebianPackageCreationStep(parent, debianStep); - } - return 0; -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemopackagecreationfactory.h b/src/plugins/madde/maemopackagecreationfactory.h deleted file mode 100644 index 714358ab9f..0000000000 --- a/src/plugins/madde/maemopackagecreationfactory.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOPACKAGECREATIONFACTORY_H -#define MAEMOPACKAGECREATIONFACTORY_H - -#include <projectexplorer/buildstep.h> - -namespace Madde { -namespace Internal { - -class MaemoPackageCreationFactory : public ProjectExplorer::IBuildStepFactory -{ -public: - MaemoPackageCreationFactory(QObject *parent = 0); - - QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const; - 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); - - 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); -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOPACKAGECREATIONFACTORY_H diff --git a/src/plugins/madde/maemopackagecreationstep.cpp b/src/plugins/madde/maemopackagecreationstep.cpp deleted file mode 100644 index 254d0ea6be..0000000000 --- a/src/plugins/madde/maemopackagecreationstep.cpp +++ /dev/null @@ -1,482 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemopackagecreationstep.h" - -#include "maemoconstants.h" -#include "maemoglobal.h" -#include "debianmanager.h" -#include "maemopackagecreationwidget.h" - -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/target.h> -#include <qt4projectmanager/qt4buildconfiguration.h> -#include <qt4projectmanager/qt4project.h> -#include <qtsupport/qtkitinformation.h> -#include <utils/environment.h> -#include <utils/fileutils.h> -#include <utils/hostosinfo.h> -#include <utils/qtcassert.h> - -#include <QDateTime> -#include <QProcess> -#include <QRegExp> - -namespace { -const QLatin1String MagicFileName(".qtcreator"); -} // namespace - -using namespace ProjectExplorer::Constants; -using ProjectExplorer::BuildStepList; -using ProjectExplorer::BuildStepConfigWidget; -using ProjectExplorer::Task; -using namespace Qt4ProjectManager; -using namespace Utils; - -namespace Madde { -namespace Internal { - -const QLatin1String AbstractMaemoPackageCreationStep::DefaultVersionNumber("0.0.1"); - -AbstractMaemoPackageCreationStep::AbstractMaemoPackageCreationStep(BuildStepList *bsl, - const Core::Id id) : AbstractPackagingStep(bsl, id) -{ -} - -AbstractMaemoPackageCreationStep::AbstractMaemoPackageCreationStep(BuildStepList *bsl, - AbstractMaemoPackageCreationStep *other) : AbstractPackagingStep(bsl, other) -{ -} - -AbstractMaemoPackageCreationStep::~AbstractMaemoPackageCreationStep() -{ -} - -bool AbstractMaemoPackageCreationStep::init() -{ - if (!AbstractPackagingStep::init()) - return false; - m_packagingNeeded = isPackagingNeeded(); - if (!isPackagingNeeded()) - return true; - - if (!qt4BuildConfiguration()) { - raiseError(tr("No Qt build configuration")); - return false; - } - - m_environment = qt4BuildConfiguration()->environment(); - if (qt4BuildConfiguration()->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild) { - m_environment.appendOrSet(QLatin1String("DEB_BUILD_OPTIONS"), - QLatin1String("nostrip"), QLatin1String(" ")); - } - - QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit()); - if (!version) { - raiseError(tr("Packaging failed: No Qt version.")); - return false; - } - - m_qmakeCommand = version->qmakeCommand().toString(); - - return true; -} - -void AbstractMaemoPackageCreationStep::run(QFutureInterface<bool> &fi) -{ - if (!m_packagingNeeded) { - emit addOutput(tr("Package up to date."), MessageOutput); - fi.reportResult(true); - return; - } - - setPackagingStarted(); - // TODO: Make the build process asynchronous; i.e. no waitFor()-functions etc. - QProcess * const buildProc = new QProcess; - connect(buildProc, SIGNAL(readyReadStandardOutput()), this, - SLOT(handleBuildOutput())); - connect(buildProc, SIGNAL(readyReadStandardError()), this, - SLOT(handleBuildOutput())); - emit addOutput(tr("Creating package file..."), MessageOutput); - const bool success = createPackage(buildProc, fi); - disconnect(buildProc, 0, this, 0); - buildProc->deleteLater(); - if (success) - emit addOutput(tr("Package created."), BuildStep::MessageOutput); - setPackagingFinished(success); - fi.reportResult(success); -} - -BuildStepConfigWidget *AbstractMaemoPackageCreationStep::createConfigWidget() -{ - return new MaemoPackageCreationWidget(this); -} - -void AbstractMaemoPackageCreationStep::handleBuildOutput() -{ - QProcess * const buildProc = qobject_cast<QProcess *>(sender()); - if (!buildProc) - return; - QByteArray stdOut = buildProc->readAllStandardOutput(); - stdOut.replace('\0', QByteArray()); // Output contains NUL characters. - if (!stdOut.isEmpty()) - emit addOutput(QString::fromLocal8Bit(stdOut), BuildStep::NormalOutput, - BuildStep::DontAppendNewline); - QByteArray errorOut = buildProc->readAllStandardError(); - errorOut.replace('\0', QByteArray()); - if (!errorOut.isEmpty()) { - emit addOutput(QString::fromLocal8Bit(errorOut), BuildStep::ErrorOutput, - BuildStep::DontAppendNewline); - } -} - -const Qt4BuildConfiguration *AbstractMaemoPackageCreationStep::qt4BuildConfiguration() const -{ - return static_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration()); -} - -bool AbstractMaemoPackageCreationStep::isPackagingNeeded() const -{ - if (AbstractPackagingStep::isPackagingNeeded()) - return true; - return isMetaDataNewerThan(QFileInfo(packageFilePath()).lastModified()); -} - -QString AbstractMaemoPackageCreationStep::packageFileName() const -{ - QString error; - const QString &version = versionString(&error); - if (version.isEmpty()) - return QString(); - QFileInfo fi = DebianManager::packageFileName(DebianManager::debianDirectory(target())).toFileInfo(); - const QString baseName = replaceDots(fi.completeBaseName()); - return baseName + QLatin1Char('.') + fi.suffix(); -} - -QString AbstractMaemoPackageCreationStep::versionString(QString *error) const -{ - return DebianManager::projectVersion(DebianManager::debianDirectory(target()), error); -} - -bool AbstractMaemoPackageCreationStep::setVersionString(const QString &version, QString *error) -{ - const bool success = DebianManager::setProjectVersion(DebianManager::debianDirectory(target()), version, error); - if (success) - emit packageFilePathChanged(); - return success; -} - -bool AbstractMaemoPackageCreationStep::callPackagingCommand(QProcess *proc, - const QStringList &arguments) -{ - proc->setEnvironment(m_environment.toStringList()); - proc->setWorkingDirectory(cachedPackageDirectory()); - - const QString madCommand = MaemoGlobal::madCommand(m_qmakeCommand); - const QString cmdLine = madCommand + QLatin1Char(' ') - + arguments.join(QLatin1String(" ")); - emit addOutput(tr("Package Creation: Running command '%1'.").arg(cmdLine), - BuildStep::MessageOutput); - MaemoGlobal::callMad(*proc, arguments, m_qmakeCommand, true); - if (!proc->waitForStarted()) { - raiseError(tr("Packaging failed: Could not start command '%1'. Reason: %2") - .arg(cmdLine, proc->errorString())); - return false; - } - proc->waitForFinished(-1); - if (proc->error() != QProcess::UnknownError || proc->exitCode() != 0) { - QString mainMessage = tr("Packaging Error: Command '%1' failed.") - .arg(cmdLine); - if (proc->error() != QProcess::UnknownError) - mainMessage += tr(" Reason: %1").arg(proc->errorString()); - else - mainMessage += tr("Exit code: %1").arg(proc->exitCode()); - raiseError(mainMessage); - return false; - } - return true; -} - -void AbstractMaemoPackageCreationStep::preparePackagingProcess(QProcess *proc, - const Qt4BuildConfiguration *bc, const QString &workingDir) -{ - Environment env = bc->environment(); - if (bc->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild) { - env.appendOrSet(QLatin1String("DEB_BUILD_OPTIONS"), - QLatin1String("nostrip"), QLatin1String(" ")); - } - proc->setEnvironment(env.toStringList()); - proc->setWorkingDirectory(workingDir); -} - -QString AbstractMaemoPackageCreationStep::replaceDots(const QString &name) const -{ - Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit()); - // Idiotic OVI store requirement for N900 (but not allowed for N9 ...). - if (deviceType == Maemo5OsType) { - QString adaptedName = name; - return adaptedName.replace(QLatin1Char('.'), QLatin1Char('_')); - } - return name; -} - -//////////////// -// MaemoDebianPackageCreationStep -//////////////// - -MaemoDebianPackageCreationStep::MaemoDebianPackageCreationStep(BuildStepList *bsl) - : AbstractMaemoPackageCreationStep(bsl, CreatePackageId) -{ - ctor(); -} - -const Core::Id MaemoDebianPackageCreationStep::CreatePackageId - = "MaemoDebianPackageCreationStep"; - -MaemoDebianPackageCreationStep::MaemoDebianPackageCreationStep(BuildStepList *buildConfig, - MaemoDebianPackageCreationStep *other) - : AbstractMaemoPackageCreationStep(buildConfig, other) -{ - ctor(); -} - -void MaemoDebianPackageCreationStep::ctor() -{ - setDefaultDisplayName(tr("Create Debian Package")); -} - -bool MaemoDebianPackageCreationStep::init() -{ - if (!AbstractMaemoPackageCreationStep::init()) - return false; - QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit()); - m_maddeRoot = MaemoGlobal::maddeRoot(version->qmakeCommand().toString()); - m_projectDirectory = project()->projectDirectory(); - m_pkgFileName = DebianManager::packageFileName(DebianManager::debianDirectory(target())).toString(); - m_packageName = DebianManager::packageName(DebianManager::debianDirectory(target())); - m_templatesDirPath = DebianManager::debianDirectory(target()).toString(); - m_debugBuild = qt4BuildConfiguration()->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild; - checkProjectName(); - return true; -} - -bool MaemoDebianPackageCreationStep::createPackage(QProcess *buildProc, - const QFutureInterface<bool> &fi) -{ - Q_UNUSED(fi); - const bool inSourceBuild = QFileInfo(cachedPackageDirectory()) == QFileInfo(m_projectDirectory); - if (!copyDebianFiles(inSourceBuild)) - return false; - const QStringList args = QStringList() << QLatin1String("dpkg-buildpackage") - << QLatin1String("-nc") << QLatin1String("-uc") << QLatin1String("-us"); - if (!callPackagingCommand(buildProc, args)) - return false; - - QFile::remove(cachedPackageFilePath()); - - // Workaround for non-working dh_builddeb --destdir=. - if (!QDir(cachedPackageDirectory()).isRoot()) { - QString error; - if (!error.isEmpty()) - raiseError(tr("Packaging failed: Could not get package name.")); - const QString changesSourceFileName = QFileInfo(m_pkgFileName).completeBaseName() - + QLatin1String(".changes"); - const QString changesTargetFileName = replaceDots(QFileInfo(m_pkgFileName).completeBaseName()) - + QLatin1String(".changes"); - const QString packageSourceDir = cachedPackageDirectory() + QLatin1String("/../"); - const QString packageSourceFilePath = packageSourceDir + m_pkgFileName; - const QString changesSourceFilePath = packageSourceDir + changesSourceFileName; - const QString changesTargetFilePath - = cachedPackageDirectory() + QLatin1Char('/') + changesTargetFileName; - QFile::remove(changesTargetFilePath); - if (!QFile::rename(packageSourceFilePath, cachedPackageFilePath()) - || !QFile::rename(changesSourceFilePath, changesTargetFilePath)) { - raiseError(tr("Packaging failed: Could not move package files from '%1' to '%2'.") - .arg(packageSourceDir, cachedPackageDirectory())); - return false; - } - } - - if (inSourceBuild) - callPackagingCommand(buildProc, QStringList() << QLatin1String("dh_clean")); - return true; -} - -bool MaemoDebianPackageCreationStep::isMetaDataNewerThan(const QDateTime &packageDate) const -{ - const FileName debianPath = DebianManager::debianDirectory(target()); - if (packageDate <= debianPath.toFileInfo().lastModified()) - return true; - const QStringList debianFiles = DebianManager::debianFiles(debianPath); - foreach (const QString &debianFile, debianFiles) { - FileName absFilePath = debianPath; - absFilePath.appendPath(debianFile); - if (packageDate <= absFilePath.toFileInfo().lastModified()) - return true; - } - return false; -} - -void MaemoDebianPackageCreationStep::checkProjectName() -{ - QRegExp legalName(QLatin1String("[0-9-+a-z\\.]+")); - if (!legalName.exactMatch(project()->displayName())) { - emit addTask(Task(Task::Warning, - tr("Your project name contains characters not allowed in " - "Debian packages.\nThey must only use lower-case letters, " - "numbers, '-', '+' and '.'.\n""We will try to work around that, " - "but you may experience problems."), - FileName(), -1, Core::Id(TASK_CATEGORY_DEPLOYMENT))); - } -} - -bool MaemoDebianPackageCreationStep::copyDebianFiles(bool inSourceBuild) -{ - const QString debianDirPath = cachedPackageDirectory() + QLatin1String("/debian"); - const QString magicFilePath - = debianDirPath + QLatin1Char('/') + MagicFileName; - if (inSourceBuild && QFileInfo(debianDirPath).isDir() - && !QFileInfo(magicFilePath).exists()) { - raiseError(tr("Packaging failed: Foreign debian directory detected. " - "You are not using a shadow build and there is a debian " - "directory in your project root ('%1'). Qt Creator will not " - "overwrite that directory. Please remove it or use the " - "shadow build feature.").arg(QDir::toNativeSeparators(debianDirPath))); - return false; - } - QString error; - if (!FileUtils::removeRecursively(FileName::fromString(debianDirPath), &error)) { - raiseError(tr("Packaging failed: Could not remove directory '%1': %2") - .arg(debianDirPath, error)); - return false; - } - QDir buildDir(cachedPackageDirectory()); - if (!buildDir.mkdir(QLatin1String("debian"))) { - raiseError(tr("Could not create Debian directory '%1'.").arg(debianDirPath)); - return false; - } - QDir templatesDir(m_templatesDirPath); - const QStringList &files = templatesDir.entryList(QDir::Files); - foreach (const QString &fileName, files) { - const QString srcFile = m_templatesDirPath + QLatin1Char('/') + fileName; - QString newFileName = fileName; - if (newFileName == QLatin1String("manifest.aegis")) - newFileName = m_packageName + QLatin1String(".aegis"); - - const QString destFile = debianDirPath + QLatin1Char('/') + newFileName; - if (fileName == QLatin1String("rules")) { - if (!adaptRulesFile(srcFile, destFile)) - return false; - continue; - } - - if (newFileName == DebianManager::packageName(DebianManager::debianDirectory(target())) + QLatin1String(".aegis")) { - FileReader reader; - if (!reader.fetch(srcFile)) { - raiseError(tr("Could not read manifest file '%1': %2.") - .arg(QDir::toNativeSeparators(srcFile), reader.errorString())); - return false; - } - - if (reader.data().isEmpty() || reader.data().startsWith("AutoGenerateAegisFile")) - continue; - if (reader.data().startsWith("NoAegisFile")) { - QFile targetFile(destFile); - if (!targetFile.open(QIODevice::WriteOnly)) { - raiseError(tr("Could not write manifest file '%1': %2.") - .arg(QDir::toNativeSeparators(destFile), targetFile.errorString())); - return false; - } - continue; - } - } - - if (!QFile::copy(srcFile, destFile)) { - raiseError(tr("Could not copy file '%1' to '%2'.") - .arg(QDir::toNativeSeparators(srcFile), QDir::toNativeSeparators(destFile))); - return false; - } - } - - QFile magicFile(magicFilePath); - if (!magicFile.open(QIODevice::WriteOnly)) { - raiseError(tr("Error: Could not create file '%1'.") - .arg(QDir::toNativeSeparators(magicFilePath))); - return false; - } - - return true; -} - -QString MaemoDebianPackageCreationStep::packagingCommand(const QString &maddeRoot, const QString &commandName) -{ - QString perl; - if (HostOsInfo::isWindowsHost()) - perl = maddeRoot + QLatin1String("/bin/perl.exe "); - return perl + maddeRoot + QLatin1String("/madbin/") + commandName; -} - -void MaemoDebianPackageCreationStep::ensureShlibdeps(QByteArray &rulesContent) -{ - QString contentAsString = QString::fromLocal8Bit(rulesContent); - const QString whiteSpace(QLatin1String("[ \\t]*")); - const QString pattern = QLatin1String("\\n") + whiteSpace - + QLatin1Char('#') + whiteSpace + QLatin1String("dh_shlibdeps") - + QLatin1String("([^\\n]*)\\n"); - contentAsString.replace(QRegExp(pattern), - QLatin1String("\n\tdh_shlibdeps\\1\n")); - rulesContent = contentAsString.toLocal8Bit(); -} - -bool MaemoDebianPackageCreationStep::adaptRulesFile( - const QString &templatePath, const QString &rulesFilePath) -{ - FileReader reader; - if (!reader.fetch(templatePath)) { - raiseError(reader.errorString()); - return false; - } - QByteArray content = reader.data(); - // Always check for dependencies in release builds. - if (!m_debugBuild) - ensureShlibdeps(content); - - FileSaver saver(rulesFilePath); - saver.write(content); - if (!saver.finalize()) { - raiseError(saver.errorString()); - return false; - } - QFile rulesFile(rulesFilePath); - rulesFile.setPermissions(rulesFile.permissions() | QFile::ExeUser); - return true; -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemopackagecreationstep.h b/src/plugins/madde/maemopackagecreationstep.h deleted file mode 100644 index 7c8ad111cb..0000000000 --- a/src/plugins/madde/maemopackagecreationstep.h +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOPACKAGECREATIONSTEP_H -#define MAEMOPACKAGECREATIONSTEP_H - -#include <remotelinux/abstractpackagingstep.h> -#include <utils/environment.h> -#include <utils/fileutils.h> - -QT_BEGIN_NAMESPACE -class QDateTime; -class QFile; -class QProcess; -QT_END_NAMESPACE - -namespace Qt4ProjectManager { class Qt4BuildConfiguration; } -namespace RemoteLinux { class RemoteLinuxDeployConfiguration; } - -namespace Madde { -namespace Internal { - -class AbstractMaemoPackageCreationStep : public RemoteLinux::AbstractPackagingStep -{ - Q_OBJECT -public: - virtual ~AbstractMaemoPackageCreationStep(); - - QString versionString(QString *error) const; - bool setVersionString(const QString &version, QString *error); - - static void preparePackagingProcess(QProcess *proc, - const Qt4ProjectManager::Qt4BuildConfiguration *bc, - const QString &workingDir); - - const Qt4ProjectManager::Qt4BuildConfiguration *qt4BuildConfiguration() const; - - static const QLatin1String DefaultVersionNumber; - - -protected: - AbstractMaemoPackageCreationStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id); - AbstractMaemoPackageCreationStep(ProjectExplorer::BuildStepList *buildConfig, - AbstractMaemoPackageCreationStep *other); - - bool callPackagingCommand(QProcess *proc, const QStringList &arguments); - QString replaceDots(const QString &name) const; - virtual bool init(); - -private slots: - void handleBuildOutput(); - -private: - virtual void run(QFutureInterface<bool> &fi); - virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); - - virtual QString packageFileName() const; - - virtual bool createPackage(QProcess *buildProc, const QFutureInterface<bool> &fi) = 0; - virtual bool isMetaDataNewerThan(const QDateTime &packageDate) const = 0; - - bool isPackagingNeeded() const; - - const Qt4ProjectManager::Qt4BuildConfiguration *m_lastBuildConfig; - bool m_packagingNeeded; - Utils::Environment m_environment; - QString m_qmakeCommand; -}; - - -class MaemoDebianPackageCreationStep : public AbstractMaemoPackageCreationStep -{ - Q_OBJECT - friend class MaemoPackageCreationFactory; -public: - MaemoDebianPackageCreationStep(ProjectExplorer::BuildStepList *bsl); - - static void ensureShlibdeps(QByteArray &rulesContent); - -private: - MaemoDebianPackageCreationStep(ProjectExplorer::BuildStepList *buildConfig, - MaemoDebianPackageCreationStep *other); - - virtual bool init(); - virtual bool createPackage(QProcess *buildProc, const QFutureInterface<bool> &fi); - virtual bool isMetaDataNewerThan(const QDateTime &packageDate) const; - - void ctor(); - static QString packagingCommand(const QString &maddeRoot, const QString &commandName); - bool copyDebianFiles(bool inSourceBuild); - void checkProjectName(); - bool adaptRulesFile(const QString &templatePath, const QString &rulesFilePath); - - QString m_maddeRoot; - QString m_projectDirectory; - QString m_pkgFileName; - QString m_packageName; - QString m_templatesDirPath; - bool m_debugBuild; - - static const Core::Id CreatePackageId; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOPACKAGECREATIONSTEP_H diff --git a/src/plugins/madde/maemopackagecreationwidget.cpp b/src/plugins/madde/maemopackagecreationwidget.cpp deleted file mode 100644 index 90a1661d25..0000000000 --- a/src/plugins/madde/maemopackagecreationwidget.cpp +++ /dev/null @@ -1,270 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemopackagecreationwidget.h" -#include "ui_maemopackagecreationwidget.h" - -#include "debianmanager.h" -#include "maddedevice.h" -#include "maemoglobal.h" -#include "maemopackagecreationstep.h" - -#include <coreplugin/editormanager/editormanager.h> -#include <projectexplorer/kitinformation.h> -#include <projectexplorer/project.h> -#include <projectexplorer/target.h> -#include <qt4projectmanager/qt4buildconfiguration.h> -#include <utils/qtcassert.h> - -#include <QTimer> -#include <QFileDialog> -#include <QImageReader> -#include <QMessageBox> - -using namespace ProjectExplorer; - -namespace Madde { -namespace Internal { - -MaemoPackageCreationWidget::MaemoPackageCreationWidget(AbstractMaemoPackageCreationStep *step) - : ProjectExplorer::BuildStepConfigWidget(), - m_step(step), - m_ui(new Ui::MaemoPackageCreationWidget) -{ - m_ui->setupUi(this); - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - QTimer::singleShot(0, this, SLOT(initGui())); -} - -MaemoPackageCreationWidget::~MaemoPackageCreationWidget() -{ - delete m_ui; -} - -void MaemoPackageCreationWidget::initGui() -{ - m_ui->shortDescriptionLineEdit->setMaxLength(60); - updateVersionInfo(); - Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(m_step->target()->kit()); - const Utils::FileName path = DebianManager::debianDirectory(m_step->target()); - const QSize iconSize = MaddeDevice::packageManagerIconSize(deviceType); - m_ui->packageManagerIconButton->setFixedSize(iconSize); - m_ui->packageManagerIconButton->setToolTip(tr("Size should be %1x%2 pixels") - .arg(iconSize.width()).arg(iconSize.height())); - m_ui->editSpecFileButton->setVisible(false); - updateDebianFileList(path); - handleControlFileUpdate(path); - DebianManager *dm = DebianManager::instance(); - connect(m_ui->packageManagerNameLineEdit, SIGNAL(editingFinished()), - SLOT(setPackageManagerName())); - connect(dm, SIGNAL(debianDirectoryChanged(Utils::FileName)), - SLOT(updateDebianFileList(Utils::FileName))); - connect(dm, SIGNAL(changelogChanged(Utils::FileName)), - SLOT(updateVersionInfo())); - connect(dm, SIGNAL(controlChanged(Utils::FileName)), - SLOT(handleControlFileUpdate(Utils::FileName))); - - connect(m_step, SIGNAL(packageFilePathChanged()), this, - SIGNAL(updateSummary())); - connect(m_ui->packageNameLineEdit, SIGNAL(editingFinished()), - SLOT(setPackageName())); - connect(m_ui->shortDescriptionLineEdit, SIGNAL(editingFinished()), - SLOT(setShortDescription())); -} - -void MaemoPackageCreationWidget::updateDebianFileList(const Utils::FileName &debianDir) -{ - if (debianDir != DebianManager::debianDirectory(m_step->target())) - return; - - m_ui->debianFilesComboBox->clear(); - const QStringList &debianFiles = DebianManager::debianFiles(debianDir); - foreach (const QString &fileName, debianFiles) { - if (fileName != QLatin1String("compat") - && !fileName.endsWith(QLatin1Char('~'))) - m_ui->debianFilesComboBox->addItem(fileName); - } -} - -void MaemoPackageCreationWidget::updateVersionInfo() -{ - QString error; - QString versionString = m_step->versionString(&error); - if (versionString.isEmpty()) { - QMessageBox::critical(this, tr("No Version Available."), error); - versionString = AbstractMaemoPackageCreationStep::DefaultVersionNumber; - } - const QStringList list = versionString.split(QLatin1Char('.'), - QString::SkipEmptyParts); - const bool blocked = m_ui->major->signalsBlocked(); - m_ui->major->blockSignals(true); - m_ui->minor->blockSignals(true); - m_ui->patch->blockSignals(true); - m_ui->major->setValue(list.value(0, QLatin1String("0")).toInt()); - m_ui->minor->setValue(list.value(1, QLatin1String("0")).toInt()); - m_ui->patch->setValue(list.value(2, QLatin1String("0")).toInt()); - m_ui->major->blockSignals(blocked); - m_ui->minor->blockSignals(blocked); - m_ui->patch->blockSignals(blocked); - updateSummary(); -} - -void MaemoPackageCreationWidget::handleControlFileUpdate(const Utils::FileName &debianDir) -{ - if (debianDir != DebianManager::debianDirectory(m_step->target())) - return; - - updatePackageName(); - updateShortDescription(); - updatePackageManagerName(); - updatePackageManagerIcon(); - updateSummary(); -} - -void MaemoPackageCreationWidget::updatePackageManagerIcon() -{ - const Utils::FileName path = DebianManager::debianDirectory(m_step->target()); - QString error; - const QIcon &icon = DebianManager::packageManagerIcon(path, &error); - if (!error.isEmpty()) { - QMessageBox::critical(this, tr("Could not read icon"), error); - } else { - m_ui->packageManagerIconButton->setIcon(icon); - m_ui->packageManagerIconButton->setIconSize(m_ui->packageManagerIconButton->size()); - } -} - -void MaemoPackageCreationWidget::updatePackageName() -{ - const Utils::FileName path = DebianManager::debianDirectory(m_step->target()); - m_ui->packageNameLineEdit->setText(DebianManager::packageName(path)); -} - -void MaemoPackageCreationWidget::updatePackageManagerName() -{ - const Utils::FileName path = DebianManager::debianDirectory(m_step->target()); - Core::Id deviceType - = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(m_step->target()->kit()); - m_ui->packageManagerNameLineEdit->setText(DebianManager::packageManagerName(path, deviceType)); -} - -void MaemoPackageCreationWidget::updateShortDescription() -{ - const Utils::FileName path = DebianManager::debianDirectory(m_step->target()); - m_ui->shortDescriptionLineEdit->setText(DebianManager::shortDescription(path)); -} - -void MaemoPackageCreationWidget::setPackageManagerIcon() -{ - const Utils::FileName path = DebianManager::debianDirectory(m_step->target()); - Core::Id deviceType - = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(m_step->target()->kit()); - QString imageFilter = tr("Images") + QLatin1String("( "); - const QList<QByteArray> &imageTypes = QImageReader::supportedImageFormats(); - foreach (const QByteArray &imageType, imageTypes) - imageFilter += QLatin1String("*.") + QLatin1String(imageType) + QLatin1Char(' '); - imageFilter += QLatin1Char(')'); - const QSize iconSize = MaddeDevice::packageManagerIconSize(deviceType); - const QString iconFileName = QFileDialog::getOpenFileName(this, - tr("Choose Image (will be scaled to %1x%2 pixels if necessary)") - .arg(iconSize.width()).arg(iconSize.height()), QString(), imageFilter); - if (!iconFileName.isEmpty()) { - QString error; - if (!DebianManager::setPackageManagerIcon(path, deviceType, - Utils::FileName::fromString(iconFileName), &error)) - QMessageBox::critical(this, tr("Could Not Set New Icon"), error); - } -} - -void MaemoPackageCreationWidget::setPackageName() -{ - const Utils::FileName path = DebianManager::debianDirectory(m_step->target()); - if (!DebianManager::setPackageName(path, m_ui->packageNameLineEdit->text())) { - QMessageBox::critical(this, tr("File Error"), - tr("Could not set project name.")); - } -} - -void MaemoPackageCreationWidget::setPackageManagerName() -{ - const Utils::FileName path = DebianManager::debianDirectory(m_step->target()); - Core::Id deviceType - = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(m_step->target()->kit()); - if (!DebianManager::setPackageManagerName(path, deviceType, m_ui->packageManagerNameLineEdit->text())) { - QMessageBox::critical(this, tr("File Error"), - tr("Could not set package name for project manager.")); - } -} - -void MaemoPackageCreationWidget::setShortDescription() -{ - const Utils::FileName path = DebianManager::debianDirectory(m_step->target()); - if (!DebianManager::setShortDescription(path, m_ui->shortDescriptionLineEdit->text())) { - QMessageBox::critical(this, tr("File Error"), - tr("Could not set project description.")); - } -} - -QString MaemoPackageCreationWidget::summaryText() const -{ - return tr("<b>Create Package:</b> ") - + QDir::toNativeSeparators(m_step->packageFilePath()); -} - -QString MaemoPackageCreationWidget::displayName() const -{ - return m_step->displayName(); -} - -void MaemoPackageCreationWidget::versionInfoChanged() -{ - QString error; - const bool success = m_step->setVersionString(m_ui->major->text() - + QLatin1Char('.') + m_ui->minor->text() + QLatin1Char('.') - + m_ui->patch->text(), &error); - if (!success) { - QMessageBox::critical(this, tr("Could Not Set Version Number"), error); - updateVersionInfo(); - } -} - -void MaemoPackageCreationWidget::editDebianFile() -{ - Utils::FileName path = DebianManager::debianDirectory(m_step->target()); - path.appendPath(m_ui->debianFilesComboBox->currentText()); - editFile(path.toString()); -} - -void MaemoPackageCreationWidget::editFile(const QString &filePath) -{ - Core::EditorManager::openEditor(filePath); -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemopackagecreationwidget.h b/src/plugins/madde/maemopackagecreationwidget.h deleted file mode 100644 index 73dc7d1114..0000000000 --- a/src/plugins/madde/maemopackagecreationwidget.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOPACKAGECREATIONWIDGET_H -#define MAEMOPACKAGECREATIONWIDGET_H - -#include <projectexplorer/buildstep.h> -#include <utils/fileutils.h> - -namespace Madde { -namespace Internal { - -namespace Ui { class MaemoPackageCreationWidget; } -class AbstractMaemoPackageCreationStep; - -class MaemoPackageCreationWidget : public ProjectExplorer::BuildStepConfigWidget -{ - Q_OBJECT - -public: - MaemoPackageCreationWidget(AbstractMaemoPackageCreationStep *step); - ~MaemoPackageCreationWidget(); - - virtual QString summaryText() const; - virtual QString displayName() const; - -private slots: - void editDebianFile(); - void versionInfoChanged(); - void initGui(); - void updateDebianFileList(const Utils::FileName &debianDir); - void updateVersionInfo(); - void handleControlFileUpdate(const Utils::FileName &debianDir); - void setPackageManagerIcon(); - void setPackageManagerName(); - void setPackageName(); - void setShortDescription(); - -private: - void updatePackageManagerIcon(); - void updatePackageName(); - void updatePackageManagerName(); - void updateShortDescription(); - void editFile(const QString &filePath); - - AbstractMaemoPackageCreationStep * const m_step; - Ui::MaemoPackageCreationWidget * const m_ui; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOPACKAGECREATIONWIDGET_H diff --git a/src/plugins/madde/maemopackagecreationwidget.ui b/src/plugins/madde/maemopackagecreationwidget.ui deleted file mode 100644 index 08d30453d3..0000000000 --- a/src/plugins/madde/maemopackagecreationwidget.ui +++ /dev/null @@ -1,353 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Madde::Internal::MaemoPackageCreationWidget</class> - <widget class="QWidget" name="Madde::Internal::MaemoPackageCreationWidget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>615</width> - <height>284</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>1</horstretch> - <verstretch>1</verstretch> - </sizepolicy> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <layout class="QFormLayout" name="formLayout"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::ExpandingFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="packageNameLabel"> - <property name="text"> - <string>Package name:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="packageNameLineEdit"/> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="font"> - <font> - <weight>50</weight> - <bold>false</bold> - </font> - </property> - <property name="text"> - <string>Package version:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QLabel" name="label_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Major:</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="major"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximum"> - <number>99</number> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Minor:</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="minor"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximum"> - <number>99</number> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Patch:</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="patch"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximum"> - <number>99</number> - </property> - </widget> - </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="3" column="0"> - <widget class="QLabel" name="shortDescriptionLabel"> - <property name="text"> - <string>Short package description:</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_5"> - <item> - <widget class="QLineEdit" name="shortDescriptionLineEdit"/> - </item> - </layout> - </item> - <item row="4" column="0"> - <widget class="QLabel" name="packageManagerNameLabel"> - <property name="text"> - <string>Name to be displayed in Package Manager:</string> - </property> - </widget> - </item> - <item row="4" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <item> - <widget class="QLineEdit" name="packageManagerNameLineEdit"/> - </item> - </layout> - </item> - <item row="5" column="0"> - <widget class="QLabel" name="packageManagerIconLabel"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>48</height> - </size> - </property> - <property name="text"> - <string>Icon to be displayed in Package Manager:</string> - </property> - </widget> - </item> - <item row="5" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QToolButton" name="packageManagerIconButton"> - <property name="toolTip"> - <string/> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <spacer name="packageManagerIconSpacer"> - <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="6" column="0"> - <widget class="QLabel" name="editDebianFileLabel"> - <property name="text"> - <string>Adapt Debian file:</string> - </property> - </widget> - </item> - <item row="6" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QComboBox" name="debianFilesComboBox"/> - </item> - <item> - <widget class="QPushButton" name="editDebianFileButton"> - <property name="text"> - <string>Edit...</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="7" column="1"> - <widget class="QPushButton" name="editSpecFileButton"> - <property name="text"> - <string>Edit spec file</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - <resources/> - <connections> - <connection> - <sender>major</sender> - <signal>valueChanged(int)</signal> - <receiver>Madde::Internal::MaemoPackageCreationWidget</receiver> - <slot>versionInfoChanged()</slot> - <hints> - <hint type="sourcelabel"> - <x>352</x> - <y>88</y> - </hint> - <hint type="destinationlabel"> - <x>461</x> - <y>32</y> - </hint> - </hints> - </connection> - <connection> - <sender>minor</sender> - <signal>valueChanged(int)</signal> - <receiver>Madde::Internal::MaemoPackageCreationWidget</receiver> - <slot>versionInfoChanged()</slot> - <hints> - <hint type="sourcelabel"> - <x>449</x> - <y>88</y> - </hint> - <hint type="destinationlabel"> - <x>5</x> - <y>15</y> - </hint> - </hints> - </connection> - <connection> - <sender>patch</sender> - <signal>valueChanged(int)</signal> - <receiver>Madde::Internal::MaemoPackageCreationWidget</receiver> - <slot>versionInfoChanged()</slot> - <hints> - <hint type="sourcelabel"> - <x>546</x> - <y>88</y> - </hint> - <hint type="destinationlabel"> - <x>466</x> - <y>0</y> - </hint> - </hints> - </connection> - <connection> - <sender>editDebianFileButton</sender> - <signal>clicked()</signal> - <receiver>Madde::Internal::MaemoPackageCreationWidget</receiver> - <slot>editDebianFile()</slot> - <hints> - <hint type="sourcelabel"> - <x>398</x> - <y>218</y> - </hint> - <hint type="destinationlabel"> - <x>8</x> - <y>86</y> - </hint> - </hints> - </connection> - <connection> - <sender>packageManagerIconButton</sender> - <signal>clicked()</signal> - <receiver>Madde::Internal::MaemoPackageCreationWidget</receiver> - <slot>setPackageManagerIcon()</slot> - <hints> - <hint type="sourcelabel"> - <x>289</x> - <y>186</y> - </hint> - <hint type="destinationlabel"> - <x>2</x> - <y>143</y> - </hint> - </hints> - </connection> - </connections> - <slots> - <slot>addFile()</slot> - <slot>removeFile()</slot> - <slot>handleSkipButtonToggled(bool)</slot> - <slot>versionInfoChanged()</slot> - <slot>editDebianFile()</slot> - <slot>setPackageManagerIcon()</slot> - </slots> -</ui> diff --git a/src/plugins/madde/maemopackageinstaller.cpp b/src/plugins/madde/maemopackageinstaller.cpp deleted file mode 100644 index 69fc1ed0d4..0000000000 --- a/src/plugins/madde/maemopackageinstaller.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemopackageinstaller.h" - -#include "maemoglobal.h" - -namespace Madde { -namespace Internal { - -MaemoDebianPackageInstaller::MaemoDebianPackageInstaller(QObject *parent) - : AbstractRemoteLinuxPackageInstaller(parent) -{ - connect(this, SIGNAL(stderrData(QString)), SLOT(handleInstallerErrorOutput(QString))); -} - -void MaemoDebianPackageInstaller::prepareInstallation() -{ - m_installerStderr.clear(); -} - -QString MaemoDebianPackageInstaller::installCommandLine(const QString &packageFilePath) const -{ - return MaemoGlobal::devrootshPath() + QLatin1String(" dpkg -i --no-force-downgrade ") - + packageFilePath; -} - -QString MaemoDebianPackageInstaller::cancelInstallationCommandLine() const -{ - return QLatin1String("pkill dpkg"); -} - -void MaemoDebianPackageInstaller::handleInstallerErrorOutput(const QString &output) -{ - m_installerStderr += output; -} - -QString MaemoDebianPackageInstaller::errorString() const -{ - if (m_installerStderr.contains(QLatin1String("Will not downgrade"))) { - return tr("Installation failed: " - "You tried to downgrade a package, which is not allowed."); - } else { - return QString(); - } -} - - -HarmattanPackageInstaller::HarmattanPackageInstaller(QObject *parent) - : AbstractRemoteLinuxPackageInstaller(parent) -{ -} - -QString HarmattanPackageInstaller::installCommandLine(const QString &packageFilePath) const -{ - return QLatin1String("pkgmgr install-file -f ") + packageFilePath - + QLatin1String(" |grep -v '%'"); // Otherwise, the terminal codes will screw with our output. -} - -QString HarmattanPackageInstaller::cancelInstallationCommandLine() const -{ - return QLatin1String("pkill pkgmgr"); -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemopackageinstaller.h b/src/plugins/madde/maemopackageinstaller.h deleted file mode 100644 index a01af55781..0000000000 --- a/src/plugins/madde/maemopackageinstaller.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef ABSTRACTMAEMOPACKAGEINSTALLER_H -#define ABSTRACTMAEMOPACKAGEINSTALLER_H - -#include <remotelinux/remotelinuxpackageinstaller.h> - -namespace Madde { -namespace Internal { - -class MaemoDebianPackageInstaller: public RemoteLinux::AbstractRemoteLinuxPackageInstaller -{ - Q_OBJECT -public: - explicit MaemoDebianPackageInstaller(QObject *parent); - -private slots: - void handleInstallerErrorOutput(const QString &output); - -private: - void prepareInstallation(); - QString errorString() const; - QString installCommandLine(const QString &packageFilePath) const; - QString cancelInstallationCommandLine() const; - - QString m_installerStderr; -}; - - -class HarmattanPackageInstaller: public RemoteLinux::AbstractRemoteLinuxPackageInstaller -{ - Q_OBJECT -public: - explicit HarmattanPackageInstaller(QObject *parent); - -private: - QString installCommandLine(const QString &packageFilePath) const; - QString cancelInstallationCommandLine() const; -}; - -} // namespace Internal -} // namespace Madde - -#endif // ABSTRACTMAEMOPACKAGEINSTALLER_H diff --git a/src/plugins/madde/maemopublishedprojectmodel.cpp b/src/plugins/madde/maemopublishedprojectmodel.cpp deleted file mode 100644 index 27c5a738c3..0000000000 --- a/src/plugins/madde/maemopublishedprojectmodel.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemopublishedprojectmodel.h" - -#include <QFileInfo> - -namespace Madde { -namespace Internal { -namespace { -const int IncludeColumn = 2; -} // anonymous namespace - -MaemoPublishedProjectModel::MaemoPublishedProjectModel(QObject *parent) - : QFileSystemModel(parent) -{ - setFilter(filter() | QDir::Hidden | QDir::System); -} - -void MaemoPublishedProjectModel::initFilesToExclude() -{ - initFilesToExclude(rootPath()); -} - -void MaemoPublishedProjectModel::initFilesToExclude(const QString &filePath) -{ - QFileInfo fi(filePath); - if (fi.isDir()) { - const QStringList fileNames = QDir(filePath).entryList(QDir::Files - | QDir::Dirs | QDir::NoDotAndDotDot | QDir::System | QDir::Hidden); - foreach (const QString &fileName, fileNames) - initFilesToExclude(filePath + QLatin1Char('/') + fileName); - } else { - const QString &fileName = fi.fileName(); - if (fi.isHidden() || fileName.endsWith(QLatin1String(".o")) - || fileName == QLatin1String("Makefile") - || fileName.contains(QLatin1String(".pro.user")) - || fileName.contains(QLatin1String(".so")) - || fileName.endsWith(QLatin1String(".a"))) { - m_filesToExclude.insert(filePath); - } - } -} - -int MaemoPublishedProjectModel::columnCount(const QModelIndex &parent) const -{ - Q_UNUSED(parent); - return IncludeColumn + 1; -} - -int MaemoPublishedProjectModel::rowCount(const QModelIndex &parent) const -{ - if (isDir(parent) && m_filesToExclude.contains(filePath(parent))) - return 0; - return QFileSystemModel::rowCount(parent); -} - -QVariant MaemoPublishedProjectModel::headerData(int section, - Qt::Orientation orientation, int role) const -{ - if (orientation != Qt::Horizontal || section != IncludeColumn) - return QFileSystemModel::headerData(section, orientation, role); - return tr("Include in package"); -} - -Qt::ItemFlags MaemoPublishedProjectModel::flags(const QModelIndex &index) const -{ - if (index.column() != IncludeColumn) - return QFileSystemModel::flags(index); - return Qt::ItemIsEnabled | Qt::ItemIsUserCheckable; -} - -QVariant MaemoPublishedProjectModel::data(const QModelIndex &index, - int role) const -{ - if (index.column() != IncludeColumn) - return QFileSystemModel::data(index, role); - const bool include = !m_filesToExclude.contains(filePath(index)); - if (role == Qt::DisplayRole) - return include ? tr("Include") : tr("Do not include"); - else if (role == Qt::CheckStateRole) - return include ? Qt::Checked : Qt::Unchecked; - else - return QVariant(); -} - -bool MaemoPublishedProjectModel::setData(const QModelIndex &index, - const QVariant &value, int role) -{ - if (index.column() != IncludeColumn) - return QFileSystemModel::setData(index, value, role); - if (role == Qt::CheckStateRole) { - if (value == Qt::Checked) - m_filesToExclude.remove(filePath(index)); - else - m_filesToExclude.insert(filePath(index)); - if (isDir(index)) - emit layoutChanged(); - return true; - } - return false; -} - - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemopublishedprojectmodel.h b/src/plugins/madde/maemopublishedprojectmodel.h deleted file mode 100644 index 7d0723d6e5..0000000000 --- a/src/plugins/madde/maemopublishedprojectmodel.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOPUBLISHEDPROJECTMODEL_H -#define MAEMOPUBLISHEDPROJECTMODEL_H - -#include <QSet> -#include <QStringList> -#include <QFileSystemModel> - -namespace Madde { -namespace Internal { - -class MaemoPublishedProjectModel : public QFileSystemModel -{ - Q_OBJECT -public: - explicit MaemoPublishedProjectModel(QObject *parent = 0); - void initFilesToExclude(); - QStringList filesToExclude() const { return m_filesToExclude.toList(); } - -private: - virtual int columnCount(const QModelIndex &parent) const; - virtual int rowCount(const QModelIndex &parent) const; - virtual QVariant headerData(int section, Qt::Orientation orientation, - int role) const; - virtual QVariant data(const QModelIndex &index, int role) const; - virtual bool setData(const QModelIndex &index, const QVariant &value, - int role); - virtual Qt::ItemFlags flags(const QModelIndex &index) const; - - void initFilesToExclude(const QString &filePath); - - QSet<QString> m_filesToExclude; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOPUBLISHEDPROJECTMODEL_H diff --git a/src/plugins/madde/maemopublisherfremantlefree.cpp b/src/plugins/madde/maemopublisherfremantlefree.cpp deleted file mode 100644 index 7f3f7c0ef6..0000000000 --- a/src/plugins/madde/maemopublisherfremantlefree.cpp +++ /dev/null @@ -1,593 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maemopublisherfremantlefree.h" - -#include "maemoglobal.h" -#include "maemoconstants.h" -#include "debianmanager.h" -#include "maemopackagecreationstep.h" -#include "maemopublishingfileselectiondialog.h" -#include "qt4maemodeployconfiguration.h" - -#include <coreplugin/idocument.h> -#include <projectexplorer/project.h> -#include <projectexplorer/target.h> -#include <projectexplorer/toolchain.h> -#include <qt4projectmanager/qmakestep.h> -#include <qt4projectmanager/qt4buildconfiguration.h> -#include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> -#include <utils/fileutils.h> -#include <utils/qtcassert.h> -#include <ssh/sshremoteprocessrunner.h> - -#include <QCoreApplication> -#include <QDir> -#include <QFile> -#include <QFileInfo> -#include <QStringList> -#include <QIcon> - -using namespace Core; -using namespace Qt4ProjectManager; -using namespace RemoteLinux; -using namespace QSsh; -using namespace Utils; - -namespace Madde { -namespace Internal { - -MaemoPublisherFremantleFree::MaemoPublisherFremantleFree(const ProjectExplorer::Project *project, - QObject *parent) : - QObject(parent), - m_project(project), - m_state(Inactive), - m_uploader(0) -{ - m_sshParams.authenticationType = SshConnectionParameters::AuthenticationTypePublicKey; - m_sshParams.timeout = 30; - m_sshParams.port = 22; - m_process = new QProcess(this); - connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)), - SLOT(handleProcessFinished())); - connect(m_process, SIGNAL(error(QProcess::ProcessError)), - SLOT(handleProcessError(QProcess::ProcessError))); - connect(m_process, SIGNAL(readyReadStandardOutput()), - SLOT(handleProcessStdOut())); - connect(m_process, SIGNAL(readyReadStandardError()), - SLOT(handleProcessStdErr())); -} - -MaemoPublisherFremantleFree::~MaemoPublisherFremantleFree() -{ - QTC_ASSERT(m_state == Inactive, return); - m_process->kill(); -} - -void MaemoPublisherFremantleFree::publish() -{ - createPackage(); -} - -void MaemoPublisherFremantleFree::setSshParams(const QString &hostName, - const QString &userName, const QString &keyFile, const QString &remoteDir) -{ - Q_ASSERT(m_doUpload); - m_sshParams.host = hostName; - m_sshParams.userName = userName; - m_sshParams.privateKeyFile = keyFile; - m_remoteDir = remoteDir; -} - -void MaemoPublisherFremantleFree::cancel() -{ - finishWithFailure(tr("Canceled."), tr("Publishing canceled by user.")); -} - -void MaemoPublisherFremantleFree::createPackage() -{ - setState(CopyingProjectDir); - - const QStringList &problems = findProblems(); - if (!problems.isEmpty()) { - const QLatin1String separator("\n- "); - finishWithFailure(tr("The project is missing some information " - "important to publishing:") + separator + problems.join(separator), - tr("Publishing failed: Missing project information.")); - return; - } - - m_tmpProjectDir = tmpDirContainer() + QLatin1Char('/') - + m_project->displayName(); - if (QFileInfo(tmpDirContainer()).exists()) { - emit progressReport(tr("Removing left-over temporary directory...")); - QString error; - if (!FileUtils::removeRecursively(FileName::fromString(tmpDirContainer()), &error)) { - finishWithFailure(tr("Error removing temporary directory: %1").arg(error), - tr("Publishing failed: Could not create source package.")); - return; - } - } - - emit progressReport(tr("Setting up temporary directory...")); - if (!QDir::temp().mkdir(QFileInfo(tmpDirContainer()).fileName())) { - finishWithFailure(tr("Error: Could not create temporary directory."), - tr("Publishing failed: Could not create source package.")); - return; - } - if (!copyRecursively(m_project->projectDirectory(), m_tmpProjectDir)) { - finishWithFailure(tr("Error: Could not copy project directory."), - tr("Publishing failed: Could not create source package.")); - return; - } - if (!fixNewlines()) { - finishWithFailure(tr("Error: Could not fix newlines."), - tr("Publishing failed: Could not create source package.")); - return; - } - - emit progressReport(tr("Cleaning up temporary directory...")); - AbstractMaemoPackageCreationStep::preparePackagingProcess(m_process, - m_buildConfig, m_tmpProjectDir); - setState(RunningQmake); - ProjectExplorer::AbstractProcessStep * const qmakeStep - = m_buildConfig->qmakeStep(); - qmakeStep->init(); - const ProjectExplorer::ProcessParameters * const pp - = qmakeStep->processParameters(); - m_process->start(pp->effectiveCommand() + QLatin1String(" ") - + pp->effectiveArguments()); -} - -bool MaemoPublisherFremantleFree::copyRecursively(const QString &srcFilePath, - const QString &tgtFilePath) -{ - if (m_state == Inactive) - return true; - - QFileInfo srcFileInfo(srcFilePath); - if (srcFileInfo.isDir()) { - if (srcFileInfo == QFileInfo(m_project->projectDirectory() - + QLatin1String("/debian"))) - return true; - QString actualSourcePath = srcFilePath; - QString actualTargetPath = tgtFilePath; - - if (srcFileInfo.fileName() == QLatin1String("qtc_packaging")) { - actualSourcePath += QLatin1String("/debian_fremantle"); - actualTargetPath.replace(QRegExp(QLatin1String("qtc_packaging$")), - QLatin1String("debian")); - } - - QDir targetDir(actualTargetPath); - targetDir.cdUp(); - if (!targetDir.mkdir(QFileInfo(actualTargetPath).fileName())) { - emit progressReport(tr("Failed to create directory '%1'.") - .arg(QDir::toNativeSeparators(actualTargetPath)), ErrorOutput); - return false; - } - QDir sourceDir(actualSourcePath); - QStringList fileNames = sourceDir.entryList(QDir::Files | QDir::Hidden - | QDir::System | QDir::Dirs | QDir::NoDotAndDotDot); - foreach (const QString &fileName, fileNames) { - if (!copyRecursively(actualSourcePath + QLatin1Char('/') + fileName, - actualTargetPath + QLatin1Char('/') + fileName)) - return false; - } - } else { - if (tgtFilePath == m_tmpProjectDir + QLatin1String("/debian/rules")) { - FileReader reader; - if (!reader.fetch(srcFilePath)) { - emit progressReport(reader.errorString(), ErrorOutput); - return false; - } - QByteArray rulesContents = reader.data(); - rulesContents.replace("$(MAKE) clean", "# $(MAKE) clean"); - rulesContents.replace("# Add here commands to configure the package.", - "qmake " + QFileInfo(m_project->projectFilePath()).fileName().toLocal8Bit()); - MaemoDebianPackageCreationStep::ensureShlibdeps(rulesContents); - FileSaver saver(tgtFilePath); - saver.write(rulesContents); - if (!saver.finalize()) { - emit progressReport(saver.errorString(), ErrorOutput); - return false; - } - QFile rulesFile(tgtFilePath); - if (!rulesFile.setPermissions(rulesFile.permissions() | QFile::ExeUser)) { - emit progressReport(tr("Could not set execute permissions for rules file: %1") - .arg(rulesFile.errorString())); - return false; - } - } else { - QFile srcFile(srcFilePath); - if (!srcFile.copy(tgtFilePath)) { - emit progressReport(tr("Could not copy file '%1' to '%2': %3.") - .arg(QDir::toNativeSeparators(srcFilePath), - QDir::toNativeSeparators(tgtFilePath), - srcFile.errorString())); - return false; - } - } - } - return true; -} - -bool MaemoPublisherFremantleFree::fixNewlines() -{ - QDir debianDir(m_tmpProjectDir + QLatin1String("/debian")); - const QStringList &fileNames = debianDir.entryList(QDir::Files); - foreach (const QString &fileName, fileNames) { - QString filePath = debianDir.filePath(fileName); - FileReader reader; - if (!reader.fetch(filePath)) - return false; - QByteArray contents = reader.data(); - const QByteArray crlf("\r\n"); - if (!contents.contains(crlf)) - continue; - contents.replace(crlf, "\n"); - FileSaver saver(filePath); - saver.write(contents); - if (!saver.finalize()) - return false; - } - return true; -} - -void MaemoPublisherFremantleFree::handleProcessError(QProcess::ProcessError error) -{ - if (error == QProcess::FailedToStart) - handleProcessFinished(true); -} - -void MaemoPublisherFremantleFree::handleProcessFinished() -{ - handleProcessFinished(false); -} - -void MaemoPublisherFremantleFree::handleProcessStdOut() -{ - if (m_state == RunningQmake || m_state == RunningMakeDistclean - || m_state == BuildingPackage) { - emit progressReport(QString::fromLocal8Bit(m_process->readAllStandardOutput()), - ToolStatusOutput); - } -} - -void MaemoPublisherFremantleFree::handleProcessStdErr() -{ - if (m_state == RunningQmake || m_state == RunningMakeDistclean - || m_state == BuildingPackage) { - emit progressReport(QString::fromLocal8Bit(m_process->readAllStandardError()), - ToolErrorOutput); - } -} - -void MaemoPublisherFremantleFree::handleProcessFinished(bool failedToStart) -{ - QTC_ASSERT(m_state == RunningQmake || m_state == RunningMakeDistclean - || m_state == BuildingPackage || m_state == Inactive, return); - - switch (m_state) { - case RunningQmake: - if (failedToStart || m_process->exitStatus() != QProcess::NormalExit - ||m_process->exitCode() != 0) { - runDpkgBuildPackage(); - } else { - setState(RunningMakeDistclean); - // Toolchain might be null! (yes because this sucks) - ProjectExplorer::ToolChain *tc - = ProjectExplorer::ToolChainKitInformation::toolChain(m_buildConfig->target()->kit()); - if (!tc) { - finishWithFailure(QString(), tr("Make distclean failed: %1") - .arg(ProjectExplorer::ToolChainKitInformation::msgNoToolChainInTarget())); - } - m_process->start(tc->makeCommand(m_buildConfig->environment()), QStringList() << QLatin1String("distclean")); - } - break; - case RunningMakeDistclean: - runDpkgBuildPackage(); - break; - case BuildingPackage: { - QString error; - if (failedToStart) { - error = tr("Error: Failed to start dpkg-buildpackage."); - } else if (m_process->exitStatus() != QProcess::NormalExit - || m_process->exitCode() != 0) { - error = tr("Error: dpkg-buildpackage did not succeed."); - } - - if (!error.isEmpty()) { - finishWithFailure(error, tr("Package creation failed.")); - return; - } - - QDir dir(tmpDirContainer()); - const QStringList &fileNames = dir.entryList(QDir::Files); - foreach (const QString &fileName, fileNames) { - const QString filePath - = tmpDirContainer() + QLatin1Char('/') + fileName; - if (fileName.endsWith(QLatin1String(".dsc"))) - m_filesToUpload.append(filePath); - else - m_filesToUpload.prepend(filePath); - } - if (!m_doUpload) { - emit progressReport(tr("Done.")); - QStringList nativeFilePaths; - foreach (const QString &filePath, m_filesToUpload) - nativeFilePaths << QDir::toNativeSeparators(filePath); - m_resultString = tr("Packaging finished successfully. " - "The following files were created:\n") - + nativeFilePaths.join(QLatin1String("\n")); - setState(Inactive); - } else { - uploadPackage(); - } - break; - } - default: - break; - } -} - -void MaemoPublisherFremantleFree::runDpkgBuildPackage() -{ - MaemoPublishingFileSelectionDialog d(m_tmpProjectDir); - if (d.exec() == QDialog::Rejected) { - cancel(); - return; - } - foreach (const QString &filePath, d.filesToExclude()) { - QString error; - if (!FileUtils::removeRecursively(FileName::fromString(filePath), &error)) { - finishWithFailure(error, - tr("Publishing failed: Could not create package.")); - } - } - - QtSupport::BaseQtVersion *lqt = QtSupport::QtKitInformation::qtVersion(m_buildConfig->target()->kit()); - if (!lqt) - finishWithFailure(QString(), tr("No Qt version set.")); - - if (m_state == Inactive) - return; - setState(BuildingPackage); - emit progressReport(tr("Building source package...")); - const QStringList args = QStringList() << QLatin1String("dpkg-buildpackage") - << QLatin1String("-S") << QLatin1String("-us") << QLatin1String("-uc"); - MaemoGlobal::callMad(*m_process, args, lqt->qmakeCommand().toString(), true); -} - -// We have to implement the SCP protocol, because the maemo.org -// webmaster refuses to enable SFTP "for security reasons" ... -void MaemoPublisherFremantleFree::uploadPackage() -{ - if (!m_uploader) - m_uploader = new SshRemoteProcessRunner(this); - connect(m_uploader, SIGNAL(processStarted()), SLOT(handleScpStarted())); - connect(m_uploader, SIGNAL(connectionError()), SLOT(handleConnectionError())); - connect(m_uploader, SIGNAL(processClosed(int)), SLOT(handleUploadJobFinished(int))); - connect(m_uploader, SIGNAL(readyReadStandardOutput()), SLOT(handleScpStdOut())); - emit progressReport(tr("Starting scp...")); - setState(StartingScp); - m_uploader->run("scp -td " + m_remoteDir.toUtf8(), m_sshParams); -} - -void MaemoPublisherFremantleFree::handleScpStarted() -{ - QTC_ASSERT(m_state == StartingScp || m_state == Inactive, return); - - if (m_state == StartingScp) - prepareToSendFile(); -} - -void MaemoPublisherFremantleFree::handleConnectionError() -{ - if (m_state != Inactive) { - finishWithFailure(tr("SSH error: %1").arg(m_uploader->lastConnectionErrorString()), - tr("Upload failed.")); - } -} - -void MaemoPublisherFremantleFree::handleUploadJobFinished(int exitStatus) -{ - QTC_ASSERT(m_state == PreparingToUploadFile || m_state == UploadingFile || m_state ==Inactive, - return); - - if (m_state != Inactive && (exitStatus != SshRemoteProcess::NormalExit - || m_uploader->processExitCode() != 0)) { - QString error; - if (exitStatus != SshRemoteProcess::NormalExit) { - error = tr("Error uploading file: %1.") - .arg(m_uploader->processErrorString()); - } else { - error = tr("Error uploading file."); - } - finishWithFailure(error, tr("Upload failed.")); - } -} - -void MaemoPublisherFremantleFree::prepareToSendFile() -{ - if (m_filesToUpload.isEmpty()) { - emit progressReport(tr("All files uploaded.")); - m_resultString = tr("Upload succeeded. You should shortly " - "receive an email informing you about the outcome " - "of the build process."); - setState(Inactive); - return; - } - - setState(PreparingToUploadFile); - const QString &nextFilePath = m_filesToUpload.first(); - emit progressReport(tr("Uploading file %1...") - .arg(QDir::toNativeSeparators(nextFilePath))); - QFileInfo info(nextFilePath); - m_uploader->writeDataToProcess("C0644 " + QByteArray::number(info.size()) - + ' ' + info.fileName().toUtf8() + '\n'); -} - -void MaemoPublisherFremantleFree::sendFile() -{ - Q_ASSERT(!m_filesToUpload.isEmpty()); - Q_ASSERT(m_state == PreparingToUploadFile); - - setState(UploadingFile); - const QString filePath = m_filesToUpload.takeFirst(); - QFile file(filePath); - if (!file.open(QIODevice::ReadOnly)) { - finishWithFailure(tr("Cannot open file for reading: %1.") - .arg(file.errorString()), tr("Upload failed.")); - return; - } - qint64 bytesToSend = file.size(); - while (bytesToSend > 0) { - const QByteArray &data - = file.read(qMin(bytesToSend, Q_INT64_C(1024*1024))); - if (data.count() == 0) { - finishWithFailure(tr("Cannot read file: %1").arg(file.errorString()), - tr("Upload failed.")); - return; - } - m_uploader->writeDataToProcess(data); - bytesToSend -= data.size(); - QCoreApplication::processEvents(); - if (m_state == Inactive) - return; - } - m_uploader->writeDataToProcess(QByteArray(1, '\0')); -} - -void MaemoPublisherFremantleFree::handleScpStdOut() -{ - QTC_ASSERT(m_state == PreparingToUploadFile || m_state == UploadingFile || m_state == Inactive, - return); - - if (m_state == Inactive) - return; - - m_scpOutput += m_uploader->readAllStandardOutput(); - if (m_scpOutput == QByteArray(1, '\0')) { - m_scpOutput.clear(); - switch (m_state) { - case PreparingToUploadFile: - sendFile(); - break; - case UploadingFile: - prepareToSendFile(); - break; - default: - break; - } - } else if (m_scpOutput.endsWith('\n')) { - const QByteArray error = m_scpOutput.mid(1, m_scpOutput.count() - 2); - QString progressError; - if (!error.isEmpty()) { - progressError = tr("Error uploading file: %1.") - .arg(QString::fromUtf8(error)); - } else { - progressError = tr("Error uploading file."); - } - finishWithFailure(progressError, tr("Upload failed.")); - } -} - -QString MaemoPublisherFremantleFree::tmpDirContainer() const -{ - return QDir::tempPath() + QLatin1String("/qtc_packaging_") - + m_project->displayName(); -} - -void MaemoPublisherFremantleFree::finishWithFailure(const QString &progressMsg, - const QString &resultMsg) -{ - if (!progressMsg.isEmpty()) - emit progressReport(progressMsg, ErrorOutput); - m_resultString = resultMsg; - setState(Inactive); -} - -QStringList MaemoPublisherFremantleFree::findProblems() const -{ - QStringList problems; - ProjectExplorer::Target *target = m_buildConfig->target(); - Core::Id deviceType - = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target->kit()); - if (deviceType != Maemo5OsType) - return QStringList(); - - const QString &description = DebianManager::shortDescription(DebianManager::debianDirectory(target)); - if (description.trimmed().isEmpty()) { - problems << tr("The package description is empty. You must set one " - "in Projects -> Run -> Create Package -> Details."); - } else if (description.contains(QLatin1String("insert up to"))) { - problems << tr("The package description is '%1', which is probably " - "not what you want. Please change it in " - "Projects -> Run -> Create Package -> Details.").arg(description); - } - - QString dummy; - if (DebianManager::packageManagerIcon(DebianManager::debianDirectory(target), &dummy).isNull()) - problems << tr("You have not set an icon for the package manager. " - "The icon must be set in Projects -> Run -> Create Package -> Details."); - return problems; -} - -void MaemoPublisherFremantleFree::setState(State newState) -{ - if (m_state == newState) - return; - const State oldState = m_state; - m_state = newState; - if (m_state == Inactive) { - switch (oldState) { - case RunningQmake: - case RunningMakeDistclean: - case BuildingPackage: - disconnect(m_process, 0, this, 0); - m_process->terminate(); - break; - case StartingScp: - case PreparingToUploadFile: - case UploadingFile: - // TODO: Can we ensure the remote scp exits, e.g. by sending - // an illegal sequence of bytes? (Probably not, if - // we are currently uploading a file.) - disconnect(m_uploader, 0, this, 0); - break; - default: - break; - } - emit finished(); - } -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemopublisherfremantlefree.h b/src/plugins/madde/maemopublisherfremantlefree.h deleted file mode 100644 index f14f077bd1..0000000000 --- a/src/plugins/madde/maemopublisherfremantlefree.h +++ /dev/null @@ -1,126 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#ifndef MAEMOPUBLISHERFREMANTLEFREE_H -#define MAEMOPUBLISHERFREMANTLEFREE_H - -#include <ssh/sshconnection.h> - -#include <QObject> -#include <QProcess> - -namespace ProjectExplorer { -class Project; -} - -namespace Qt4ProjectManager { -class Qt4BuildConfiguration; -} - -namespace QSsh { -class SshRemoteProcessRunner; -} - -namespace Madde { -namespace Internal { - -class MaemoPublisherFremantleFree : public QObject -{ - Q_OBJECT -public: - enum OutputType { - StatusOutput, ErrorOutput, ToolStatusOutput, ToolErrorOutput - }; - - explicit MaemoPublisherFremantleFree(const ProjectExplorer::Project *project, - QObject *parent = 0); - ~MaemoPublisherFremantleFree(); - - void publish(); - void cancel(); - - void setBuildConfiguration(const Qt4ProjectManager::Qt4BuildConfiguration *buildConfig) { m_buildConfig = buildConfig; } - void setDoUpload(bool doUpload) { m_doUpload = doUpload; } - void setSshParams(const QString &hostName, const QString &userName, - const QString &keyFile, const QString &remoteDir); - - QString resultString() const { return m_resultString; } - -signals: - void progressReport(const QString &text, - MaemoPublisherFremantleFree::OutputType = StatusOutput); - void finished(); - -private slots: - void handleProcessFinished(); - void handleProcessStdOut(); - void handleProcessStdErr(); - void handleProcessError(QProcess::ProcessError error); - void handleScpStarted(); - void handleConnectionError(); - void handleUploadJobFinished(int exitStatus); - void handleScpStdOut(); - -private: - enum State { - Inactive, CopyingProjectDir, RunningQmake, RunningMakeDistclean, - BuildingPackage, StartingScp, PreparingToUploadFile, UploadingFile - }; - - void setState(State newState); - void createPackage(); - void uploadPackage(); - bool copyRecursively(const QString &srcFilePath, - const QString &tgtFilePath); - bool fixNewlines(); - void handleProcessFinished(bool failedToStart); - void runDpkgBuildPackage(); - QString tmpDirContainer() const; - void prepareToSendFile(); - void sendFile(); - void finishWithFailure(const QString &progressMsg, const QString &resultMsg); - QStringList findProblems() const; - - const ProjectExplorer::Project * const m_project; - bool m_doUpload; - const Qt4ProjectManager::Qt4BuildConfiguration *m_buildConfig; - State m_state; - QString m_tmpProjectDir; - QProcess *m_process; - QSsh::SshConnectionParameters m_sshParams; - QString m_remoteDir; - QSsh::SshRemoteProcessRunner *m_uploader; - QByteArray m_scpOutput; - QList<QString> m_filesToUpload; - QString m_resultString; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOPUBLISHERFREMANTLEFREE_H diff --git a/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.cpp b/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.cpp deleted file mode 100644 index 7d85bbc2d3..0000000000 --- a/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maemopublishingbuildsettingspagefremantlefree.h" -#include "ui_maemopublishingbuildsettingspagefremantlefree.h" - -#include "maemoconstants.h" -#include "maemoglobal.h" -#include "maemopublisherfremantlefree.h" - -#include <projectexplorer/project.h> -#include <projectexplorer/target.h> -#include <qt4projectmanager/qt4buildconfiguration.h> -#include <qt4projectmanager/qt4projectmanagerconstants.h> -#include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> -#include <qtsupport/qtsupportconstants.h> -#include <utils/qtcassert.h> - -using namespace ProjectExplorer; -using namespace Qt4ProjectManager; - -namespace Madde { -namespace Internal { - -MaemoPublishingBuildSettingsPageFremantleFree::MaemoPublishingBuildSettingsPageFremantleFree(const Project *project, - MaemoPublisherFremantleFree *publisher, QWidget *parent) : - QWizardPage(parent), - m_publisher(publisher), - ui(new Ui::MaemoPublishingWizardPageFremantleFree) -{ - ui->setupUi(this); - - collectBuildConfigurations(project); - QTC_ASSERT(!m_buildConfigs.isEmpty(), return); - - foreach (const Qt4BuildConfiguration *const bc, m_buildConfigs) - ui->buildConfigComboBox->addItem(bc->displayName()); - - ui->buildConfigComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContentsOnFirstShow); - ui->buildConfigComboBox->setCurrentIndex(0); - connect(ui->skipUploadCheckBox, SIGNAL(toggled(bool)), - SLOT(handleNoUploadSettingChanged())); -} - -MaemoPublishingBuildSettingsPageFremantleFree::~MaemoPublishingBuildSettingsPageFremantleFree() -{ - delete ui; -} - -void MaemoPublishingBuildSettingsPageFremantleFree::collectBuildConfigurations(const Project *project) -{ - m_buildConfigs.clear(); - - foreach (const Target *const target, project->targets()) { - QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit()); - if (!version || version->platformName() != QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)) - continue; - foreach (BuildConfiguration *const bc, target->buildConfigurations()) { - Qt4BuildConfiguration *const qt4Bc = qobject_cast<Qt4BuildConfiguration *>(bc); - if (qt4Bc) - m_buildConfigs << qt4Bc; - } - } -} - -void MaemoPublishingBuildSettingsPageFremantleFree::initializePage() -{ - ui->skipUploadCheckBox->setChecked(true); -} - -bool MaemoPublishingBuildSettingsPageFremantleFree::validatePage() -{ - m_publisher->setBuildConfiguration(m_buildConfigs.at(ui->buildConfigComboBox->currentIndex())); - m_publisher->setDoUpload(!skipUpload()); - return true; -} - -void MaemoPublishingBuildSettingsPageFremantleFree::handleNoUploadSettingChanged() -{ - setCommitPage(skipUpload()); -} - -bool MaemoPublishingBuildSettingsPageFremantleFree::skipUpload() const -{ - return ui->skipUploadCheckBox->isChecked(); -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.h b/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.h deleted file mode 100644 index 0b21b7c84d..0000000000 --- a/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOPUBLISHINGBUILDSETTINGSPAGEFREMANTLEFREE_H -#define MAEMOPUBLISHINGBUILDSETTINGSPAGEFREMANTLEFREE_H - -#include <QList> -#include <QWizardPage> - -namespace ProjectExplorer { class Project; } -namespace Qt4ProjectManager { class Qt4BuildConfiguration; } - -namespace Madde { -namespace Internal { - -class MaemoPublisherFremantleFree; -namespace Ui { class MaemoPublishingWizardPageFremantleFree; } - -class MaemoPublishingBuildSettingsPageFremantleFree : public QWizardPage -{ - Q_OBJECT - -public: - explicit MaemoPublishingBuildSettingsPageFremantleFree(const ProjectExplorer::Project *project, - MaemoPublisherFremantleFree *publisher, - QWidget *parent = 0); - ~MaemoPublishingBuildSettingsPageFremantleFree(); - -private: - Q_SLOT void handleNoUploadSettingChanged(); - virtual void initializePage(); - virtual bool validatePage(); - void collectBuildConfigurations(const ProjectExplorer::Project *project); - bool skipUpload() const; - - QList<Qt4ProjectManager::Qt4BuildConfiguration *> m_buildConfigs; - MaemoPublisherFremantleFree * const m_publisher; - Ui::MaemoPublishingWizardPageFremantleFree *ui; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOPUBLISHINGBUILDSETTINGSPAGEFREMANTLEFREE_H diff --git a/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.ui b/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.ui deleted file mode 100644 index a77aa6f951..0000000000 --- a/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.ui +++ /dev/null @@ -1,75 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Madde::Internal::MaemoPublishingWizardPageFremantleFree</class> - <widget class="QWizardPage" name="Madde::Internal::MaemoPublishingWizardPageFremantleFree"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>433</width> - <height>149</height> - </rect> - </property> - <property name="windowTitle"> - <string>WizardPage</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLabel" name="buildConfigLabel"> - <property name="text"> - <string>Choose build configuration:</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="buildConfigComboBox"/> - </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> - <widget class="Line" name="line"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="skipUploadCheckBox"> - <property name="text"> - <string>Only create source package, do not upload</string> - </property> - </widget> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>78</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/src/plugins/madde/maemopublishingfileselectiondialog.cpp b/src/plugins/madde/maemopublishingfileselectiondialog.cpp deleted file mode 100644 index 4aedd4d912..0000000000 --- a/src/plugins/madde/maemopublishingfileselectiondialog.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemopublishingfileselectiondialog.h" -#include "ui_maemopublishingfileselectiondialog.h" - -#include "maemopublishedprojectmodel.h" - -namespace Madde { -namespace Internal { - -MaemoPublishingFileSelectionDialog::MaemoPublishingFileSelectionDialog(const QString &projectPath, - QWidget *parent) : - QDialog(parent), - ui(new Ui::MaemoPublishingFileSelectionDialog) -{ - ui->setupUi(this); - m_projectModel = new MaemoPublishedProjectModel(this); - const QModelIndex rootIndex = m_projectModel->setRootPath(projectPath); - m_projectModel->initFilesToExclude(); - ui->projectView->setModel(m_projectModel); - ui->projectView->setRootIndex(rootIndex); - ui->projectView->header()->setResizeMode(0, QHeaderView::ResizeToContents); -} - -MaemoPublishingFileSelectionDialog::~MaemoPublishingFileSelectionDialog() -{ - delete ui; -} - -QStringList MaemoPublishingFileSelectionDialog::filesToExclude() const -{ - return m_projectModel->filesToExclude(); -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemopublishingfileselectiondialog.h b/src/plugins/madde/maemopublishingfileselectiondialog.h deleted file mode 100644 index d008a2af77..0000000000 --- a/src/plugins/madde/maemopublishingfileselectiondialog.h +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOPUBLISHINGFILESELECTIONDIALOG_H -#define MAEMOPUBLISHINGFILESELECTIONDIALOG_H - -#include <QStringList> -#include <QDialog> - -namespace Madde { -namespace Internal { - -namespace Ui { class MaemoPublishingFileSelectionDialog; } - -class MaemoPublishingFileSelectionDialog : public QDialog -{ - Q_OBJECT - -public: - explicit MaemoPublishingFileSelectionDialog(const QString &projectPath, - QWidget *parent = 0); - ~MaemoPublishingFileSelectionDialog(); - QStringList filesToExclude() const; - -private: - Ui::MaemoPublishingFileSelectionDialog *ui; - class MaemoPublishedProjectModel *m_projectModel; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOPUBLISHINGFILESELECTIONDIALOG_H diff --git a/src/plugins/madde/maemopublishingfileselectiondialog.ui b/src/plugins/madde/maemopublishingfileselectiondialog.ui deleted file mode 100644 index 441d082706..0000000000 --- a/src/plugins/madde/maemopublishingfileselectiondialog.ui +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Madde::Internal::MaemoPublishingFileSelectionDialog</class> - <widget class="QDialog" name="Madde::Internal::MaemoPublishingFileSelectionDialog"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>704</width> - <height>528</height> - </rect> - </property> - <property name="windowTitle"> - <string>Choose Package Contents</string> - </property> - <property name="modal"> - <bool>false</bool> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QLabel" name="label"> - <property name="text"> - <string><b>Please select the files you want to be included in the source tarball.</b> -</string> - </property> - </widget> - </item> - <item> - <widget class="QTreeView" name="projectView"/> - </item> - <item> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons"> - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> - </property> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections> - <connection> - <sender>buttonBox</sender> - <signal>accepted()</signal> - <receiver>Madde::Internal::MaemoPublishingFileSelectionDialog</receiver> - <slot>accept()</slot> - <hints> - <hint type="sourcelabel"> - <x>248</x> - <y>254</y> - </hint> - <hint type="destinationlabel"> - <x>157</x> - <y>274</y> - </hint> - </hints> - </connection> - <connection> - <sender>buttonBox</sender> - <signal>rejected()</signal> - <receiver>Madde::Internal::MaemoPublishingFileSelectionDialog</receiver> - <slot>reject()</slot> - <hints> - <hint type="sourcelabel"> - <x>316</x> - <y>260</y> - </hint> - <hint type="destinationlabel"> - <x>286</x> - <y>274</y> - </hint> - </hints> - </connection> - </connections> -</ui> diff --git a/src/plugins/madde/maemopublishingresultpagefremantlefree.cpp b/src/plugins/madde/maemopublishingresultpagefremantlefree.cpp deleted file mode 100644 index 82a78952ae..0000000000 --- a/src/plugins/madde/maemopublishingresultpagefremantlefree.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maemopublishingresultpagefremantlefree.h" -#include "ui_maemopublishingresultpagefremantlefree.h" - -#include <QAbstractButton> - -namespace Madde { -namespace Internal { -typedef MaemoPublisherFremantleFree MPFF; - -MaemoPublishingResultPageFremantleFree::MaemoPublishingResultPageFremantleFree(MPFF *publisher, - QWidget *parent) : QWizardPage(parent), m_publisher(publisher), - ui(new Ui::MaemoPublishingResultPageFremantleFree) -{ - m_lastOutputType = MPFF::StatusOutput; - ui->setupUi(this); -} - -MaemoPublishingResultPageFremantleFree::~MaemoPublishingResultPageFremantleFree() -{ - delete ui; -} - -void MaemoPublishingResultPageFremantleFree::initializePage() -{ - cancelButton()->disconnect(); - connect(cancelButton(), SIGNAL(clicked()), SLOT(handleCancelRequest())); - connect(m_publisher, SIGNAL(finished()), SLOT(handleFinished())); - connect(m_publisher, - SIGNAL(progressReport(QString,MaemoPublisherFremantleFree::OutputType)), - SLOT(handleProgress(QString,MaemoPublisherFremantleFree::OutputType))); - m_publisher->publish(); -} - -void MaemoPublishingResultPageFremantleFree::handleFinished() -{ - handleProgress(m_publisher->resultString(), MPFF::StatusOutput); - m_isComplete = true; - cancelButton()->setEnabled(false); - emit completeChanged(); -} - -void MaemoPublishingResultPageFremantleFree::handleProgress(const QString &text, - MPFF::OutputType type) -{ - const QString color = QLatin1String(type == MPFF::StatusOutput - || type == MPFF::ToolStatusOutput ? "blue" : "red"); - ui->progressTextEdit->setTextColor(QColor(color)); - const bool bold = type == MPFF::StatusOutput - || type == MPFF::ErrorOutput ? true : false; - QFont font = ui->progressTextEdit->currentFont(); - font.setBold(bold); - ui->progressTextEdit->setCurrentFont(font); - - if (type == MPFF::StatusOutput || type == MPFF::ErrorOutput - || m_lastOutputType == MPFF::StatusOutput - || m_lastOutputType == MPFF::ErrorOutput) { - ui->progressTextEdit->append(text); - } else { - ui->progressTextEdit->insertPlainText(text); - } - ui->progressTextEdit->moveCursor(QTextCursor::End); - m_lastOutputType = type; -} - -void MaemoPublishingResultPageFremantleFree::handleCancelRequest() -{ - cancelButton()->setEnabled(false); - m_publisher->cancel(); -} - -QAbstractButton *MaemoPublishingResultPageFremantleFree::cancelButton() const -{ - return wizard()->button(QWizard::CancelButton); -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemopublishingresultpagefremantlefree.h b/src/plugins/madde/maemopublishingresultpagefremantlefree.h deleted file mode 100644 index c8c89fed88..0000000000 --- a/src/plugins/madde/maemopublishingresultpagefremantlefree.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOPUBLISHINGRESULTPAGEFREMANTLEFREE_H -#define MAEMOPUBLISHINGRESULTPAGEFREMANTLEFREE_H - -#include "maemopublisherfremantlefree.h" -#include <QWizardPage> - -namespace Madde { -namespace Internal { - -namespace Ui { class MaemoPublishingResultPageFremantleFree; } - -class MaemoPublishingResultPageFremantleFree : public QWizardPage -{ - Q_OBJECT - -public: - explicit MaemoPublishingResultPageFremantleFree(MaemoPublisherFremantleFree *publisher, - QWidget *parent = 0); - ~MaemoPublishingResultPageFremantleFree(); - -private slots: - void handleFinished(); - void handleProgress(const QString &text, - MaemoPublisherFremantleFree::OutputType type); - void handleCancelRequest(); - -private: - virtual bool isComplete() const { return m_isComplete; } - virtual void initializePage(); - - QAbstractButton *cancelButton() const; - - MaemoPublisherFremantleFree * const m_publisher; - bool m_isComplete; - MaemoPublisherFremantleFree::OutputType m_lastOutputType; - Ui::MaemoPublishingResultPageFremantleFree *ui; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOPUBLISHINGRESULTPAGEFREMANTLEFREE_H diff --git a/src/plugins/madde/maemopublishingresultpagefremantlefree.ui b/src/plugins/madde/maemopublishingresultpagefremantlefree.ui deleted file mode 100644 index 981a7e671f..0000000000 --- a/src/plugins/madde/maemopublishingresultpagefremantlefree.ui +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Madde::Internal::MaemoPublishingResultPageFremantleFree</class> - <widget class="QWizardPage" name="Madde::Internal::MaemoPublishingResultPageFremantleFree"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>414</width> - <height>337</height> - </rect> - </property> - <property name="windowTitle"> - <string>WizardPage</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QGroupBox" name="progressGroupBox"> - <property name="title"> - <string>Progress</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QTextEdit" name="progressTextEdit"/> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/src/plugins/madde/maemopublishinguploadsettingspagefremantlefree.cpp b/src/plugins/madde/maemopublishinguploadsettingspagefremantlefree.cpp deleted file mode 100644 index a3d82802d3..0000000000 --- a/src/plugins/madde/maemopublishinguploadsettingspagefremantlefree.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maemopublishinguploadsettingspagefremantlefree.h" -#include "ui_maemopublishinguploadsettingspagefremantlefree.h" - -#include "maemopublisherfremantlefree.h" - -#include <utils/pathchooser.h> - -#include <QDir> - -namespace Madde { -namespace Internal { - -MaemoPublishingUploadSettingsPageFremantleFree::MaemoPublishingUploadSettingsPageFremantleFree(MaemoPublisherFremantleFree *publisher, - QWidget *parent) : - QWizardPage(parent), - m_publisher(publisher), - ui(new Ui::MaemoPublishingUploadSettingsPageFremantleFree) -{ - ui->setupUi(this); - ui->serverAddressLabel->hide(); - ui->serverAddressLineEdit->hide(); - ui->targetDirectoryOnServerLabel->hide(); - ui->targetDirectoryOnServerLineEdit->hide(); - setTitle(tr("Publishing to Fremantle's \"Extras-devel/free\" Repository")); - setSubTitle(tr("Upload options")); - connect(ui->garageAccountLineEdit, SIGNAL(textChanged(QString)), - SIGNAL(completeChanged())); - connect(ui->privateKeyPathChooser, SIGNAL(changed(QString)), - SIGNAL(completeChanged())); - connect(ui->serverAddressLineEdit, SIGNAL(textChanged(QString)), - SIGNAL(completeChanged())); - connect(ui->targetDirectoryOnServerLineEdit, SIGNAL(textChanged(QString)), - SIGNAL(completeChanged())); -} - -MaemoPublishingUploadSettingsPageFremantleFree::~MaemoPublishingUploadSettingsPageFremantleFree() -{ - delete ui; -} - -void MaemoPublishingUploadSettingsPageFremantleFree::initializePage() -{ - ui->garageAccountLineEdit->clear(); - ui->privateKeyPathChooser->setExpectedKind(Utils::PathChooser::File); - ui->privateKeyPathChooser->setPromptDialogTitle(tr("Choose a Private Key File")); - ui->privateKeyPathChooser->setPath(QDir::toNativeSeparators(QDir::homePath() + QLatin1String("/.ssh/id_rsa"))); - ui->serverAddressLineEdit->setText(QLatin1String("drop.maemo.org")); - ui->targetDirectoryOnServerLineEdit->setText(QLatin1String("/var/www/extras-devel/incoming-builder/fremantle/")); -} - -bool MaemoPublishingUploadSettingsPageFremantleFree::isComplete() const -{ - return !garageAccountName().isEmpty() && !privateKeyFilePath().isEmpty() - && !serverName().isEmpty() && !directoryOnServer().isEmpty(); -} - -QString MaemoPublishingUploadSettingsPageFremantleFree::garageAccountName() const -{ - return ui->garageAccountLineEdit->text().trimmed(); -} - -QString MaemoPublishingUploadSettingsPageFremantleFree::privateKeyFilePath() const -{ - return ui->privateKeyPathChooser->path(); -} - -QString MaemoPublishingUploadSettingsPageFremantleFree::serverName() const -{ - return ui->serverAddressLineEdit->text().trimmed(); -} - -QString MaemoPublishingUploadSettingsPageFremantleFree::directoryOnServer() const -{ - return ui->targetDirectoryOnServerLineEdit->text().trimmed(); -} - -bool MaemoPublishingUploadSettingsPageFremantleFree::validatePage() -{ - m_publisher->setSshParams(serverName(), garageAccountName(), - privateKeyFilePath(), directoryOnServer()); - return true; -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemopublishinguploadsettingspagefremantlefree.h b/src/plugins/madde/maemopublishinguploadsettingspagefremantlefree.h deleted file mode 100644 index ee1f064094..0000000000 --- a/src/plugins/madde/maemopublishinguploadsettingspagefremantlefree.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOPUBLISHINGUPLOADSETTINGSPAGEFREMANTLEFREE_H -#define MAEMOPUBLISHINGUPLOADSETTINGSPAGEFREMANTLEFREE_H - -#include <QWizardPage> - -namespace Madde { -namespace Internal { - -class MaemoPublisherFremantleFree; -namespace Ui { class MaemoPublishingUploadSettingsPageFremantleFree; } - -class MaemoPublishingUploadSettingsPageFremantleFree : public QWizardPage -{ - Q_OBJECT - -public: - explicit MaemoPublishingUploadSettingsPageFremantleFree(MaemoPublisherFremantleFree *publisher, - QWidget *parent = 0); - ~MaemoPublishingUploadSettingsPageFremantleFree(); - -private: - void initializePage(); - bool isComplete() const; - bool validatePage(); - - QString garageAccountName() const; - QString privateKeyFilePath() const; - QString serverName() const; - QString directoryOnServer() const; - - MaemoPublisherFremantleFree * const m_publisher; - Ui::MaemoPublishingUploadSettingsPageFremantleFree *ui; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOPUBLISHINGUPLOADSETTINGSPAGEFREMANTLEFREE_H diff --git a/src/plugins/madde/maemopublishinguploadsettingspagefremantlefree.ui b/src/plugins/madde/maemopublishinguploadsettingspagefremantlefree.ui deleted file mode 100644 index e1c5350fe1..0000000000 --- a/src/plugins/madde/maemopublishinguploadsettingspagefremantlefree.ui +++ /dev/null @@ -1,100 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Madde::Internal::MaemoPublishingUploadSettingsPageFremantleFree</class> - <widget class="QWizardPage" name="Madde::Internal::MaemoPublishingUploadSettingsPageFremantleFree"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>636</width> - <height>128</height> - </rect> - </property> - <property name="windowTitle"> - <string>WizardPage</string> - </property> - <property name="title"> - <string>Upload Settings</string> - </property> - <layout class="QFormLayout" name="formLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="accountNameLabel"> - <property name="text"> - <string>Garage account name:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QLineEdit" name="garageAccountLineEdit"/> - </item> - <item> - <widget class="QLabel" name="getAccountLabel"> - <property name="text"> - <string><a href="https://garage.maemo.org/account/register.php">Get an account</a></string> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label"> - <property name="text"> - <string><a href="https://garage.maemo.org/extras-assistant/index.php">Request upload rights</a></string> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="keyFileLabel"> - <property name="text"> - <string>Private key file:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="Utils::PathChooser" name="privateKeyPathChooser" native="true"/> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="serverAddressLabel"> - <property name="text"> - <string>Server address:</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="serverAddressLineEdit"/> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="targetDirectoryOnServerLabel"> - <property name="text"> - <string>Target directory on server:</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QLineEdit" name="targetDirectoryOnServerLineEdit"/> - </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> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/src/plugins/madde/maemopublishingwizardfactories.cpp b/src/plugins/madde/maemopublishingwizardfactories.cpp deleted file mode 100644 index 9d02fb74f5..0000000000 --- a/src/plugins/madde/maemopublishingwizardfactories.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maemopublishingwizardfactories.h" - -#include "maemoconstants.h" -#include "maemoglobal.h" -#include "maemopublishingwizardfremantlefree.h" - -#include <projectexplorer/target.h> -#include <qt4projectmanager/qt4project.h> -#include <qt4projectmanager/qt4projectmanagerconstants.h> -#include <qtsupport/baseqtversion.h> -#include <qtsupport/qtkitinformation.h> -#include <qtsupport/qtsupportconstants.h> - -using namespace ProjectExplorer; -using namespace Qt4ProjectManager; - -namespace Madde { -namespace Internal { - -MaemoPublishingWizardFactoryFremantleFree::MaemoPublishingWizardFactoryFremantleFree(QObject *parent) - : IPublishingWizardFactory(parent) -{ -} - -QString MaemoPublishingWizardFactoryFremantleFree::displayName() const -{ - return tr("Publish for \"Fremantle Extras-devel free\" repository"); -} - -QString MaemoPublishingWizardFactoryFremantleFree::description() const -{ - return tr("This wizard will create a source archive and optionally upload " - "it to a build server, where the project will be compiled and " - "packaged and then moved to the \"Extras-devel free\" " - "repository, from where users can install it onto their N900 " - "devices. For the upload functionality, an account at " - "garage.maemo.org is required."); -} - -bool MaemoPublishingWizardFactoryFremantleFree::canCreateWizard(const Project *project) const -{ - if (!qobject_cast<const Qt4Project *>(project)) - return false; - foreach (const Target *const target, project->targets()) { - QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit()); - const QString &platform = version ? version->platformName() : QString(); - if (platform == QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)) - return true; - } - return false; -} - -QWizard *MaemoPublishingWizardFactoryFremantleFree::createWizard(const Project *project) const -{ - Q_ASSERT(canCreateWizard(project)); - return new MaemoPublishingWizardFremantleFree(project); -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemopublishingwizardfactories.h b/src/plugins/madde/maemopublishingwizardfactories.h deleted file mode 100644 index 28985cf713..0000000000 --- a/src/plugins/madde/maemopublishingwizardfactories.h +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#ifndef MAEMOPUBLISHINGWIZARDFACTORIES_H -#define MAEMOPUBLISHINGWIZARDFACTORIES_H - -#include <projectexplorer/publishing/ipublishingwizardfactory.h> - -namespace Core { -class SshRemoteProcessRunner; -} - -namespace Madde { -namespace Internal { - -class MaemoPublishingWizardFactoryFremantleFree - : public ProjectExplorer::IPublishingWizardFactory -{ - Q_OBJECT -public: - explicit MaemoPublishingWizardFactoryFremantleFree(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 Madde - -#endif // MAEMOPUBLISHINGWIZARDFACTORIES_H diff --git a/src/plugins/madde/maemopublishingwizardfremantlefree.cpp b/src/plugins/madde/maemopublishingwizardfremantlefree.cpp deleted file mode 100644 index 2ff299dc09..0000000000 --- a/src/plugins/madde/maemopublishingwizardfremantlefree.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemopublishingwizardfremantlefree.h" - -#include "maemopublishingresultpagefremantlefree.h" -#include "maemopublisherfremantlefree.h" -#include "maemopublishinguploadsettingspagefremantlefree.h" -#include "maemopublishingbuildsettingspagefremantlefree.h" - -using namespace ProjectExplorer; - -namespace Madde { -namespace Internal { -namespace { -enum PageId { BuildSettingsPageId, UploadSettingsPageId, ResultPageId }; -} // anonymous namespace - -MaemoPublishingWizardFremantleFree::MaemoPublishingWizardFremantleFree(const Project *project, - QWidget *parent) : - Wizard(parent), - m_project(project), - m_publisher(new MaemoPublisherFremantleFree(project, this)) -{ - setOption(NoCancelButton, false); - setWindowTitle(tr("Publishing to Fremantle's \"Extras-devel free\" Repository")); - - m_buildSettingsPage = new MaemoPublishingBuildSettingsPageFremantleFree(project, m_publisher); - m_buildSettingsPage->setTitle(tr("Build Settings")); - setPage(BuildSettingsPageId, m_buildSettingsPage); - - m_uploadSettingsPage = new MaemoPublishingUploadSettingsPageFremantleFree(m_publisher); - m_uploadSettingsPage->setTitle(tr("Upload Settings")); - m_uploadSettingsPage->setCommitPage(true); - setPage(UploadSettingsPageId, m_uploadSettingsPage); - - m_resultPage = new MaemoPublishingResultPageFremantleFree(m_publisher); - m_resultPage->setTitle(tr("Result")); - setPage(ResultPageId, m_resultPage); -} - -int MaemoPublishingWizardFremantleFree::nextId() const -{ - if (currentPage()->isCommitPage()) - return ResultPageId; - return QWizard::nextId(); -} - - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemopublishingwizardfremantlefree.h b/src/plugins/madde/maemopublishingwizardfremantlefree.h deleted file mode 100644 index af9b2e6cd7..0000000000 --- a/src/plugins/madde/maemopublishingwizardfremantlefree.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOPUBLISHINGWIZARDFREMANTLEFREE_H -#define MAEMOPUBLISHINGWIZARDFREMANTLEFREE_H - -#include <utils/wizard.h> - -namespace ProjectExplorer { -class Project; -} - -namespace Madde { -namespace Internal { -class MaemoPublishingResultPageFremantleFree; -class MaemoPublisherFremantleFree; -class MaemoPublishingUploadSettingsPageFremantleFree; -class MaemoPublishingBuildSettingsPageFremantleFree; - -class MaemoPublishingWizardFremantleFree : public Utils::Wizard -{ - Q_OBJECT -public: - explicit MaemoPublishingWizardFremantleFree(const ProjectExplorer::Project *project, - QWidget *parent = 0); - -private: - virtual int nextId() const; - - const ProjectExplorer::Project * const m_project; - MaemoPublisherFremantleFree * const m_publisher; - MaemoPublishingBuildSettingsPageFremantleFree *m_buildSettingsPage; - MaemoPublishingUploadSettingsPageFremantleFree *m_uploadSettingsPage; - MaemoPublishingResultPageFremantleFree *m_resultPage; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOPUBLISHINGWIZARDFREMANTLEFREE_H diff --git a/src/plugins/madde/maemoqemumanager.cpp b/src/plugins/madde/maemoqemumanager.cpp deleted file mode 100644 index 9a5ff3d6f3..0000000000 --- a/src/plugins/madde/maemoqemumanager.cpp +++ /dev/null @@ -1,529 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemoqemumanager.h" - -#include "maemoglobal.h" -#include "maemoqemuruntimeparser.h" -#include "maemosettingspages.h" -#include "maemoqtversion.h" - -#include <coreplugin/actionmanager/actionmanager.h> -#include <coreplugin/actionmanager/command.h> -#include <coreplugin/id.h> -#include <coreplugin/coreconstants.h> -#include <coreplugin/icore.h> -#include <coreplugin/icontext.h> -#include <coreplugin/modemanager.h> - -#include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/projectexplorer.h> -#include <projectexplorer/project.h> -#include <projectexplorer/session.h> -#include <projectexplorer/target.h> -#include <qtsupport/qtkitinformation.h> -#include <qtsupport/qtversionmanager.h> -#include <remotelinux/remotelinuxrunconfiguration.h> -#include <utils/filesystemwatcher.h> - -#include <QDebug> -#include <QDir> -#include <QList> -#include <QSet> -#include <QStringBuilder> - -#include <QAction> -#include <QDesktopServices> -#include <QMessageBox> - -#include <limits.h> - -using namespace ProjectExplorer; -using namespace QtSupport; -using namespace RemoteLinux; - -namespace Madde { -namespace Internal { - -MaemoQemuManager *MaemoQemuManager::m_instance = 0; - -const QSize iconSize = QSize(24, 20); - -MaemoQemuManager::MaemoQemuManager(QObject *parent) - : QObject(parent) - , m_qemuAction(0) - , m_qemuProcess(new QProcess(this)) - , m_runningQtId(INT_MIN) - , m_userTerminated(false) - , m_runtimeRootWatcher(0) - , m_runtimeFolderWatcher(0) -{ - m_qemuStarterIcon.addFile(QLatin1String(":/qt-maemo/images/qemu-run.png"), iconSize); - m_qemuStarterIcon.addFile(QLatin1String(":/qt-maemo/images/qemu-stop.png"), iconSize, - QIcon::Normal, QIcon::On); - - m_qemuAction = new QAction(tr("MeeGo Emulator"), this); - m_qemuAction->setIcon(m_qemuStarterIcon.pixmap(iconSize)); - m_qemuAction->setToolTip(tr("Start MeeGo Emulator")); - connect(m_qemuAction, SIGNAL(triggered()), this, SLOT(startRuntime())); - - Core::Command *qemuCommand = Core::ActionManager::registerAction(m_qemuAction, - "MaemoEmulator", Core::Context(Core::Constants::C_GLOBAL)); - qemuCommand->setAttribute(Core::Command::CA_UpdateText); - qemuCommand->setAttribute(Core::Command::CA_UpdateIcon); - - Core::ModeManager::addAction(qemuCommand->action(), 1); - m_qemuAction->setEnabled(false); - m_qemuAction->setVisible(false); - - // listen to Qt version changes to update the start button - connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), - this, SLOT(qtVersionsChanged(QList<int>,QList<int>,QList<int>))); - - // listen to project add, remove and startup changes to udate start button - QObject *sessionManager = SessionManager::instance(); - connect(sessionManager, SIGNAL(projectAdded(ProjectExplorer::Project*)), this, - SLOT(projectAdded(ProjectExplorer::Project*))); - connect(sessionManager, SIGNAL(projectRemoved(ProjectExplorer::Project*)), this, - SLOT(projectRemoved(ProjectExplorer::Project*))); - connect(sessionManager, SIGNAL(startupProjectChanged(ProjectExplorer::Project*)), - this, SLOT(projectChanged(ProjectExplorer::Project*))); - - connect(m_qemuProcess, SIGNAL(error(QProcess::ProcessError)), this, - SLOT(qemuProcessError(QProcess::ProcessError))); - connect(m_qemuProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, - SLOT(qemuProcessFinished())); - connect(m_qemuProcess, SIGNAL(readyReadStandardOutput()), this, - SLOT(qemuOutput())); - connect(m_qemuProcess, SIGNAL(readyReadStandardError()), this, - SLOT(qemuOutput())); - connect(this, SIGNAL(qemuProcessStatus(QemuStatus,QString)), - this, SLOT(qemuStatusChanged(QemuStatus,QString))); -} - -Utils::FileSystemWatcher *MaemoQemuManager::runtimeRootWatcher() -{ - if (!m_runtimeRootWatcher) { - m_runtimeRootWatcher = new Utils::FileSystemWatcher(this); - m_runtimeRootWatcher->setObjectName(QLatin1String("MaemoQemuRuntimeRootWatcher")); - connect(m_runtimeRootWatcher, SIGNAL(directoryChanged(QString)), this, - SLOT(runtimeRootChanged(QString))); - } - return m_runtimeRootWatcher; -} - -Utils::FileSystemWatcher *MaemoQemuManager::runtimeFolderWatcher() -{ - if (!m_runtimeFolderWatcher) { - m_runtimeFolderWatcher = new Utils::FileSystemWatcher(this); - m_runtimeFolderWatcher->setObjectName(QLatin1String("MaemoQemuRuntimeFolderWatcher")); - connect(m_runtimeFolderWatcher, SIGNAL(directoryChanged(QString)), this, - SLOT(runtimeFolderChanged(QString))); - } - return m_runtimeFolderWatcher; -} - -MaemoQemuManager::~MaemoQemuManager() -{ - terminateRuntime(); - m_instance = 0; -} - -MaemoQemuManager &MaemoQemuManager::instance(QObject *parent) -{ - if (m_instance == 0) - m_instance = new MaemoQemuManager(parent); - return *m_instance; -} - -bool MaemoQemuManager::runtimeForQtVersion(int uniqueId, MaemoQemuRuntime *rt) const -{ - *rt = m_runtimes.value(uniqueId, MaemoQemuRuntime()); - return rt->isValid(); -} - -bool MaemoQemuManager::qemuIsRunning() const -{ - return m_runningQtId != INT_MIN; -} - -void MaemoQemuManager::qtVersionsChanged(const QList<int> &added, const QList<int> &removed, const QList<int> &changed) -{ - QList<int> uniqueIds; - uniqueIds << added << removed << changed; - foreach (int uniqueId, uniqueIds) { - if (QtVersionManager::isValidId(uniqueId)) { - MaemoQtVersion *version = dynamic_cast<MaemoQtVersion *>(QtVersionManager::version(uniqueId)); - - if (version) { - MaemoQemuRuntime runtime - = MaemoQemuRuntimeParser::parseRuntime(version); - if (runtime.isValid()) { - m_runtimes.insert(uniqueId, runtime); - if (!runtimeRootWatcher()->watchesDirectory(runtime.m_watchPath)) - runtimeRootWatcher()->addDirectory(runtime.m_watchPath, - Utils::FileSystemWatcher::WatchAllChanges); - } else { - m_runtimes.remove(uniqueId); - } - } - } else { - // this Qt version has been removed from the settings - m_runtimes.remove(uniqueId); - if (uniqueId == m_runningQtId) { - terminateRuntime(); - emit qemuProcessStatus(QemuUserReason, tr("Qemu has been shut " - "down, because you removed the corresponding Qt version.")); - } - } - } - - showOrHideQemuButton(); -} - -void MaemoQemuManager::projectAdded(ProjectExplorer::Project *project) -{ - // handle all target related changes, add, remove, etc... - connect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)), this, - SLOT(targetAdded(ProjectExplorer::Target*))); - connect(project, SIGNAL(removedTarget(ProjectExplorer::Target*)), this, - SLOT(targetRemoved(ProjectExplorer::Target*))); - connect(project, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)), - this, SLOT(targetChanged(ProjectExplorer::Target*))); - - foreach (Target *target, project->targets()) - targetAdded(target); -} - -void MaemoQemuManager::projectRemoved(ProjectExplorer::Project *project) -{ - disconnect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)), this, - SLOT(targetAdded(ProjectExplorer::Target*))); - disconnect(project, SIGNAL(removedTarget(ProjectExplorer::Target*)), this, - SLOT(targetRemoved(ProjectExplorer::Target*))); - disconnect(project, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)), - this, SLOT(targetChanged(ProjectExplorer::Target*))); - - foreach (Target *target, project->targets()) - targetRemoved(target); - showOrHideQemuButton(); -} - -void MaemoQemuManager::projectChanged(ProjectExplorer::Project *project) -{ - if (project) { - toggleStarterButton(project->activeTarget()); - deviceConfigurationChanged(project->activeTarget()); - } -} - -void MaemoQemuManager::targetAdded(ProjectExplorer::Target *target) -{ - if (!target || !MaemoGlobal::hasMaemoDevice(target->kit())) - return; - - // handle the Qt version changes the build configuration uses - connect(target, SIGNAL(environmentChanged()), this, SLOT(environmentChanged())); - connect(target, SIGNAL(kitChanged()), this, SLOT(systemChanged())); - - toggleStarterButton(target); -} - -void MaemoQemuManager::targetRemoved(ProjectExplorer::Target *target) -{ - if (!target || !MaemoGlobal::hasMaemoDevice(target->kit())) - return; - - disconnect(target, SIGNAL(environmentChanged()), this, SLOT(environmentChanged())); - disconnect(target, SIGNAL(kitChanged()), this, SLOT(systemChanged())); - - showOrHideQemuButton(); -} - -void MaemoQemuManager::targetChanged(ProjectExplorer::Target *target) -{ - if (target) { - toggleStarterButton(target); - deviceConfigurationChanged(target); - } -} - -void MaemoQemuManager::systemChanged() -{ - Target *t = qobject_cast<Target *>(sender()); - targetChanged(t); -} - -void MaemoQemuManager::environmentChanged() -{ - // likely to happen when the Qt version changes the build config is using - if (Project *project = SessionManager::startupProject()) - toggleStarterButton(project->activeTarget()); -} - -void MaemoQemuManager::deviceConfigurationChanged(ProjectExplorer::Target *target) -{ - m_qemuAction->setEnabled(targetUsesMatchingRuntimeConfig(target)); -} - -void MaemoQemuManager::startRuntime() -{ - m_userTerminated = false; - Project *p = SessionManager::startupProject(); - if (!p) - return; - BaseQtVersion *version; - if (!targetUsesMatchingRuntimeConfig(p->activeTarget(), &version)) { - qWarning("Strange: Qemu button was enabled, but target does not match."); - return; - } - - m_runningQtId = version->uniqueId(); - const MaemoQemuRuntime rt = m_runtimes.value(version->uniqueId()); - m_qemuProcess->setProcessEnvironment(rt.environment()); - m_qemuProcess->setWorkingDirectory(rt.m_root); - m_qemuProcess->start(rt.m_bin % QLatin1Char(' ') % rt.m_args); - if (!m_qemuProcess->waitForStarted()) - return; - - emit qemuProcessStatus(QemuStarting); - connect(m_qemuAction, SIGNAL(triggered()), this, SLOT(terminateRuntime())); - disconnect(m_qemuAction, SIGNAL(triggered()), this, SLOT(startRuntime())); -} - -void MaemoQemuManager::terminateRuntime() -{ - m_userTerminated = true; - - if (m_qemuProcess->state() != QProcess::NotRunning) { - m_qemuProcess->terminate(); - m_qemuProcess->kill(); - } - - connect(m_qemuAction, SIGNAL(triggered()), this, SLOT(startRuntime())); - disconnect(m_qemuAction, SIGNAL(triggered()), this, SLOT(terminateRuntime())); -} - -void MaemoQemuManager::qemuProcessFinished() -{ - m_runningQtId = INT_MIN; - QemuStatus status = QemuFinished; - QString error; - - if (!m_userTerminated) { - if (m_qemuProcess->exitStatus() == QProcess::CrashExit) { - status = QemuCrashed; - error = m_qemuProcess->errorString(); - } else if (m_qemuProcess->exitCode() != 0) { - error = tr("Qemu finished with error: Exit code was %1.") - .arg(m_qemuProcess->exitCode()); - } - } - - m_userTerminated = false; - emit qemuProcessStatus(status, error); -} - -void MaemoQemuManager::qemuProcessError(QProcess::ProcessError error) -{ - if (error == QProcess::FailedToStart) - emit qemuProcessStatus(QemuFailedToStart, m_qemuProcess->errorString()); -} - -void MaemoQemuManager::qemuStatusChanged(QemuStatus status, const QString &error) -{ - bool running = false; - switch (status) { - case QemuStarting: - running = true; - break; - case QemuFailedToStart: - QMessageBox::warning(0, tr("Qemu error"), - tr("Qemu failed to start: %1")); - break; - case QemuCrashed: - MaemoQemuSettingsPage::showQemuCrashDialog(); - break; - case QemuFinished: - case QemuUserReason: - if (!error.isEmpty()) - QMessageBox::warning(0, tr("Qemu error"), error); - break; - default: - Q_ASSERT(!"Missing handling of Qemu status"); - } - - updateStarterIcon(running); -} - -void MaemoQemuManager::qemuOutput() -{ - qDebug("%s", m_qemuProcess->readAllStandardOutput().data()); - qDebug("%s", m_qemuProcess->readAllStandardError().data()); -} - -void MaemoQemuManager::runtimeRootChanged(const QString &directory) -{ - QList<int> uniqueIds; - QMap<int, MaemoQemuRuntime>::const_iterator it; - for (it = m_runtimes.constBegin(); it != m_runtimes.constEnd(); ++it) { - if (QDir(it.value().m_watchPath) == QDir(directory)) - uniqueIds.append(it.key()); - } - - foreach (int uniqueId, uniqueIds) { - MaemoQemuRuntime runtime = m_runtimes.value(uniqueId, MaemoQemuRuntime()); - if (runtime.isValid()) { - if (QFile::exists(runtime.m_root)) { - // nothing changed, so we can remove it - uniqueIds.removeAll(uniqueId); - } - } else { - if (QFile::exists(runtime.m_root)) { - if (!QFile::exists(runtime.m_root + QLatin1String("/information"))) { - // install might be still in progress - uniqueIds.removeAll(uniqueId); - runtimeFolderWatcher()->addDirectory(runtime.m_root, - Utils::FileSystemWatcher::WatchAllChanges); - } - } - } - } - notify(uniqueIds); -} - -void MaemoQemuManager::runtimeFolderChanged(const QString &directory) -{ - if (QFile::exists(directory + QLatin1String("/information"))) { - QList<int> uniqueIds; - QMap<int, MaemoQemuRuntime>::const_iterator it; - for (it = m_runtimes.constBegin(); it != m_runtimes.constEnd(); ++it) { - if (QDir(it.value().m_root) == QDir(directory)) - uniqueIds.append(it.key()); - } - notify(uniqueIds); - if (m_runtimeFolderWatcher) - m_runtimeFolderWatcher->removeDirectory(directory); - } -} - -// -- private - -void MaemoQemuManager::updateStarterIcon(bool running) -{ - QIcon::State state; - QString toolTip; - if (running) { - state = QIcon::On; - toolTip = tr("Stop MeeGo Emulator"); - } else { - state = QIcon::Off; - toolTip = tr("Start MeeGo Emulator"); - } - - m_qemuAction->setToolTip(toolTip); - m_qemuAction->setIcon(m_qemuStarterIcon.pixmap(iconSize, QIcon::Normal, - state)); -} - -void MaemoQemuManager::toggleStarterButton(Target *target) -{ - int uniqueId = -1; - if (target) { - BaseQtVersion *version = QtKitInformation::qtVersion(target->kit()); - if (version) - uniqueId = version->uniqueId(); - } - - if (uniqueId >= 0 && (m_runtimes.isEmpty() || !m_runtimes.contains(uniqueId))) - qtVersionsChanged(QList<int>(), QList<int>(), QList<int>() << uniqueId); - - bool isRunning = m_qemuProcess->state() != QProcess::NotRunning; - if (m_runningQtId == uniqueId) - isRunning = false; - - const Project * const p = SessionManager::startupProject(); - const bool qemuButtonEnabled - = p && p->activeTarget() && MaemoGlobal::hasMaemoDevice(target->kit()) - && m_runtimes.value(uniqueId, MaemoQemuRuntime()).isValid() - && targetUsesMatchingRuntimeConfig(target) && !isRunning; - m_qemuAction->setEnabled(qemuButtonEnabled); - showOrHideQemuButton(); -} - -bool MaemoQemuManager::sessionHasMaemoTarget() const -{ - foreach (const Project *p, SessionManager::projects()) { - foreach (const Target * const target, p->targets()) { - if (MaemoGlobal::hasMaemoDevice(target->kit())) - return true; - } - } - return false; -} - -bool MaemoQemuManager::targetUsesMatchingRuntimeConfig(Target *target, - BaseQtVersion **qtVersion) -{ - if (!target) - return false; - if (target != target->project()->activeTarget()) - return false; - - RemoteLinuxRunConfiguration *mrc = - qobject_cast<RemoteLinuxRunConfiguration *> (target->activeRunConfiguration()); - if (!mrc) - return false; - - BaseQtVersion *version = QtKitInformation::qtVersion(target->kit()); - if (!version || !m_runtimes.value(version->uniqueId(), MaemoQemuRuntime()).isValid()) - return false; - - if (qtVersion) - *qtVersion = version; - const IDevice::ConstPtr config = DeviceKitInformation::device(target->kit()); - return !config.isNull() && config->machineType() == IDevice::Emulator; -} - -void MaemoQemuManager::notify(const QList<int> uniqueIds) -{ - qtVersionsChanged(QList<int>(), QList<int>(), uniqueIds); - environmentChanged(); // to toggle the start button -} - -void MaemoQemuManager::showOrHideQemuButton() -{ - const bool showButton = !m_runtimes.isEmpty() && sessionHasMaemoTarget(); - if (!showButton) - terminateRuntime(); - m_qemuAction->setVisible(showButton); -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemoqemumanager.h b/src/plugins/madde/maemoqemumanager.h deleted file mode 100644 index 06f216de0b..0000000000 --- a/src/plugins/madde/maemoqemumanager.h +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOQEMUMANAGER_H -#define MAEMOQEMUMANAGER_H - -#include "maemoconstants.h" -#include "maemoqemuruntime.h" - -#include <QMap> -#include <QObject> -#include <QProcess> - -#include <QIcon> - -QT_FORWARD_DECLARE_CLASS(QAction) -QT_FORWARD_DECLARE_CLASS(QStringList) - -namespace ProjectExplorer { -class BuildConfiguration; -class Project; -class RunConfiguration; -class Target; -} - -namespace QtSupport { class BaseQtVersion; } -namespace RemoteLinux { class RemoteLinuxRunConfiguration; } -namespace Utils { class FileSystemWatcher; } - -namespace Madde { -namespace Internal { - -class MaemoQemuManager : public QObject -{ - Q_OBJECT - -public: - static MaemoQemuManager& instance(QObject *parent = 0); - - bool runtimeForQtVersion(int uniqueId, MaemoQemuRuntime *rt) const; - bool qemuIsRunning() const; - Q_SLOT void startRuntime(); - -signals: - void qemuProcessStatus(QemuStatus, const QString &error = QString()); - -private slots: - void qtVersionsChanged(const QList<int> &addedIds, const QList<int> &removedIds, const QList<int> &changed); - - void projectAdded(ProjectExplorer::Project *project); - void projectRemoved(ProjectExplorer::Project *project); - void projectChanged(ProjectExplorer::Project *project); - - void targetAdded(ProjectExplorer::Target *target); - void targetRemoved(ProjectExplorer::Target *target); - void targetChanged(ProjectExplorer::Target *target); - void systemChanged(); - - void environmentChanged(); // needed to check for Qt version - void deviceConfigurationChanged(ProjectExplorer::Target *target); - - void terminateRuntime(); - - void qemuProcessFinished(); - void qemuProcessError(QProcess::ProcessError error); - void qemuStatusChanged(QemuStatus status, const QString &error); - void qemuOutput(); - - void runtimeRootChanged(const QString &directory); - void runtimeFolderChanged(const QString &directory); - -private: - MaemoQemuManager(QObject *parent); - ~MaemoQemuManager(); - - bool sessionHasMaemoTarget() const; - - void updateStarterIcon(bool running); - void toggleStarterButton(ProjectExplorer::Target *target); - bool targetUsesMatchingRuntimeConfig(ProjectExplorer::Target *target, - QtSupport::BaseQtVersion **qtVersion = 0); - - void notify(const QList<int> uniqueIds); - void showOrHideQemuButton(); - -private: - QAction *m_qemuAction; - QProcess *m_qemuProcess; - Utils::FileSystemWatcher *runtimeRootWatcher(); - Utils::FileSystemWatcher *runtimeFolderWatcher(); - - int m_runningQtId; - bool m_userTerminated; - QIcon m_qemuStarterIcon; - QMap<int, MaemoQemuRuntime> m_runtimes; - static MaemoQemuManager *m_instance; - Utils::FileSystemWatcher *m_runtimeRootWatcher; - Utils::FileSystemWatcher *m_runtimeFolderWatcher; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOQEMUMANAGER_H diff --git a/src/plugins/madde/maemoqemuruntime.h b/src/plugins/madde/maemoqemuruntime.h deleted file mode 100644 index b568326c9e..0000000000 --- a/src/plugins/madde/maemoqemuruntime.h +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#ifndef MAEMOQEMURUNTIME_H -#define MAEMOQEMURUNTIME_H - -#include "maemoqemusettings.h" - -#include <utils/portlist.h> - -#include <QHash> -#include <QList> -#include <QPair> -#include <QProcessEnvironment> -#include <QString> - -namespace Madde { -namespace Internal { - -enum QemuStatus { - QemuStarting, - QemuFailedToStart, - QemuFinished, - QemuCrashed, - QemuUserReason -}; - -struct MaemoQemuRuntime -{ - typedef QPair<QString, QString> Variable; - - MaemoQemuRuntime() {} - MaemoQemuRuntime(const QString &root) : m_root(root) {} - bool isValid() const { - return !m_bin.isEmpty(); - } - QProcessEnvironment environment() const { - QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); - foreach (const Variable &var, m_normalVars) - env.insert(var.first, var.second); - QHash<MaemoQemuSettings::OpenGlMode, QString>::ConstIterator it - = m_openGlBackendVarValues.find(MaemoQemuSettings::openGlMode()); - if (it != m_openGlBackendVarValues.constEnd()) - env.insert(m_openGlBackendVarName, it.value()); - return env; - } - - QString m_name; - QString m_bin; - QString m_root; - QString m_args; - QString m_sshPort; - QString m_watchPath; - Utils::PortList m_freePorts; - QList<Variable> m_normalVars; - QString m_openGlBackendVarName; - QHash<MaemoQemuSettings::OpenGlMode, QString> m_openGlBackendVarValues; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOQEMURUNTIME_H diff --git a/src/plugins/madde/maemoqemuruntimeparser.cpp b/src/plugins/madde/maemoqemuruntimeparser.cpp deleted file mode 100644 index 1a88c73037..0000000000 --- a/src/plugins/madde/maemoqemuruntimeparser.cpp +++ /dev/null @@ -1,428 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maemoqemuruntimeparser.h" - -#include "maemoglobal.h" -#include "maemoqemusettings.h" - -#include <qtsupport/baseqtversion.h> -#include <utils/hostosinfo.h> -#include <utils/qtcassert.h> - -#include <QDir> -#include <QProcess> -#include <QStringList> -#include <QTextStream> - -namespace Madde { -namespace Internal { - -class MaemoQemuRuntimeParserV1 : public MaemoQemuRuntimeParser -{ -public: - MaemoQemuRuntimeParserV1(const QString &madInfoOutput, - const QString &targetName, const QString &maddeRoot); - MaemoQemuRuntime parseRuntime(); - -private: - void fillRuntimeInformation(MaemoQemuRuntime *runtime) const; - void setEnvironment(MaemoQemuRuntime *runTime, const QString &envSpec) const; -}; - -class MaemoQemuRuntimeParserV2 : public MaemoQemuRuntimeParser -{ -public: - MaemoQemuRuntimeParserV2(const QString &madInfoOutput, - const QString &targetName, const QString &maddeRoot); - MaemoQemuRuntime parseRuntime(); - -private: - struct Port { - Port() : port(-1), ssh(false) {} - int port; - bool ssh; - }; - - void handleTargetTag(QString &runtimeName); - MaemoQemuRuntime handleRuntimeTag(); - void handleEnvironmentTag(MaemoQemuRuntime &runtime); - void handleVariableTag(MaemoQemuRuntime &runtime); - QList<Port> handleTcpPortListTag(); - Port handlePortTag(); - MaemoQemuSettings::OpenGlMode openGlTagToEnum(const QString &tag) const; -}; - -MaemoQemuRuntimeParser::MaemoQemuRuntimeParser(const QString &madInfoOutput, - const QString &targetName, const QString &maddeRoot) - : m_targetName(targetName), - m_maddeRoot(maddeRoot), - m_madInfoReader(madInfoOutput) -{ -} - -MaemoQemuRuntime MaemoQemuRuntimeParser::parseRuntime(const QtSupport::BaseQtVersion *qtVersion) -{ - MaemoQemuRuntime runtime; - const QString maddeRootPath = MaemoGlobal::maddeRoot(qtVersion->qmakeCommand().toString()); - QProcess madProc; - if (!MaemoGlobal::callMad(madProc, QStringList() << QLatin1String("info"), qtVersion->qmakeCommand().toString(), false)) - return runtime; - if (!madProc.waitForStarted() || !madProc.waitForFinished()) - return runtime; - QString madInfoOutput = QString::fromLocal8Bit(madProc.readAllStandardOutput()); - const QString &targetName = MaemoGlobal::targetName(qtVersion->qmakeCommand().toString()); - runtime = MaemoQemuRuntimeParserV2(madInfoOutput, targetName, maddeRootPath) - .parseRuntime(); - if (!runtime.m_name.isEmpty()) { - runtime.m_root = maddeRootPath + QLatin1String("/runtimes/") - + runtime.m_name; - } else { - runtime = MaemoQemuRuntimeParserV1(madInfoOutput, targetName, - maddeRootPath).parseRuntime(); - } - runtime.m_watchPath = runtime.m_root - .left(runtime.m_root.lastIndexOf(QLatin1Char('/'))); - - return runtime; -} - -MaemoQemuRuntimeParserV1::MaemoQemuRuntimeParserV1(const QString &madInfoOutput, - const QString &targetName, const QString &maddeRoot) - : MaemoQemuRuntimeParser(madInfoOutput, targetName, maddeRoot) -{ -} - -MaemoQemuRuntime MaemoQemuRuntimeParserV1::parseRuntime() -{ - QStringList installedRuntimes; - QString targetRuntime; - while (!m_madInfoReader.atEnd() && !installedRuntimes.contains(targetRuntime)) { - if (m_madInfoReader.readNext() == QXmlStreamReader::StartElement) { - if (targetRuntime.isEmpty() - && m_madInfoReader.name() == QLatin1String("target")) { - const QXmlStreamAttributes &attrs = m_madInfoReader.attributes(); - if (attrs.value(QLatin1String("target_id")) == m_targetName) - targetRuntime = attrs.value(QLatin1String("runtime_id")).toString(); - } else if (m_madInfoReader.name() == QLatin1String("runtime")) { - const QXmlStreamAttributes attrs = m_madInfoReader.attributes(); - while (!m_madInfoReader.atEnd()) { - if (m_madInfoReader.readNext() == QXmlStreamReader::EndElement - && m_madInfoReader.name() == QLatin1String("runtime")) - break; - if (m_madInfoReader.tokenType() == QXmlStreamReader::StartElement - && m_madInfoReader.name() == QLatin1String("installed")) { - if (m_madInfoReader.readNext() == QXmlStreamReader::Characters - && m_madInfoReader.text() == QLatin1String("true")) { - if (attrs.hasAttribute(QLatin1String("runtime_id"))) { - installedRuntimes << attrs.value(QLatin1String("runtime_id")).toString(); - } else if (attrs.hasAttribute(QLatin1String("id"))) { - // older MADDE seems to use only id - installedRuntimes << attrs.value(QLatin1String("id")).toString(); - } - } - break; - } - } - } - } - } - - MaemoQemuRuntime runtime; - if (installedRuntimes.contains(targetRuntime)) { - runtime.m_name = targetRuntime; - runtime.m_root = m_maddeRoot + QLatin1String("/runtimes/") - + targetRuntime; - fillRuntimeInformation(&runtime); - } - return runtime; - -} - -void MaemoQemuRuntimeParserV1::fillRuntimeInformation(MaemoQemuRuntime *runtime) const -{ - const QStringList files = QDir(runtime->m_root).entryList(QDir::Files - | QDir::NoSymLinks | QDir::NoDotAndDotDot); - - const QLatin1String infoFile("information"); - if (files.contains(infoFile)) { - QFile file(runtime->m_root + QLatin1Char('/') + infoFile); - if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { - QMap<QString, QString> map; - QTextStream stream(&file); - while (!stream.atEnd()) { - const QString &line = stream.readLine().trimmed(); - const int index = line.indexOf(QLatin1Char('=')); - map.insert(line.mid(0, index).remove(QLatin1Char('\'')), - line.mid(index + 1).remove(QLatin1Char('\''))); - } - - runtime->m_bin = map.value(QLatin1String("qemu")); - runtime->m_args = map.value(QLatin1String("qemu_args")); - setEnvironment(runtime, map.value(QLatin1String("libpath"))); - runtime->m_sshPort = map.value(QLatin1String("sshport")); - runtime->m_freePorts = Utils::PortList(); - int i = 2; - while (true) { - const QString port = map.value(QLatin1String("redirport") - + QString::number(i++)); - if (port.isEmpty()) - break; - runtime->m_freePorts.addPort(port.toInt()); - } - - // This is complex because of extreme MADDE weirdness. - const QString root = m_maddeRoot + QLatin1Char('/'); - const bool pathIsRelative = QFileInfo(runtime->m_bin).isRelative(); - if (Utils::HostOsInfo::isWindowsHost()) { - runtime->m_bin = - root + (pathIsRelative - ? QLatin1String("madlib/") + runtime->m_bin // Fremantle. - : runtime->m_bin) // Harmattan. - + QLatin1String(".exe"); - } else { - runtime->m_bin = pathIsRelative - ? root + QLatin1String("madlib/") + runtime->m_bin // Fremantle. - : runtime->m_bin; // Harmattan. - } - } - } -} - -void MaemoQemuRuntimeParserV1::setEnvironment(MaemoQemuRuntime *runTime, - const QString &envSpec) const -{ - QString remainingEnvSpec = envSpec; - QString currentKey; - while (true) { - const int nextEqualsSignPos - = remainingEnvSpec.indexOf(QLatin1Char('=')); - if (nextEqualsSignPos == -1) { - if (!currentKey.isEmpty()) - runTime->m_normalVars << MaemoQemuRuntime::Variable(currentKey, - remainingEnvSpec); - break; - } - const int keyStartPos - = remainingEnvSpec.lastIndexOf(QRegExp(QLatin1String("\\s")), - nextEqualsSignPos) + 1; - if (!currentKey.isEmpty()) { - const int valueEndPos - = remainingEnvSpec.lastIndexOf(QRegExp(QLatin1String("\\S")), - qMax(0, keyStartPos - 1)) + 1; - runTime->m_normalVars << MaemoQemuRuntime::Variable(currentKey, - remainingEnvSpec.left(valueEndPos)); - } - currentKey = remainingEnvSpec.mid(keyStartPos, - nextEqualsSignPos - keyStartPos); - remainingEnvSpec.remove(0, nextEqualsSignPos + 1); - } -} - - -MaemoQemuRuntimeParserV2::MaemoQemuRuntimeParserV2(const QString &madInfoOutput, - const QString &targetName, const QString &maddeRoot) - : MaemoQemuRuntimeParser(madInfoOutput, targetName, maddeRoot) -{ -} - -MaemoQemuRuntime MaemoQemuRuntimeParserV2::parseRuntime() -{ - QString runtimeName; - QList<MaemoQemuRuntime> runtimes; - while (m_madInfoReader.readNextStartElement()) { - if (m_madInfoReader.name() == QLatin1String("madde")) { - while (m_madInfoReader.readNextStartElement()) { - if (m_madInfoReader.name() == QLatin1String("targets")) { - while (m_madInfoReader.readNextStartElement()) - handleTargetTag(runtimeName); - } else if (m_madInfoReader.name() == QLatin1String("runtimes")) { - while (m_madInfoReader.readNextStartElement()) { - const MaemoQemuRuntime &rt = handleRuntimeTag(); - if (!rt.m_name.isEmpty() && !rt.m_bin.isEmpty() - && !rt.m_args.isEmpty()) { - runtimes << rt; - } - } - } else { - m_madInfoReader.skipCurrentElement(); - } - } - } - } - foreach (const MaemoQemuRuntime &rt, runtimes) { - if (rt.m_name == runtimeName) - return rt; - } - return MaemoQemuRuntime(); -} - -void MaemoQemuRuntimeParserV2::handleTargetTag(QString &runtimeName) -{ - const QXmlStreamAttributes &attrs = m_madInfoReader.attributes(); - if (m_madInfoReader.name() == QLatin1String("target") && runtimeName.isEmpty() - && attrs.value(QLatin1String("name")) == m_targetName - && attrs.value(QLatin1String("installed")) == QLatin1String("true")) { - while (m_madInfoReader.readNextStartElement()) { - if (m_madInfoReader.name() == QLatin1String("runtime")) - runtimeName = m_madInfoReader.readElementText(); - else - m_madInfoReader.skipCurrentElement(); - } - } else { - m_madInfoReader.skipCurrentElement(); - } -} - -MaemoQemuRuntime MaemoQemuRuntimeParserV2::handleRuntimeTag() -{ - MaemoQemuRuntime runtime; - const QXmlStreamAttributes &attrs = m_madInfoReader.attributes(); - if (m_madInfoReader.name() != QLatin1String("runtime") - || attrs.value(QLatin1String("installed")) != QLatin1String("true")) { - m_madInfoReader.skipCurrentElement(); - return runtime; - } - runtime.m_name = attrs.value(QLatin1String("name")).toString(); - while (m_madInfoReader.readNextStartElement()) { - if (m_madInfoReader.name() == QLatin1String("exec-path")) { - runtime.m_bin = m_madInfoReader.readElementText(); - } else if (m_madInfoReader.name() == QLatin1String("args")) { - runtime.m_args = m_madInfoReader.readElementText(); - } else if (m_madInfoReader.name() == QLatin1String("environment")) { - handleEnvironmentTag(runtime); - } else if (m_madInfoReader.name() == QLatin1String("tcpportmap")) { - const QList<Port> &ports = handleTcpPortListTag(); - foreach (const Port &port, ports) { - if (port.ssh) - runtime.m_sshPort = QString::number(port.port); - else - runtime.m_freePorts.addPort(port.port); - } - } else { - m_madInfoReader.skipCurrentElement(); - } - } - return runtime; -} - -void MaemoQemuRuntimeParserV2::handleEnvironmentTag(MaemoQemuRuntime &runtime) -{ - while (m_madInfoReader.readNextStartElement()) - handleVariableTag(runtime); - - if (Utils::HostOsInfo::isWindowsHost()) { - const QString root = QDir::toNativeSeparators(m_maddeRoot) - + QLatin1Char('/'); - const QLatin1Char colon(';'); - const QLatin1String key("PATH"); - QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); - runtime.m_normalVars << MaemoQemuRuntime::Variable(key, - root + QLatin1String("bin") + colon + env.value(key)); - runtime.m_normalVars << MaemoQemuRuntime::Variable(key, - root + QLatin1String("madlib") + colon + env.value(key)); - } -} - -void MaemoQemuRuntimeParserV2::handleVariableTag(MaemoQemuRuntime &runtime) -{ - if (m_madInfoReader.name() != QLatin1String("variable")) { - m_madInfoReader.skipCurrentElement(); - return; - } - - const bool isGlBackend = m_madInfoReader.attributes().value(QLatin1String("purpose")) - == QLatin1String("glbackend"); - QString varName; - QString varValue; - while (m_madInfoReader.readNextStartElement()) { - const QXmlStreamAttributes &attrs = m_madInfoReader.attributes(); - if (m_madInfoReader.name() == QLatin1String("name")) { - varName = m_madInfoReader.readElementText(); - } else if (m_madInfoReader.name() == QLatin1String("value") - && attrs.value(QLatin1String("set")) != QLatin1String("false")) { - varValue = m_madInfoReader.readElementText(); - if (isGlBackend) { - MaemoQemuSettings::OpenGlMode openGlMode - = openGlTagToEnum(attrs.value(QLatin1String("option")).toString()); - runtime.m_openGlBackendVarValues.insert(openGlMode, varValue); - } - } else { - m_madInfoReader.skipCurrentElement(); - } - } - - if (varName.isEmpty()) - return; - if (isGlBackend) - runtime.m_openGlBackendVarName = varName; - else - runtime.m_normalVars << MaemoQemuRuntime::Variable(varName, varValue); -} - -QList<MaemoQemuRuntimeParserV2::Port> MaemoQemuRuntimeParserV2::handleTcpPortListTag() -{ - QList<Port> ports; - while (m_madInfoReader.readNextStartElement()) { - const Port &port = handlePortTag(); - if (port.port != -1) - ports << port; - } - return ports; -} - -MaemoQemuRuntimeParserV2::Port MaemoQemuRuntimeParserV2::handlePortTag() -{ - Port port; - if (m_madInfoReader.name() == QLatin1String("port")) { - const QXmlStreamAttributes &attrs = m_madInfoReader.attributes(); - port.ssh = attrs.value(QLatin1String("service")) == QLatin1String("ssh"); - while (m_madInfoReader.readNextStartElement()) { - if (m_madInfoReader.name() == QLatin1String("host")) - port.port = m_madInfoReader.readElementText().toInt(); - else - m_madInfoReader.skipCurrentElement(); - } - } - return port; -} - -MaemoQemuSettings::OpenGlMode MaemoQemuRuntimeParserV2::openGlTagToEnum(const QString &tag) const -{ - if (tag == QLatin1String("hardware-acceleration")) - return MaemoQemuSettings::HardwareAcceleration; - if (tag == QLatin1String("software-rendering")) - return MaemoQemuSettings::SoftwareRendering; - if (tag == QLatin1String("autodetect")) - return MaemoQemuSettings::AutoDetect; - QTC_CHECK(false); - return MaemoQemuSettings::AutoDetect; -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemoqemuruntimeparser.h b/src/plugins/madde/maemoqemuruntimeparser.h deleted file mode 100644 index 398788bbc5..0000000000 --- a/src/plugins/madde/maemoqemuruntimeparser.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#ifndef MAEMOQEMURUNTIMEPARSER_H -#define MAEMOQEMURUNTIMEPARSER_H - -#include "maemoqemuruntime.h" - -#include <QString> -#include <QXmlStreamReader> - -namespace QtSupport { -class BaseQtVersion; -} - -namespace Madde { -namespace Internal { - -class MaemoQemuRuntimeParser -{ -public: - static MaemoQemuRuntime parseRuntime(const QtSupport::BaseQtVersion *qtVersion); - -protected: - MaemoQemuRuntimeParser(const QString &madInfoOutput, - const QString &targetName, const QString &maddeRoot); - - const QString m_targetName; - const QString m_maddeRoot; - QXmlStreamReader m_madInfoReader; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOQEMURUNTIMEPARSER_H diff --git a/src/plugins/madde/maemoqemusettings.cpp b/src/plugins/madde/maemoqemusettings.cpp deleted file mode 100644 index 93552d3221..0000000000 --- a/src/plugins/madde/maemoqemusettings.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemoqemusettings.h" - -#include <coreplugin/icore.h> - -#include <QSettings> - -namespace Madde { -namespace Internal { -namespace { -const QString SettingsGroup = QLatin1String("Maemo Qemu Settings"); -const QString OpenGlModeKey = QLatin1String("OpenGl Mode"); -} // anonymous namespace - -MaemoQemuSettings::OpenGlMode MaemoQemuSettings::openGlMode() -{ - if (!m_initialized) { - QSettings *settings = Core::ICore::settings(); - settings->beginGroup(SettingsGroup); - m_openGlMode = static_cast<OpenGlMode>(settings->value(OpenGlModeKey, AutoDetect).toInt()); - settings->endGroup(); - m_initialized = true; - } - return m_openGlMode; -} - -void MaemoQemuSettings::setOpenGlMode(OpenGlMode openGlMode) -{ - Q_ASSERT(m_initialized); - m_openGlMode = openGlMode; - QSettings *settings = Core::ICore::settings(); - settings->beginGroup(SettingsGroup); - settings->setValue(OpenGlModeKey, m_openGlMode); - settings->endGroup(); -} - -bool MaemoQemuSettings::m_initialized = false; -MaemoQemuSettings::OpenGlMode MaemoQemuSettings::m_openGlMode; - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemoqemusettings.h b/src/plugins/madde/maemoqemusettings.h deleted file mode 100644 index c5a20f7e95..0000000000 --- a/src/plugins/madde/maemoqemusettings.h +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOQEMUSETTINGS_H -#define MAEMOQEMUSETTINGS_H - -namespace Madde { -namespace Internal { - -class MaemoQemuSettings -{ -public: - enum OpenGlMode { HardwareAcceleration, SoftwareRendering, AutoDetect }; - - static OpenGlMode openGlMode(); - static void setOpenGlMode(OpenGlMode openGlMode); - -private: - MaemoQemuSettings(); - - static bool m_initialized; - static OpenGlMode m_openGlMode; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOQEMUSETTINGS_H diff --git a/src/plugins/madde/maemoqemusettingswidget.cpp b/src/plugins/madde/maemoqemusettingswidget.cpp deleted file mode 100644 index 3a7817cc87..0000000000 --- a/src/plugins/madde/maemoqemusettingswidget.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemoqemusettingswidget.h" -#include "ui_maemoqemusettingswidget.h" - -#include "maemoqemusettings.h" - -namespace Madde { -namespace Internal { - -MaemoQemuSettingsWidget::MaemoQemuSettingsWidget(QWidget *parent) : - QWidget(parent), - ui(new Ui::MaemoQemuSettingsWidget) -{ - ui->setupUi(this); - switch (MaemoQemuSettings::openGlMode()) { - case MaemoQemuSettings::HardwareAcceleration: - ui->hardwareAccelerationButton->setChecked(true); - break; - case MaemoQemuSettings::SoftwareRendering: - ui->softwareRenderingButton->setChecked(true); - break; - case MaemoQemuSettings::AutoDetect: - ui->autoDetectButton->setChecked(true); - break; - } -} - -MaemoQemuSettingsWidget::~MaemoQemuSettingsWidget() -{ - delete ui; -} - -QString MaemoQemuSettingsWidget::keywords() const -{ - const QChar space = QLatin1Char(' '); - QString keywords = ui->groupBox->title() + space - + ui->hardwareAccelerationButton->text() + space - + ui->softwareRenderingButton->text() + space - + ui->autoDetectButton->text(); - keywords.remove(QLatin1Char('&')); - return keywords; -} - -void MaemoQemuSettingsWidget::saveSettings() -{ - const MaemoQemuSettings::OpenGlMode openGlMode - = ui->hardwareAccelerationButton->isChecked() - ? MaemoQemuSettings::HardwareAcceleration - : ui->softwareRenderingButton->isChecked() - ? MaemoQemuSettings::SoftwareRendering - : MaemoQemuSettings::AutoDetect; - MaemoQemuSettings::setOpenGlMode(openGlMode); -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemoqemusettingswidget.h b/src/plugins/madde/maemoqemusettingswidget.h deleted file mode 100644 index 649ae31d1e..0000000000 --- a/src/plugins/madde/maemoqemusettingswidget.h +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOQEMUSETTINGSWIDGET_H -#define MAEMOQEMUSETTINGSWIDGET_H - -#include <QWidget> - -namespace Madde { -namespace Internal { - -namespace Ui { class MaemoQemuSettingsWidget; } - -class MaemoQemuSettingsWidget : public QWidget -{ - Q_OBJECT - -public: - explicit MaemoQemuSettingsWidget(QWidget *parent = 0); - ~MaemoQemuSettingsWidget(); - void saveSettings(); - QString keywords() const; - -private: - Ui::MaemoQemuSettingsWidget *ui; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOQEMUSETTINGSWIDGET_H diff --git a/src/plugins/madde/maemoqemusettingswidget.ui b/src/plugins/madde/maemoqemusettingswidget.ui deleted file mode 100644 index 769f94df0c..0000000000 --- a/src/plugins/madde/maemoqemusettingswidget.ui +++ /dev/null @@ -1,64 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Madde::Internal::MaemoQemuSettingsWidget</class> - <widget class="QWidget" name="Madde::Internal::MaemoQemuSettingsWidget"> - <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="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QGroupBox" name="groupBox"> - <property name="title"> - <string>OpenGL Mode</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QRadioButton" name="hardwareAccelerationButton"> - <property name="text"> - <string>&Hardware acceleration</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="softwareRenderingButton"> - <property name="text"> - <string>&Software rendering</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="autoDetectButton"> - <property name="text"> - <string>&Auto-detect</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/src/plugins/madde/maemoqtversion.cpp b/src/plugins/madde/maemoqtversion.cpp deleted file mode 100644 index 423d2ffee7..0000000000 --- a/src/plugins/madde/maemoqtversion.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maemoqtversion.h" - -#include "maemoconstants.h" -#include "maemoglobal.h" - -#include <projectexplorer/kitinformation.h> -#include <qt4projectmanager/qt4projectmanagerconstants.h> -#include <qtsupport/qtsupportconstants.h> -#include <coreplugin/featureprovider.h> -#include <utils/hostosinfo.h> - -#include <QCoreApplication> -#include <QFile> -#include <QDir> -#include <QTextStream> - -using namespace Qt4ProjectManager; - -namespace Madde { -namespace Internal { - -MaemoQtVersion::MaemoQtVersion() - : QtSupport::BaseQtVersion(), - m_isvalidVersion(false), - m_initialized(false) -{ - -} - -MaemoQtVersion::MaemoQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource) - : QtSupport::BaseQtVersion(path, isAutodetected, autodetectionSource), - m_deviceType(MaemoGlobal::deviceType(path.toString())), - m_isvalidVersion(false), - m_initialized(false) -{ - setDisplayName(defaultDisplayName(qtVersionString(), path, false)); -} - -MaemoQtVersion::~MaemoQtVersion() -{ - -} - -void MaemoQtVersion::fromMap(const QVariantMap &map) -{ - QtSupport::BaseQtVersion::fromMap(map); - QString path = qmakeCommand().toString(); - m_deviceType = MaemoGlobal::deviceType(path); -} - -QString MaemoQtVersion::type() const -{ - return QLatin1String(QtSupport::Constants::MAEMOQT); -} - -bool MaemoQtVersion::isValid() const -{ - if (!BaseQtVersion::isValid()) - return false; - if (!m_initialized) { - m_isvalidVersion = MaemoGlobal::isValidMaemoQtVersion(qmakeCommand().toString(), m_deviceType); - m_initialized = true; - } - return m_isvalidVersion; -} - -MaemoQtVersion *MaemoQtVersion::clone() const -{ - return new MaemoQtVersion(*this); -} - -QList<ProjectExplorer::Abi> MaemoQtVersion::detectQtAbis() const -{ - QList<ProjectExplorer::Abi> result; - if (!isValid()) - return result; - if (m_deviceType == Maemo5OsType) { - result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS, - ProjectExplorer::Abi::MaemoLinuxFlavor, ProjectExplorer::Abi::ElfFormat, - 32)); - } else if (m_deviceType == HarmattanOsType) { - result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS, - ProjectExplorer::Abi::HarmattanLinuxFlavor, - ProjectExplorer::Abi::ElfFormat, - 32)); - } - return result; -} - -QString MaemoQtVersion::description() const -{ - if (m_deviceType == Maemo5OsType) - return QCoreApplication::translate("QtVersion", "Maemo", "Qt Version is meant for Maemo5"); - if (m_deviceType == HarmattanOsType) - return QCoreApplication::translate("QtVersion", "Harmattan ", "Qt Version is meant for Harmattan"); - return QString(); -} - -bool MaemoQtVersion::supportsShadowBuilds() const -{ - return !Utils::HostOsInfo::isWindowsHost(); -} - -Core::Id MaemoQtVersion::deviceType() const -{ - return m_deviceType; -} - -Core::FeatureSet MaemoQtVersion::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); - features |= Core::FeatureSet(QtSupport::Constants::FEATURE_MOBILE); - - if (deviceType() != Maemo5OsType) //Only Maemo5 has proper support for Widgets - features.remove(Core::Feature(QtSupport::Constants::FEATURE_QWIDGETS)); - - return features; -} - -QString MaemoQtVersion::platformName() const -{ - if (m_deviceType == Maemo5OsType) - return QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM); - return QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM); -} - -QString MaemoQtVersion::platformDisplayName() const -{ - if (m_deviceType == Maemo5OsType) - return QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM_TR); - return QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM_TR); -} - -void MaemoQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const -{ - Q_UNUSED(k); - const QString maddeRoot = MaemoGlobal::maddeRoot(qmakeCommand().toString()); - - // Needed to make pkg-config stuff work. - Utils::FileName sysRoot = ProjectExplorer::SysRootKitInformation::sysRoot(k); - env.prependOrSet(QLatin1String("SYSROOT_DIR"), sysRoot.toUserOutput()); - env.prependOrSetPath(QDir::toNativeSeparators(QString::fromLatin1("%1/madbin") - .arg(maddeRoot))); - env.prependOrSetPath(QDir::toNativeSeparators(QString::fromLatin1("%1/madlib") - .arg(maddeRoot))); - env.prependOrSet(QLatin1String("PERL5LIB"), - QDir::toNativeSeparators(QString::fromLatin1("%1/madlib/perl5").arg(maddeRoot))); - - env.prependOrSetPath(QDir::toNativeSeparators(QString::fromLatin1("%1/bin").arg(maddeRoot))); - env.prependOrSetPath(QDir::toNativeSeparators(QString::fromLatin1("%1/bin") - .arg(MaemoGlobal::targetRoot(qmakeCommand().toString())))); - - // Actually this is tool chain related, but since we no longer have a tool chain... - const QString manglePathsKey = QLatin1String("GCCWRAPPER_PATHMANGLE"); - if (!env.hasKey(manglePathsKey)) { - const QStringList pathsToMangle = QStringList() << QLatin1String("/lib") - << QLatin1String("/opt") << QLatin1String("/usr"); - env.set(manglePathsKey, pathsToMangle.join(QLatin1String(":"))); - } -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemoqtversion.h b/src/plugins/madde/maemoqtversion.h deleted file mode 100644 index 3f38e43be1..0000000000 --- a/src/plugins/madde/maemoqtversion.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#ifndef MAEMOQTVERSION_H -#define MAEMOQTVERSION_H - -#include <qtsupport/baseqtversion.h> -#include <coreplugin/id.h> - -namespace Madde { -namespace Internal { - -class MaemoQtVersion : public QtSupport::BaseQtVersion -{ -public: - MaemoQtVersion(); - MaemoQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString()); - ~MaemoQtVersion(); - - void fromMap(const QVariantMap &map); - MaemoQtVersion *clone() const; - - QString type() const; - bool isValid() const; - - QList<ProjectExplorer::Abi> detectQtAbis() const; - void addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const; - - QString description() const; - - bool supportsShadowBuilds() const; - Core::Id deviceType() const; - Core::FeatureSet availableFeatures() const; - QString platformName() const; - QString platformDisplayName() const; - -private: - mutable QString m_systemRoot; - mutable Core::Id m_deviceType; - mutable bool m_isvalidVersion; - mutable bool m_initialized; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOQTVERSION_H diff --git a/src/plugins/madde/maemoqtversionfactory.cpp b/src/plugins/madde/maemoqtversionfactory.cpp deleted file mode 100644 index 198fd1ac14..0000000000 --- a/src/plugins/madde/maemoqtversionfactory.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemoqtversionfactory.h" -#include "maemoglobal.h" -#include "maemoqtversion.h" - -#include <qtsupport/qtsupportconstants.h> -#include <utils/qtcassert.h> - -#include <QFileInfo> - -namespace Madde { -namespace Internal { - -MaemoQtVersionFactory::MaemoQtVersionFactory(QObject *parent) - : QtSupport::QtVersionFactory(parent) -{ - -} - -MaemoQtVersionFactory::~MaemoQtVersionFactory() -{ - -} - -bool MaemoQtVersionFactory::canRestore(const QString &type) -{ - return type == QLatin1String(QtSupport::Constants::MAEMOQT); -} - -QtSupport::BaseQtVersion *MaemoQtVersionFactory::restore(const QString &type, - const QVariantMap &data) -{ - QTC_ASSERT(canRestore(type), return 0); - MaemoQtVersion *v = new MaemoQtVersion; - v->fromMap(data); - return v; -} - -int MaemoQtVersionFactory::priority() const -{ - return 50; -} - -QtSupport::BaseQtVersion *MaemoQtVersionFactory::create(const Utils::FileName &qmakeCommand, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource) -{ - Q_UNUSED(evaluator); - // we are the fallback :) so we don't care what kinf of qt it is - QFileInfo fi = qmakeCommand.toFileInfo(); - if (!fi.exists() || !fi.isExecutable() || !fi.isFile()) - return 0; - - QString qmakePath = qmakeCommand.toString(); - if (MaemoGlobal::isValidMaemo5QtVersion(qmakePath) - || MaemoGlobal::isValidHarmattanQtVersion(qmakePath)) { - return new MaemoQtVersion(qmakeCommand, isAutoDetected, autoDetectionSource); - } - return 0; -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemoqtversionfactory.h b/src/plugins/madde/maemoqtversionfactory.h deleted file mode 100644 index d5e9ec19d3..0000000000 --- a/src/plugins/madde/maemoqtversionfactory.h +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOQTVERSIONFACTORY_H -#define MAEMOQTVERSIONFACTORY_H - -#include <qtsupport/qtversionfactory.h> - -namespace Madde { -namespace Internal { - -class MaemoQtVersionFactory : public QtSupport::QtVersionFactory -{ -public: - explicit MaemoQtVersionFactory(QObject *parent = 0); - ~MaemoQtVersionFactory(); - - 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()); -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOQTVERSIONFACTORY_H diff --git a/src/plugins/madde/maemoremotecopyfacility.cpp b/src/plugins/madde/maemoremotecopyfacility.cpp deleted file mode 100644 index c981c41c7f..0000000000 --- a/src/plugins/madde/maemoremotecopyfacility.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maemoremotecopyfacility.h" - -#include "maemoglobal.h" - -#include <ssh/sshconnection.h> -#include <ssh/sshremoteprocessrunner.h> -#include <utils/hostosinfo.h> - -#include <QDir> - -using namespace ProjectExplorer; -using namespace QSsh; - -namespace Madde { -namespace Internal { - -MaemoRemoteCopyFacility::MaemoRemoteCopyFacility(QObject *parent) : - QObject(parent), m_copyRunner(0), m_killProcess(0), m_isCopying(false) -{ -} - -MaemoRemoteCopyFacility::~MaemoRemoteCopyFacility() {} - -void MaemoRemoteCopyFacility::copyFiles(const IDevice::ConstPtr &device, - const QList<DeployableFile> &deployables, const QString &mountPoint) -{ - Q_ASSERT(!m_isCopying); - - m_devConf = device; - m_deployables = deployables; - m_mountPoint = mountPoint; - - if (!m_copyRunner) - m_copyRunner = new SshRemoteProcessRunner(this); - connect(m_copyRunner, SIGNAL(connectionError()), SLOT(handleConnectionError())); - connect(m_copyRunner, SIGNAL(readyReadStandardOutput()), SLOT(handleRemoteStdout())); - connect(m_copyRunner, SIGNAL(readyReadStandardError()), SLOT(handleRemoteStderr())); - connect(m_copyRunner, SIGNAL(processClosed(int)), SLOT(handleCopyFinished(int))); - - m_isCopying = true; - copyNextFile(); -} - -void MaemoRemoteCopyFacility::cancel() -{ - Q_ASSERT(m_isCopying); - - if (!m_killProcess) - m_killProcess = new SshRemoteProcessRunner(this); - m_killProcess->run("pkill cp", m_devConf->sshParameters()); - setFinished(); -} - -void MaemoRemoteCopyFacility::handleConnectionError() -{ - setFinished(); - emit finished(tr("Connection failed: %1").arg(m_copyRunner->lastConnectionErrorString())); -} - -void MaemoRemoteCopyFacility::handleRemoteStdout() -{ - emit stdoutData(QString::fromUtf8(m_copyRunner->readAllStandardOutput())); -} - -void MaemoRemoteCopyFacility::handleRemoteStderr() -{ - emit stderrData(QString::fromUtf8(m_copyRunner->readAllStandardError())); -} - -void MaemoRemoteCopyFacility::handleCopyFinished(int exitStatus) -{ - if (!m_isCopying) - return; - - if (exitStatus != SshRemoteProcess::NormalExit - || m_copyRunner->processExitCode() != 0) { - setFinished(); - emit finished(tr("Error: Copy command failed.")); - } else { - emit fileCopied(m_deployables.takeFirst()); - copyNextFile(); - } -} - -void MaemoRemoteCopyFacility::copyNextFile() -{ - Q_ASSERT(m_isCopying); - - if (m_deployables.isEmpty()) { - setFinished(); - emit finished(); - return; - } - - const DeployableFile &d = m_deployables.first(); - QString sourceFilePath = m_mountPoint; - if (Utils::HostOsInfo::isWindowsHost()) { - const QString localFilePath = QDir::fromNativeSeparators(d.localFilePath().toString()); - sourceFilePath += QLatin1Char('/') + localFilePath.at(0).toLower() - + localFilePath.mid(2); - } else { - sourceFilePath += d.localFilePath().toString(); - } - - QString command = QString::fromLatin1("%1 mkdir -p %3 && %1 cp -a %2 %3") - .arg(MaemoGlobal::remoteSudo(m_devConf->type(), m_devConf->sshParameters().userName), - sourceFilePath, d.remoteDirectory()); - emit progress(tr("Copying file '%1' to directory '%2' on the device...") - .arg(d.localFilePath().toString(), d.remoteDirectory())); - m_copyRunner->run(command.toUtf8(), m_devConf->sshParameters()); -} - -void MaemoRemoteCopyFacility::setFinished() -{ - disconnect(m_copyRunner, 0, this, 0); - m_deployables.clear(); - m_isCopying = false; -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemoremotecopyfacility.h b/src/plugins/madde/maemoremotecopyfacility.h deleted file mode 100644 index ef9955dc22..0000000000 --- a/src/plugins/madde/maemoremotecopyfacility.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOREMOTECOPYFACILITY_H -#define MAEMOREMOTECOPYFACILITY_H - -#include <projectexplorer/deployablefile.h> -#include <projectexplorer/devicesupport/idevice.h> - -#include <QList> -#include <QSharedPointer> - -namespace QSsh { -class SshConnection; -class SshRemoteProcessRunner; -} - -namespace Madde { -namespace Internal { - -class MaemoRemoteCopyFacility : public QObject -{ - Q_OBJECT -public: - explicit MaemoRemoteCopyFacility(QObject *parent = 0); - ~MaemoRemoteCopyFacility(); - - void copyFiles(const ProjectExplorer::IDevice::ConstPtr &device, - const QList<ProjectExplorer::DeployableFile> &deployables, const QString &mountPoint); - void cancel(); - -signals: - void stdoutData(const QString &output); - void stderrData(const QString &output); - void progress(const QString &message); - void fileCopied(const ProjectExplorer::DeployableFile &deployable); - void finished(const QString &errorMsg = QString()); - -private slots: - void handleConnectionError(); - void handleCopyFinished(int exitStatus); - void handleRemoteStdout(); - void handleRemoteStderr(); - -private: - void copyNextFile(); - void setFinished(); - - QSsh::SshRemoteProcessRunner *m_copyRunner; - QSsh::SshRemoteProcessRunner *m_killProcess; - ProjectExplorer::IDevice::ConstPtr m_devConf; - QList<ProjectExplorer::DeployableFile> m_deployables; - QString m_mountPoint; - bool m_isCopying; // TODO: Redundant due to being in sync with m_copyRunner? -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOREMOTECOPYFACILITY_H diff --git a/src/plugins/madde/maemoremotemounter.cpp b/src/plugins/madde/maemoremotemounter.cpp deleted file mode 100644 index c640efec97..0000000000 --- a/src/plugins/madde/maemoremotemounter.cpp +++ /dev/null @@ -1,391 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemoremotemounter.h" - -#include "maemoglobal.h" -#include "maddedevice.h" - -#include <projectexplorer/devicesupport/deviceusedportsgatherer.h> -#include <ssh/sshconnection.h> -#include <ssh/sshremoteprocessrunner.h> -#include <utils/qtcassert.h> - -#include <QTimer> - -using namespace ProjectExplorer; -using namespace QSsh; -using namespace RemoteLinux; -using namespace Utils; - -namespace Madde { -namespace Internal { - -MaemoRemoteMounter::MaemoRemoteMounter(QObject *parent) - : QObject(parent), - m_utfsServerTimer(new QTimer(this)), - m_mountProcess(new SshRemoteProcessRunner(this)), - m_unmountProcess(new SshRemoteProcessRunner(this)), - m_portsGatherer(new DeviceUsedPortsGatherer(this)), - m_state(Inactive) -{ - connect(m_utfsServerTimer, SIGNAL(timeout()), SLOT(handleUtfsServerTimeout())); - connect(m_portsGatherer, SIGNAL(error(QString)), - SLOT(handlePortsGathererError(QString))); - connect(m_portsGatherer, SIGNAL(portListReady()), - SLOT(handlePortListReady())); - - m_utfsServerTimer->setSingleShot(true); -} - -MaemoRemoteMounter::~MaemoRemoteMounter() -{ - killAllUtfsServers(); -} - -void MaemoRemoteMounter::setParameters(const IDevice::ConstPtr &devConf, const FileName &maddeRoot) -{ - QTC_ASSERT(m_state == Inactive, return); - - m_devConf = devConf; - m_maddeRoot = maddeRoot; -} - -void MaemoRemoteMounter::addMountSpecification(const MaemoMountSpecification &mountSpec, - bool mountAsRoot) -{ - QTC_ASSERT(m_state == Inactive, return); - - if (MaddeDevice::allowsRemoteMounts(m_devConf->type()) && mountSpec.isValid()) - m_mountSpecs << MountInfo(mountSpec, mountAsRoot); -} - -bool MaemoRemoteMounter::hasValidMountSpecifications() const -{ - return !m_mountSpecs.isEmpty(); -} - -void MaemoRemoteMounter::mount() -{ - QTC_ASSERT(m_state == Inactive, return); - - Q_ASSERT(m_utfsServers.isEmpty()); - - if (m_mountSpecs.isEmpty()) { - setState(Inactive); - emit reportProgress(tr("No directories to mount")); - emit mounted(); - } else { - setState(GatheringPorts); - m_portsGatherer->start(m_devConf); - } -} - -void MaemoRemoteMounter::unmount() -{ - QTC_ASSERT(m_state == Inactive, return); - - if (m_mountSpecs.isEmpty()) { - emit reportProgress(tr("No directories to unmount")); - emit unmounted(); - return; - } - - QString remoteCall; - const QString remoteSudo = MaemoGlobal::remoteSudo(m_devConf->type(), - m_devConf->sshParameters().userName); - for (int i = 0; i < m_mountSpecs.count(); ++i) { - remoteCall += QString::fromLatin1("%1 umount %2 && %1 rmdir %2;") - .arg(remoteSudo, m_mountSpecs.at(i).mountSpec.remoteMountPoint); - } - - setState(Unmounting); - connect(m_unmountProcess, SIGNAL(processClosed(int)), SLOT(handleUnmountProcessFinished(int))); - m_unmountProcess->run(remoteCall.toUtf8(), m_devConf->sshParameters()); -} - -void MaemoRemoteMounter::handleUnmountProcessFinished(int exitStatus) -{ - QTC_ASSERT(m_state == Unmounting || m_state == Inactive, return); - - if (m_state == Inactive) - return; - setState(Inactive); - - QString errorMsg; - switch (exitStatus) { - case SshRemoteProcess::FailedToStart: - errorMsg = tr("Could not execute unmount request."); - break; - case SshRemoteProcess::CrashExit: - errorMsg = tr("Failure unmounting: %1").arg(m_unmountProcess->processErrorString()); - break; - case SshRemoteProcess::NormalExit: - break; - default: - Q_ASSERT_X(false, Q_FUNC_INFO, - "Impossible SshRemoteProcess exit status."); - } - - killAllUtfsServers(); - - if (errorMsg.isEmpty()) { - emit reportProgress(tr("Finished unmounting.")); - emit unmounted(); - } else { - const QByteArray &umountStderr = m_unmountProcess->readAllStandardError(); - if (!umountStderr.isEmpty()) - errorMsg += tr("\nstderr was: '%1'").arg(QString::fromUtf8(umountStderr)); - emit error(errorMsg); - } -} - -void MaemoRemoteMounter::stop() -{ - setState(Inactive); -} - -void MaemoRemoteMounter::startUtfsClients() -{ - QTC_ASSERT(m_state == GatheringPorts, return); - - const QString userName = m_devConf->sshParameters().userName; - const QString chmodFuse = MaemoGlobal::remoteSudo(m_devConf->type(), - userName) + QLatin1String(" chmod a+r+w /dev/fuse"); - const QString chmodUtfsClient - = QLatin1String("chmod a+x ") + utfsClientOnDevice(); - const QLatin1String andOp(" && "); - QString remoteCall = chmodFuse + andOp + chmodUtfsClient; - PortList ports = m_devConf->freePorts(); - for (int i = 0; i < m_mountSpecs.count(); ++i) { - MountInfo &mountInfo = m_mountSpecs[i]; - mountInfo.remotePort = m_portsGatherer->getNextFreePort(&ports); - if (mountInfo.remotePort == -1) { - setState(Inactive); - emit error(tr("Error: Not enough free ports on device to fulfill all mount requests.")); - return; - } - - const QString remoteSudo - = MaemoGlobal::remoteSudo(m_devConf->type(), userName); - const MaemoMountSpecification &mountSpec = mountInfo.mountSpec; - const QString mkdir = QString::fromLatin1("%1 mkdir -p %2") - .arg(remoteSudo, mountSpec.remoteMountPoint); - const QString chmod = QString::fromLatin1("%1 chmod a+r+w+x %2") - .arg(remoteSudo, mountSpec.remoteMountPoint); - QString utfsClient - = QString::fromLatin1("%1 -l %2 -r %2 -b %2 %4 -o nonempty") - .arg(utfsClientOnDevice()).arg(mountInfo.remotePort) - .arg(mountSpec.remoteMountPoint); - if (mountInfo.mountAsRoot) { - utfsClient.prepend(MaemoGlobal::remoteSudo(m_devConf->type(), - userName) + QLatin1Char(' ')); - } - QLatin1String seqOp("; "); - remoteCall += seqOp + MaemoGlobal::remoteSourceProfilesCommand() - + seqOp + mkdir + andOp + chmod + andOp + utfsClient; - } - - emit reportProgress(tr("Starting remote UTFS clients...")); - setState(UtfsClientsStarting); - connect(m_mountProcess, SIGNAL(processStarted()), SLOT(handleUtfsClientsStarted())); - connect(m_mountProcess, SIGNAL(processClosed(int)), SLOT(handleUtfsClientsFinished(int))); - m_mountProcess->run(remoteCall.toUtf8(), m_devConf->sshParameters()); -} - -void MaemoRemoteMounter::handleUtfsClientsStarted() -{ - QTC_ASSERT(m_state == UtfsClientsStarting || m_state == Inactive, return); - - if (m_state == UtfsClientsStarting) { - setState(UtfsClientsStarted); - QTimer::singleShot(250, this, SLOT(startUtfsServers())); - } -} - -void MaemoRemoteMounter::handleUtfsClientsFinished(int exitStatus) -{ - QTC_ASSERT(m_state == UtfsClientsStarting || m_state == UtfsClientsStarted - || m_state == UtfsServersStarted || m_state == Inactive, return); - - if (m_state == Inactive) - return; - - setState(Inactive); - if (exitStatus == SshRemoteProcess::NormalExit && m_mountProcess->processExitCode() == 0) { - emit reportProgress(tr("Mount operation succeeded.")); - emit mounted(); - } else { - QString errMsg = tr("Failure running UTFS client: %1") - .arg(m_mountProcess->processErrorString()); - const QByteArray &mountStderr = m_mountProcess->readAllStandardError(); - if (!mountStderr.isEmpty()) - errMsg += tr("\nstderr was: '%1'").arg(QString::fromUtf8(mountStderr)); - emit error(errMsg); - } -} - -void MaemoRemoteMounter::startUtfsServers() -{ - QTC_ASSERT(m_state == UtfsClientsStarted || m_state == Inactive, return); - - if (m_state == Inactive) - return; - - emit reportProgress(tr("Starting UTFS servers...")); - m_utfsServerTimer->start(30000); - for (int i = 0; i < m_mountSpecs.count(); ++i) { - const MountInfo &mountInfo = m_mountSpecs.at(i); - const MaemoMountSpecification &mountSpec = mountInfo.mountSpec; - const ProcPtr utfsServerProc(new QProcess); - const QString port = QString::number(mountInfo.remotePort); - const QString localSecretOpt = QLatin1String("-l"); - const QString remoteSecretOpt = QLatin1String("-r"); - const QStringList utfsServerArgs = QStringList() << localSecretOpt - << port << remoteSecretOpt << port << QLatin1String("-c") - << (m_devConf->sshParameters().host + QLatin1Char(':') + port) - << mountSpec.localDir; - connect(utfsServerProc.data(), - SIGNAL(finished(int,QProcess::ExitStatus)), this, - SLOT(handleUtfsServerFinished(int,QProcess::ExitStatus))); - connect(utfsServerProc.data(), SIGNAL(error(QProcess::ProcessError)), - this, SLOT(handleUtfsServerError(QProcess::ProcessError))); - connect(utfsServerProc.data(), SIGNAL(readyReadStandardError()), this, - SLOT(handleUtfsServerStderr())); - m_utfsServers << utfsServerProc; - utfsServerProc->start(utfsServer().toString(), utfsServerArgs); - } - - setState(UtfsServersStarted); -} - -void MaemoRemoteMounter::handlePortsGathererError(const QString &errorMsg) -{ - QTC_ASSERT(m_state == GatheringPorts, return); - - setState(Inactive); - emit error(errorMsg); -} - -void MaemoRemoteMounter::handlePortListReady() -{ - QTC_ASSERT(m_state == GatheringPorts, return); - - startUtfsClients(); -} - -void MaemoRemoteMounter::handleUtfsServerStderr() -{ - if (m_state != Inactive) { - QProcess * const proc = static_cast<QProcess *>(sender()); - const QByteArray &output = proc->readAllStandardError(); - emit debugOutput(QString::fromLocal8Bit(output)); - } -} - -void MaemoRemoteMounter::handleUtfsServerError(QProcess::ProcessError) -{ - if (m_state == Inactive || m_utfsServers.isEmpty()) - return; - - QProcess * const proc = static_cast<QProcess *>(sender()); - QString errorString = proc->errorString(); - const QByteArray &errorOutput = proc->readAllStandardError(); - if (!errorOutput.isEmpty()) { - errorString += tr("\nstderr was: %1") - .arg(QString::fromLocal8Bit(errorOutput)); - } - killAllUtfsServers(); - emit error(tr("Error running UTFS server: %1").arg(errorString)); - - setState(Inactive); -} - -void MaemoRemoteMounter::handleUtfsServerFinished(int /* exitCode */, - QProcess::ExitStatus exitStatus) -{ - if (m_state != Inactive && exitStatus != QProcess::NormalExit) - handleUtfsServerError(static_cast<QProcess *>(sender())->error()); -} - -QString MaemoRemoteMounter::utfsClientOnDevice() const -{ - return QLatin1String("/usr/lib/mad-developer/utfs-client"); -} - -Utils::FileName MaemoRemoteMounter::utfsServer() const -{ - Utils::FileName result = m_maddeRoot; - return result.appendPath(QLatin1String("madlib/utfs-server")); -} - -void MaemoRemoteMounter::killAllUtfsServers() -{ - foreach (const ProcPtr &proc, m_utfsServers) - killUtfsServer(proc.data()); - m_utfsServers.clear(); -} - -void MaemoRemoteMounter::killUtfsServer(QProcess *proc) -{ - disconnect(proc, 0, this, 0); - proc->terminate(); - proc->waitForFinished(1000); - proc->kill(); -} - -void MaemoRemoteMounter::handleUtfsServerTimeout() -{ - QTC_ASSERT(m_state == UtfsServersStarted || m_state == Inactive, return); - - if (m_state == Inactive) - return; - - killAllUtfsServers(); - emit error(tr("Timeout waiting for UTFS servers to connect.")); - - setState(Inactive); -} - -void MaemoRemoteMounter::setState(State newState) -{ - if (newState == m_state) - return; - if (newState == Inactive) { - m_utfsServerTimer->stop(); - disconnect(m_mountProcess, 0, this, 0); - m_mountProcess->cancel(); - disconnect(m_unmountProcess, 0, this, 0); - m_unmountProcess->cancel(); - } - m_state = newState; -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemoremotemounter.h b/src/plugins/madde/maemoremotemounter.h deleted file mode 100644 index d7448185fb..0000000000 --- a/src/plugins/madde/maemoremotemounter.h +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOREMOTEMOUNTER_H -#define MAEMOREMOTEMOUNTER_H - -#include "maemomountspecification.h" - -#include <projectexplorer/devicesupport/idevice.h> -#include <utils/fileutils.h> - -#include <QList> -#include <QObject> -#include <QProcess> -#include <QSharedPointer> -#include <QString> - -QT_FORWARD_DECLARE_CLASS(QTimer) - -namespace QSsh { class SshRemoteProcessRunner; } -namespace ProjectExplorer { class DeviceUsedPortsGatherer; } - -namespace Madde { -namespace Internal { - -class MaemoRemoteMounter : public QObject -{ - Q_OBJECT - -public: - MaemoRemoteMounter(QObject *parent = 0); - ~MaemoRemoteMounter(); - - void setParameters(const ProjectExplorer::IDevice::ConstPtr &devConf, - const Utils::FileName &maddeRoot); - void addMountSpecification(const MaemoMountSpecification &mountSpec, - bool mountAsRoot); - bool hasValidMountSpecifications() const; - void resetMountSpecifications() { m_mountSpecs.clear(); } - void mount(); - void unmount(); - void stop(); - -signals: - void mounted(); - void unmounted(); - void error(const QString &reason); - void reportProgress(const QString &progressOutput); - void debugOutput(const QString &output); - -private slots: - void handleUtfsClientsStarted(); - void handleUtfsClientsFinished(int exitStatus); - void handleUnmountProcessFinished(int exitStatus); - void handleUtfsServerError(QProcess::ProcessError procError); - void handleUtfsServerFinished(int exitCode, - QProcess::ExitStatus exitStatus); - void handleUtfsServerTimeout(); - void handleUtfsServerStderr(); - void startUtfsServers(); - void handlePortsGathererError(const QString &errorMsg); - void handlePortListReady(); - -private: - enum State { - Inactive, Unmounting, UtfsClientsStarting, UtfsClientsStarted, - UtfsServersStarted, GatheringPorts - }; - - void setState(State newState); - - void startUtfsClients(); - void killUtfsServer(QProcess *proc); - void killAllUtfsServers(); - QString utfsClientOnDevice() const; - Utils::FileName utfsServer() const; - - QTimer * const m_utfsServerTimer; - - struct MountInfo { - MountInfo(const MaemoMountSpecification &m, bool root) - : mountSpec(m), mountAsRoot(root), remotePort(-1) {} - MaemoMountSpecification mountSpec; - bool mountAsRoot; - int remotePort; - }; - - ProjectExplorer::IDevice::ConstPtr m_devConf; - QList<MountInfo> m_mountSpecs; - QSsh::SshRemoteProcessRunner * const m_mountProcess; - QSsh::SshRemoteProcessRunner * const m_unmountProcess; - - typedef QSharedPointer<QProcess> ProcPtr; - QList<ProcPtr> m_utfsServers; - - ProjectExplorer::DeviceUsedPortsGatherer *m_portsGatherer; - Utils::FileName m_maddeRoot; - - State m_state; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOREMOTEMOUNTER_H diff --git a/src/plugins/madde/maemoremotemountsmodel.cpp b/src/plugins/madde/maemoremotemountsmodel.cpp deleted file mode 100644 index 9f31c4de08..0000000000 --- a/src/plugins/madde/maemoremotemountsmodel.cpp +++ /dev/null @@ -1,187 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemoremotemountsmodel.h" - -#include "maemoconstants.h" - -namespace Madde { -namespace Internal { - -MaemoRemoteMountsModel::MaemoRemoteMountsModel(QObject *parent) : - QAbstractTableModel(parent) -{ -} - -void MaemoRemoteMountsModel::addMountSpecification(const QString &localDir) -{ - beginInsertRows(QModelIndex(), rowCount(), rowCount()); - m_mountSpecs << MaemoMountSpecification(localDir, - MaemoMountSpecification::InvalidMountPoint); - endInsertRows(); -} - -void MaemoRemoteMountsModel::removeMountSpecificationAt(int pos) -{ - Q_ASSERT(pos >= 0 && pos < rowCount()); - beginRemoveRows(QModelIndex(), pos, pos); - m_mountSpecs.removeAt(pos); - endRemoveRows(); -} - -void MaemoRemoteMountsModel::setLocalDir(int pos, const QString &localDir) -{ - Q_ASSERT(pos >= 0 && pos < rowCount()); - m_mountSpecs[pos].localDir = localDir; - const QModelIndex currentIndex = index(pos, LocalDirRow); - emit dataChanged(currentIndex, currentIndex); -} - -int MaemoRemoteMountsModel::validMountSpecificationCount() const -{ - int count = 0; - foreach (const MaemoMountSpecification &m, m_mountSpecs) { - if (m.isValid()) - ++count; - } - return count; -} - -bool MaemoRemoteMountsModel::hasValidMountSpecifications() const -{ - foreach (const MaemoMountSpecification &m, m_mountSpecs) { - if (m.isValid()) - return true; - } - return false; -} - -QVariantMap MaemoRemoteMountsModel::toMap() const -{ - QVariantMap map; - QVariantList localDirsList; - QVariantList remoteMountPointsList; - foreach (const MaemoMountSpecification &mountSpec, m_mountSpecs) { - localDirsList << mountSpec.localDir; - remoteMountPointsList << mountSpec.remoteMountPoint; - } - map.insert(ExportedLocalDirsKey, localDirsList); - map.insert(RemoteMountPointsKey, remoteMountPointsList); - return map; -} - -void MaemoRemoteMountsModel::fromMap(const QVariantMap &map) -{ - const QVariantList &localDirsList - = map.value(ExportedLocalDirsKey).toList(); - const QVariantList &remoteMountPointsList - = map.value(RemoteMountPointsKey).toList(); - const int count - = qMin(localDirsList.count(), remoteMountPointsList.count()); - for (int i = 0; i < count; ++i) { - const QString &localDir = localDirsList.at(i).toString(); - const QString &remoteMountPoint - = remoteMountPointsList.at(i).toString(); - m_mountSpecs << MaemoMountSpecification(localDir, remoteMountPoint); - } -} - -Qt::ItemFlags MaemoRemoteMountsModel::flags(const QModelIndex &index) const -{ - Qt::ItemFlags ourFlags = QAbstractTableModel::flags(index); - if (index.column() == RemoteMountPointRow) - ourFlags |= Qt::ItemIsEditable; - return ourFlags; -} - -QVariant MaemoRemoteMountsModel::headerData(int section, - Qt::Orientation orientation, int role) const -{ - if (role != Qt::DisplayRole || orientation != Qt::Horizontal) - return QVariant(); - - switch (section) { - case LocalDirRow: return tr("Local directory"); - case RemoteMountPointRow: return tr("Remote mount point"); - default: return QVariant(); - } -} - -QVariant MaemoRemoteMountsModel::data(const QModelIndex &index, int role) const -{ - if (!index.isValid() || index.row() >= rowCount()) - return QVariant(); - - const MaemoMountSpecification &mountSpec = mountSpecificationAt(index.row()); - switch (index.column()) { - case LocalDirRow: - if (role == Qt::DisplayRole) - return mountSpec.localDir; - break; - case RemoteMountPointRow: - if (role == Qt::DisplayRole || role == Qt::EditRole) - return mountSpec.remoteMountPoint; - break; - } - return QVariant(); -} - -bool MaemoRemoteMountsModel::setData(const QModelIndex &index, - const QVariant &value, int role) -{ - if (!index.isValid() || index.row() >= rowCount() || role != Qt::EditRole) - return false; - - bool set; - switch (index.column()) { - case RemoteMountPointRow: { - const QString &newRemoteMountPoint = value.toString(); - for (int i = 0; i < m_mountSpecs.count(); ++i) { - const MaemoMountSpecification &mountSpec = m_mountSpecs.at(i); - if (i != index.row() && mountSpec.isValid() - && mountSpec.remoteMountPoint == newRemoteMountPoint) - return false; - } - m_mountSpecs[index.row()].remoteMountPoint = newRemoteMountPoint; - set = true; - break; - } - case LocalDirRow: - default: - set = false; - break; - } - - if (set) - emit dataChanged(index, index); - return set; -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemoremotemountsmodel.h b/src/plugins/madde/maemoremotemountsmodel.h deleted file mode 100644 index 8154044ad6..0000000000 --- a/src/plugins/madde/maemoremotemountsmodel.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOREMOTEMOUNTSMODEL_H -#define MAEMOREMOTEMOUNTSMODEL_H - -#include "maemomountspecification.h" - -#include <QAbstractTableModel> -#include <QList> -#include <QString> -#include <QVariantMap> - -namespace Madde { -namespace Internal { - -class MaemoRemoteMountsModel : public QAbstractTableModel -{ - Q_OBJECT -public: - explicit MaemoRemoteMountsModel(QObject *parent = 0); - int mountSpecificationCount() const { return m_mountSpecs.count(); } - int validMountSpecificationCount() const; - MaemoMountSpecification mountSpecificationAt(int pos) const { return m_mountSpecs.at(pos); } - bool hasValidMountSpecifications() const; - const QList<MaemoMountSpecification> &mountSpecs() const { return m_mountSpecs; } - - void addMountSpecification(const QString &localDir); - void removeMountSpecificationAt(int pos); - void setLocalDir(int pos, const QString &localDir); - - QVariantMap toMap() const; - void fromMap(const QVariantMap &map); - - static const int LocalDirRow = 0; - static const int RemoteMountPointRow = 1; - -private: - virtual int columnCount(const QModelIndex& = QModelIndex()) const; - virtual int rowCount(const QModelIndex& = QModelIndex()) const; - virtual Qt::ItemFlags flags(const QModelIndex &index) const; - virtual QModelIndex parent(const QModelIndex &child) const; - virtual QVariant headerData(int section, Qt::Orientation orientation, - int role) const; - virtual QVariant data(const QModelIndex &index, int role) const; - virtual bool setData(const QModelIndex &index, const QVariant &value, - int role); - - QList<MaemoMountSpecification> m_mountSpecs; -}; - -inline int MaemoRemoteMountsModel::columnCount(const QModelIndex &) const -{ - return 2; -} - -inline int MaemoRemoteMountsModel::rowCount(const QModelIndex &parent) const -{ - return parent.isValid() ? 0 : mountSpecificationCount(); -} - -inline QModelIndex MaemoRemoteMountsModel::parent(const QModelIndex &) const -{ - return QModelIndex(); -} - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOREMOTEMOUNTSMODEL_H diff --git a/src/plugins/madde/maemorunconfiguration.cpp b/src/plugins/madde/maemorunconfiguration.cpp deleted file mode 100644 index 55c17c8393..0000000000 --- a/src/plugins/madde/maemorunconfiguration.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maemorunconfiguration.h" - -#include "maddedevice.h" -#include "maemoconstants.h" -#include "maemoglobal.h" -#include "maemoremotemountsmodel.h" -#include "maemorunconfigurationwidget.h" - -#include <debugger/debuggerconstants.h> -#include <debugger/debuggerrunconfigurationaspect.h> -#include <projectexplorer/buildconfiguration.h> -#include <projectexplorer/kitinformation.h> -#include <projectexplorer/project.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/target.h> -#include <remotelinux/remotelinuxenvironmentaspect.h> -#include <utils/portlist.h> -#include <utils/qtcassert.h> -#include <ssh/sshconnection.h> - -#include <QDir> -#include <QFileInfo> - -using namespace ProjectExplorer; -using namespace RemoteLinux; - -namespace Madde { -namespace Internal { - -MaemoRunConfiguration::MaemoRunConfiguration(Target *parent, Core::Id id, - const QString &proFilePath) - : RemoteLinuxRunConfiguration(parent, id, proFilePath) -{ - init(); -} - -MaemoRunConfiguration::MaemoRunConfiguration(Target *parent, - MaemoRunConfiguration *source) - : RemoteLinuxRunConfiguration(parent, source) -{ - init(); -} - -void MaemoRunConfiguration::init() -{ - m_remoteMounts = new MaemoRemoteMountsModel(this); - connect(m_remoteMounts, SIGNAL(rowsInserted(QModelIndex,int,int)), this, - SLOT(handleRemoteMountsChanged())); - connect(m_remoteMounts, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, - SLOT(handleRemoteMountsChanged())); - connect(m_remoteMounts, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, - SLOT(handleRemoteMountsChanged())); - connect(m_remoteMounts, SIGNAL(modelReset()), SLOT(handleRemoteMountsChanged())); -} - -bool MaemoRunConfiguration::isEnabled() const -{ - if (!RemoteLinuxRunConfiguration::isEnabled()) - return false; - if (!hasEnoughFreePorts(NormalRunMode)) { - setDisabledReason(tr("Not enough free ports on the device.")); - return false; - } - return true; -} - -QWidget *MaemoRunConfiguration::createConfigurationWidget() -{ - return new MaemoRunConfigurationWidget(this); -} - -QVariantMap MaemoRunConfiguration::toMap() const -{ - QVariantMap map = RemoteLinuxRunConfiguration::toMap(); - map.unite(m_remoteMounts->toMap()); - return map; -} - -bool MaemoRunConfiguration::fromMap(const QVariantMap &map) -{ - if (!RemoteLinuxRunConfiguration::fromMap(map)) - return false; - m_remoteMounts->fromMap(map); - return true; -} - -Utils::PortList MaemoRunConfiguration::freePorts() const -{ - return MaemoGlobal::freePorts(target()->kit()); -} - -bool MaemoRunConfiguration::hasEnoughFreePorts(RunMode mode) const -{ - const int freePortCount = freePorts().count(); - Core::Id typeId = DeviceTypeKitInformation::deviceTypeId(target()->kit()); - const bool remoteMountsAllowed = MaddeDevice::allowsRemoteMounts(typeId); - const int mountDirCount = remoteMountsAllowed - ? remoteMounts()->validMountSpecificationCount() : 0; - if (mode == DebugRunMode || mode == DebugRunModeWithBreakOnMain) - return freePortCount >= mountDirCount + portsUsedByDebuggers(); - if (mode == NormalRunMode) - return freePortCount >= mountDirCount; - return false; -} - -void MaemoRunConfiguration::handleRemoteMountsChanged() -{ - emit remoteMountsChanged(); - updateEnabledState(); -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemorunconfiguration.h b/src/plugins/madde/maemorunconfiguration.h deleted file mode 100644 index edfebb8fe7..0000000000 --- a/src/plugins/madde/maemorunconfiguration.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#ifndef MAEMORUNCONFIGURATION_H -#define MAEMORUNCONFIGURATION_H - -#include <remotelinux/remotelinuxrunconfiguration.h> - -namespace Madde { -namespace Internal { -class MaemoRemoteMountsModel; - -class MaemoRunConfiguration : public RemoteLinux::RemoteLinuxRunConfiguration -{ - Q_OBJECT - -public: - MaemoRunConfiguration(ProjectExplorer::Target *parent, Core::Id id, - const QString &projectFilePath); - MaemoRunConfiguration(ProjectExplorer::Target *parent, MaemoRunConfiguration *source); - - QVariantMap toMap() const; - bool fromMap(const QVariantMap &map); - bool isEnabled() const; - QWidget *createConfigurationWidget(); - Utils::PortList freePorts() const; - - Internal::MaemoRemoteMountsModel *remoteMounts() const { return m_remoteMounts; } - bool hasEnoughFreePorts(ProjectExplorer::RunMode mode) const; - -signals: - void remoteMountsChanged(); - -private slots: - void handleRemoteMountsChanged(); - -private: - void init(); - - MaemoRemoteMountsModel *m_remoteMounts; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMORUNCONFIGURATION_H diff --git a/src/plugins/madde/maemorunconfigurationwidget.cpp b/src/plugins/madde/maemorunconfigurationwidget.cpp deleted file mode 100644 index e879b91e14..0000000000 --- a/src/plugins/madde/maemorunconfigurationwidget.cpp +++ /dev/null @@ -1,247 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "maemorunconfigurationwidget.h" - -#include "maddedevice.h" -#include "maemoglobal.h" -#include "maemoremotemountsmodel.h" -#include "maemorunconfiguration.h" - -#include <coreplugin/coreconstants.h> -#include <coreplugin/icore.h> -#include <debugger/debuggerrunconfigurationaspect.h> -#include <projectexplorer/kitinformation.h> -#include <projectexplorer/target.h> -#include <qt4projectmanager/qt4buildconfiguration.h> -#include <remotelinux/remotelinuxrunconfigurationwidget.h> -#include <utils/detailswidget.h> - -#include <QButtonGroup> -#include <QCoreApplication> -#include <QComboBox> -#include <QFileDialog> -#include <QFormLayout> -#include <QGroupBox> -#include <QHBoxLayout> -#include <QHeaderView> -#include <QLabel> -#include <QLineEdit> -#include <QMessageBox> -#include <QPushButton> -#include <QRadioButton> -#include <QTableView> -#include <QToolButton> - -using namespace Qt4ProjectManager; -using namespace RemoteLinux; - -namespace Madde { -namespace Internal { - -MaemoRunConfigurationWidget::MaemoRunConfigurationWidget( - MaemoRunConfiguration *runConfiguration, QWidget *parent) - : QWidget(parent), m_runConfiguration(runConfiguration) -{ - QVBoxLayout *topLayout = new QVBoxLayout(this); - topLayout->setMargin(0); - QWidget *topWidget = new QWidget; - topLayout->addWidget(topWidget); - QVBoxLayout *mainLayout = new QVBoxLayout(topWidget); - mainLayout->setMargin(0); - m_remoteLinuxRunConfigWidget = new RemoteLinuxRunConfigurationWidget(runConfiguration, parent); - mainLayout->addWidget(m_remoteLinuxRunConfigWidget); - m_subWidget = new QWidget; - mainLayout->addWidget(m_subWidget); - QVBoxLayout *subLayout = new QVBoxLayout(m_subWidget); - subLayout->setMargin(0); - addMountWidgets(subLayout); - connect(m_runConfiguration->target(), SIGNAL(kitChanged()), this, SLOT(updateMountWarning())); - connect(m_runConfiguration->extraAspect<Debugger::DebuggerRunConfigurationAspect>(), - SIGNAL(debuggersChanged()), - SLOT(updateMountWarning())); - updateMountWarning(); - - Core::Id devId = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(runConfiguration->target()->kit()); - m_mountDetailsContainer->setVisible(MaddeDevice::allowsRemoteMounts(devId)); - - connect(m_runConfiguration, SIGNAL(enabledChanged()), - this, SLOT(runConfigurationEnabledChange())); - runConfigurationEnabledChange(); -} - -void MaemoRunConfigurationWidget::runConfigurationEnabledChange() -{ - bool enabled = m_runConfiguration->isEnabled(); - m_subWidget->setEnabled(enabled); -} - -void MaemoRunConfigurationWidget::addMountWidgets(QVBoxLayout *mainLayout) -{ - m_mountDetailsContainer = new Utils::DetailsWidget(this); - QWidget *mountViewWidget = new QWidget; - m_mountDetailsContainer->setWidget(mountViewWidget); - mainLayout->addWidget(m_mountDetailsContainer); - QVBoxLayout *mountViewLayout = new QVBoxLayout(mountViewWidget); - m_mountWarningLabel = new QLabel; - mountViewLayout->addWidget(m_mountWarningLabel); - QHBoxLayout *tableLayout = new QHBoxLayout; - mountViewLayout->addLayout(tableLayout); - m_mountView = new QTableView; - m_mountView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); - m_mountView->setSelectionBehavior(QTableView::SelectRows); - m_mountView->setModel(m_runConfiguration->remoteMounts()); - tableLayout->addWidget(m_mountView); - QVBoxLayout *mountViewButtonsLayout = new QVBoxLayout; - tableLayout->addLayout(mountViewButtonsLayout); - QToolButton *addMountButton = new QToolButton; - QIcon plusIcon; - plusIcon.addFile(QLatin1String(Core::Constants::ICON_PLUS)); - addMountButton->setIcon(plusIcon); - mountViewButtonsLayout->addWidget(addMountButton); - m_removeMountButton = new QToolButton; - QIcon minusIcon; - minusIcon.addFile(QLatin1String(Core::Constants::ICON_MINUS)); - m_removeMountButton->setIcon(minusIcon); - mountViewButtonsLayout->addWidget(m_removeMountButton); - mountViewButtonsLayout->addStretch(1); - - connect(addMountButton, SIGNAL(clicked()), this, SLOT(addMount())); - connect(m_removeMountButton, SIGNAL(clicked()), this, SLOT(removeMount())); - connect(m_mountView, SIGNAL(doubleClicked(QModelIndex)), this, - SLOT(changeLocalMountDir(QModelIndex))); - connect(m_mountView->selectionModel(), - SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, - SLOT(enableOrDisableRemoveMountSpecButton())); - enableOrDisableRemoveMountSpecButton(); - connect(m_runConfiguration, SIGNAL(remoteMountsChanged()), SLOT(handleRemoteMountsChanged())); - handleRemoteMountsChanged(); -} - -void MaemoRunConfigurationWidget::enableOrDisableRemoveMountSpecButton() -{ - const QModelIndexList selectedRows - = m_mountView->selectionModel()->selectedRows(); - m_removeMountButton->setEnabled(!selectedRows.isEmpty()); -} - -void MaemoRunConfigurationWidget::addMount() -{ - const QString localDir = QFileDialog::getExistingDirectory(this, - tr("Choose directory to mount")); - if (!localDir.isEmpty()) { - MaemoRemoteMountsModel * const mountsModel - = m_runConfiguration->remoteMounts(); - mountsModel->addMountSpecification(localDir); - m_mountView->edit(mountsModel->index(mountsModel->mountSpecificationCount() - 1, - mountsModel->RemoteMountPointRow)); - } -} - -void MaemoRunConfigurationWidget::removeMount() -{ - const QModelIndexList selectedRows - = m_mountView->selectionModel()->selectedRows(); - if (!selectedRows.isEmpty()) { - m_runConfiguration->remoteMounts() - ->removeMountSpecificationAt(selectedRows.first().row()); - } -} - -void MaemoRunConfigurationWidget::changeLocalMountDir(const QModelIndex &index) -{ - if (index.column() == MaemoRemoteMountsModel::LocalDirRow) { - MaemoRemoteMountsModel * const mountsModel - = m_runConfiguration->remoteMounts(); - const QString oldDir - = mountsModel->mountSpecificationAt(index.row()).localDir; - const QString localDir = QFileDialog::getExistingDirectory(this, - tr("Choose directory to mount"), oldDir); - if (!localDir.isEmpty()) - mountsModel->setLocalDir(index.row(), localDir); - } -} - -void MaemoRunConfigurationWidget::handleRemoteMountsChanged() -{ - const int mountCount - = m_runConfiguration->remoteMounts()->validMountSpecificationCount(); - QString text; - switch (mountCount) { - case 0: - text = tr("No local directories to be mounted on the device."); - break; - case 1: - text = tr("One local directory to be mounted on the device."); - break; - default: - //: Note: Only mountCount>1 will occur here as 0, 1 are handled above. - text = tr("%n local directories to be mounted on the device.", 0, mountCount); - break; - } - m_mountDetailsContainer->setSummaryText(QLatin1String("<b>") + text - + QLatin1String("</b>")); - updateMountWarning(); -} - -void MaemoRunConfigurationWidget::updateMountWarning() -{ - QString mountWarning; - const Utils::PortList &portList = m_runConfiguration->freePorts(); - const int availablePortCount = portList.count(); - const int mountDirCount - = m_runConfiguration->remoteMounts()->validMountSpecificationCount(); - if (mountDirCount > availablePortCount) { - mountWarning = tr("WARNING: You want to mount %1 directories, but " - "your device has only %n free ports.<br>You will not be able " - "to run this configuration.", 0, availablePortCount) - .arg(mountDirCount); - } else if (mountDirCount > 0) { - const int portsLeftByDebuggers = availablePortCount - - m_runConfiguration->portsUsedByDebuggers(); - if (mountDirCount > portsLeftByDebuggers) { - mountWarning = tr("WARNING: You want to mount %1 directories, " - "but only %n ports on the device will be available " - "in debug mode. <br>You will not be able to debug your " - "application with this configuration.", 0, portsLeftByDebuggers) - .arg(mountDirCount); - } - } - if (mountWarning.isEmpty()) { - m_mountWarningLabel->hide(); - } else { - m_mountWarningLabel->setText(QLatin1String("<font color=\"red\">") - + mountWarning + QLatin1String("</font>")); - m_mountWarningLabel->show(); - m_mountDetailsContainer->setState(Utils::DetailsWidget::Expanded); - } -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemorunconfigurationwidget.h b/src/plugins/madde/maemorunconfigurationwidget.h deleted file mode 100644 index f6f5a6e169..0000000000 --- a/src/plugins/madde/maemorunconfigurationwidget.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMORUNCONFIGURATIONWIDGET_H -#define MAEMORUNCONFIGURATIONWIDGET_H - -#include <QWidget> - -QT_BEGIN_NAMESPACE -class QLabel; -class QModelIndex; -class QTableView; -class QToolButton; -class QVBoxLayout; -QT_END_NAMESPACE - -namespace Utils { class DetailsWidget; } - -namespace RemoteLinux { -class RemoteLinuxRunConfigurationWidget; -} - -namespace Madde { -namespace Internal { -class MaemoRunConfiguration; - -class MaemoRunConfigurationWidget : public QWidget -{ - Q_OBJECT -public: - explicit MaemoRunConfigurationWidget(MaemoRunConfiguration *runConfiguration, - QWidget *parent = 0); - -private slots: - void addMount(); - void removeMount(); - void changeLocalMountDir(const QModelIndex &index); - void enableOrDisableRemoveMountSpecButton(); - void handleRemoteMountsChanged(); - void updateMountWarning(); - void runConfigurationEnabledChange(); - -private: - void addMountWidgets(QVBoxLayout *mainLayout); - - QWidget *m_subWidget; - QLabel *m_mountWarningLabel; - QTableView *m_mountView; - QToolButton *m_removeMountButton; - Utils::DetailsWidget *m_mountDetailsContainer; - RemoteLinux::RemoteLinuxRunConfigurationWidget *m_remoteLinuxRunConfigWidget; - MaemoRunConfiguration *m_runConfiguration; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMORUNCONFIGURATIONWIDGET_H diff --git a/src/plugins/madde/maemorunfactories.cpp b/src/plugins/madde/maemorunfactories.cpp deleted file mode 100644 index cbd84ddbc6..0000000000 --- a/src/plugins/madde/maemorunfactories.cpp +++ /dev/null @@ -1,243 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maemorunfactories.h" - -#include "maemoapplicationrunnerhelperactions.h" -#include "maemoconstants.h" -#include "maemoglobal.h" -#include "maemoremotemountsmodel.h" -#include "maemorunconfiguration.h" - -#include <debugger/debuggerconstants.h> -#include <debugger/debuggerstartparameters.h> -#include <debugger/debuggerplugin.h> -#include <debugger/debuggerrunner.h> -#include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/kitinformation.h> -#include <projectexplorer/target.h> -#include <qt4projectmanager/qt4nodes.h> -#include <qt4projectmanager/qt4project.h> -#include <qtsupport/customexecutablerunconfiguration.h> -#include <remotelinux/remotelinuxdebugsupport.h> -#include <remotelinux/remotelinuxruncontrol.h> -#include <utils/qtcassert.h> - -using namespace Debugger; -using namespace ProjectExplorer; -using namespace Qt4ProjectManager; -using namespace RemoteLinux; - -namespace Madde { -namespace Internal { - -namespace { - -QString pathFromId(Core::Id id) -{ - QString idStr = id.toString(); - const QString prefix = QLatin1String(MAEMO_RC_ID_PREFIX); - if (!idStr.startsWith(prefix)) - return QString(); - return idStr.mid(prefix.size()); -} - -template<class Receiver> void setHelperActions(Receiver *receiver, MaemoRunConfiguration *runConfig, - RunControl *runControl) -{ - const Kit * const k = runConfig->target()->kit(); - MaemoPreRunAction * const preRunAction = new MaemoPreRunAction( - DeviceKitInformation::device(k), MaemoGlobal::maddeRoot(k), - runConfig->remoteMounts()->mountSpecs(), runControl); - MaemoPostRunAction * const postRunAction - = new MaemoPostRunAction(preRunAction->mounter(), runControl); - receiver->setApplicationRunnerPreRunAction(preRunAction); - receiver->setApplicationRunnerPostRunAction(postRunAction); -} - -} // namespace - -MaemoRunConfigurationFactory::MaemoRunConfigurationFactory(QObject *parent) - : QmakeRunConfigurationFactory(parent) -{ setObjectName(QLatin1String("MaemoRunConfigurationFactory")); } - -MaemoRunConfigurationFactory::~MaemoRunConfigurationFactory() -{ -} - -bool MaemoRunConfigurationFactory::canCreate(Target *parent, const Core::Id id) const -{ - if (!canHandle(parent)) - return false; - return static_cast<Qt4Project *>(parent->project())->hasApplicationProFile(pathFromId(id)); -} - -bool MaemoRunConfigurationFactory::canRestore(Target *parent, - const QVariantMap &map) const -{ - return canHandle(parent) - && ProjectExplorer::idFromMap(map).toString().startsWith(QLatin1String(MAEMO_RC_ID_PREFIX)); -} - -bool MaemoRunConfigurationFactory::canClone(Target *parent, - RunConfiguration *source) const -{ - if (!canHandle(parent)) - return false; - const RemoteLinuxRunConfiguration * const rlrc - = qobject_cast<RemoteLinuxRunConfiguration *>(source); - Core::Id id = source->id().withSuffix(QLatin1Char('.') + rlrc->projectFilePath()); - return rlrc && canCreate(parent, id); -} - -QList<Core::Id> MaemoRunConfigurationFactory::availableCreationIds(Target *parent) const -{ - QList<Core::Id> result; - if (!canHandle(parent)) - return result; - QStringList proFiles = static_cast<Qt4Project *>(parent->project())->applicationProFilePathes(QLatin1String(MAEMO_RC_ID_PREFIX)); - foreach (const QString &pf, proFiles) - result << Core::Id::fromString(pf); - return result; -} - -QString MaemoRunConfigurationFactory::displayNameForId(const Core::Id id) const -{ - return QFileInfo(pathFromId(id)).completeBaseName() - + QLatin1String(" (on remote Maemo device)"); -} - -RunConfiguration *MaemoRunConfigurationFactory::doCreate(Target *parent, const Core::Id id) -{ - return new MaemoRunConfiguration(parent, id, pathFromId(id)); -} - -RunConfiguration *MaemoRunConfigurationFactory::doRestore(Target *parent, - const QVariantMap &map) -{ - Core::Id id = ProjectExplorer::idFromMap(map); - return new MaemoRunConfiguration(parent, id, pathFromId(id)); -} - -RunConfiguration *MaemoRunConfigurationFactory::clone(Target *parent, RunConfiguration *source) -{ - if (!canClone(parent, source)) - return 0; - - MaemoRunConfiguration *old = static_cast<MaemoRunConfiguration *>(source); - return new MaemoRunConfiguration(parent, old); -} - -bool MaemoRunConfigurationFactory::canHandle(Target *t) const -{ - if (!t->project()->supportsKit(t->kit())) - return false; - if (!qobject_cast<Qt4Project *>(t->project())) - return false; - Core::Id devType = DeviceTypeKitInformation::deviceTypeId(t->kit()); - return devType == Maemo5OsType || devType == HarmattanOsType; -} - -QList<RunConfiguration *> MaemoRunConfigurationFactory::runConfigurationsForNode(Target *t, Node *n) -{ - QList<ProjectExplorer::RunConfiguration *> result; - foreach (ProjectExplorer::RunConfiguration *rc, t->runConfigurations()) - if (MaemoRunConfiguration *mrc = qobject_cast<MaemoRunConfiguration *>(rc)) - if (mrc->projectFilePath() == n->path()) - result << rc; - return result; -} - - -MaemoRunControlFactory::MaemoRunControlFactory(QObject *parent) - : IRunControlFactory(parent) -{ -} - -MaemoRunControlFactory::~MaemoRunControlFactory() -{ -} - -bool MaemoRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const -{ - if (mode != NormalRunMode && mode != DebugRunMode && mode != DebugRunModeWithBreakOnMain) - return false; - const MaemoRunConfiguration * const maemoRunConfig - = qobject_cast<MaemoRunConfiguration *>(runConfiguration); - return maemoRunConfig && maemoRunConfig->isEnabled(); -} - -RunControl* MaemoRunControlFactory::create(RunConfiguration *runConfig, RunMode mode, - QString *errorMessage) -{ - QTC_ASSERT(canRun(runConfig, mode), return 0); - - MaemoRunConfiguration *rc = qobject_cast<MaemoRunConfiguration *>(runConfig); - QTC_ASSERT(rc, return 0); - switch (mode) { - case NormalRunMode: { - RemoteLinuxRunControl * const runControl = new RemoteLinuxRunControl(rc); - setHelperActions(runControl, rc, runControl); - return runControl; - } - case DebugRunMode: - case DebugRunModeWithBreakOnMain: { - IDevice::ConstPtr dev = DeviceKitInformation::device(rc->target()->kit()); - if (!dev) { - *errorMessage = tr("Cannot debug: Kit has no device."); - return 0; - } - if (rc->portsUsedByDebuggers() > dev->freePorts().count()) { - *errorMessage = tr("Cannot debug: Not enough free ports available."); - return 0; - } - DebuggerStartParameters params = LinuxDeviceDebugSupport::startParameters(rc); - if (mode == ProjectExplorer::DebugRunModeWithBreakOnMain) - params.breakOnMain = true; - DebuggerRunControl * const runControl - = DebuggerPlugin::createDebugger(params, rc, errorMessage); - if (!runControl) - return 0; - LinuxDeviceDebugSupport * const debugSupport = - new LinuxDeviceDebugSupport(rc, runControl->engine()); - setHelperActions(debugSupport, rc, runControl); - connect(runControl, SIGNAL(finished()), debugSupport, SLOT(handleDebuggingFinished())); - return runControl; - } - case NoRunMode: - case QmlProfilerRunMode: - case CallgrindRunMode: - case MemcheckRunMode: - QTC_ASSERT(false, return 0); - } - - QTC_ASSERT(false, return 0); -} - - } // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/maemorunfactories.h b/src/plugins/madde/maemorunfactories.h deleted file mode 100644 index 84d779099a..0000000000 --- a/src/plugins/madde/maemorunfactories.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMORUNFACTORIES_H -#define MAEMORUNFACTORIES_H - -#include <qt4projectmanager/qmakerunconfigurationfactory.h> - -namespace ProjectExplorer { -class RunControl; -class Target; -} // namespace ProjectExplorer - -using ProjectExplorer::IRunConfigurationFactory; -using ProjectExplorer::IRunControlFactory; -using ProjectExplorer::RunConfiguration; -using ProjectExplorer::RunConfigWidget; -using ProjectExplorer::RunControl; -using ProjectExplorer::Target; - -namespace Madde { -namespace Internal { - -class MaemoRunConfigurationFactory : public Qt4ProjectManager::QmakeRunConfigurationFactory -{ - Q_OBJECT - -public: - explicit MaemoRunConfigurationFactory(QObject *parent = 0); - ~MaemoRunConfigurationFactory(); - - QString displayNameForId(const Core::Id id) const; - QList<Core::Id> availableCreationIds(Target *parent) const; - - bool canCreate(Target *parent, const Core::Id id) const; - - bool canRestore(Target *parent, const QVariantMap &map) const; - - bool canClone(Target *parent, RunConfiguration *source) const; - RunConfiguration *clone(Target *parent, RunConfiguration *source); - - QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Target *t, - ProjectExplorer::Node *n); - -private: - bool canHandle(ProjectExplorer::Target *t) const; - - RunConfiguration *doCreate(Target *parent, const Core::Id id); - RunConfiguration *doRestore(Target *parent, const QVariantMap &map); -}; - -class MaemoRunControlFactory : public IRunControlFactory -{ - Q_OBJECT -public: - explicit MaemoRunControlFactory(QObject *parent = 0); - ~MaemoRunControlFactory(); - - bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const; - RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration, - ProjectExplorer::RunMode mode, - QString *errorMessage); -}; - - } // namespace Internal -} // namespace Madde - -#endif // MAEMORUNFACTORIES_H diff --git a/src/plugins/madde/maemosettingspages.cpp b/src/plugins/madde/maemosettingspages.cpp deleted file mode 100644 index 185b3791b7..0000000000 --- a/src/plugins/madde/maemosettingspages.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "maemosettingspages.h" - -#include "maemoqemusettings.h" -#include "maemoqemusettingswidget.h" - -#include <coreplugin/icore.h> -#include <projectexplorer/projectexplorerconstants.h> - -#include <QCoreApplication> -#include <QDialog> -#include <QDialogButtonBox> -#include <QFrame> -#include <QLabel> -#include <QVBoxLayout> -#include <QIcon> -#include <QMainWindow> - -namespace Madde { -namespace Internal { -namespace { - -class MaemoQemuCrashDialog : public QDialog -{ - Q_OBJECT -public: - MaemoQemuCrashDialog(QWidget *parent = 0) : QDialog(parent) - { - setWindowTitle(tr("Qemu error")); - QString message = tr("Qemu crashed.") + QLatin1String(" <p>"); - const MaemoQemuSettings::OpenGlMode openGlMode - = MaemoQemuSettings::openGlMode(); - const QString linkString = QLatin1String("</p><a href=\"dummy\">") - + tr("Click here to change the OpenGL mode.") - + QLatin1String("</a>"); - if (openGlMode == MaemoQemuSettings::HardwareAcceleration) { - message += tr("You have configured Qemu to use OpenGL " - "hardware acceleration, which might not be supported by " - "your system. You could try using software rendering instead."); - message += linkString; - } else if (openGlMode == MaemoQemuSettings::AutoDetect) { - message += tr("Qemu is currently configured to auto-detect the " - "OpenGL mode, which is known to not work in some cases. " - "You might want to use software rendering instead."); - message += linkString; - } - QLabel * const messageLabel = new QLabel(message, this); - messageLabel->setWordWrap(true); - messageLabel->setTextFormat(Qt::RichText); - connect(messageLabel, SIGNAL(linkActivated(QString)), - SLOT(showSettingsPage())); - QVBoxLayout *mainLayout = new QVBoxLayout(this); - mainLayout->addWidget(messageLabel); - QFrame * const separator = new QFrame; - separator->setFrameShape(QFrame::HLine); - separator->setFrameShadow(QFrame::Sunken); - mainLayout->addWidget(separator); - QDialogButtonBox * const buttonBox = new QDialogButtonBox; - buttonBox->addButton(QDialogButtonBox::Ok); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - mainLayout->addWidget(buttonBox); - } - -private: - Q_SLOT void showSettingsPage() - { - Core::ICore::showOptionsDialog(MaemoQemuSettingsPage::pageCategory(), - MaemoQemuSettingsPage::pageId()); - accept(); - } -}; - -} // anonymous namespace - - -MaemoQemuSettingsPage::MaemoQemuSettingsPage(QObject *parent) - : Core::IOptionsPage(parent) -{ - setId(pageId()); - setDisplayName(tr("MeeGo Qemu Settings")); - setCategory(pageCategory()); - //setDisplayCategory(QString()); // Will be set by device configurations page. - //setCategoryIcon(QIcon()) // See above. -} - -bool MaemoQemuSettingsPage::matches(const QString &searchKeyWord) const -{ - return m_widget->keywords().contains(searchKeyWord, Qt::CaseInsensitive); -} - -QWidget *MaemoQemuSettingsPage::createPage(QWidget *parent) -{ - m_widget = new MaemoQemuSettingsWidget(parent); - return m_widget; -} - -void MaemoQemuSettingsPage::apply() -{ - m_widget->saveSettings(); -} - -void MaemoQemuSettingsPage::finish() -{ -} - -void MaemoQemuSettingsPage::showQemuCrashDialog() -{ - MaemoQemuCrashDialog dlg(Core::ICore::mainWindow()); - dlg.exec(); -} - -Core::Id MaemoQemuSettingsPage::pageId() -{ - return "ZZ.Qemu Settings"; -} - -Core::Id MaemoQemuSettingsPage::pageCategory() -{ - return ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY; -} - -} // namespace Internal -} // namespace Madde - -#include "maemosettingspages.moc" diff --git a/src/plugins/madde/maemosettingspages.h b/src/plugins/madde/maemosettingspages.h deleted file mode 100644 index da273400de..0000000000 --- a/src/plugins/madde/maemosettingspages.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MAEMOSETTINGSPAGES_H -#define MAEMOSETTINGSPAGES_H - -#include <coreplugin/dialogs/ioptionspage.h> -#include <coreplugin/id.h> - -namespace Madde{ -namespace Internal { -class MaemoQemuSettingsWidget; - -class MaemoQemuSettingsPage : public Core::IOptionsPage -{ - Q_OBJECT - -public: - MaemoQemuSettingsPage(QObject *parent = 0); - - bool matches(const QString &searchKeyWord) const; - QWidget *createPage(QWidget *parent); - void apply(); - void finish(); - - static void showQemuCrashDialog(); - static Core::Id pageId(); - static Core::Id pageCategory(); - -private: - QString m_keywords; - MaemoQemuSettingsWidget *m_widget; -}; - -} // namespace Internal -} // namespace Madde - -#endif // MAEMOSETTINGSPAGES_H diff --git a/src/plugins/madde/qt-maemo.qrc b/src/plugins/madde/qt-maemo.qrc deleted file mode 100644 index 354fe64d1b..0000000000 --- a/src/plugins/madde/qt-maemo.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<RCC> - <qresource prefix="/qt-maemo"> - <file>images/qemu-run.png</file> - <file>images/qemu-stop.png</file> - </qresource> -</RCC> diff --git a/src/plugins/madde/qt4maemodeployconfiguration.cpp b/src/plugins/madde/qt4maemodeployconfiguration.cpp deleted file mode 100644 index d423c206cd..0000000000 --- a/src/plugins/madde/qt4maemodeployconfiguration.cpp +++ /dev/null @@ -1,317 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#include "qt4maemodeployconfiguration.h" - -#include "debianmanager.h" -#include "maddeqemustartstep.h" -#include "maddeuploadandinstallpackagesteps.h" -#include "maemoconstants.h" -#include "maemodeploybymountsteps.h" -#include "maemoglobal.h" -#include "maemoinstalltosysrootstep.h" -#include "maemopackagecreationstep.h" - -#include <coreplugin/icore.h> -#include <projectexplorer/buildsteplist.h> -#include <projectexplorer/deployablefile.h> -#include <projectexplorer/target.h> -#include <projectexplorer/projectexplorer.h> -#include <qt4projectmanager/qt4buildconfiguration.h> -#include <qt4projectmanager/qt4project.h> -#include <qtsupport/qtkitinformation.h> -#include <qtsupport/qtsupportconstants.h> -#include <remotelinux/remotelinuxcheckforfreediskspacestep.h> -#include <remotelinux/remotelinuxdeployconfigurationwidget.h> -#include <utils/qtcassert.h> - -#include <QFileInfo> -#include <QString> - -#include <QMainWindow> -#include <QMessageBox> - -using namespace ProjectExplorer; -using namespace Qt4ProjectManager; -using namespace RemoteLinux; - -namespace Madde { -namespace Internal { - -Qt4MaemoDeployConfiguration::Qt4MaemoDeployConfiguration(ProjectExplorer::Target *target, - const Core::Id id, const QString &displayName) - : RemoteLinuxDeployConfiguration(target, id, displayName) -{ - init(); -} - -Qt4MaemoDeployConfiguration::Qt4MaemoDeployConfiguration(ProjectExplorer::Target *target, - Qt4MaemoDeployConfiguration *source) - : RemoteLinuxDeployConfiguration(target, source) -{ - init(); - cloneSteps(source); -} - -NamedWidget *Qt4MaemoDeployConfiguration::createConfigWidget() -{ - return new RemoteLinuxDeployConfigurationWidget(this); -} - -Qt4MaemoDeployConfiguration::~Qt4MaemoDeployConfiguration() {} - -Core::Id Qt4MaemoDeployConfiguration::fremantleWithPackagingId() -{ - return "DeployToFremantleWithPackaging"; -} - -Core::Id Qt4MaemoDeployConfiguration::fremantleWithoutPackagingId() -{ - return "DeployToFremantleWithoutPackaging"; -} - -Core::Id Qt4MaemoDeployConfiguration::harmattanId() -{ - return "DeployToHarmattan"; -} - -void Qt4MaemoDeployConfiguration::debianDirChanged(const Utils::FileName &dir) -{ - if (dir == DebianManager::debianDirectory(target())) - emit packagingChanged(); -} - -void Qt4MaemoDeployConfiguration::setupPackaging() -{ - if (target()->project()->activeTarget() != target()) - return; - - disconnect(target()->project(), SIGNAL(fileListChanged()), this, SLOT(setupPackaging())); - setupDebianPackaging(); -} - -void Qt4MaemoDeployConfiguration::setupDebianPackaging() -{ - Qt4BuildConfiguration *bc = qobject_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration()); - if (!bc || !target()->kit()) - return; - - Utils::FileName debianDir = DebianManager::debianDirectory(target()); - DebianManager::ActionStatus status = DebianManager::createTemplate(bc, debianDir); - - if (status == DebianManager::ActionFailed) - return; - - DebianManager * const dm = DebianManager::instance(); - dm->monitor(debianDir); - connect(dm, SIGNAL(debianDirectoryChanged(Utils::FileName)), this, - SLOT(debianDirChanged(Utils::FileName))); - - if (status == DebianManager::NoActionRequired) - return; - - Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target()->kit()); - QString projectName = target()->project()->displayName(); - - if (!DebianManager::hasPackageManagerIcon(debianDir)) { - // Such a file is created by the mobile wizards. - Utils::FileName iconPath = Utils::FileName::fromString(target()->project()->projectDirectory()); - iconPath.appendPath(projectName + QLatin1String("64.png")); - if (iconPath.toFileInfo().exists()) - dm->setPackageManagerIcon(debianDir, deviceType, iconPath); - } - - // Set up aegis manifest on harmattan: - if (deviceType == HarmattanOsType) { - Utils::FileName manifest = debianDir; - const QString manifestName = QLatin1String("manifest.aegis"); - manifest.appendPath(manifestName); - const QFile aegisFile(manifest.toString()); - if (!aegisFile.exists()) { - Utils::FileReader reader; - if (!reader.fetch(Core::ICore::resourcePath() - + QLatin1String("/templates/shared/") + manifestName)) { - qDebug("Reading manifest template failed."); - return; - } - QString content = QString::fromUtf8(reader.data()); - content.replace(QLatin1String("%%PROJECTNAME%%"), projectName); - Utils::FileSaver writer(aegisFile.fileName(), QIODevice::WriteOnly); - writer.write(content.toUtf8()); - if (!writer.finalize()) { - qDebug("Failure writing manifest file."); - return; - } - } - } - - emit packagingChanged(); - - // fix path: - QStringList files = DebianManager::debianFiles(debianDir); - Utils::FileName path = Utils::FileName::fromString(QDir(target()->project()->projectDirectory()) - .relativeFilePath(debianDir.toString())); - QStringList relativeFiles; - foreach (const QString &f, files) { - Utils::FileName fn = path; - fn.appendPath(f); - relativeFiles << fn.toString(); - } - - addFilesToProject(relativeFiles); -} - -void Qt4MaemoDeployConfiguration::addFilesToProject(const QStringList &files) -{ - if (files.isEmpty()) - return; - - const QString list = QLatin1String("<ul><li>") + files.join(QLatin1String("</li><li>")) - + QLatin1String("</li></ul>"); - QMessageBox::StandardButton button = - QMessageBox::question(Core::ICore::mainWindow(), - tr("Add Packaging Files to Project"), - tr("<html>Qt Creator has set up the following files to enable " - "packaging:\n %1\nDo you want to add them to the project?</html>") - .arg(list), QMessageBox::Yes | QMessageBox::No); - if (button == QMessageBox::Yes) - ProjectExplorer::ProjectExplorerPlugin::instance() - ->addExistingFiles(target()->project()->rootProjectNode(), files); -} - -void Qt4MaemoDeployConfiguration::init() -{ - connect(target()->project(), SIGNAL(fileListChanged()), this, SLOT(setupPackaging())); -} - -Qt4MaemoDeployConfigurationFactory::Qt4MaemoDeployConfigurationFactory(QObject *parent) - : DeployConfigurationFactory(parent) -{ setObjectName(QLatin1String("Qt4MaemoDeployConfigurationFactory")); } - -QList<Core::Id> Qt4MaemoDeployConfigurationFactory::availableCreationIds(Target *parent) const -{ - QList<Core::Id> ids; - if (!canHandle(parent)) - return ids; - - Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->kit()); - if (deviceType == Maemo5OsType) - ids << Qt4MaemoDeployConfiguration::fremantleWithPackagingId() - << Qt4MaemoDeployConfiguration::fremantleWithoutPackagingId(); - else if (deviceType == HarmattanOsType) - ids << Qt4MaemoDeployConfiguration::harmattanId(); - return ids; -} - -QString Qt4MaemoDeployConfigurationFactory::displayNameForId(const Core::Id id) const -{ - if (id == Qt4MaemoDeployConfiguration::fremantleWithoutPackagingId()) - return tr("Copy Files to Maemo5 Device"); - else if (id == Qt4MaemoDeployConfiguration::fremantleWithPackagingId()) - return tr("Build Debian Package and Install to Maemo5 Device"); - else if (id == Qt4MaemoDeployConfiguration::harmattanId()) - return tr("Build Debian Package and Install to Harmattan Device"); - return QString(); -} - -bool Qt4MaemoDeployConfigurationFactory::canCreate(Target *parent, - const Core::Id id) const -{ - return availableCreationIds(parent).contains(id); -} - -DeployConfiguration *Qt4MaemoDeployConfigurationFactory::create(Target *parent, - const Core::Id id) -{ - Q_ASSERT(canCreate(parent, id)); - - const QString displayName = displayNameForId(id); - Qt4MaemoDeployConfiguration * const dc = new Qt4MaemoDeployConfiguration(parent, id, displayName); - dc->setupDebianPackaging(); - - if (id == Qt4MaemoDeployConfiguration::fremantleWithoutPackagingId()) { - dc->stepList()->insertStep(0, new MaemoMakeInstallToSysrootStep(dc->stepList())); - dc->stepList()->insertStep(1, new MaddeQemuStartStep(dc->stepList())); - dc->stepList()->insertStep(2, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList())); - dc->stepList()->insertStep(3, new MaemoCopyFilesViaMountStep(dc->stepList())); - } else if (id == Qt4MaemoDeployConfiguration::fremantleWithPackagingId()) { - dc->stepList()->insertStep(0, new MaemoDebianPackageCreationStep(dc->stepList())); - dc->stepList()->insertStep(1, new MaemoInstallDebianPackageToSysrootStep(dc->stepList())); - dc->stepList()->insertStep(2, new MaddeQemuStartStep(dc->stepList())); - dc->stepList()->insertStep(3, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList())); - dc->stepList()->insertStep(4, new MaemoInstallPackageViaMountStep(dc->stepList())); - } else if (id == Qt4MaemoDeployConfiguration::harmattanId()) { - dc->stepList()->insertStep(0, new MaemoDebianPackageCreationStep(dc->stepList())); - dc->stepList()->insertStep(1, new MaemoInstallDebianPackageToSysrootStep(dc->stepList())); - dc->stepList()->insertStep(2, new MaddeQemuStartStep(dc->stepList())); - dc->stepList()->insertStep(3, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList())); - dc->stepList()->insertStep(4, new MaemoUploadAndInstallPackageStep(dc->stepList())); - } - return dc; -} - -bool Qt4MaemoDeployConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const -{ - Core::Id id = idFromMap(map); - return canHandle(parent) && availableCreationIds(parent).contains(id) - && MaemoGlobal::supportsMaemoDevice(parent->kit()); -} - -DeployConfiguration *Qt4MaemoDeployConfigurationFactory::restore(Target *parent, const QVariantMap &map) -{ - QTC_ASSERT(canRestore(parent, map), return 0); - - Qt4MaemoDeployConfiguration * const dc - = qobject_cast<Qt4MaemoDeployConfiguration *>(create(parent, idFromMap(map))); - if (!dc->fromMap(map)) { - delete dc; - return 0; - } - return dc; -} - -DeployConfiguration *Qt4MaemoDeployConfigurationFactory::clone(Target *parent, - DeployConfiguration *product) -{ - if (!canClone(parent, product)) - return 0; - return new Qt4MaemoDeployConfiguration(parent, - qobject_cast<Qt4MaemoDeployConfiguration *>(product)); -} - -bool Qt4MaemoDeployConfigurationFactory::canHandle(Target *parent) const -{ - if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project())) - return false; - if (!parent->project()->supportsKit(parent->kit())) - return false; - return MaemoGlobal::supportsMaemoDevice(parent->kit()); -} - -} // namespace Internal -} // namespace Madde diff --git a/src/plugins/madde/qt4maemodeployconfiguration.h b/src/plugins/madde/qt4maemodeployconfiguration.h deleted file mode 100644 index f129b57900..0000000000 --- a/src/plugins/madde/qt4maemodeployconfiguration.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef QT4MAEMODEPLOYCONFIGURATION_H -#define QT4MAEMODEPLOYCONFIGURATION_H - -#include <remotelinux/remotelinuxdeployconfiguration.h> -#include <utils/fileutils.h> - -namespace Madde { -namespace Internal { - -class Qt4MaemoDeployConfigurationFactory : public ProjectExplorer::DeployConfigurationFactory -{ - Q_OBJECT - -public: - explicit Qt4MaemoDeployConfigurationFactory(QObject *parent = 0); - - QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const; - QString displayNameForId(const Core::Id id) const; - 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); - ProjectExplorer::DeployConfiguration *clone(ProjectExplorer::Target *parent, - ProjectExplorer::DeployConfiguration *product); - - bool canHandle(ProjectExplorer::Target *parent) const; -}; - -class Qt4MaemoDeployConfiguration : public RemoteLinux::RemoteLinuxDeployConfiguration -{ - Q_OBJECT - -public: - ~Qt4MaemoDeployConfiguration(); - - ProjectExplorer::NamedWidget *createConfigWidget(); - - static Core::Id fremantleWithPackagingId(); - static Core::Id fremantleWithoutPackagingId(); - static Core::Id harmattanId(); - -signals: - void packagingChanged(); - -private slots: - void debianDirChanged(const Utils::FileName &dir); - void setupPackaging(); - -private: - void init(); - void setupDebianPackaging(); - void addFilesToProject(const QStringList &files); - - friend class Internal::Qt4MaemoDeployConfigurationFactory; - - Qt4MaemoDeployConfiguration(ProjectExplorer::Target *target, const Core::Id id, - const QString &displayName); - Qt4MaemoDeployConfiguration(ProjectExplorer::Target *target, - Qt4MaemoDeployConfiguration *source); -}; - -} // namespace Internal -} // namespace Madde - -#endif // QT4MAEMODEPLOYCONFIGURATION_H diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 39311cdc0f..47654779f0 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -43,7 +43,6 @@ SUBDIRS = \ macros \ remotelinux \ android \ - madde \ valgrind \ todo \ qnx \ diff --git a/src/plugins/plugins.qbs b/src/plugins/plugins.qbs index a91139a8ac..1aac37aa89 100644 --- a/src/plugins/plugins.qbs +++ b/src/plugins/plugins.qbs @@ -36,7 +36,6 @@ Project { "ios/ios.qbs", "locator/locator.qbs", "macros/macros.qbs", - "madde/madde.qbs", "mercurial/mercurial.qbs", "perforce/perforce.qbs", "projectexplorer/projectexplorer.qbs", diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index ed0c2fca86..936505369d 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -67,8 +67,6 @@ static const char compilerPlatformLinkerFlagsKeyC[] = "ProjectExplorer.GccToolCh static const char targetAbiKeyC[] = "ProjectExplorer.GccToolChain.TargetAbi"; static const char supportedAbisKeyC[] = "ProjectExplorer.GccToolChain.SupportedAbis"; -static const char LEGACY_MAEMO_ID[] = "Qt4ProjectManager.ToolChain.Maemo:"; - static QByteArray runGcc(const FileName &gcc, const QStringList &arguments, const QStringList &env) { if (gcc.isEmpty() || !gcc.toFileInfo().isExecutable()) @@ -748,8 +746,7 @@ QList<ToolChain *> GccToolChainFactory::autoDetect() bool GccToolChainFactory::canRestore(const QVariantMap &data) { const QString id = idFromMap(data); - return id.startsWith(QLatin1String(Constants::GCC_TOOLCHAIN_ID) + QLatin1Char(':')) - || id.startsWith(QLatin1String(LEGACY_MAEMO_ID)); + return id.startsWith(QLatin1String(Constants::GCC_TOOLCHAIN_ID) + QLatin1Char(':')); } ToolChain *GccToolChainFactory::restore(const QVariantMap &data) @@ -758,11 +755,6 @@ ToolChain *GccToolChainFactory::restore(const QVariantMap &data) // Updating from 2.5: QVariantMap updated = data; QString id = idFromMap(updated); - if (id.startsWith(QLatin1String(LEGACY_MAEMO_ID))) { - id = QString::fromLatin1(Constants::GCC_TOOLCHAIN_ID).append(id.mid(id.indexOf(QLatin1Char(':')))); - idToMap(updated, id); - autoDetectionToMap(updated, false); - } if (tc->fromMap(updated)) return tc; @@ -1376,10 +1368,6 @@ void ProjectExplorerPlugin::testGccAbiGuessing_data() << QByteArray("#define __ARM_64 1\n#define __Something\n") << (QStringList()); - QTest::newRow("Maemo 1") - << QString::fromLatin1("arm-none-linux-gnueabi") - << QByteArray("") - << (QStringList() << QLatin1String("arm-linux-generic-elf-32bit")); QTest::newRow("Linux 1 (32bit intel)") << QString::fromLatin1("i686-linux-gnu") << QByteArray("") diff --git a/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp b/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp index 14bce0294f..f24d686fed 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/simulatorqtversion.cpp @@ -88,8 +88,6 @@ QString SimulatorQtVersion::description() const 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); features |= Core::FeatureSet(QtSupport::Constants::FEATURE_MOBILE); return features; @@ -97,6 +95,5 @@ Core::FeatureSet SimulatorQtVersion::availableFeatures() const bool SimulatorQtVersion::supportsPlatform(const QString &platformName) const { - return (platformName.isEmpty() - || platformName == QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM)); + return platformName.isEmpty(); } diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.pro b/src/plugins/qt4projectmanager/qt4projectmanager.pro index a336ae54a0..e574c4bc9b 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.pro +++ b/src/plugins/qt4projectmanager/qt4projectmanager.pro @@ -131,8 +131,6 @@ FORMS += makestep.ui \ wizards/html5appwizardsourcespage.ui \ wizards/mobilelibrarywizardoptionpage.ui \ wizards/mobileappwizardgenericoptionspage.ui \ - wizards/mobileappwizardmaemooptionspage.ui \ - wizards/mobileappwizardharmattanoptionspage.ui \ wizards/qtquickcomponentsetoptionspage.ui RESOURCES += qt4projectmanager.qrc \ diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.qbs b/src/plugins/qt4projectmanager/qt4projectmanager.qbs index 16964a0362..8d0e6b98f6 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.qbs +++ b/src/plugins/qt4projectmanager/qt4projectmanager.qbs @@ -118,8 +118,6 @@ QtcPlugin { "librarywizarddialog.cpp", "librarywizarddialog.h", "mobileapp.cpp", "mobileapp.h", "mobileappwizardgenericoptionspage.ui", - "mobileappwizardharmattanoptionspage.ui", - "mobileappwizardmaemooptionspage.ui", "mobileappwizardpages.cpp", "mobileappwizardpages.h", "mobilelibraryparameters.cpp", "mobilelibraryparameters.h", "mobilelibrarywizardoptionpage.cpp", "mobilelibrarywizardoptionpage.h", "mobilelibrarywizardoptionpage.ui", diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerconstants.h b/src/plugins/qt4projectmanager/qt4projectmanagerconstants.h index 2845852eb8..b310741283 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerconstants.h +++ b/src/plugins/qt4projectmanager/qt4projectmanagerconstants.h @@ -79,7 +79,6 @@ const char SHADOWBUILD_TARGETFEATURE_ID[] = "Qt4ProjectManager.TargetFeature.Sha // Tool chains: const char GCCE_TOOLCHAIN_ID[] = "Qt4ProjectManager.ToolChain.GCCE"; -const char MAEMO_TOOLCHAIN_ID[] = "Qt4ProjectManager.ToolChain.Maemo"; // ICONS const char ICON_QTQUICK_APP[] = ":/wizards/images/qtquickapp.png"; diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp b/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp index b98c5a9570..49f3f12971 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp @@ -60,9 +60,7 @@ const int AbstractMobileApp::StubVersion = 9; AbstractMobileApp::AbstractMobileApp() : QObject() - , m_canSupportMeegoBooster(false) , m_orientation(ScreenOrientationAuto) - , m_supportsMeegoBooster(false) { } @@ -124,8 +122,6 @@ QString AbstractMobileApp::path(int fileType) const case AppPro: return outputPathBase() + m_projectName + QLatin1String(".pro"); case AppProOrigin: return originsRootApp + QLatin1String("app.pro"); case AppProPath: return outputPathBase(); - case DesktopFremantle: return outputPathBase() + m_projectName + QLatin1String(".desktop"); - case DesktopHarmattan: return outputPathBase() + m_projectName + QLatin1String("_harmattan.desktop"); case DesktopOrigin: return originsRootShared + QLatin1String("app.desktop"); case DeploymentPri: return outputPathBase() + DeploymentPriFileName; case DeploymentPriOrigin: return originsRootShared + DeploymentPriFileName; @@ -154,17 +150,6 @@ QByteArray AbstractMobileApp::generateDesktopFile(QString *errorMessage, int fil QByteArray desktopFileContent; if (!readTemplate(DesktopOrigin, &desktopFileContent, errorMessage)) return QByteArray(); - if (fileType == AbstractGeneratedFileInfo::DesktopFremantleFile) { - desktopFileContent.replace("Icon=thisApp", - "Icon=" + projectName().toUtf8() + "64"); - } else if (fileType == AbstractGeneratedFileInfo::DesktopHarmattanFile) { - desktopFileContent.replace("Icon=thisApp", - "Icon=/usr/share/icons/hicolor/80x80/apps/" + projectName().toUtf8() + "80.png"); - if (m_supportsMeegoBooster) - desktopFileContent.replace("Exec=", "Exec=/usr/bin/invoker --type=d -s "); - else - desktopFileContent.replace("Exec=", "Exec=/usr/bin/single-instance "); - } return desktopFileContent.replace("thisApp", projectName().toUtf8()); } @@ -353,8 +338,6 @@ Core::GeneratedFiles AbstractMobileApp::generateFiles(QString *errorMessage) con files << file(generateFile(AbstractGeneratedFileInfo::MainCppFile, errorMessage), path(MainCpp)); files << file(generateFile(AbstractGeneratedFileInfo::PngIcon64File, errorMessage), path(PngIcon64)); files << file(generateFile(AbstractGeneratedFileInfo::PngIcon80File, errorMessage), path(PngIcon80)); - files << file(generateFile(AbstractGeneratedFileInfo::DesktopFremantleFile, errorMessage), path(DesktopFremantle)); - files << file(generateFile(AbstractGeneratedFileInfo::DesktopHarmattanFile, errorMessage), path(DesktopHarmattan)); return files; } #endif // CREATORLESSTEST @@ -364,22 +347,6 @@ QString AbstractMobileApp::error() const return m_error; } -bool AbstractMobileApp::canSupportMeegoBooster() const -{ - return m_canSupportMeegoBooster; -} - -bool AbstractMobileApp::supportsMeegoBooster() const -{ - return m_supportsMeegoBooster; -} - -void AbstractMobileApp::setSupportsMeegoBooster(bool supportMeegoBooster) -{ - QTC_ASSERT(canSupportMeegoBooster(), return); - m_supportsMeegoBooster = supportMeegoBooster; -} - QByteArray AbstractMobileApp::readBlob(const QString &filePath, QString *errorMsg) const { @@ -409,10 +376,6 @@ QByteArray AbstractMobileApp::generateFile(int fileType, case AbstractGeneratedFileInfo::PngIcon80File: data = readBlob(path(PngIconOrigin80), errorMessage); break; - case AbstractGeneratedFileInfo::DesktopFremantleFile: - case AbstractGeneratedFileInfo::DesktopHarmattanFile: - data = generateDesktopFile(errorMessage, fileType); - break; case AbstractGeneratedFileInfo::DeploymentPriFile: data = readBlob(path(DeploymentPriOrigin), errorMessage); comment = ProFileComment; diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileapp.h b/src/plugins/qt4projectmanager/wizards/abstractmobileapp.h index 333eb28217..05829462d0 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileapp.h +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileapp.h @@ -55,8 +55,6 @@ struct DeploymentPriFile, PngIcon64File, PngIcon80File, - DesktopFremantleFile, - DesktopHarmattanFile, ExtendedFile }; @@ -95,8 +93,6 @@ public: AppPro, AppProOrigin, AppProPath, - DesktopFremantle, - DesktopHarmattan, DesktopOrigin, DeploymentPri, DeploymentPriOrigin, @@ -121,10 +117,6 @@ public: QString path(int fileType) const; QString error() const; - bool canSupportMeegoBooster() const; - bool supportsMeegoBooster() const; - void setSupportsMeegoBooster(bool supportBooster); - #ifndef CREATORLESSTEST virtual Core::GeneratedFiles generateFiles(QString *errorMessage) const; #else @@ -159,7 +151,6 @@ protected: static const int StubVersion; QString m_error; - bool m_canSupportMeegoBooster; private: QByteArray generateDesktopFile(QString *errorMessage, int fileType) const; @@ -184,7 +175,6 @@ private: QString m_pngIcon64; QString m_pngIcon80; ScreenOrientation m_orientation; - bool m_supportsMeegoBooster; }; } // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp index 8b94e4cdf6..12d0ea4215 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp @@ -53,14 +53,10 @@ AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent, : ProjectExplorer::BaseProjectWizardDialog(parent, parameters) , m_targetsPage(0) , m_genericOptionsPageId(-1) - , m_maemoOptionsPageId(-1) - , m_harmattanOptionsPageId(-1) , m_targetsPageId(-1) , m_ignoreGeneralOptions(false) , m_targetItem(0) , m_genericItem(0) - , m_maemoItem(0) - , m_harmattanItem(0) , m_kitIds(parameters.extraValues().value(QLatin1String(ProjectExplorer::Constants::PROJECT_KIT_IDS)) .value<QList<Core::Id> >()) { @@ -82,8 +78,6 @@ AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent, } m_genericOptionsPage = new Internal::MobileAppWizardGenericOptionsPage; - m_maemoOptionsPage = new Internal::MobileAppWizardMaemoOptionsPage; - m_harmattanOptionsPage = new Internal::MobileAppWizardHarmattanOptionsPage; } void AbstractMobileAppWizardDialog::addMobilePages() @@ -93,12 +87,7 @@ void AbstractMobileAppWizardDialog::addMobilePages() m_targetItem = wizardProgress()->item(m_targetsPageId); } - const bool shouldAddGenericPage = m_targetsPage - || isQtPlatformSelected(QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)); - const bool shouldAddMaemoPage = m_targetsPage - || isQtPlatformSelected(QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)); - const bool shouldAddHarmattanPage = m_targetsPage - || isQtPlatformSelected(QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM)); + const bool shouldAddGenericPage = m_targetsPage; if (shouldAddGenericPage) { m_genericOptionsPageId = addPageWithTitle(m_genericOptionsPage, @@ -106,18 +95,6 @@ void AbstractMobileAppWizardDialog::addMobilePages() m_genericItem = wizardProgress()->item(m_genericOptionsPageId); } - if (shouldAddMaemoPage) { - m_maemoOptionsPageId = addPageWithTitle(m_maemoOptionsPage, - QLatin1String(" ") + tr("Maemo5 And MeeGo Specific")); - m_maemoItem = wizardProgress()->item(m_maemoOptionsPageId); - } - - if (shouldAddHarmattanPage) { - m_harmattanOptionsPageId = addPageWithTitle(m_harmattanOptionsPage, - QLatin1String(" ") + tr("Harmattan Specific")); - m_harmattanItem = wizardProgress()->item(m_harmattanOptionsPageId); - } - if (m_targetItem) m_targetItem->setNextShownItem(0); } @@ -137,26 +114,10 @@ int AbstractMobileAppWizardDialog::addPageWithTitle(QWizardPage *page, const QSt int AbstractMobileAppWizardDialog::nextId() const { if (m_targetsPage) { - if (currentPage() == m_targetsPage) { - if (isQtPlatformSelected(QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM))) - return m_genericOptionsPageId; - else if (isQtPlatformSelected(QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM))) - return m_harmattanOptionsPageId; - else - return idOfNextGenericPage(); - } else if (currentPage() == m_genericOptionsPage) { - if (isQtPlatformSelected(QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM))) - return m_maemoOptionsPageId; - else if (isQtPlatformSelected(QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM))) - return m_harmattanOptionsPageId; - else - return idOfNextGenericPage(); - } else if (currentPage() == m_maemoOptionsPage) { - if (isQtPlatformSelected(QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM))) - return m_harmattanOptionsPageId; - else - return idOfNextGenericPage(); - } + if (currentPage() == m_targetsPage) + return idOfNextGenericPage(); + if (currentPage() == m_genericOptionsPage) + return idOfNextGenericPage(); } return BaseProjectWizardDialog::nextId(); } @@ -166,21 +127,10 @@ void AbstractMobileAppWizardDialog::initializePage(int id) if (m_targetItem) { if (id == startId()) { m_targetItem->setNextItems(QList<Utils::WizardProgressItem *>() - << m_genericItem << m_maemoItem << m_harmattanItem << itemOfNextGenericPage()); - m_genericItem->setNextItems(QList<Utils::WizardProgressItem *>() - << m_maemoItem); - m_maemoItem->setNextItems(QList<Utils::WizardProgressItem *>() - << m_harmattanItem << itemOfNextGenericPage()); - } else if (id == m_genericOptionsPageId - || id == m_maemoOptionsPageId) { + << m_genericItem << itemOfNextGenericPage()); + } else if (id == m_genericOptionsPageId) { QList<Utils::WizardProgressItem *> order; - order << m_genericItem; - if (isQtPlatformSelected(QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM))) - order << m_maemoItem; - if (isQtPlatformSelected(QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM))) - order << m_harmattanItem; - order << itemOfNextGenericPage(); - + order << m_genericItem << itemOfNextGenericPage(); for (int i = 0; i < order.count() - 1; i++) order.at(i)->setNextShownItem(order.at(i + 1)); } @@ -200,7 +150,7 @@ Utils::WizardProgressItem *AbstractMobileAppWizardDialog::targetsPageItem() cons int AbstractMobileAppWizardDialog::idOfNextGenericPage() const { - return pageIds().at(pageIds().indexOf(m_harmattanOptionsPageId) + 1); + return pageIds().at(pageIds().indexOf(m_genericOptionsPageId) + 1); } Utils::WizardProgressItem *AbstractMobileAppWizardDialog::itemOfNextGenericPage() const @@ -239,9 +189,6 @@ QWizard *AbstractMobileAppWizard::createWizardDialog(QWidget *parent, = createWizardDialogInternal(parent, wizardDialogParameters); wdlg->setProjectName(ProjectExplorer::BaseProjectWizardDialog::uniqueProjectName(wizardDialogParameters.defaultPath())); wdlg->m_genericOptionsPage->setOrientation(app()->orientation()); - wdlg->m_maemoOptionsPage->setPngIcon(app()->pngIcon64()); - wdlg->m_harmattanOptionsPage->setPngIcon(app()->pngIcon80()); - wdlg->m_harmattanOptionsPage->setBoosterOptionEnabled(app()->canSupportMeegoBooster()); connect(wdlg, SIGNAL(projectParametersChanged(QString,QString)), SLOT(useProjectPath(QString,QString))); wdlg->addExtensionPages(wizardDialogParameters.extensionPages()); @@ -255,10 +202,6 @@ Core::GeneratedFiles AbstractMobileAppWizard::generateFiles(const QWizard *wizar const AbstractMobileAppWizardDialog *wdlg = qobject_cast<const AbstractMobileAppWizardDialog*>(wizard); app()->setOrientation(wdlg->m_genericOptionsPage->orientation()); - app()->setPngIcon64(wdlg->m_maemoOptionsPage->pngIcon()); - app()->setPngIcon80(wdlg->m_harmattanOptionsPage->pngIcon()); - if (wdlg->isQtPlatformSelected(QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM))) - app()->setSupportsMeegoBooster(wdlg->m_harmattanOptionsPage->supportsBooster()); prepareGenerateFiles(wizard, errorMessage); return app()->generateFiles(errorMessage); } diff --git a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h index cfb2a997f8..4aa8111e99 100644 --- a/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h +++ b/src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h @@ -44,11 +44,7 @@ namespace Qt4ProjectManager { class AbstractMobileApp; -namespace Internal { -class MobileAppWizardGenericOptionsPage; -class MobileAppWizardMaemoOptionsPage; -class MobileAppWizardHarmattanOptionsPage; -} +namespace Internal { class MobileAppWizardGenericOptionsPage; } /// \internal class QT4PROJECTMANAGER_EXPORT AbstractMobileAppWizardDialog : public ProjectExplorer::BaseProjectWizardDialog @@ -79,19 +75,13 @@ private: QList<Core::Id> selectedKits() const; Internal::MobileAppWizardGenericOptionsPage *m_genericOptionsPage; - Internal::MobileAppWizardMaemoOptionsPage *m_maemoOptionsPage; - Internal::MobileAppWizardHarmattanOptionsPage *m_harmattanOptionsPage; ProjectExplorer::TargetSetupPage *m_targetsPage; int m_genericOptionsPageId; - 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_maemoItem; - Utils::WizardProgressItem *m_harmattanItem; QList<Core::Id> m_kitIds; friend class AbstractMobileAppWizard; diff --git a/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp b/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp index d674e570db..aa7d1b47fd 100644 --- a/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp +++ b/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp @@ -112,9 +112,7 @@ GuiAppParameters GuiAppWizardDialog::parameters() const rc.formFileName = m_filesPage->formFileName(); rc.designerForm = m_filesPage->formInputChecked(); rc.isMobileApplication = true; - if (isQtPlatformSelected(QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)) - || isQtPlatformSelected(QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM)) - || isQtPlatformSelected(QLatin1String(QtSupport::Constants::ANDROID_PLATFORM))) { + if (isQtPlatformSelected(QLatin1String(QtSupport::Constants::ANDROID_PLATFORM))) { rc.widgetWidth = 800; rc.widgetHeight = 480; } else { diff --git a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp index b7816ccfe4..dadeca8538 100644 --- a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp +++ b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp @@ -370,7 +370,7 @@ MobileLibraryParameters LibraryWizardDialog::mobileLibraryParameters() const mlp.fileName = projectName(); // Maemo stuff should always be added to pro file. Even if no mobile target is specified - mlp.type |= MobileLibraryParameters::Maemo; + mlp.type |= MobileLibraryParameters::Linux; return mlp; } diff --git a/src/plugins/qt4projectmanager/wizards/mobileappwizardharmattanoptionspage.ui b/src/plugins/qt4projectmanager/wizards/mobileappwizardharmattanoptionspage.ui deleted file mode 100644 index 864fc7ee6c..0000000000 --- a/src/plugins/qt4projectmanager/wizards/mobileappwizardharmattanoptionspage.ui +++ /dev/null @@ -1,95 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Qt4ProjectManager::Internal::MobileAppWizardHarmattanOptionsPage</class> - <widget class="QWizardPage" name="Qt4ProjectManager::Internal::MobileAppWizardHarmattanOptionsPage"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>400</width> - <height>300</height> - </rect> - </property> - <property name="windowTitle"> - <string>WizardPage</string> - </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="appIconLabel"> - <property name="text"> - <string>Application icon (80x80):</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QToolButton" name="pngIconButton"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="iconSize"> - <size> - <width>64</width> - <height>64</height> - </size> - </property> - </widget> - </item> - <item row="1" column="0" colspan="2"> - <widget class="QCheckBox" name="makeBoostableCheckBox"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="toolTip"> - <string>Generate code to speed up the launching on the device.</string> - </property> - <property name="text"> - <string>Make application boostable</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="0" column="2"> - <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> - <item row="2" column="1"> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/src/plugins/qt4projectmanager/wizards/mobileappwizardmaemooptionspage.ui b/src/plugins/qt4projectmanager/wizards/mobileappwizardmaemooptionspage.ui deleted file mode 100644 index 4a9fe0d563..0000000000 --- a/src/plugins/qt4projectmanager/wizards/mobileappwizardmaemooptionspage.ui +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Qt4ProjectManager::Internal::MobileAppWizardMaemoOptionsPage</class> - <widget class="QWizardPage" name="Qt4ProjectManager::Internal::MobileAppWizardMaemoOptionsPage"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>400</width> - <height>300</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="text"> - <string>Application icon (64x64):</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QToolButton" name="pngIconButton"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="iconSize"> - <size> - <width>64</width> - <height>64</height> - </size> - </property> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.cpp b/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.cpp index bcc3152129..c54c0aea80 100644 --- a/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.cpp +++ b/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.cpp @@ -29,8 +29,6 @@ #include "mobileappwizardpages.h" #include "ui_mobileappwizardgenericoptionspage.h" -#include "ui_mobileappwizardmaemooptionspage.h" -#include "ui_mobileappwizardharmattanoptionspage.h" #include <utils/fileutils.h> #include <QTemporaryFile> @@ -46,22 +44,6 @@ class MobileAppWizardGenericOptionsPagePrivate friend class MobileAppWizardGenericOptionsPage; }; -class MobileAppWizardMaemoOptionsPagePrivate -{ - Ui::MobileAppWizardMaemoOptionsPage ui; - QSize iconSize; - QString pngIcon; - friend class MobileAppWizardMaemoOptionsPage; -}; - -class MobileAppWizardHarmattanOptionsPagePrivate -{ - Ui::MobileAppWizardHarmattanOptionsPage ui; - QSize iconSize; - QString pngIcon; - friend class MobileAppWizardHarmattanOptionsPage; -}; - MobileAppWizardGenericOptionsPage::MobileAppWizardGenericOptionsPage(QWidget *parent) : QWizardPage(parent) , d(new MobileAppWizardGenericOptionsPagePrivate) @@ -99,27 +81,6 @@ AbstractMobileApp::ScreenOrientation MobileAppWizardGenericOptionsPage::orientat } -MobileAppWizardMaemoOptionsPage::MobileAppWizardMaemoOptionsPage(QWidget *parent) - : QWizardPage(parent) - , d(new MobileAppWizardMaemoOptionsPagePrivate) -{ - d->ui.setupUi(this); - d->iconSize = QSize(64, 64); - d->ui.pngIconButton->setIconSize(d->iconSize); - connect(d->ui.pngIconButton, SIGNAL(clicked()), this, SLOT(openPngIcon())); -} - -MobileAppWizardMaemoOptionsPage::~MobileAppWizardMaemoOptionsPage() -{ - delete d; -} - -QString MobileAppWizardMaemoOptionsPage::pngIcon() const -{ - return d->pngIcon; -} - - class PngIconScaler : public QObject { Q_OBJECT @@ -166,86 +127,6 @@ private: QPixmap m_pixmap; }; - -void MobileAppWizardMaemoOptionsPage::setPngIcon(const QString &icon) -{ - QString actualIconPath; - PngIconScaler scaler(d->iconSize, icon); - if (scaler.hasRightSize()) { - actualIconPath = icon; - } else { - if (!scaler.scale(&actualIconPath)) - return; - } - - d->ui.pngIconButton->setIcon(scaler.pixmap()); - d->pngIcon = actualIconPath; -} - -void MobileAppWizardMaemoOptionsPage::openPngIcon() -{ - const QString iconPath = QFileDialog::getOpenFileName(this, - d->ui.appIconLabel->text(), d->pngIcon, - QLatin1String("*.png")); - if (!iconPath.isEmpty()) - setPngIcon(iconPath); -} - -MobileAppWizardHarmattanOptionsPage::MobileAppWizardHarmattanOptionsPage(QWidget *parent) - : QWizardPage(parent) - , d(new MobileAppWizardHarmattanOptionsPagePrivate) -{ - d->ui.setupUi(this); - d->iconSize = QSize(80, 80); - d->ui.pngIconButton->setIconSize(d->iconSize); - connect(d->ui.pngIconButton, SIGNAL(clicked()), this, SLOT(openPngIcon())); -} - -MobileAppWizardHarmattanOptionsPage::~MobileAppWizardHarmattanOptionsPage() -{ - delete d; -} - -QString MobileAppWizardHarmattanOptionsPage::pngIcon() const -{ - return d->pngIcon; -} - -void MobileAppWizardHarmattanOptionsPage::setPngIcon(const QString &icon) -{ - QString actualIconPath; - PngIconScaler scaler(d->iconSize, icon); - if (scaler.hasRightSize()) { - actualIconPath = icon; - } else { - if (!scaler.scale(&actualIconPath)) - return; - } - - d->ui.pngIconButton->setIcon(scaler.pixmap()); - d->pngIcon = actualIconPath; -} - -void MobileAppWizardHarmattanOptionsPage::openPngIcon() -{ - const QString iconPath = QFileDialog::getOpenFileName(this, - d->ui.appIconLabel->text(), d->pngIcon, - QLatin1String("*.png")); - if (!iconPath.isEmpty()) - setPngIcon(iconPath); -} - -void MobileAppWizardHarmattanOptionsPage::setBoosterOptionEnabled(bool enable) -{ - d->ui.makeBoostableCheckBox->setEnabled(enable); - d->ui.makeBoostableCheckBox->setChecked(enable); -} - -bool MobileAppWizardHarmattanOptionsPage::supportsBooster() const -{ - return d->ui.makeBoostableCheckBox->isChecked(); -} - } // namespace Internal } // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h b/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h index 6e5d172777..d6f9206cc7 100644 --- a/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h +++ b/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h @@ -52,45 +52,6 @@ private: class MobileAppWizardGenericOptionsPagePrivate *d; }; -class MobileAppWizardMaemoOptionsPage : public QWizardPage -{ - Q_OBJECT - -public: - explicit MobileAppWizardMaemoOptionsPage(QWidget *parent = 0); - virtual ~MobileAppWizardMaemoOptionsPage(); - - QString pngIcon() const; - void setPngIcon(const QString &icon); - -private slots: - void openPngIcon(); - -private: - class MobileAppWizardMaemoOptionsPagePrivate *d; -}; - -class MobileAppWizardHarmattanOptionsPage : public QWizardPage -{ - Q_OBJECT - -public: - explicit MobileAppWizardHarmattanOptionsPage(QWidget *parent = 0); - virtual ~MobileAppWizardHarmattanOptionsPage(); - - QString pngIcon() const; - void setPngIcon(const QString &icon); - - void setBoosterOptionEnabled(bool enable); - bool supportsBooster() const; - -private slots: - void openPngIcon(); - -private: - class MobileAppWizardHarmattanOptionsPagePrivate *d; -}; - } // namespace Internal } // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.cpp b/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.cpp index 33f6fe4776..edd4f36e59 100644 --- a/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.cpp +++ b/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.cpp @@ -41,19 +41,15 @@ MobileLibraryParameters::MobileLibraryParameters() : void MobileLibraryParameters::writeProFile(QTextStream &str) const { - if (type&Maemo) - writeMaemoProFile(str); + if (type&Linux) + writeLinuxProFile(str); } -void MobileLibraryParameters::writeMaemoProFile(QTextStream &str) const +void MobileLibraryParameters::writeLinuxProFile(QTextStream &str) const { str << "\n" "unix:!symbian {\n" - " maemo5 {\n" - " target.path = /opt/usr/lib\n" - " } else {\n" - " target.path = /usr/lib\n" - " }\n" + " target.path = /usr/lib\n" " INSTALLS += target\n" "}\n"; } diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.h b/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.h index c4469462a6..f3470ee05e 100644 --- a/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.h +++ b/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.h @@ -42,13 +42,13 @@ namespace Internal { // Additional parameters required for creating mobile // libraries struct MobileLibraryParameters { - enum Type { TypeNone = 0, Maemo = 0x1 }; + enum Type { TypeNone = 0, Linux = 0x1 }; MobileLibraryParameters(); void writeProFile(QTextStream &str) const; private: - void writeMaemoProFile(QTextStream &str) const; + void writeLinuxProFile(QTextStream &str) const; public: uint type; diff --git a/src/plugins/qt4projectmanager/wizards/qtquickapp.cpp b/src/plugins/qt4projectmanager/wizards/qtquickapp.cpp index 32b6905a74..eac1da521f 100644 --- a/src/plugins/qt4projectmanager/wizards/qtquickapp.cpp +++ b/src/plugins/qt4projectmanager/wizards/qtquickapp.cpp @@ -45,7 +45,6 @@ QtQuickApp::QtQuickApp() , m_mainQmlMode(ModeGenerate) , m_componentSet(QtQuick10Components) { - m_canSupportMeegoBooster = true; } void QtQuickApp::setComponentSet(ComponentSet componentSet) @@ -147,8 +146,6 @@ void QtQuickApp::handleCurrentProFileTemplateLine(const QString &line, proFile << nextLine << endl; } else if (line.contains(QLatin1String("# HARMATTAN_BOOSTABLE"))) { QString nextLine = proFileTemplate.readLine(); // eats '# CONFIG += qdeclarative-boostable' - if (supportsMeegoBooster()) - nextLine.remove(0, 2); // remove comment proFile << nextLine << endl; } } @@ -159,8 +156,6 @@ 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::Meego10Components)) - files.append(file(generateFile(QtQuickAppGeneratedFileInfo::MainPageQmlFile, errorMessage), path(MainPageQml))); files.last().setAttributes(Core::GeneratedFile::OpenEditorAttribute); } @@ -276,8 +271,6 @@ QList<DeploymentFolder> QtQuickApp::deploymentFolders() const QString QtQuickApp::componentSetDir(ComponentSet componentSet) const { switch (componentSet) { - case Meego10Components: - return QLatin1String("meego10"); case QtQuick20Components: return QLatin1String("qtquick20"); case QtQuickControls10: diff --git a/src/plugins/qt4projectmanager/wizards/qtquickapp.h b/src/plugins/qt4projectmanager/wizards/qtquickapp.h index 3bd248d763..1f8db6732d 100644 --- a/src/plugins/qt4projectmanager/wizards/qtquickapp.h +++ b/src/plugins/qt4projectmanager/wizards/qtquickapp.h @@ -74,7 +74,6 @@ public: enum ComponentSet { QtQuick10Components, - Meego10Components, QtQuick20Components, QtQuickControls10 }; diff --git a/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp b/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp index da32cbe6d4..7c9f5f0164 100644 --- a/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp @@ -153,19 +153,6 @@ void QtQuickAppWizard::createInstances(ExtensionSystem::IPlugin *plugin) wizard = new QtQuickAppWizard; - wizard->setQtQuickKind(MeegoComponents); - wizard->setDisplayName(tr("Qt Quick 1 Application for MeeGo Harmattan")); - wizard->setDescription(basicDescription + tr("The Qt Quick Components for MeeGo Harmattan are " - "a set of ready-made components that are designed " - "with specific native appearance for the MeeGo Harmattan " - "platform.\n\nRequires <b>Qt 4.7.4</b> or newer, and the " - "component set installed for your Qt version.")); - wizard->setRequiredFeatures(basicFeatures | Core::Feature(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_MEEGO) - | Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_1_1)); - plugin->addAutoReleasedObject(wizard); - - - wizard = new QtQuickAppWizard; wizard->setQtQuickKind(ImportQml); wizard->setDisplayName(tr("Qt Quick 1 Application (from Existing QML File)")); wizard->setDescription(basicDescription + tr("Creates a deployable Qt Quick application from " @@ -213,10 +200,6 @@ AbstractMobileAppWizardDialog *QtQuickAppWizard::createWizardDialogInternal(QWid d->app->setComponentSet(QtQuickApp::QtQuick10Components); d->app->setMainQml(QtQuickApp::ModeGenerate); break; - case MeegoComponents: - d->app->setComponentSet(QtQuickApp::Meego10Components); - d->app->setMainQml(QtQuickApp::ModeGenerate); - break; case ImportQml: d->app->setComponentSet(QtQuickApp::QtQuick10Components); d->app->setMainQml(QtQuickApp::ModeImport); diff --git a/src/plugins/qt4projectmanager/wizards/qtquickappwizard.h b/src/plugins/qt4projectmanager/wizards/qtquickappwizard.h index caf2462f46..b625403041 100644 --- a/src/plugins/qt4projectmanager/wizards/qtquickappwizard.h +++ b/src/plugins/qt4projectmanager/wizards/qtquickappwizard.h @@ -43,7 +43,6 @@ public: enum Kind { QtQuick1_1 = 0, QtQuick2_0 = 1, - MeegoComponents = 2, ImportQml = 3, ImportQml2 = 4, QtQuick_Controls_1_0 = 5 diff --git a/src/plugins/qtsupport/qtsupportconstants.h b/src/plugins/qtsupport/qtsupportconstants.h index 8d6860b3f3..b178b842e0 100644 --- a/src/plugins/qtsupport/qtsupportconstants.h +++ b/src/plugins/qtsupport/qtsupportconstants.h @@ -58,21 +58,16 @@ const char FEATURE_QT_QUICK_2[] = "QtSupport.Wizards.FeatureQtQuick.2"; const char FEATURE_QT_QUICK_CONTROLS[] = "QtSupport.Wizards.FeatureQtQuick.Controls"; const char FEATURE_QT_WEBKIT[] = "QtSupport.Wizards.FeatureQtWebkit"; const char FEATURE_QT_CONSOLE[] = "QtSupport.Wizards.FeatureQtConsole"; -const char FEATURE_QTQUICK_COMPONENTS_MEEGO[] = "QtSupport.Wizards.FeatureQtQuickComponentsMeego"; const char FEATURE_MOBILE[] = "QtSupport.Wizards.FeatureMobile"; const char FEATURE_DESKTOP[] = "QtSupport.Wizards.FeatureDesktop"; // Platforms -const char MEEGO_HARMATTAN_PLATFORM[] = "MeeGo/Harmattan"; -const char MAEMO_FREMANTLE_PLATFORM[] = "Maemo/Fremantle"; const char DESKTOP_PLATFORM[] = "Desktop"; const char EMBEDDED_LINUX_PLATFORM[] = "Embedded Linux"; const char WINDOWS_CE_PLATFORM[] = "Windows CE"; const char ANDROID_PLATFORM[] = "Android"; const char IOS_PLATFORM[] = "Ios"; -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 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"); |