Commit 3a87fdd5 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Maemo: Move more functionality into the new target classes.

parent 2ec85cc6
......@@ -482,15 +482,12 @@ void MaemoDeployStep::handleUnmounted()
m_mounter->resetMountSpecifications();
setState(Inactive);
break;
case UnmountingOldDirs: {
const Qt4BuildConfiguration * const bc
= static_cast<Qt4BuildConfiguration *>(buildConfiguration());
if (MaemoGlobal::allowsRemoteMounts(bc->qtVersion()))
case UnmountingOldDirs:
if (maemotarget()->allowsRemoteMounts())
setupMount();
else
prepareSftpConnection();
break;
}
case UnmountingCurrentDirs:
setState(GatheringPorts);
m_portsGatherer->start(m_connection, m_cachedDeviceConfig->freePorts());
......@@ -827,6 +824,13 @@ const AbstractMaemoToolChain *MaemoDeployStep::toolChain() const
return static_cast<AbstractMaemoToolChain *>(bc->toolChain());
}
const AbstractQt4MaemoTarget *MaemoDeployStep::maemotarget() const
{
const Qt4BuildConfiguration * const bc
= static_cast<Qt4BuildConfiguration *>(buildConfiguration());
return static_cast<AbstractQt4MaemoTarget *>(bc->target());
}
void MaemoDeployStep::handleSysrootInstallerOutput()
{
ASSERT_STATE(QList<State>() << InstallingToSysroot << StopRequested);
......
......@@ -143,6 +143,7 @@ private:
const MaemoPackageCreationStep *packagingStep() const;
QString deployMountPoint() const;
const AbstractMaemoToolChain *toolChain() const;
const AbstractQt4MaemoTarget *maemotarget() const;
void copyNextFileToDevice();
void installToSysroot();
QString uploadDir() const;
......
......@@ -89,9 +89,6 @@ public:
static QString targetName(const QtVersion *qtVersion);
static QString madCommand(const QtVersion *qtVersion);
static MaemoVersion version(const QtVersion *qtVersion);
static bool allowsRemoteMounts(const QtVersion *qtVersion) { return version(qtVersion) == Maemo5; }
static bool allowsPackagingDisabling(const QtVersion *qtVersion) { return version(qtVersion) == Maemo5; }
static bool allowsQmlDebugging(const QtVersion *qtVersion) { return version(qtVersion) == Maemo6; }
static bool callMad(QProcess &proc, const QStringList &args,
const QtVersion *qtVersion);
......
......@@ -413,8 +413,7 @@ QString MaemoPackageCreationStep::packageFilePath() const
bool MaemoPackageCreationStep::isPackagingEnabled() const
{
return m_packagingEnabled
|| !MaemoGlobal::allowsPackagingDisabling(qt4BuildConfiguration()->qtVersion());
return m_packagingEnabled || !maemoTarget()->allowsPackagingDisabling();
}
QString MaemoPackageCreationStep::versionString(QString *error) const
......
......@@ -86,8 +86,7 @@ void MaemoPackageCreationWidget::initGui()
{
const Qt4BuildConfiguration * const bc = m_step->qt4BuildConfiguration();
if (bc) {
m_ui->skipCheckBox->setVisible(MaemoGlobal::allowsPackagingDisabling(
bc->qtVersion()));
m_ui->skipCheckBox->setVisible(m_step->maemoTarget()->allowsPackagingDisabling());
m_ui->skipCheckBox->setChecked(!m_step->isPackagingEnabled());
}
......
......@@ -35,6 +35,7 @@
#include "maemoglobal.h"
#include "maemousedportsgatherer.h"
#include "qt4maemotarget.h"
#include <coreplugin/ssh/sftpchannel.h>
#include <coreplugin/ssh/sshconnection.h>
......@@ -75,7 +76,8 @@ void MaemoRemoteMounter::setBuildConfiguration(const Qt4BuildConfiguration *bc)
{
ASSERT_STATE(Inactive);
const QtVersion * const qtVersion = bc->qtVersion();
m_remoteMountsAllowed = MaemoGlobal::allowsRemoteMounts(qtVersion);
m_remoteMountsAllowed
= qobject_cast<AbstractQt4MaemoTarget *>(bc->target())->allowsRemoteMounts();
m_maddeRoot = MaemoGlobal::maddeRoot(qtVersion);
}
......
......@@ -321,8 +321,7 @@ MaemoPortList MaemoRunConfiguration::freePorts() const
bool MaemoRunConfiguration::useRemoteGdb() const
{
return m_useRemoteGdb
&& MaemoGlobal::allowsRemoteMounts(activeQt4BuildConfiguration()->qtVersion());
return m_useRemoteGdb && maemoTarget()->allowsRemoteMounts();
}
void MaemoRunConfiguration::setArguments(const QString &args)
......@@ -332,7 +331,7 @@ void MaemoRunConfiguration::setArguments(const QString &args)
MaemoRunConfiguration::DebuggingType MaemoRunConfiguration::debuggingType() const
{
if (!MaemoGlobal::allowsQmlDebugging(activeQt4BuildConfiguration()->qtVersion()))
if (!maemoTarget()->allowsQmlDebugging())
return DebugCppOnly;
if (useCppDebugger()) {
if (useQmlDebugger())
......
......@@ -342,16 +342,13 @@ void MaemoRunConfigurationWidget::handleBuildConfigChanged()
void MaemoRunConfigurationWidget::handleToolchainChanged()
{
const Qt4BuildConfiguration * const bc
= m_runConfiguration->activeQt4BuildConfiguration();
if (bc) {
const QtVersion * const qtVersion = bc->qtVersion();
const bool remoteMountsAvailable
= MaemoGlobal::allowsRemoteMounts(qtVersion);
const AbstractQt4MaemoTarget * const maemoTarget
= m_runConfiguration->maemoTarget();
if (maemoTarget) {
const bool remoteMountsAvailable = maemoTarget->allowsRemoteMounts();
m_debugDetailsContainer->setVisible(remoteMountsAvailable);
m_mountDetailsContainer->setVisible(remoteMountsAvailable);
const bool qmlDebuggingAvailable
= MaemoGlobal::allowsQmlDebugging(qtVersion);
const bool qmlDebuggingAvailable = maemoTarget->allowsQmlDebugging();
m_debuggingLanguagesLabel->setVisible(qmlDebuggingAvailable);
m_debugCppOnlyButton->setVisible(qmlDebuggingAvailable);
m_debugQmlOnlyButton->setVisible(qmlDebuggingAvailable);
......
......@@ -169,9 +169,8 @@ bool MaemoRunControlFactory::canRun(RunConfiguration *runConfiguration,
return false;
const int freePortCount = maemoRunConfig->freePorts().count();
const QtVersion * const qtVersion
= maemoRunConfig->activeQt4BuildConfiguration()->qtVersion();
const bool remoteMountsAllowed = MaemoGlobal::allowsRemoteMounts(qtVersion);
const bool remoteMountsAllowed
= maemoRunConfig->maemoTarget()->allowsRemoteMounts();
if (remoteMountsAllowed && freePortCount == 0)
return false;
const int mountDirCount
......
......@@ -72,6 +72,10 @@ public:
QString shortDescription() const;
bool setShortDescription(const QString &description);
virtual bool allowsRemoteMounts() const=0;
virtual bool allowsPackagingDisabling() const=0;
virtual bool allowsQmlDebugging() const=0;
signals:
void debianDirContentsChanged();
void changeLogChanged();
......@@ -124,6 +128,9 @@ public:
private:
virtual QString debianDirName() const;
virtual bool allowsRemoteMounts() const { return true; }
virtual bool allowsPackagingDisabling() const { return true; }
virtual bool allowsQmlDebugging() const { return false; }
};
class Qt4HarmattanTarget : public AbstractQt4MaemoTarget
......@@ -137,6 +144,9 @@ public:
private:
virtual QString debianDirName() const;
virtual bool allowsRemoteMounts() const { return false; }
virtual bool allowsPackagingDisabling() const { return false; }
virtual bool allowsQmlDebugging() const { return true; }
};
} // namespace Internal
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment