RemoteLinux: Move constants and functions to more suitable locations.

Mostly to facilitate splitting up generic Linux und Maemo-specific
things.

Change-Id: I6072ae7deaea013219e8969d6a5254e6c5c96693
Reviewed-on: http://codereview.qt.nokia.com/2098
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
Christian Kandeler
2011-07-25 11:55:00 +02:00
parent 92d32becfc
commit 76a5b1953c
27 changed files with 131 additions and 132 deletions

View File

@@ -31,8 +31,8 @@
**************************************************************************/ **************************************************************************/
#include "deployablefilesperprofile.h" #include "deployablefilesperprofile.h"
#include "linuxdeviceconfiguration.h"
#include "maemoglobal.h" #include "maemoglobal.h"
#include "maemoconstants.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/filemanager.h> #include <coreplugin/filemanager.h>
@@ -265,7 +265,7 @@ bool DeployableFilesPerProFile::addDesktopFile()
const QtSupport::BaseQtVersion * const version = qtVersion(); const QtSupport::BaseQtVersion * const version = qtVersion();
QTC_ASSERT(version && version->isValid(), return false); QTC_ASSERT(version && version->isValid(), return false);
QString remoteDir = QLatin1String("/usr/share/applications"); QString remoteDir = QLatin1String("/usr/share/applications");
if (MaemoGlobal::osType(version->qmakeCommand()) == LinuxDeviceConfiguration::Maemo5OsType) if (MaemoGlobal::osType(version->qmakeCommand()) == QLatin1String(Maemo5OsType))
remoteDir += QLatin1String("/hildon"); remoteDir += QLatin1String("/hildon");
const QLatin1String filesLine("desktopfile.files = $${TARGET}.desktop"); const QLatin1String filesLine("desktopfile.files = $${TARGET}.desktop");
const QString pathLine = QLatin1String("desktopfile.path = ") + remoteDir; const QString pathLine = QLatin1String("desktopfile.path = ") + remoteDir;
@@ -341,11 +341,11 @@ QString DeployableFilesPerProFile::proFileScope() const
const QtSupport::BaseQtVersion *const qv = qtVersion(); const QtSupport::BaseQtVersion *const qv = qtVersion();
QTC_ASSERT(qv && qv->isValid(), return QString()); QTC_ASSERT(qv && qv->isValid(), return QString());
const QString osType = MaemoGlobal::osType(qv->qmakeCommand()); const QString osType = MaemoGlobal::osType(qv->qmakeCommand());
if (osType == LinuxDeviceConfiguration::Maemo5OsType) if (osType == QLatin1String(Maemo5OsType))
return QLatin1String("maemo5"); return QLatin1String("maemo5");
if (osType == LinuxDeviceConfiguration::HarmattanOsType) if (osType == QLatin1String(HarmattanOsType))
return QLatin1String("contains(MEEGO_EDITION,harmattan)"); return QLatin1String("contains(MEEGO_EDITION,harmattan)");
if (osType == LinuxDeviceConfiguration::MeeGoOsType) if (osType == QLatin1String(MeeGoOsType))
return QLatin1String("!isEmpty(MEEGO_VERSION_MAJOR):!contains(MEEGO_EDITION,harmattan)"); return QLatin1String("!isEmpty(MEEGO_VERSION_MAJOR):!contains(MEEGO_EDITION,harmattan)");
return QLatin1String("unix:!symbian:!maemo5:isEmpty(MEEGO_VERSION_MAJOR)"); return QLatin1String("unix:!symbian:!maemo5:isEmpty(MEEGO_VERSION_MAJOR)");
} }

View File

@@ -60,7 +60,7 @@ ILinuxDeviceConfigurationWizard *GenericLinuxDeviceConfigurationFactory::createW
bool GenericLinuxDeviceConfigurationFactory::supportsOsType(const QString &osType) const bool GenericLinuxDeviceConfigurationFactory::supportsOsType(const QString &osType) const
{ {
return osType == LinuxDeviceConfiguration::GenericLinuxOsType; return osType == QLatin1String(Constants::GenericLinuxOsType);
} }
QString GenericLinuxDeviceConfigurationFactory::displayNameForOsType(const QString &osType) const QString GenericLinuxDeviceConfigurationFactory::displayNameForOsType(const QString &osType) const

View File

@@ -33,6 +33,7 @@
#include "genericlinuxdeviceconfigurationwizardpages.h" #include "genericlinuxdeviceconfigurationwizardpages.h"
#include "linuxdevicetestdialog.h" #include "linuxdevicetestdialog.h"
#include "linuxdevicetester.h" #include "linuxdevicetester.h"
#include "remotelinux_constants.h"
using namespace Utils; using namespace Utils;
@@ -83,7 +84,7 @@ LinuxDeviceConfiguration::Ptr GenericLinuxDeviceConfigurationWizard::deviceConfi
else else
sshParams.privateKeyFile = m_d->setupPage.privateKeyFilePath(); sshParams.privateKeyFile = m_d->setupPage.privateKeyFilePath();
LinuxDeviceConfiguration::Ptr devConf = LinuxDeviceConfiguration::create(m_d->setupPage.configurationName(), LinuxDeviceConfiguration::Ptr devConf = LinuxDeviceConfiguration::create(m_d->setupPage.configurationName(),
LinuxDeviceConfiguration::GenericLinuxOsType, LinuxDeviceConfiguration::Physical, QLatin1String(Constants::GenericLinuxOsType), LinuxDeviceConfiguration::Physical,
PortList::fromString(QLatin1String("10000-10100")), sshParams); PortList::fromString(QLatin1String("10000-10100")), sshParams);
LinuxDeviceTestDialog dlg(devConf, new GenericLinuxDeviceTester(this), this); LinuxDeviceTestDialog dlg(devConf, new GenericLinuxDeviceTester(this), this);
dlg.exec(); dlg.exec();

View File

@@ -31,6 +31,8 @@
**************************************************************************/ **************************************************************************/
#include "linuxdeviceconfiguration.h" #include "linuxdeviceconfiguration.h"
#include "remotelinux_constants.h"
#include <QtCore/QSettings> #include <QtCore/QSettings>
#include <QtGui/QDesktopServices> #include <QtGui/QDesktopServices>
@@ -103,10 +105,10 @@ LinuxDeviceConfiguration::LinuxDeviceConfiguration(const QSettings &settings,
if (m_osType.isEmpty()) { if (m_osType.isEmpty()) {
const int oldOsType = settings.value(OldOsVersionKey, -1).toInt(); const int oldOsType = settings.value(OldOsVersionKey, -1).toInt();
switch (oldOsType) { switch (oldOsType) {
case 0: m_osType = Maemo5OsType; break; case 0: m_osType = QLatin1String("Maemo5OsType"); break;
case 1: m_osType = HarmattanOsType; break; case 1: m_osType = QLatin1String("HarmattanOsType"); break;
case 2: m_osType = MeeGoOsType; break; case 2: m_osType = QLatin1String("MeeGoOsType"); break;
default: m_osType = GenericLinuxOsType; default: m_osType = QLatin1String(Constants::GenericLinuxOsType);
} }
} }
@@ -162,8 +164,4 @@ void LinuxDeviceConfiguration::save(QSettings &settings) const
} }
const LinuxDeviceConfiguration::Id LinuxDeviceConfiguration::InvalidId = 0; const LinuxDeviceConfiguration::Id LinuxDeviceConfiguration::InvalidId = 0;
const QString LinuxDeviceConfiguration::Maemo5OsType = QLatin1String("Maemo5OsType");
const QString LinuxDeviceConfiguration::HarmattanOsType = QLatin1String("HarmattanOsType");
const QString LinuxDeviceConfiguration::MeeGoOsType = QLatin1String("MeeGoOsType");
const QString LinuxDeviceConfiguration::GenericLinuxOsType = QLatin1String("GenericLinuxOsType");
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -62,11 +62,6 @@ public:
typedef quint64 Id; typedef quint64 Id;
static const QString Maemo5OsType;
static const QString HarmattanOsType;
static const QString MeeGoOsType;
static const QString GenericLinuxOsType;
enum DeviceType { Physical, Emulator }; enum DeviceType { Physical, Emulator };
~LinuxDeviceConfiguration(); ~LinuxDeviceConfiguration();

View File

@@ -29,9 +29,11 @@
** Nokia at info@qt.nokia.com. ** Nokia at info@qt.nokia.com.
** **
**************************************************************************/ **************************************************************************/
#include "linuxdeviceconfigurations.h" #include "linuxdeviceconfigurations.h"
#include "maemoglobal.h" #include "maemoglobal.h"
#include "maemoconstants.h"
#include "remotelinux_constants.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
@@ -224,10 +226,10 @@ void LinuxDeviceConfigurations::load()
} }
settings->endArray(); settings->endArray();
settings->endGroup(); settings->endGroup();
ensureDefaultExists(LinuxDeviceConfiguration::Maemo5OsType); ensureDefaultExists(QLatin1String(Maemo5OsType));
ensureDefaultExists(LinuxDeviceConfiguration::HarmattanOsType); ensureDefaultExists(QLatin1String(HarmattanOsType));
ensureDefaultExists(LinuxDeviceConfiguration::MeeGoOsType); ensureDefaultExists(QLatin1String(MeeGoOsType));
ensureDefaultExists(LinuxDeviceConfiguration::GenericLinuxOsType); ensureDefaultExists(QLatin1String(Constants::GenericLinuxOsType));
} }
LinuxDeviceConfiguration::ConstPtr LinuxDeviceConfigurations::deviceAt(int idx) const LinuxDeviceConfiguration::ConstPtr LinuxDeviceConfigurations::deviceAt(int idx) const

View File

@@ -32,6 +32,7 @@
#include "maddedeviceconfigurationfactory.h" #include "maddedeviceconfigurationfactory.h"
#include "maddedevicetester.h" #include "maddedevicetester.h"
#include "maemoconstants.h"
#include "maemodeviceconfigwizard.h" #include "maemodeviceconfigwizard.h"
#include "publickeydeploymentdialog.h" #include "publickeydeploymentdialog.h"
#include "madderemoteprocesslist.h" #include "madderemoteprocesslist.h"
@@ -65,17 +66,16 @@ ILinuxDeviceConfigurationWizard *MaddeDeviceConfigurationFactory::createWizard(Q
bool MaddeDeviceConfigurationFactory::supportsOsType(const QString &osType) const bool MaddeDeviceConfigurationFactory::supportsOsType(const QString &osType) const
{ {
return osType == LinuxDeviceConfiguration::Maemo5OsType return osType == QLatin1String(Maemo5OsType) || osType == QLatin1String(HarmattanOsType)
|| osType == LinuxDeviceConfiguration::HarmattanOsType || osType == QLatin1String(MeeGoOsType);
|| osType == LinuxDeviceConfiguration::MeeGoOsType;
} }
QString MaddeDeviceConfigurationFactory::displayNameForOsType(const QString &osType) const QString MaddeDeviceConfigurationFactory::displayNameForOsType(const QString &osType) const
{ {
QTC_ASSERT(supportsOsType(osType), return QString()); QTC_ASSERT(supportsOsType(osType), return QString());
if (osType == LinuxDeviceConfiguration::Maemo5OsType) if (osType == QLatin1String(Maemo5OsType))
return tr("Maemo5/Fremantle"); return tr("Maemo5/Fremantle");
if (osType == LinuxDeviceConfiguration::HarmattanOsType) if (osType == QLatin1String(HarmattanOsType))
return tr("MeeGo 1.2 Harmattan"); return tr("MeeGo 1.2 Harmattan");
return tr("Other MeeGo OS"); return tr("Other MeeGo OS");
} }

View File

@@ -31,6 +31,7 @@
**************************************************************************/ **************************************************************************/
#include "maddedevicetester.h" #include "maddedevicetester.h"
#include "maemoconstants.h"
#include "maemoglobal.h" #include "maemoglobal.h"
#include <remotelinux/linuxdeviceconfiguration.h> #include <remotelinux/linuxdeviceconfiguration.h>
@@ -114,7 +115,7 @@ void MaddeDeviceTester::handleGenericTestFinished(TestResult result)
connect(m_processRunner.data(), SIGNAL(processClosed(int)), SLOT(handleProcessFinished(int))); connect(m_processRunner.data(), SIGNAL(processClosed(int)), SLOT(handleProcessFinished(int)));
QString qtInfoCmd; QString qtInfoCmd;
if (m_deviceConfiguration->osType() == LinuxDeviceConfiguration::MeeGoOsType) { if (m_deviceConfiguration->osType() == QLatin1String(MeeGoOsType)) {
qtInfoCmd = QLatin1String("rpm -qa 'libqt*' --queryformat '%{NAME} %{VERSION}\\n'"); qtInfoCmd = QLatin1String("rpm -qa 'libqt*' --queryformat '%{NAME} %{VERSION}\\n'");
} else { } else {
qtInfoCmd = QLatin1String("dpkg-query -W -f " qtInfoCmd = QLatin1String("dpkg-query -W -f "
@@ -208,7 +209,7 @@ void MaddeDeviceTester::handleMadDeveloperTestFinished(int exitStatus)
} else if (m_processRunner->process()->exitCode() != 0) { } else if (m_processRunner->process()->exitCode() != 0) {
QString message = tr("Connectivity tool not installed on device. " QString message = tr("Connectivity tool not installed on device. "
"Deployment will not be possible."); "Deployment will not be possible.");
if (m_deviceConfiguration->osType() == LinuxDeviceConfiguration::HarmattanOsType) { if (m_deviceConfiguration->osType() == QLatin1String(HarmattanOsType)) {
message += tr("Please switch the device to developer mode " message += tr("Please switch the device to developer mode "
"via Settings -> Security.\n"); "via Settings -> Security.\n");
} }
@@ -218,7 +219,7 @@ void MaddeDeviceTester::handleMadDeveloperTestFinished(int exitStatus)
emit progressMessage(tr("Connectivity tool present.\n")); emit progressMessage(tr("Connectivity tool present.\n"));
} }
if (m_deviceConfiguration->osType() != LinuxDeviceConfiguration::HarmattanOsType) { if (m_deviceConfiguration->osType() != QLatin1String(HarmattanOsType)) {
setFinished(); setFinished();
return; return;
} }
@@ -258,7 +259,7 @@ QString MaddeDeviceTester::processedQtLibsList()
QString unfilteredLibs = QString::fromUtf8(m_stdout); QString unfilteredLibs = QString::fromUtf8(m_stdout);
QString filteredLibs; QString filteredLibs;
QString patternString; QString patternString;
if (m_deviceConfiguration->osType() == LinuxDeviceConfiguration::MeeGoOsType) if (m_deviceConfiguration->osType() == QLatin1String(MeeGoOsType))
patternString = QLatin1String("(libqt\\S+) ((\\d+)\\.(\\d+)\\.(\\d+))"); patternString = QLatin1String("(libqt\\S+) ((\\d+)\\.(\\d+)\\.(\\d+))");
else else
patternString = QLatin1String("(\\S+) (\\S*(\\d+)\\.(\\d+)\\.(\\d+)\\S*) \\S+ \\S+ \\S+"); patternString = QLatin1String("(\\S+) (\\S*(\\d+)\\.(\\d+)\\.(\\d+)\\S*) \\S+ \\S+ \\S+");

View File

@@ -30,6 +30,8 @@
**************************************************************************/ **************************************************************************/
#include "madderemoteprocesslist.h" #include "madderemoteprocesslist.h"
#include "maemoconstants.h"
#include <remotelinux/linuxdeviceconfiguration.h> #include <remotelinux/linuxdeviceconfiguration.h>
#include <QtCore/QString> #include <QtCore/QString>
@@ -52,7 +54,7 @@ QString MaddeRemoteProcessList::listProcessesCommandLine() const
{ {
// The ps command on Fremantle ignores all command line options, so // The ps command on Fremantle ignores all command line options, so
// we have to collect the information in /proc manually. // we have to collect the information in /proc manually.
if (deviceConfiguration()->osType() == LinuxDeviceConfiguration::Maemo5OsType) { if (deviceConfiguration()->osType() == QLatin1String(Maemo5OsType)) {
return QLatin1String("sep1=") + QLatin1String(FremantleLineSeparator1) + QLatin1Char(';') return QLatin1String("sep1=") + QLatin1String(FremantleLineSeparator1) + QLatin1Char(';')
+ QLatin1String("sep2=") + QLatin1String(FremantleLineSeparator2) + QLatin1Char(';') + QLatin1String("sep2=") + QLatin1String(FremantleLineSeparator2) + QLatin1Char(';')
+ QLatin1String("pidlist=`ls /proc |grep -E '^[[:digit:]]+$' |sort -n`; " + QLatin1String("pidlist=`ls /proc |grep -E '^[[:digit:]]+$' |sort -n`; "
@@ -70,7 +72,7 @@ QString MaddeRemoteProcessList::listProcessesCommandLine() const
QList<AbstractRemoteLinuxProcessList::RemoteProcess> MaddeRemoteProcessList::buildProcessList(const QString &listProcessesReply) const QList<AbstractRemoteLinuxProcessList::RemoteProcess> MaddeRemoteProcessList::buildProcessList(const QString &listProcessesReply) const
{ {
QString adaptedReply = listProcessesReply; QString adaptedReply = listProcessesReply;
if (deviceConfiguration()->osType() == LinuxDeviceConfiguration::Maemo5OsType) { if (deviceConfiguration()->osType() == QLatin1String(Maemo5OsType)) {
adaptedReply.replace(QLatin1String(FremantleLineSeparator1) adaptedReply.replace(QLatin1String(FremantleLineSeparator1)
+ QLatin1String(FremantleLineSeparator2), QLatin1String("\n")); + QLatin1String(FremantleLineSeparator2), QLatin1String("\n"));
adaptedReply.prepend(QLatin1String("dummy\n")); adaptedReply.prepend(QLatin1String("dummy\n"));

View File

@@ -31,7 +31,6 @@
**************************************************************************/ **************************************************************************/
#include "maddeuploadandinstallpackagesteps.h" #include "maddeuploadandinstallpackagesteps.h"
#include "maemoglobal.h"
#include "maemopackagecreationstep.h" #include "maemopackagecreationstep.h"
#include "maemopackageinstaller.h" #include "maemopackageinstaller.h"
#include "maemoqemumanager.h" #include "maemoqemumanager.h"
@@ -146,7 +145,7 @@ AbstractRemoteLinuxDeployService *MaemoUploadAndInstallPackageStep::deployServic
bool MaemoUploadAndInstallPackageStep::isDeploymentPossible(QString *whyNot) const bool MaemoUploadAndInstallPackageStep::isDeploymentPossible(QString *whyNot) const
{ {
const AbstractMaemoPackageCreationStep * const pStep const AbstractMaemoPackageCreationStep * const pStep
= MaemoGlobal::earlierBuildStep<MaemoDebianPackageCreationStep>(deployConfiguration(), this); = deployConfiguration()->earlierBuildStep<MaemoDebianPackageCreationStep>(this);
if (!pStep) { if (!pStep) {
if (whyNot) if (whyNot)
*whyNot = tr("No Debian package creation step found."); *whyNot = tr("No Debian package creation step found.");
@@ -193,7 +192,7 @@ AbstractRemoteLinuxDeployService *MeegoUploadAndInstallPackageStep::deployServic
bool MeegoUploadAndInstallPackageStep::isDeploymentPossible(QString *whyNot) const bool MeegoUploadAndInstallPackageStep::isDeploymentPossible(QString *whyNot) const
{ {
const AbstractMaemoPackageCreationStep * const pStep const AbstractMaemoPackageCreationStep * const pStep
= MaemoGlobal::earlierBuildStep<MaemoRpmPackageCreationStep>(deployConfiguration(), this); = deployConfiguration()->earlierBuildStep<MaemoRpmPackageCreationStep>(this);
if (!pStep) { if (!pStep) {
if (whyNot) if (whyNot)
*whyNot = tr("No RPM package creation step found."); *whyNot = tr("No RPM package creation step found.");

View File

@@ -37,6 +37,10 @@
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal { namespace Internal {
const char Maemo5OsType[] = "Maemo5OsType";
const char HarmattanOsType[] = "HarmattanOsType";
const char MeeGoOsType[] = "MeeGoOsType";
#define PREFIX "Qt4ProjectManager.MaemoRunConfiguration" #define PREFIX "Qt4ProjectManager.MaemoRunConfiguration"
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN32

View File

@@ -422,7 +422,7 @@ AbstractRemoteLinuxDeployService *MaemoInstallPackageViaMountStep::deployService
bool MaemoInstallPackageViaMountStep::isDeploymentPossible(QString *whyNot) const bool MaemoInstallPackageViaMountStep::isDeploymentPossible(QString *whyNot) const
{ {
const AbstractMaemoPackageCreationStep * const pStep const AbstractMaemoPackageCreationStep * const pStep
= MaemoGlobal::earlierBuildStep<MaemoDebianPackageCreationStep>(deployConfiguration(), this); = deployConfiguration()->earlierBuildStep<MaemoDebianPackageCreationStep>(this);
if (!pStep) { if (!pStep) {
if (whyNot) if (whyNot)
*whyNot = tr("No Debian package creation step found."); *whyNot = tr("No Debian package creation step found.");

View File

@@ -37,6 +37,7 @@
#include "ui_maemodeviceconfigwizardstartpage.h" #include "ui_maemodeviceconfigwizardstartpage.h"
#include "maddedevicetester.h" #include "maddedevicetester.h"
#include "maemoconstants.h"
#include "maemoglobal.h" #include "maemoglobal.h"
#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h> #include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h>
@@ -60,7 +61,7 @@ namespace {
QString defaultUser(const QString &osType) QString defaultUser(const QString &osType)
{ {
if (osType == LinuxDeviceConfiguration::MeeGoOsType) if (osType == QLatin1String(MeeGoOsType))
return QLatin1String("meego"); return QLatin1String("meego");
return QLatin1String("developer"); return QLatin1String("developer");
} }
@@ -100,12 +101,12 @@ public:
setTitle(tr("General Information")); setTitle(tr("General Information"));
setSubTitle(QLatin1String(" ")); // For Qt bug (background color) setSubTitle(QLatin1String(" ")); // For Qt bug (background color)
m_ui->osTypeComboBox->addItem(MaemoGlobal::osTypeToString(LinuxDeviceConfiguration::Maemo5OsType), m_ui->osTypeComboBox->addItem(MaemoGlobal::osTypeToString(QLatin1String(Maemo5OsType)),
LinuxDeviceConfiguration::Maemo5OsType); QLatin1String(Maemo5OsType));
m_ui->osTypeComboBox->addItem(MaemoGlobal::osTypeToString(LinuxDeviceConfiguration::HarmattanOsType), m_ui->osTypeComboBox->addItem(MaemoGlobal::osTypeToString(QLatin1String(HarmattanOsType)),
LinuxDeviceConfiguration::HarmattanOsType); QLatin1String(HarmattanOsType));
m_ui->osTypeComboBox->addItem(MaemoGlobal::osTypeToString(LinuxDeviceConfiguration::MeeGoOsType), m_ui->osTypeComboBox->addItem(MaemoGlobal::osTypeToString(QLatin1String(MeeGoOsType)),
LinuxDeviceConfiguration::MeeGoOsType); QLatin1String(MeeGoOsType));
QButtonGroup *buttonGroup = new QButtonGroup(this); QButtonGroup *buttonGroup = new QButtonGroup(this);
buttonGroup->setExclusive(true); buttonGroup->setExclusive(true);
@@ -115,7 +116,7 @@ public:
SLOT(handleDeviceTypeChanged())); SLOT(handleDeviceTypeChanged()));
m_ui->nameLineEdit->setText(QLatin1String("(New Configuration)")); m_ui->nameLineEdit->setText(QLatin1String("(New Configuration)"));
m_ui->osTypeComboBox->setCurrentIndex(m_ui->osTypeComboBox->findData(LinuxDeviceConfiguration::HarmattanOsType)); m_ui->osTypeComboBox->setCurrentIndex(m_ui->osTypeComboBox->findData(QLatin1String(HarmattanOsType)));
m_ui->hwButton->setChecked(true); m_ui->hwButton->setChecked(true);
handleDeviceTypeChanged(); handleDeviceTypeChanged();
m_ui->hostNameLineEdit->setText(defaultHost(deviceType())); m_ui->hostNameLineEdit->setText(defaultHost(deviceType()));
@@ -559,7 +560,7 @@ LinuxDeviceConfiguration::Ptr MaemoDeviceConfigWizard::deviceConfiguration()
sshParams.port = d->wizardData.sshPort; sshParams.port = d->wizardData.sshPort;
if (d->wizardData.deviceType == LinuxDeviceConfiguration::Emulator) { if (d->wizardData.deviceType == LinuxDeviceConfiguration::Emulator) {
sshParams.authenticationType = Utils::SshConnectionParameters::AuthenticationByPassword; sshParams.authenticationType = Utils::SshConnectionParameters::AuthenticationByPassword;
sshParams.password = d->wizardData.osType == LinuxDeviceConfiguration::MeeGoOsType sshParams.password = d->wizardData.osType == QLatin1String(MeeGoOsType)
? QLatin1String("meego") : QString(); ? QLatin1String("meego") : QString();
sshParams.timeout = 30; sshParams.timeout = 30;
freePortsSpec = QLatin1String("13219,14168"); freePortsSpec = QLatin1String("13219,14168");

View File

@@ -31,7 +31,6 @@
**************************************************************************/ **************************************************************************/
#include "maemoglobal.h" #include "maemoglobal.h"
#include "linuxdeviceconfiguration.h"
#include "maemoconstants.h" #include "maemoconstants.h"
#include "maemoqemumanager.h" #include "maemoqemumanager.h"
@@ -42,6 +41,8 @@
#include <qt4projectmanager/qt4projectmanagerconstants.h> #include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <qtsupport/qtversionmanager.h> #include <qtsupport/qtversionmanager.h>
#include <qt4projectmanager/qt4target.h> #include <qt4projectmanager/qt4target.h>
#include <remotelinux/linuxdeviceconfiguration.h>
#include <remotelinux/remotelinux_constants.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <QtCore/QDir> #include <QtCore/QDir>
@@ -82,17 +83,17 @@ bool MaemoGlobal::isMeegoTargetId(const QString &id)
bool MaemoGlobal::isValidMaemo5QtVersion(const QString &qmakePath) bool MaemoGlobal::isValidMaemo5QtVersion(const QString &qmakePath)
{ {
return isValidMaemoQtVersion(qmakePath, LinuxDeviceConfiguration::Maemo5OsType); return isValidMaemoQtVersion(qmakePath, QLatin1String(Maemo5OsType));
} }
bool MaemoGlobal::isValidHarmattanQtVersion(const QString &qmakePath) bool MaemoGlobal::isValidHarmattanQtVersion(const QString &qmakePath)
{ {
return isValidMaemoQtVersion(qmakePath, LinuxDeviceConfiguration::HarmattanOsType); return isValidMaemoQtVersion(qmakePath, QLatin1String(HarmattanOsType));
} }
bool MaemoGlobal::isValidMeegoQtVersion(const QString &qmakePath) bool MaemoGlobal::isValidMeegoQtVersion(const QString &qmakePath)
{ {
return isValidMaemoQtVersion(qmakePath, LinuxDeviceConfiguration::MeeGoOsType); return isValidMaemoQtVersion(qmakePath, QLatin1String(MeeGoOsType));
} }
bool MaemoGlobal::isLinuxQt(const QtSupport::BaseQtVersion *qtVersion) bool MaemoGlobal::isLinuxQt(const QtSupport::BaseQtVersion *qtVersion)
@@ -155,16 +156,15 @@ QString MaemoGlobal::devrootshPath()
int MaemoGlobal::applicationIconSize(const QString &osType) int MaemoGlobal::applicationIconSize(const QString &osType)
{ {
return osType == LinuxDeviceConfiguration::HarmattanOsType ? 80 : 64; return osType == QLatin1String(HarmattanOsType) ? 80 : 64;
} }
QString MaemoGlobal::remoteSudo(const QString &osType, const QString &uname) QString MaemoGlobal::remoteSudo(const QString &osType, const QString &uname)
{ {
if (uname == QLatin1String("root")) if (uname == QLatin1String("root"))
return QString(); return QString();
if (osType == LinuxDeviceConfiguration::Maemo5OsType if (osType == QLatin1String(Maemo5OsType) || osType == QLatin1String(HarmattanOsType)
|| osType == LinuxDeviceConfiguration::HarmattanOsType || osType == QLatin1String(MeeGoOsType)) {
|| osType == LinuxDeviceConfiguration::MeeGoOsType) {
return devrootshPath(); return devrootshPath();
} }
return QString(); // Using sudo would open a can of worms. return QString(); // Using sudo would open a can of worms.
@@ -173,8 +173,8 @@ QString MaemoGlobal::remoteSudo(const QString &osType, const QString &uname)
QString MaemoGlobal::remoteCommandPrefix(const QString &osType) QString MaemoGlobal::remoteCommandPrefix(const QString &osType)
{ {
QString prefix = QString::fromLocal8Bit("%1; ").arg(remoteSourceProfilesCommand()); QString prefix = QString::fromLocal8Bit("%1; ").arg(remoteSourceProfilesCommand());
if (osType != LinuxDeviceConfiguration::Maemo5OsType if (osType != QLatin1String(Maemo5OsType)
&& osType != LinuxDeviceConfiguration::HarmattanOsType) { && osType != QLatin1String(HarmattanOsType)) {
prefix += QLatin1String("DISPLAY=:0.0 "); prefix += QLatin1String("DISPLAY=:0.0 ");
} }
return prefix; return prefix;
@@ -238,7 +238,7 @@ QString MaemoGlobal::madCommand(const QString &qmakePath)
QString MaemoGlobal::madDeveloperUiName(const QString &osType) QString MaemoGlobal::madDeveloperUiName(const QString &osType)
{ {
return osType == LinuxDeviceConfiguration::HarmattanOsType return osType == QLatin1String(HarmattanOsType)
? tr("SDK Connectivity") : tr("Mad Developer"); ? tr("SDK Connectivity") : tr("Mad Developer");
} }
@@ -246,12 +246,12 @@ QString MaemoGlobal::osType(const QString &qmakePath)
{ {
const QString &name = targetName(qmakePath); const QString &name = targetName(qmakePath);
if (name.startsWith(QLatin1String("fremantle"))) if (name.startsWith(QLatin1String("fremantle")))
return LinuxDeviceConfiguration::Maemo5OsType; return QLatin1String(Maemo5OsType);
if (name.startsWith(QLatin1String("harmattan"))) if (name.startsWith(QLatin1String("harmattan")))
return LinuxDeviceConfiguration::HarmattanOsType; return QLatin1String(HarmattanOsType);
if (name.startsWith(QLatin1String("meego"))) if (name.startsWith(QLatin1String("meego")))
return LinuxDeviceConfiguration::MeeGoOsType; return QLatin1String(MeeGoOsType);
return LinuxDeviceConfiguration::GenericLinuxOsType; return QLatin1String(Constants::GenericLinuxOsType);
} }
QString MaemoGlobal::architecture(const QString &qmakePath) QString MaemoGlobal::architecture(const QString &qmakePath)
@@ -346,16 +346,5 @@ QString MaemoGlobal::osTypeToString(const QString &osType)
return tr("Unknown OS"); return tr("Unknown OS");
} }
MaemoGlobal::PackagingSystem MaemoGlobal::packagingSystem(const QString &osType)
{
if (osType == LinuxDeviceConfiguration::Maemo5OsType
|| osType == LinuxDeviceConfiguration::HarmattanOsType) {
return Dpkg;
}
if (osType == LinuxDeviceConfiguration::MeeGoOsType)
return Rpm;
return Tar;
}
} // namespace Internal } // namespace Internal
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -38,20 +38,21 @@
#include <coreplugin/ifile.h> #include <coreplugin/ifile.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <projectexplorer/buildstep.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/deployconfiguration.h>
#include <QtCore/QList>
#include <QtCore/QSharedPointer>
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
#include <QtCore/QSharedPointer>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QProcess; class QProcess;
class QString; class QString;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace QtSupport { class BaseQtVersion; } namespace ProjectExplorer {
class Target;
}
namespace QtSupport {
class BaseQtVersion;
}
namespace RemoteLinux { namespace RemoteLinux {
class LinuxDeviceConfiguration; class LinuxDeviceConfiguration;
@@ -130,24 +131,6 @@ public:
static QString osTypeToString(const QString &osType); static QString osTypeToString(const QString &osType);
static PackagingSystem packagingSystem(const QString &osType);
template<class T> static T *earlierBuildStep(const ProjectExplorer::DeployConfiguration *dc,
const ProjectExplorer::BuildStep *laterBuildStep)
{
if (!dc)
return 0;
const ProjectExplorer::BuildStepList * const bsl = dc->stepList();
const QList<ProjectExplorer::BuildStep *> &buildSteps = bsl->steps();
for (int i = 0; i < buildSteps.count(); ++i) {
if (buildSteps.at(i) == laterBuildStep)
return 0;
if (T * const step = dynamic_cast<T *>(buildSteps.at(i)))
return step;
}
return 0;
}
static bool isValidMaemoQtVersion(const QString &qmakePath, const QString &osType); static bool isValidMaemoQtVersion(const QString &qmakePath, const QString &osType);
private: private:
static QString madAdminCommand(const QString &qmakePath); static QString madAdminCommand(const QString &qmakePath);

View File

@@ -71,7 +71,7 @@ public:
virtual QString summaryText() const virtual QString summaryText() const
{ {
if (!MaemoGlobal::earlierBuildStep<AbstractMaemoPackageCreationStep>(m_step->deployConfiguration(), m_step)) { if (!m_step->deployConfiguration()->earlierBuildStep<AbstractMaemoPackageCreationStep>(m_step)) {
return QLatin1String("<font color=\"red\">") return QLatin1String("<font color=\"red\">")
+ tr("Cannot deploy to sysroot: No packaging step found.") + tr("Cannot deploy to sysroot: No packaging step found.")
+ QLatin1String("</font>"); + QLatin1String("</font>");
@@ -146,6 +146,12 @@ AbstractMaemoInstallPackageToSysrootStep::AbstractMaemoInstallPackageToSysrootSt
{ {
} }
RemoteLinuxDeployConfiguration *AbstractMaemoInstallPackageToSysrootStep::deployConfiguration() const
{
return qobject_cast<RemoteLinuxDeployConfiguration *>(BuildStep::deployConfiguration());
}
void AbstractMaemoInstallPackageToSysrootStep::run(QFutureInterface<bool> &fi) void AbstractMaemoInstallPackageToSysrootStep::run(QFutureInterface<bool> &fi)
{ {
const Qt4BuildConfiguration * const bc const Qt4BuildConfiguration * const bc
@@ -158,7 +164,7 @@ void AbstractMaemoInstallPackageToSysrootStep::run(QFutureInterface<bool> &fi)
} }
const AbstractMaemoPackageCreationStep * const pStep const AbstractMaemoPackageCreationStep * const pStep
= MaemoGlobal::earlierBuildStep<AbstractMaemoPackageCreationStep>(deployConfiguration(), this); = deployConfiguration()->earlierBuildStep<AbstractMaemoPackageCreationStep>(this);
if (!pStep) { if (!pStep) {
addOutput(tr("Cannot install package to sysroot without packaging step."), addOutput(tr("Cannot install package to sysroot without packaging step."),
ErrorMessageOutput); ErrorMessageOutput);

View File

@@ -41,6 +41,8 @@
QT_FORWARD_DECLARE_CLASS(QProcess) QT_FORWARD_DECLARE_CLASS(QProcess)
namespace RemoteLinux { namespace RemoteLinux {
class RemoteLinuxDeployConfiguration;
namespace Internal { namespace Internal {
class AbstractMaemoInstallPackageToSysrootStep : public ProjectExplorer::BuildStep class AbstractMaemoInstallPackageToSysrootStep : public ProjectExplorer::BuildStep
@@ -50,6 +52,8 @@ public:
virtual bool init() { return true; } virtual bool init() { return true; }
virtual void run(QFutureInterface<bool> &fi); virtual void run(QFutureInterface<bool> &fi);
RemoteLinuxDeployConfiguration *deployConfiguration() const;
protected: protected:
AbstractMaemoInstallPackageToSysrootStep(ProjectExplorer::BuildStepList *bsl, AbstractMaemoInstallPackageToSysrootStep(ProjectExplorer::BuildStepList *bsl,
const QString &id); const QString &id);

View File

@@ -32,6 +32,7 @@
#include "maemopublishingbuildsettingspagefremantlefree.h" #include "maemopublishingbuildsettingspagefremantlefree.h"
#include "ui_maemopublishingbuildsettingspagefremantlefree.h" #include "ui_maemopublishingbuildsettingspagefremantlefree.h"
#include "maemoconstants.h"
#include "maemoglobal.h" #include "maemoglobal.h"
#include "maemopublisherfremantlefree.h" #include "maemopublisherfremantlefree.h"
@@ -40,7 +41,6 @@
#include <qt4projectmanager/qt4buildconfiguration.h> #include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h> #include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <qtsupport/baseqtversion.h> #include <qtsupport/baseqtversion.h>
#include <remotelinux/linuxdeviceconfiguration.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
using namespace ProjectExplorer; using namespace ProjectExplorer;
@@ -86,7 +86,7 @@ void MaemoPublishingBuildSettingsPageFremantleFree::collectBuildConfigurations(c
QtSupport::BaseQtVersion *lqt = qt4Bc->qtVersion(); QtSupport::BaseQtVersion *lqt = qt4Bc->qtVersion();
if (!lqt) if (!lqt)
continue; continue;
if (MaemoGlobal::osType(lqt->qmakeCommand()) == LinuxDeviceConfiguration::Maemo5OsType) if (MaemoGlobal::osType(lqt->qmakeCommand()) == QLatin1String(Maemo5OsType))
m_buildConfigs << qt4Bc; m_buildConfigs << qt4Bc;
} }
break; break;

View File

@@ -31,6 +31,7 @@
**************************************************************************/ **************************************************************************/
#include "maemopublishingwizardfactories.h" #include "maemopublishingwizardfactories.h"
#include "maemoconstants.h"
#include "maemoglobal.h" #include "maemoglobal.h"
#include "maemopublishingwizardfremantlefree.h" #include "maemopublishingwizardfremantlefree.h"
@@ -39,7 +40,6 @@
#include <qt4projectmanager/qt4project.h> #include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h> #include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <qtsupport/baseqtversion.h> #include <qtsupport/baseqtversion.h>
#include "remotelinux/linuxdeviceconfiguration.h"
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Qt4ProjectManager; using namespace Qt4ProjectManager;
@@ -83,7 +83,7 @@ bool MaemoPublishingWizardFactoryFremantleFree::canCreateWizard(const Project *p
QtSupport::BaseQtVersion *qt = qt4Bc->qtVersion(); QtSupport::BaseQtVersion *qt = qt4Bc->qtVersion();
if (!qt) if (!qt)
continue; continue;
if (MaemoGlobal::osType(qt->qmakeCommand()) == LinuxDeviceConfiguration::Maemo5OsType) if (MaemoGlobal::osType(qt->qmakeCommand()) == QLatin1String(Maemo5OsType))
return true; return true;
} }
break; break;

View File

@@ -31,11 +31,11 @@
**************************************************************************/ **************************************************************************/
#include "maemoqtversion.h" #include "maemoqtversion.h"
#include "maemoconstants.h"
#include "maemoglobal.h" #include "maemoglobal.h"
#include <qt4projectmanager/qt4projectmanagerconstants.h> #include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <qtsupport/qtsupportconstants.h> #include <qtsupport/qtsupportconstants.h>
#include <remotelinux/linuxdeviceconfiguration.h>
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
#include <QtCore/QFile> #include <QtCore/QFile>
@@ -114,16 +114,16 @@ QList<ProjectExplorer::Abi> MaemoQtVersion::qtAbis() const
QList<ProjectExplorer::Abi> result; QList<ProjectExplorer::Abi> result;
if (!m_isvalidVersion) if (!m_isvalidVersion)
return result; return result;
if (m_osType == LinuxDeviceConfiguration::Maemo5OsType) { if (m_osType == QLatin1String(Maemo5OsType)) {
result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS, result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS,
ProjectExplorer::Abi::MaemoLinuxFlavor, ProjectExplorer::Abi::ElfFormat, ProjectExplorer::Abi::MaemoLinuxFlavor, ProjectExplorer::Abi::ElfFormat,
32)); 32));
} else if (m_osType == LinuxDeviceConfiguration::HarmattanOsType) { } else if (m_osType == QLatin1String(HarmattanOsType)) {
result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS, result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS,
ProjectExplorer::Abi::HarmattanLinuxFlavor, ProjectExplorer::Abi::HarmattanLinuxFlavor,
ProjectExplorer::Abi::ElfFormat, ProjectExplorer::Abi::ElfFormat,
32)); 32));
} else if (m_osType == LinuxDeviceConfiguration::MeeGoOsType) { } else if (m_osType == QLatin1String(MeeGoOsType)) {
result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS, result.append(ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::LinuxOS,
ProjectExplorer::Abi::MeegoLinuxFlavor, ProjectExplorer::Abi::MeegoLinuxFlavor,
ProjectExplorer::Abi::ElfFormat, 32)); ProjectExplorer::Abi::ElfFormat, 32));
@@ -141,11 +141,11 @@ QSet<QString> MaemoQtVersion::supportedTargetIds() const
QSet<QString> result; QSet<QString> result;
if (!m_isvalidVersion) if (!m_isvalidVersion)
return result; return result;
if (m_osType == LinuxDeviceConfiguration::Maemo5OsType) { if (m_osType == QLatin1String(Maemo5OsType)) {
result.insert(QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID)); result.insert(QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID));
} else if (m_osType == LinuxDeviceConfiguration::HarmattanOsType) { } else if (m_osType == QLatin1String(HarmattanOsType)) {
result.insert(QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID)); result.insert(QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID));
} else if (m_osType == LinuxDeviceConfiguration::MeeGoOsType) { } else if (m_osType == QLatin1String(MeeGoOsType)) {
result.insert(QLatin1String(Constants::MEEGO_DEVICE_TARGET_ID)); result.insert(QLatin1String(Constants::MEEGO_DEVICE_TARGET_ID));
} }
return result; return result;
@@ -153,11 +153,11 @@ QSet<QString> MaemoQtVersion::supportedTargetIds() const
QString MaemoQtVersion::description() const QString MaemoQtVersion::description() const
{ {
if (m_osType == LinuxDeviceConfiguration::Maemo5OsType) if (m_osType == QLatin1String(Maemo5OsType))
return QCoreApplication::translate("QtVersion", "Maemo", "Qt Version is meant for Maemo5"); return QCoreApplication::translate("QtVersion", "Maemo", "Qt Version is meant for Maemo5");
else if (m_osType == LinuxDeviceConfiguration::HarmattanOsType) else if (m_osType == QLatin1String(HarmattanOsType))
return QCoreApplication::translate("QtVersion", "Harmattan ", "Qt Version is meant for Harmattan"); return QCoreApplication::translate("QtVersion", "Harmattan ", "Qt Version is meant for Harmattan");
else if (m_osType == LinuxDeviceConfiguration::MeeGoOsType) else if (m_osType == QLatin1String(MeeGoOsType))
return QCoreApplication::translate("QtVersion", "Meego", "Qt Version is meant for Meego"); return QCoreApplication::translate("QtVersion", "Meego", "Qt Version is meant for Meego");
return QString(); return QString();
} }

View File

@@ -220,7 +220,7 @@ QString MaemoSshRunner::killApplicationCommandLine() const
// Fremantle's busybox configuration is strange. // Fremantle's busybox configuration is strange.
const char *killTemplate; const char *killTemplate;
if (devConfig()->osType() == LinuxDeviceConfiguration::Maemo5OsType) if (devConfig()->osType() == QLatin1String(Maemo5OsType))
killTemplate = "pkill -f -%2 %1"; killTemplate = "pkill -f -%2 %1";
else else
killTemplate = "pkill -%2 -f %1"; killTemplate = "pkill -%2 -f %1";

View File

@@ -33,6 +33,7 @@
#include "qt4maemodeployconfiguration.h" #include "qt4maemodeployconfiguration.h"
#include "maddeuploadandinstallpackagesteps.h" #include "maddeuploadandinstallpackagesteps.h"
#include "maemoconstants.h"
#include "maemodeploybymountsteps.h" #include "maemodeploybymountsteps.h"
#include "maemoinstalltosysrootstep.h" #include "maemoinstalltosysrootstep.h"
#include "maemopackagecreationstep.h" #include "maemopackagecreationstep.h"
@@ -118,25 +119,22 @@ DeployConfiguration *Qt4MaemoDeployConfigurationFactory::create(Target *parent,
DeployConfiguration *dc = 0; DeployConfiguration *dc = 0;
const QString displayName = displayNameForId(id); const QString displayName = displayNameForId(id);
if (id == Qt4MaemoDeployConfiguration::FremantleWithoutPackagingId) { if (id == Qt4MaemoDeployConfiguration::FremantleWithoutPackagingId) {
dc = new Qt4MaemoDeployConfiguration(parent, id, displayName, dc = new Qt4MaemoDeployConfiguration(parent, id, displayName, QLatin1String(Maemo5OsType));
LinuxDeviceConfiguration::Maemo5OsType);
dc->stepList()->insertStep(0, new MaemoMakeInstallToSysrootStep(dc->stepList())); dc->stepList()->insertStep(0, new MaemoMakeInstallToSysrootStep(dc->stepList()));
dc->stepList()->insertStep(1, new MaemoCopyFilesViaMountStep(dc->stepList())); dc->stepList()->insertStep(1, new MaemoCopyFilesViaMountStep(dc->stepList()));
} else if (id == Qt4MaemoDeployConfiguration::FremantleWithPackagingId) { } else if (id == Qt4MaemoDeployConfiguration::FremantleWithPackagingId) {
dc = new Qt4MaemoDeployConfiguration(parent, id, displayName, dc = new Qt4MaemoDeployConfiguration(parent, id, displayName, QLatin1String(Maemo5OsType));
LinuxDeviceConfiguration::Maemo5OsType);
dc->stepList()->insertStep(0, new MaemoDebianPackageCreationStep(dc->stepList())); dc->stepList()->insertStep(0, new MaemoDebianPackageCreationStep(dc->stepList()));
dc->stepList()->insertStep(1, new MaemoInstallDebianPackageToSysrootStep(dc->stepList())); dc->stepList()->insertStep(1, new MaemoInstallDebianPackageToSysrootStep(dc->stepList()));
dc->stepList()->insertStep(2, new MaemoInstallPackageViaMountStep(dc->stepList())); dc->stepList()->insertStep(2, new MaemoInstallPackageViaMountStep(dc->stepList()));
} else if (id == Qt4MaemoDeployConfiguration::HarmattanId) { } else if (id == Qt4MaemoDeployConfiguration::HarmattanId) {
dc = new Qt4MaemoDeployConfiguration(parent, id, displayName, dc = new Qt4MaemoDeployConfiguration(parent, id, displayName,
LinuxDeviceConfiguration::HarmattanOsType); QLatin1String(HarmattanOsType));
dc->stepList()->insertStep(0, new MaemoDebianPackageCreationStep(dc->stepList())); dc->stepList()->insertStep(0, new MaemoDebianPackageCreationStep(dc->stepList()));
dc->stepList()->insertStep(1, new MaemoInstallDebianPackageToSysrootStep(dc->stepList())); dc->stepList()->insertStep(1, new MaemoInstallDebianPackageToSysrootStep(dc->stepList()));
dc->stepList()->insertStep(2, new MaemoUploadAndInstallPackageStep(dc->stepList())); dc->stepList()->insertStep(2, new MaemoUploadAndInstallPackageStep(dc->stepList()));
} else if (id == Qt4MaemoDeployConfiguration::MeegoId) { } else if (id == Qt4MaemoDeployConfiguration::MeegoId) {
dc = new Qt4MaemoDeployConfiguration(parent, id, displayName, dc = new Qt4MaemoDeployConfiguration(parent, id, displayName, QLatin1String(MeeGoOsType));
LinuxDeviceConfiguration::MeeGoOsType);
dc->stepList()->insertStep(0, new MaemoRpmPackageCreationStep(dc->stepList())); dc->stepList()->insertStep(0, new MaemoRpmPackageCreationStep(dc->stepList()));
dc->stepList()->insertStep(1, new MaemoInstallRpmPackageToSysrootStep(dc->stepList())); dc->stepList()->insertStep(1, new MaemoInstallRpmPackageToSysrootStep(dc->stepList()));
dc->stepList()->insertStep(2, new MeegoUploadAndInstallPackageStep(dc->stepList())); dc->stepList()->insertStep(2, new MeegoUploadAndInstallPackageStep(dc->stepList()));

View File

@@ -4,6 +4,8 @@
namespace RemoteLinux { namespace RemoteLinux {
namespace Constants { namespace Constants {
const char GenericLinuxOsType[] = "GenericLinuxOsType";
const char RemoteLinuxSettingsCategory[] = "X.RemoteLinux"; const char RemoteLinuxSettingsCategory[] = "X.RemoteLinux";
const char GenericTestDeviceActionId[] = "RemoteLinux.GenericTestDeviceAction"; const char GenericTestDeviceActionId[] = "RemoteLinux.GenericTestDeviceAction";

View File

@@ -35,6 +35,8 @@
#include "linuxdeviceconfiguration.h" #include "linuxdeviceconfiguration.h"
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <projectexplorer/buildstep.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/deployconfiguration.h> #include <projectexplorer/deployconfiguration.h>
#include <QtCore/QSharedPointer> #include <QtCore/QSharedPointer>
@@ -66,6 +68,18 @@ public:
QSharedPointer<Internal::TypeSpecificDeviceConfigurationListModel> deviceConfigModel() const; QSharedPointer<Internal::TypeSpecificDeviceConfigurationListModel> deviceConfigModel() const;
QSharedPointer<const LinuxDeviceConfiguration> deviceConfiguration() const; QSharedPointer<const LinuxDeviceConfiguration> deviceConfiguration() const;
template<class T> T *earlierBuildStep(const ProjectExplorer::BuildStep *laterBuildStep)
{
const QList<ProjectExplorer::BuildStep *> &buildSteps = stepList()->steps();
for (int i = 0; i < buildSteps.count(); ++i) {
if (buildSteps.at(i) == laterBuildStep)
return 0;
if (T * const step = dynamic_cast<T *>(buildSteps.at(i)))
return step;
}
return 0;
}
signals: signals:
void deviceConfigurationListChanged(); void deviceConfigurationListChanged();
void currentDeviceConfigurationChanged(); void currentDeviceConfigurationChanged();

View File

@@ -31,9 +31,9 @@
**************************************************************************/ **************************************************************************/
#include "remotelinuxdeployconfigurationfactory.h" #include "remotelinuxdeployconfigurationfactory.h"
#include "linuxdeviceconfiguration.h"
#include "maemoglobal.h" #include "maemoglobal.h"
#include "remotelinuxdeployconfiguration.h" #include "remotelinuxdeployconfiguration.h"
#include "remotelinux_constants.h"
#include "tarpackagecreationstep.h" #include "tarpackagecreationstep.h"
#include "uploadandinstalltarpackagestep.h" #include "uploadandinstalltarpackagestep.h"
@@ -77,7 +77,7 @@ DeployConfiguration *RemoteLinuxDeployConfigurationFactory::create(Target *paren
Q_ASSERT(canCreate(parent, id)); Q_ASSERT(canCreate(parent, id));
DeployConfiguration * const dc = new RemoteLinuxDeployConfiguration(parent, id, DeployConfiguration * const dc = new RemoteLinuxDeployConfiguration(parent, id,
genericLinuxDisplayName(), LinuxDeviceConfiguration::GenericLinuxOsType); genericLinuxDisplayName(), QLatin1String(Constants::GenericLinuxOsType));
dc->stepList()->insertStep(0, new TarPackageCreationStep(dc->stepList())); dc->stepList()->insertStep(0, new TarPackageCreationStep(dc->stepList()));
dc->stepList()->insertStep(1, new UploadAndInstallTarPackageStep(dc->stepList())); dc->stepList()->insertStep(1, new UploadAndInstallTarPackageStep(dc->stepList()));
return dc; return dc;
@@ -95,7 +95,7 @@ DeployConfiguration *RemoteLinuxDeployConfigurationFactory::restore(Target *pare
return 0; return 0;
QString id = idFromMap(map); QString id = idFromMap(map);
RemoteLinuxDeployConfiguration * const dc = new RemoteLinuxDeployConfiguration(parent, id, RemoteLinuxDeployConfiguration * const dc = new RemoteLinuxDeployConfiguration(parent, id,
genericLinuxDisplayName(), LinuxDeviceConfiguration::GenericLinuxOsType); genericLinuxDisplayName(), QLatin1String(Constants::GenericLinuxOsType));
if (!dc->fromMap(map)) { if (!dc->fromMap(map)) {
delete dc; delete dc;
return 0; return 0;

View File

@@ -32,6 +32,7 @@
#include "typespecificdeviceconfigurationlistmodel.h" #include "typespecificdeviceconfigurationlistmodel.h"
#include "linuxdeviceconfigurations.h" #include "linuxdeviceconfigurations.h"
#include "remotelinux_constants.h"
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal { namespace Internal {
@@ -57,7 +58,7 @@ int TypeSpecificDeviceConfigurationListModel::rowCount(const QModelIndex &parent
const LinuxDeviceConfigurations * const devConfs const LinuxDeviceConfigurations * const devConfs
= LinuxDeviceConfigurations::instance(); = LinuxDeviceConfigurations::instance();
const int devConfsCount = devConfs->rowCount(); const int devConfsCount = devConfs->rowCount();
if (m_targetOsType == LinuxDeviceConfiguration::GenericLinuxOsType) if (m_targetOsType == QLatin1String(Constants::GenericLinuxOsType))
return devConfsCount; return devConfsCount;
for (int i = 0; i < devConfsCount; ++i) { for (int i = 0; i < devConfsCount; ++i) {
if (devConfs->deviceAt(i)->osType() == m_targetOsType) if (devConfs->deviceAt(i)->osType() == m_targetOsType)
@@ -84,7 +85,7 @@ LinuxDeviceConfiguration::ConstPtr TypeSpecificDeviceConfigurationListModel::dev
int currentRow = -1; int currentRow = -1;
const LinuxDeviceConfigurations * const devConfs const LinuxDeviceConfigurations * const devConfs
= LinuxDeviceConfigurations::instance(); = LinuxDeviceConfigurations::instance();
if (m_targetOsType == LinuxDeviceConfiguration::GenericLinuxOsType) if (m_targetOsType == QLatin1String(Constants::GenericLinuxOsType))
return devConfs->deviceAt(idx); return devConfs->deviceAt(idx);
const int devConfsCount = devConfs->rowCount(); const int devConfsCount = devConfs->rowCount();
for (int i = 0; i < devConfsCount; ++i) { for (int i = 0; i < devConfsCount; ++i) {
@@ -107,7 +108,7 @@ LinuxDeviceConfiguration::ConstPtr TypeSpecificDeviceConfigurationListModel::fin
const LinuxDeviceConfiguration::ConstPtr &devConf const LinuxDeviceConfiguration::ConstPtr &devConf
= LinuxDeviceConfigurations::instance()->find(id); = LinuxDeviceConfigurations::instance()->find(id);
return devConf && (devConf->osType() == m_targetOsType return devConf && (devConf->osType() == m_targetOsType
|| m_targetOsType == LinuxDeviceConfiguration::GenericLinuxOsType) || m_targetOsType == QLatin1String(Constants::GenericLinuxOsType))
? devConf : defaultDeviceConfig(); ? devConf : defaultDeviceConfig();
} }

View File

@@ -31,7 +31,6 @@
**************************************************************************/ **************************************************************************/
#include "uploadandinstalltarpackagestep.h" #include "uploadandinstalltarpackagestep.h"
#include "maemoglobal.h"
#include "remotelinuxdeployconfiguration.h" #include "remotelinuxdeployconfiguration.h"
#include "remotelinuxpackageinstaller.h" #include "remotelinuxpackageinstaller.h"
#include "tarpackagecreationstep.h" #include "tarpackagecreationstep.h"
@@ -93,7 +92,7 @@ void UploadAndInstallTarPackageStep::ctor()
bool UploadAndInstallTarPackageStep::isDeploymentPossible(QString *whyNot) const bool UploadAndInstallTarPackageStep::isDeploymentPossible(QString *whyNot) const
{ {
const TarPackageCreationStep * const pStep const TarPackageCreationStep * const pStep
= MaemoGlobal::earlierBuildStep<TarPackageCreationStep>(deployConfiguration(), this); = deployConfiguration()->earlierBuildStep<TarPackageCreationStep>(this);
if (!pStep) { if (!pStep) {
if (whyNot) if (whyNot)
*whyNot = tr("No tarball creation step found."); *whyNot = tr("No tarball creation step found.");