forked from qt-creator/qt-creator
Maemo: Move MADDE environment information out of MaemoToolChain class.
The toolchain is not available in all places where we need the respective information, which resulted in duplicated code.
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include "maemodeployablelistmodel.h"
|
#include "maemodeployablelistmodel.h"
|
||||||
|
|
||||||
#include "maemotoolchain.h"
|
#include "maemoglobal.h"
|
||||||
|
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/session.h>
|
#include <projectexplorer/session.h>
|
||||||
@@ -255,10 +255,10 @@ bool MaemoDeployableListModel::addDesktopFile(QString &error)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MaemoToolChain *const tc = maemoToolchain();
|
const QtVersion * const version = qtVersion();
|
||||||
QTC_ASSERT(tc, return false);
|
QTC_ASSERT(version, return false);
|
||||||
QString remoteDir = QLatin1String("/usr/share/applications");
|
QString remoteDir = QLatin1String("/usr/share/applications");
|
||||||
if (tc->version() == MaemoToolChain::Maemo5)
|
if (MaemoGlobal::version(version) == MaemoGlobal::Maemo5)
|
||||||
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;
|
||||||
@@ -333,7 +333,7 @@ bool MaemoDeployableListModel::addLinesToProFile(const QStringList &lines)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MaemoToolChain *MaemoDeployableListModel::maemoToolchain() const
|
const QtVersion *MaemoDeployableListModel::qtVersion() const
|
||||||
{
|
{
|
||||||
const ProjectExplorer::Project *const activeProject
|
const ProjectExplorer::Project *const activeProject
|
||||||
= ProjectExplorer::ProjectExplorerPlugin::instance()->session()->startupProject();
|
= ProjectExplorer::ProjectExplorerPlugin::instance()->session()->startupProject();
|
||||||
@@ -344,25 +344,22 @@ const MaemoToolChain *MaemoDeployableListModel::maemoToolchain() const
|
|||||||
const Qt4BuildConfiguration *const bc
|
const Qt4BuildConfiguration *const bc
|
||||||
= activeTarget->activeBuildConfiguration();
|
= activeTarget->activeBuildConfiguration();
|
||||||
QTC_ASSERT(bc, return 0);
|
QTC_ASSERT(bc, return 0);
|
||||||
const MaemoToolChain *const tc
|
return bc->qtVersion();
|
||||||
= dynamic_cast<MaemoToolChain *>(bc->toolChain());
|
|
||||||
QTC_ASSERT(tc, return 0);
|
|
||||||
return tc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoDeployableListModel::proFileScope() const
|
QString MaemoDeployableListModel::proFileScope() const
|
||||||
{
|
{
|
||||||
const MaemoToolChain *const tc = maemoToolchain();
|
const QtVersion *const qv = qtVersion();
|
||||||
QTC_ASSERT(tc, return QString());
|
QTC_ASSERT(qv, return QString());
|
||||||
return QLatin1String(tc->version() == MaemoToolChain::Maemo5
|
return QLatin1String(MaemoGlobal::version(qv) == MaemoGlobal::Maemo5
|
||||||
? "maemo5" : "unix:!symbian:!maemo5");
|
? "maemo5" : "unix:!symbian:!maemo5");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoDeployableListModel::installPrefix() const
|
QString MaemoDeployableListModel::installPrefix() const
|
||||||
{
|
{
|
||||||
const MaemoToolChain *const tc = maemoToolchain();
|
const QtVersion *const qv = qtVersion();
|
||||||
QTC_ASSERT(tc, return QString());
|
QTC_ASSERT(qv, return QString());
|
||||||
return QLatin1String(tc->version() == MaemoToolChain::Maemo5
|
return QLatin1String(MaemoGlobal::version(qv) == MaemoGlobal::Maemo5
|
||||||
? "/opt/usr" : "/usr");
|
? "/opt/usr" : "/usr");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,8 +45,8 @@
|
|||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
|
class QtVersion;
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class MaemoToolChain;
|
|
||||||
|
|
||||||
class MaemoDeployableListModel : public QAbstractTableModel
|
class MaemoDeployableListModel : public QAbstractTableModel
|
||||||
{
|
{
|
||||||
@@ -98,7 +98,7 @@ private:
|
|||||||
bool isEditable(const QModelIndex &index) const;
|
bool isEditable(const QModelIndex &index) const;
|
||||||
bool buildModel();
|
bool buildModel();
|
||||||
bool addLinesToProFile(const QStringList &lines);
|
bool addLinesToProFile(const QStringList &lines);
|
||||||
const MaemoToolChain *maemoToolchain() const;
|
const QtVersion *qtVersion() const;
|
||||||
QString proFileScope() const;
|
QString proFileScope() const;
|
||||||
QString installPrefix() const;
|
QString installPrefix() const;
|
||||||
|
|
||||||
|
|||||||
@@ -455,12 +455,15 @@ void MaemoDeployStep::handleUnmounted()
|
|||||||
m_mounter->resetMountSpecifications();
|
m_mounter->resetMountSpecifications();
|
||||||
setState(Inactive);
|
setState(Inactive);
|
||||||
break;
|
break;
|
||||||
case UnmountingOldDirs:
|
case UnmountingOldDirs: {
|
||||||
if (toolChain()->allowsRemoteMounts())
|
const Qt4BuildConfiguration * const bc
|
||||||
|
= static_cast<Qt4BuildConfiguration *>(buildConfiguration());
|
||||||
|
if (MaemoGlobal::allowsRemoteMounts(bc->qtVersion()))
|
||||||
setupMount();
|
setupMount();
|
||||||
else
|
else
|
||||||
prepareSftpConnection();
|
prepareSftpConnection();
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case UnmountingCurrentDirs:
|
case UnmountingCurrentDirs:
|
||||||
setState(GatheringPorts);
|
setState(GatheringPorts);
|
||||||
m_portsGatherer->start(m_connection, deviceConfig().freePorts());
|
m_portsGatherer->start(m_connection, deviceConfig().freePorts());
|
||||||
@@ -519,7 +522,7 @@ void MaemoDeployStep::setupMount()
|
|||||||
|
|
||||||
Q_ASSERT(m_needsInstall || !m_filesToCopy.isEmpty());
|
Q_ASSERT(m_needsInstall || !m_filesToCopy.isEmpty());
|
||||||
m_mounter->resetMountSpecifications();
|
m_mounter->resetMountSpecifications();
|
||||||
m_mounter->setToolchain(toolChain());
|
m_mounter->setBuildConfiguration(static_cast<Qt4BuildConfiguration *>(buildConfiguration()));
|
||||||
if (m_needsInstall) {
|
if (m_needsInstall) {
|
||||||
const QString localDir
|
const QString localDir
|
||||||
= QFileInfo(packagingStep()->packageFilePath()).absolutePath();
|
= QFileInfo(packagingStep()->packageFilePath()).absolutePath();
|
||||||
@@ -579,11 +582,13 @@ void MaemoDeployStep::installToSysroot()
|
|||||||
|
|
||||||
if (m_needsInstall) {
|
if (m_needsInstall) {
|
||||||
writeOutput(tr("Installing package to sysroot ..."));
|
writeOutput(tr("Installing package to sysroot ..."));
|
||||||
const MaemoToolChain * const tc = toolChain();
|
const Qt4BuildConfiguration * const bc
|
||||||
|
= static_cast<Qt4BuildConfiguration *>(buildConfiguration());
|
||||||
|
const QtVersion * const qtVersion = bc->qtVersion();
|
||||||
const QStringList args = QStringList() << QLatin1String("-t")
|
const QStringList args = QStringList() << QLatin1String("-t")
|
||||||
<< tc->targetName() << QLatin1String("xdpkg") << QLatin1String("-i")
|
<< MaemoGlobal::targetName(qtVersion) << QLatin1String("xdpkg")
|
||||||
<< packagingStep()->packageFilePath();
|
<< QLatin1String("-i") << packagingStep()->packageFilePath();
|
||||||
m_sysrootInstaller->start(tc->madAdminCommand(), args);
|
MaemoGlobal::callMadAdmin(*m_sysrootInstaller, args, qtVersion);
|
||||||
if (!m_sysrootInstaller->waitForStarted()) {
|
if (!m_sysrootInstaller->waitForStarted()) {
|
||||||
writeOutput(tr("Installation to sysroot failed, continuing anyway."),
|
writeOutput(tr("Installation to sysroot failed, continuing anyway."),
|
||||||
ErrorMessageOutput);
|
ErrorMessageOutput);
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
#include "maemodeviceconfigurations.h"
|
#include "maemodeviceconfigurations.h"
|
||||||
|
|
||||||
#include <coreplugin/ssh/sshconnection.h>
|
#include <coreplugin/ssh/sshconnection.h>
|
||||||
|
#include <qt4projectmanager/qtversionmanager.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
|
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
@@ -107,17 +108,42 @@ QString MaemoGlobal::failedToConnectToServerMessage(const Core::SshConnection::P
|
|||||||
return errorMsg;
|
return errorMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoGlobal::maddeRoot(const QString &qmakePath)
|
QString MaemoGlobal::maddeRoot(const QtVersion *qtVersion)
|
||||||
{
|
{
|
||||||
QDir dir(QDir::cleanPath(qmakePath).remove(binQmake));
|
QDir dir(targetRoot(qtVersion));
|
||||||
dir.cdUp(); dir.cdUp();
|
dir.cdUp(); dir.cdUp();
|
||||||
return dir.absolutePath();
|
return dir.absolutePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoGlobal::targetName(const QString &qmakePath)
|
QString MaemoGlobal::targetRoot(const QtVersion *qtVersion)
|
||||||
{
|
{
|
||||||
const QString target = QDir::cleanPath(qmakePath).remove(binQmake);
|
return QDir::cleanPath(qtVersion->qmakeCommand()).remove(binQmake);
|
||||||
return target.mid(target.lastIndexOf(QLatin1Char('/')) + 1);
|
}
|
||||||
|
|
||||||
|
QString MaemoGlobal::targetName(const QtVersion *qtVersion)
|
||||||
|
{
|
||||||
|
return QDir(targetRoot(qtVersion)).dirName();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString MaemoGlobal::madAdminCommand(const QtVersion *qtVersion)
|
||||||
|
{
|
||||||
|
return maddeRoot(qtVersion) + QLatin1String("/bin/mad-admin");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString MaemoGlobal::madCommand(const QtVersion *qtVersion)
|
||||||
|
{
|
||||||
|
return maddeRoot(qtVersion) + QLatin1String("/bin/mad");
|
||||||
|
}
|
||||||
|
|
||||||
|
MaemoGlobal::MaemoVersion MaemoGlobal::version(const QtVersion *qtVersion)
|
||||||
|
{
|
||||||
|
const QString &name = targetName(qtVersion);
|
||||||
|
if (name.startsWith(QLatin1String("fremantle")))
|
||||||
|
return Maemo5;
|
||||||
|
if (name.startsWith(QLatin1String("harmattan")))
|
||||||
|
return Maemo6;
|
||||||
|
qWarning("Unknown Maemo version!");
|
||||||
|
return static_cast<MaemoVersion>(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MaemoGlobal::removeRecursively(const QString &filePath, QString &error)
|
bool MaemoGlobal::removeRecursively(const QString &filePath, QString &error)
|
||||||
@@ -150,9 +176,25 @@ bool MaemoGlobal::removeRecursively(const QString &filePath, QString &error)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoGlobal::callMaddeShellScript(QProcess &proc, const QString &maddeRoot,
|
bool MaemoGlobal::callMad(QProcess &proc, const QStringList &args,
|
||||||
|
const QtVersion *qtVersion)
|
||||||
|
{
|
||||||
|
return callMaddeShellScript(proc, maddeRoot(qtVersion),
|
||||||
|
madCommand(qtVersion), args);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MaemoGlobal::callMadAdmin(QProcess &proc, const QStringList &args,
|
||||||
|
const QtVersion *qtVersion)
|
||||||
|
{
|
||||||
|
return callMaddeShellScript(proc, maddeRoot(qtVersion),
|
||||||
|
madAdminCommand(qtVersion), args);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MaemoGlobal::callMaddeShellScript(QProcess &proc, const QString &maddeRoot,
|
||||||
const QString &command, const QStringList &args)
|
const QString &command, const QStringList &args)
|
||||||
{
|
{
|
||||||
|
if (!QFileInfo(command).exists())
|
||||||
|
return false;
|
||||||
QString actualCommand = command;
|
QString actualCommand = command;
|
||||||
QStringList actualArgs = args;
|
QStringList actualArgs = args;
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
@@ -167,6 +209,7 @@ void MaemoGlobal::callMaddeShellScript(QProcess &proc, const QString &maddeRoot,
|
|||||||
Q_UNUSED(maddeRoot);
|
Q_UNUSED(maddeRoot);
|
||||||
#endif
|
#endif
|
||||||
proc.start(actualCommand, actualArgs);
|
proc.start(actualCommand, actualArgs);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -54,12 +54,15 @@ QT_END_NAMESPACE
|
|||||||
namespace Core { class SshConnection; }
|
namespace Core { class SshConnection; }
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
|
class QtVersion;
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class MaemoDeviceConfig;
|
class MaemoDeviceConfig;
|
||||||
|
|
||||||
class MaemoGlobal
|
class MaemoGlobal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
enum MaemoVersion { Maemo5, Maemo6 };
|
||||||
|
|
||||||
static QString homeDirOnDevice(const QString &uname);
|
static QString homeDirOnDevice(const QString &uname);
|
||||||
static QString remoteSudo();
|
static QString remoteSudo();
|
||||||
static QString remoteCommandPrefix(const QString &commandFilePath);
|
static QString remoteCommandPrefix(const QString &commandFilePath);
|
||||||
@@ -67,12 +70,22 @@ public:
|
|||||||
static QString remoteSourceProfilesCommand();
|
static QString remoteSourceProfilesCommand();
|
||||||
static QString failedToConnectToServerMessage(const QSharedPointer<Core::SshConnection> &connection,
|
static QString failedToConnectToServerMessage(const QSharedPointer<Core::SshConnection> &connection,
|
||||||
const MaemoDeviceConfig &deviceConfig);
|
const MaemoDeviceConfig &deviceConfig);
|
||||||
static QString maddeRoot(const QString &qmakePath);
|
|
||||||
static QString targetName(const QString &qmakePath);
|
static QString maddeRoot(const QtVersion *qtVersion);
|
||||||
|
static QString targetRoot(const QtVersion *qtVersion);
|
||||||
|
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);
|
||||||
|
static bool callMadAdmin(QProcess &proc, const QStringList &args,
|
||||||
|
const QtVersion *qtVersion);
|
||||||
|
|
||||||
static bool removeRecursively(const QString &filePath, QString &error);
|
static bool removeRecursively(const QString &filePath, QString &error);
|
||||||
static void callMaddeShellScript(QProcess &proc, const QString &maddeRoot,
|
|
||||||
const QString &command, const QStringList &args);
|
|
||||||
|
|
||||||
template<class T> static T *buildStep(const ProjectExplorer::DeployConfiguration *dc)
|
template<class T> static T *buildStep(const ProjectExplorer::DeployConfiguration *dc)
|
||||||
{
|
{
|
||||||
@@ -101,6 +114,11 @@ public:
|
|||||||
actual, func);
|
actual, func);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
static QString madAdminCommand(const QtVersion *qtVersion);
|
||||||
|
static bool callMaddeShellScript(QProcess &proc, const QString &maddeRoot,
|
||||||
|
const QString &command, const QStringList &args);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -110,26 +110,18 @@ MaemoManager &MaemoManager::instance()
|
|||||||
|
|
||||||
bool MaemoManager::isValidMaemoQtVersion(const QtVersion *version) const
|
bool MaemoManager::isValidMaemoQtVersion(const QtVersion *version) const
|
||||||
{
|
{
|
||||||
QString path = QDir::cleanPath(version->qmakeCommand());
|
|
||||||
path.remove(QLatin1String("/bin/qmake" EXEC_SUFFIX));
|
|
||||||
QDir dir(path);
|
|
||||||
const QByteArray target = dir.dirName().toAscii();
|
|
||||||
dir.cdUp(); dir.cdUp();
|
|
||||||
const QString madAdminCommand(dir.absolutePath() + QLatin1String("/bin/mad-admin"));
|
|
||||||
if (!QFileInfo(madAdminCommand).exists())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
QProcess madAdminProc;
|
QProcess madAdminProc;
|
||||||
const QStringList arguments(QLatin1String("list"));
|
const QStringList arguments(QLatin1String("list"));
|
||||||
MaemoGlobal::callMaddeShellScript(madAdminProc, dir.absolutePath(),
|
if (!MaemoGlobal::callMadAdmin(madAdminProc, arguments, version))
|
||||||
madAdminCommand, arguments);
|
return false;
|
||||||
if (!madAdminProc.waitForStarted() || !madAdminProc.waitForFinished())
|
if (!madAdminProc.waitForStarted() || !madAdminProc.waitForFinished())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
madAdminProc.setReadChannel(QProcess::StandardOutput);
|
madAdminProc.setReadChannel(QProcess::StandardOutput);
|
||||||
|
const QByteArray targetName = MaemoGlobal::targetName(version).toAscii();
|
||||||
while (madAdminProc.canReadLine()) {
|
while (madAdminProc.canReadLine()) {
|
||||||
const QByteArray &line = madAdminProc.readLine();
|
const QByteArray &line = madAdminProc.readLine();
|
||||||
if (line.contains(target)
|
if (line.contains(targetName)
|
||||||
&& (line.contains("(installed)") || line.contains("(default)")))
|
&& (line.contains("(installed)") || line.contains("(default)")))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -138,9 +130,7 @@ bool MaemoManager::isValidMaemoQtVersion(const QtVersion *version) const
|
|||||||
|
|
||||||
ToolChain* MaemoManager::maemoToolChain(const QtVersion *version) const
|
ToolChain* MaemoManager::maemoToolChain(const QtVersion *version) const
|
||||||
{
|
{
|
||||||
QString targetRoot = QDir::cleanPath(version->qmakeCommand());
|
return new MaemoToolChain(version);
|
||||||
targetRoot.remove(QLatin1String("/bin/qmake" EXEC_SUFFIX));
|
|
||||||
return new MaemoToolChain(targetRoot);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -47,7 +47,6 @@
|
|||||||
#include "maemoglobal.h"
|
#include "maemoglobal.h"
|
||||||
#include "maemopackagecreationwidget.h"
|
#include "maemopackagecreationwidget.h"
|
||||||
#include "maemotemplatesmanager.h"
|
#include "maemotemplatesmanager.h"
|
||||||
#include "maemotoolchain.h"
|
|
||||||
|
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
@@ -172,16 +171,17 @@ bool MaemoPackageCreationStep::createPackage(QProcess *buildProc)
|
|||||||
if (!copyDebianFiles(inSourceBuild))
|
if (!copyDebianFiles(inSourceBuild))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const QString maddeRoot = maemoToolChain()->maddeRoot();
|
const QtVersion * const qtVersion = qt4BuildConfiguration()->qtVersion();
|
||||||
const QString madCommand = maddeRoot + QLatin1String("/bin/mad");
|
const QString madCommand = MaemoGlobal::madCommand(qtVersion);
|
||||||
const QStringList args = QStringList() << QLatin1String("-t")
|
const QStringList args = QStringList() << QLatin1String("-t")
|
||||||
<< maemoToolChain()->targetName() << QLatin1String("dpkg-buildpackage")
|
<< MaemoGlobal::targetName(qtVersion)
|
||||||
<< QLatin1String("-nc") << QLatin1String("-uc") << QLatin1String("-us");
|
<< QLatin1String("dpkg-buildpackage") << QLatin1String("-nc")
|
||||||
|
<< QLatin1String("-uc") << QLatin1String("-us");
|
||||||
const QString cmdLine = madCommand + QLatin1Char(' ')
|
const QString cmdLine = madCommand + QLatin1Char(' ')
|
||||||
+ args.join(QLatin1String(" "));
|
+ args.join(QLatin1String(" "));
|
||||||
emit addOutput(tr("Package Creation: Running command '%1'.").arg(cmdLine),
|
emit addOutput(tr("Package Creation: Running command '%1'.").arg(cmdLine),
|
||||||
BuildStep::MessageOutput);
|
BuildStep::MessageOutput);
|
||||||
MaemoGlobal::callMaddeShellScript(*buildProc, maddeRoot, madCommand, args);
|
MaemoGlobal::callMad(*buildProc, args, qtVersion);
|
||||||
if (!buildProc->waitForStarted()) {
|
if (!buildProc->waitForStarted()) {
|
||||||
raiseError(tr("Packaging failed."),
|
raiseError(tr("Packaging failed."),
|
||||||
tr("Packaging error: Could not start command '%1'. Reason: %2")
|
tr("Packaging error: Could not start command '%1'. Reason: %2")
|
||||||
@@ -233,7 +233,7 @@ bool MaemoPackageCreationStep::createPackage(QProcess *buildProc)
|
|||||||
emit addOutput(tr("Package created."), BuildStep::MessageOutput);
|
emit addOutput(tr("Package created."), BuildStep::MessageOutput);
|
||||||
deployStep()->deployables()->setUnmodified();
|
deployStep()->deployables()->setUnmodified();
|
||||||
if (inSourceBuild) {
|
if (inSourceBuild) {
|
||||||
buildProc->start(packagingCommand(maemoToolChain(),
|
buildProc->start(packagingCommand(qt4BuildConfiguration(),
|
||||||
QLatin1String("dh_clean")));
|
QLatin1String("dh_clean")));
|
||||||
buildProc->waitForFinished();
|
buildProc->waitForFinished();
|
||||||
buildProc->terminate();
|
buildProc->terminate();
|
||||||
@@ -341,11 +341,6 @@ QString MaemoPackageCreationStep::projectName() const
|
|||||||
->rootProjectNode()->displayName().toLower();
|
->rootProjectNode()->displayName().toLower();
|
||||||
}
|
}
|
||||||
|
|
||||||
const MaemoToolChain *MaemoPackageCreationStep::maemoToolChain() const
|
|
||||||
{
|
|
||||||
return static_cast<MaemoToolChain *>(qt4BuildConfiguration()->toolChain());
|
|
||||||
}
|
|
||||||
|
|
||||||
MaemoDeployStep *MaemoPackageCreationStep::deployStep() const
|
MaemoDeployStep *MaemoPackageCreationStep::deployStep() const
|
||||||
{
|
{
|
||||||
MaemoDeployStep * const deployStep
|
MaemoDeployStep * const deployStep
|
||||||
@@ -355,16 +350,6 @@ MaemoDeployStep *MaemoPackageCreationStep::deployStep() const
|
|||||||
return deployStep;
|
return deployStep;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoPackageCreationStep::maddeRoot() const
|
|
||||||
{
|
|
||||||
return maemoToolChain()->maddeRoot();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString MaemoPackageCreationStep::targetRoot() const
|
|
||||||
{
|
|
||||||
return maemoToolChain()->targetRoot();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MaemoPackageCreationStep::packagingNeeded() const
|
bool MaemoPackageCreationStep::packagingNeeded() const
|
||||||
{
|
{
|
||||||
const QSharedPointer<MaemoDeployables> &deployables
|
const QSharedPointer<MaemoDeployables> &deployables
|
||||||
@@ -427,7 +412,8 @@ QString MaemoPackageCreationStep::packageFilePath() const
|
|||||||
|
|
||||||
bool MaemoPackageCreationStep::isPackagingEnabled() const
|
bool MaemoPackageCreationStep::isPackagingEnabled() const
|
||||||
{
|
{
|
||||||
return m_packagingEnabled || !maemoToolChain()->allowsPackagingDisabling();
|
return m_packagingEnabled
|
||||||
|
|| !MaemoGlobal::allowsPackagingDisabling(qt4BuildConfiguration()->qtVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoPackageCreationStep::versionString(QString *error) const
|
QString MaemoPackageCreationStep::versionString(QString *error) const
|
||||||
@@ -463,13 +449,8 @@ void MaemoPackageCreationStep::raiseError(const QString &shortMsg,
|
|||||||
bool MaemoPackageCreationStep::preparePackagingProcess(QProcess *proc,
|
bool MaemoPackageCreationStep::preparePackagingProcess(QProcess *proc,
|
||||||
const Qt4BuildConfiguration *bc, const QString &workingDir, QString *error)
|
const Qt4BuildConfiguration *bc, const QString &workingDir, QString *error)
|
||||||
{
|
{
|
||||||
const MaemoToolChain * const tc
|
const QString targetRoot = MaemoGlobal::targetRoot(bc->qtVersion());
|
||||||
= dynamic_cast<const MaemoToolChain *>(bc->toolChain());
|
QFile configFile(targetRoot % QLatin1String("/config.sh"));
|
||||||
if (!tc) {
|
|
||||||
*error = tr("Build configuration has no Maemo toolchain.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
QFile configFile(tc->targetRoot() % QLatin1String("/config.sh"));
|
|
||||||
if (!configFile.open(QIODevice::ReadOnly)) {
|
if (!configFile.open(QIODevice::ReadOnly)) {
|
||||||
*error = tr("Cannot open MADDE config file '%1'.")
|
*error = tr("Cannot open MADDE config file '%1'.")
|
||||||
.arg(nativePath(configFile));
|
.arg(nativePath(configFile));
|
||||||
@@ -478,11 +459,12 @@ bool MaemoPackageCreationStep::preparePackagingProcess(QProcess *proc,
|
|||||||
|
|
||||||
Utils::Environment env = bc->environment();
|
Utils::Environment env = bc->environment();
|
||||||
const QString &path
|
const QString &path
|
||||||
= QDir::toNativeSeparators(tc->maddeRoot() + QLatin1Char('/'));
|
= QDir::toNativeSeparators(MaemoGlobal::maddeRoot(bc->qtVersion())
|
||||||
|
+ QLatin1Char('/'));
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
env.prependOrSetPath(path % QLatin1String("bin"));
|
env.prependOrSetPath(path % QLatin1String("bin"));
|
||||||
#endif
|
#endif
|
||||||
env.prependOrSetPath(tc->targetRoot() % QLatin1String("/bin"));
|
env.prependOrSetPath(targetRoot % QLatin1String("/bin"));
|
||||||
env.prependOrSetPath(path % QLatin1String("madbin"));
|
env.prependOrSetPath(path % QLatin1String("madbin"));
|
||||||
|
|
||||||
if (bc->qmakeBuildConfiguration() & QtVersion::DebugBuild) {
|
if (bc->qmakeBuildConfiguration() & QtVersion::DebugBuild) {
|
||||||
@@ -512,14 +494,15 @@ bool MaemoPackageCreationStep::preparePackagingProcess(QProcess *proc,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoPackageCreationStep::packagingCommand(const MaemoToolChain *tc,
|
QString MaemoPackageCreationStep::packagingCommand(const Qt4BuildConfiguration *bc,
|
||||||
const QString &commandName)
|
const QString &commandName)
|
||||||
{
|
{
|
||||||
QString perl;
|
QString perl;
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
perl = tc->maddeRoot() + QLatin1String("/bin/perl.exe ");
|
perl = tc->maddeRoot() + QLatin1String("/bin/perl.exe ");
|
||||||
#endif
|
#endif
|
||||||
return perl + tc->maddeRoot() % QLatin1String("/madbin/") % commandName;
|
return perl + MaemoGlobal::maddeRoot(bc->qtVersion())
|
||||||
|
% QLatin1String("/madbin/") % commandName;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoPackageCreationStep::checkProjectName()
|
void MaemoPackageCreationStep::checkProjectName()
|
||||||
@@ -571,7 +554,9 @@ void MaemoPackageCreationStep::updateDesktopFiles(const QString &rulesFilePath)
|
|||||||
QString desktopFileDir = QFileInfo(rulesFile).dir().path()
|
QString desktopFileDir = QFileInfo(rulesFile).dir().path()
|
||||||
+ QLatin1Char('/') + projectName()
|
+ QLatin1Char('/') + projectName()
|
||||||
+ QLatin1String("/usr/share/applications/");
|
+ QLatin1String("/usr/share/applications/");
|
||||||
if (maemoToolChain()->version() == MaemoToolChain::Maemo5)
|
const MaemoGlobal::MaemoVersion version
|
||||||
|
= MaemoGlobal::version(qt4BuildConfiguration()->qtVersion());
|
||||||
|
if (version == MaemoGlobal::Maemo5)
|
||||||
desktopFileDir += QLatin1String("hildon/");
|
desktopFileDir += QLatin1String("hildon/");
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
desktopFileDir.remove(QLatin1Char(':'));
|
desktopFileDir.remove(QLatin1Char(':'));
|
||||||
@@ -583,7 +568,7 @@ void MaemoPackageCreationStep::updateDesktopFiles(const QString &rulesFilePath)
|
|||||||
= deployStep()->deployables()->modelAt(i);
|
= deployStep()->deployables()->modelAt(i);
|
||||||
if (!model->hasDesktopFile())
|
if (!model->hasDesktopFile())
|
||||||
continue;
|
continue;
|
||||||
if (maemoToolChain()->version() == MaemoToolChain::Maemo6) {
|
if (version == MaemoGlobal::Maemo6) {
|
||||||
addWorkaroundForHarmattanBug(content, insertPos,
|
addWorkaroundForHarmattanBug(content, insertPos,
|
||||||
model, desktopFileDir);
|
model, desktopFileDir);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,8 +56,6 @@ class Qt4BuildConfiguration;
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
class MaemoDeployStep;
|
class MaemoDeployStep;
|
||||||
class MaemoDeployableListModel;
|
class MaemoDeployableListModel;
|
||||||
class MaemoToolChain;
|
|
||||||
class MaemoProFileWrapper;
|
|
||||||
|
|
||||||
class MaemoPackageCreationStep : public ProjectExplorer::BuildStep
|
class MaemoPackageCreationStep : public ProjectExplorer::BuildStep
|
||||||
{
|
{
|
||||||
@@ -74,18 +72,17 @@ public:
|
|||||||
QString versionString(QString *error) const;
|
QString versionString(QString *error) const;
|
||||||
bool setVersionString(const QString &version, QString *error);
|
bool setVersionString(const QString &version, QString *error);
|
||||||
|
|
||||||
const MaemoToolChain *maemoToolChain() const;
|
|
||||||
|
|
||||||
static bool preparePackagingProcess(QProcess *proc,
|
static bool preparePackagingProcess(QProcess *proc,
|
||||||
const Qt4BuildConfiguration *bc, const QString &workingDir,
|
const Qt4BuildConfiguration *bc, const QString &workingDir,
|
||||||
QString *error);
|
QString *error);
|
||||||
static QString packagingCommand(const MaemoToolChain *tc,
|
static QString packagingCommand(const Qt4BuildConfiguration *bc,
|
||||||
const QString &commandName);
|
const QString &commandName);
|
||||||
static QString packageName(const ProjectExplorer::Project *project);
|
static QString packageName(const ProjectExplorer::Project *project);
|
||||||
static QString packageFileName(const ProjectExplorer::Project *project,
|
static QString packageFileName(const ProjectExplorer::Project *project,
|
||||||
const QString &version);
|
const QString &version);
|
||||||
|
|
||||||
QString projectName() const;
|
QString projectName() const;
|
||||||
|
const Qt4BuildConfiguration *qt4BuildConfiguration() const;
|
||||||
|
|
||||||
static const QLatin1String DefaultVersionNumber;
|
static const QLatin1String DefaultVersionNumber;
|
||||||
|
|
||||||
@@ -111,8 +108,6 @@ private:
|
|||||||
|
|
||||||
bool createPackage(QProcess *buildProc);
|
bool createPackage(QProcess *buildProc);
|
||||||
bool copyDebianFiles(bool inSourceBuild);
|
bool copyDebianFiles(bool inSourceBuild);
|
||||||
QString maddeRoot() const;
|
|
||||||
QString targetRoot() const;
|
|
||||||
static QString nativePath(const QFile &file);
|
static QString nativePath(const QFile &file);
|
||||||
bool packagingNeeded() const;
|
bool packagingNeeded() const;
|
||||||
bool isFileNewerThan(const QString &filePath,
|
bool isFileNewerThan(const QString &filePath,
|
||||||
@@ -120,7 +115,6 @@ private:
|
|||||||
void raiseError(const QString &shortMsg,
|
void raiseError(const QString &shortMsg,
|
||||||
const QString &detailedMsg = QString());
|
const QString &detailedMsg = QString());
|
||||||
QString buildDirectory() const;
|
QString buildDirectory() const;
|
||||||
const Qt4BuildConfiguration *qt4BuildConfiguration() const;
|
|
||||||
MaemoDeployStep * deployStep() const;
|
MaemoDeployStep * deployStep() const;
|
||||||
void checkProjectName();
|
void checkProjectName();
|
||||||
void updateDesktopFiles(const QString &rulesFilePath);
|
void updateDesktopFiles(const QString &rulesFilePath);
|
||||||
|
|||||||
@@ -42,9 +42,9 @@
|
|||||||
#include "maemopackagecreationwidget.h"
|
#include "maemopackagecreationwidget.h"
|
||||||
#include "ui_maemopackagecreationwidget.h"
|
#include "ui_maemopackagecreationwidget.h"
|
||||||
|
|
||||||
|
#include "maemoglobal.h"
|
||||||
#include "maemopackagecreationstep.h"
|
#include "maemopackagecreationstep.h"
|
||||||
#include "maemotemplatesmanager.h"
|
#include "maemotemplatesmanager.h"
|
||||||
#include "maemotoolchain.h"
|
|
||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
@@ -209,10 +209,11 @@ void MaemoPackageCreationWidget::setShortDescription()
|
|||||||
|
|
||||||
void MaemoPackageCreationWidget::handleToolchainChanged()
|
void MaemoPackageCreationWidget::handleToolchainChanged()
|
||||||
{
|
{
|
||||||
if (!m_step->maemoToolChain())
|
const Qt4BuildConfiguration * const bc = m_step->qt4BuildConfiguration();
|
||||||
|
if (!bc)
|
||||||
return;
|
return;
|
||||||
m_ui->skipCheckBox
|
m_ui->skipCheckBox->setVisible(MaemoGlobal::allowsPackagingDisabling(
|
||||||
->setVisible(m_step->maemoToolChain()->allowsPackagingDisabling());
|
bc->qtVersion()));
|
||||||
m_ui->skipCheckBox->setChecked(!m_step->isPackagingEnabled());
|
m_ui->skipCheckBox->setChecked(!m_step->isPackagingEnabled());
|
||||||
emit updateSummary();
|
emit updateSummary();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
#include "maemopackagecreationstep.h"
|
#include "maemopackagecreationstep.h"
|
||||||
#include "maemopublishingfileselectiondialog.h"
|
#include "maemopublishingfileselectiondialog.h"
|
||||||
#include "maemotemplatesmanager.h"
|
#include "maemotemplatesmanager.h"
|
||||||
#include "maemotoolchain.h"
|
|
||||||
|
|
||||||
#include <coreplugin/ifile.h>
|
#include <coreplugin/ifile.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
@@ -364,13 +363,11 @@ void MaemoPublisherFremantleFree::runDpkgBuildPackage()
|
|||||||
return;
|
return;
|
||||||
setState(BuildingPackage);
|
setState(BuildingPackage);
|
||||||
emit progressReport(tr("Building source package..."));
|
emit progressReport(tr("Building source package..."));
|
||||||
const MaemoToolChain * const tc
|
|
||||||
= dynamic_cast<MaemoToolChain *>(m_buildConfig->toolChain());
|
|
||||||
const QStringList args = QStringList() << QLatin1String("-t")
|
const QStringList args = QStringList() << QLatin1String("-t")
|
||||||
<< tc->targetName() << QLatin1String("dpkg-buildpackage")
|
<< MaemoGlobal::targetName(m_buildConfig->qtVersion())
|
||||||
<< QLatin1String("-S") << QLatin1String("-us") << QLatin1String("-uc");
|
<< QLatin1String("dpkg-buildpackage") << QLatin1String("-S")
|
||||||
const QString madCommand = tc->maddeRoot() + QLatin1String("/bin/mad");
|
<< QLatin1String("-us") << QLatin1String("-uc");
|
||||||
MaemoGlobal::callMaddeShellScript(*m_process, tc->maddeRoot(), madCommand, args);
|
MaemoGlobal::callMad(*m_process, args, m_buildConfig->qtVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
// We have to implement the SCP protocol, because the maemo.org
|
// We have to implement the SCP protocol, because the maemo.org
|
||||||
|
|||||||
@@ -33,8 +33,8 @@
|
|||||||
#include "maemopublishingbuildsettingspagefremantlefree.h"
|
#include "maemopublishingbuildsettingspagefremantlefree.h"
|
||||||
#include "ui_maemopublishingbuildsettingspagefremantlefree.h"
|
#include "ui_maemopublishingbuildsettingspagefremantlefree.h"
|
||||||
|
|
||||||
|
#include "maemoglobal.h"
|
||||||
#include "maemopublisherfremantlefree.h"
|
#include "maemopublisherfremantlefree.h"
|
||||||
#include "maemotoolchain.h"
|
|
||||||
|
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
@@ -80,11 +80,7 @@ void MaemoPublishingBuildSettingsPageFremantleFree::collectBuildConfigurations(c
|
|||||||
= qobject_cast<Qt4BuildConfiguration *>(bc);
|
= qobject_cast<Qt4BuildConfiguration *>(bc);
|
||||||
if (!qt4Bc)
|
if (!qt4Bc)
|
||||||
continue;
|
continue;
|
||||||
const MaemoToolChain * const tc
|
if (MaemoGlobal::version(qt4Bc->qtVersion()) == MaemoGlobal::Maemo5)
|
||||||
= dynamic_cast<MaemoToolChain *>(qt4Bc->toolChain());
|
|
||||||
if (!tc)
|
|
||||||
continue;
|
|
||||||
if (tc->version() == MaemoToolChain::Maemo5)
|
|
||||||
m_buildConfigs << qt4Bc;
|
m_buildConfigs << qt4Bc;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -32,8 +32,8 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
#include "maemopublishingwizardfactories.h"
|
#include "maemopublishingwizardfactories.h"
|
||||||
|
|
||||||
|
#include "maemoglobal.h"
|
||||||
#include "maemopublishingwizardfremantlefree.h"
|
#include "maemopublishingwizardfremantlefree.h"
|
||||||
#include "maemotoolchain.h"
|
|
||||||
|
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qt4projectmanager/qmakestep.h>
|
#include <qt4projectmanager/qmakestep.h>
|
||||||
@@ -77,11 +77,7 @@ bool MaemoPublishingWizardFactoryFremantleFree::canCreateWizard(const Project *p
|
|||||||
= qobject_cast<const Qt4BuildConfiguration *>(bc);
|
= qobject_cast<const Qt4BuildConfiguration *>(bc);
|
||||||
if (!qt4Bc)
|
if (!qt4Bc)
|
||||||
continue;
|
continue;
|
||||||
const MaemoToolChain * const tc
|
if (MaemoGlobal::version(qt4Bc->qtVersion()) == MaemoGlobal::Maemo5)
|
||||||
= dynamic_cast<MaemoToolChain *>(qt4Bc->toolChain());
|
|
||||||
if (!tc)
|
|
||||||
continue;
|
|
||||||
if (tc->version() == MaemoToolChain::Maemo5)
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
#include "maemoqemuruntimeparser.h"
|
#include "maemoqemuruntimeparser.h"
|
||||||
#include "maemosettingspages.h"
|
#include "maemosettingspages.h"
|
||||||
#include "maemorunconfiguration.h"
|
#include "maemorunconfiguration.h"
|
||||||
#include "maemotoolchain.h"
|
|
||||||
#include "qtversionmanager.h"
|
#include "qtversionmanager.h"
|
||||||
#include "qt4project.h"
|
#include "qt4project.h"
|
||||||
#include "qt4projectmanagerconstants.h"
|
#include "qt4projectmanagerconstants.h"
|
||||||
|
|||||||
@@ -92,19 +92,14 @@ MaemoQemuRuntimeParser::MaemoQemuRuntimeParser(const QString &madInfoOutput,
|
|||||||
MaemoQemuRuntime MaemoQemuRuntimeParser::parseRuntime(const QtVersion *qtVersion)
|
MaemoQemuRuntime MaemoQemuRuntimeParser::parseRuntime(const QtVersion *qtVersion)
|
||||||
{
|
{
|
||||||
MaemoQemuRuntime runtime;
|
MaemoQemuRuntime runtime;
|
||||||
const QString maddeRootPath
|
const QString maddeRootPath = MaemoGlobal::maddeRoot(qtVersion);
|
||||||
= MaemoGlobal::maddeRoot(qtVersion->qmakeCommand());
|
|
||||||
const QString madCommand = maddeRootPath + QLatin1String("/bin/mad");
|
|
||||||
if (!QFileInfo(madCommand).exists())
|
|
||||||
return runtime;
|
|
||||||
QProcess madProc;
|
QProcess madProc;
|
||||||
MaemoGlobal::callMaddeShellScript(madProc, maddeRootPath, madCommand,
|
if (!MaemoGlobal::callMad(madProc, QStringList() << QLatin1String("info"), qtVersion))
|
||||||
QStringList() << QLatin1String("info"));
|
return runtime;
|
||||||
if (!madProc.waitForStarted() || !madProc.waitForFinished())
|
if (!madProc.waitForStarted() || !madProc.waitForFinished())
|
||||||
return runtime;
|
return runtime;
|
||||||
const QByteArray &madInfoOutput = madProc.readAllStandardOutput();
|
const QByteArray &madInfoOutput = madProc.readAllStandardOutput();
|
||||||
const QString &targetName
|
const QString &targetName = MaemoGlobal::targetName(qtVersion);
|
||||||
= MaemoGlobal::targetName(qtVersion->qmakeCommand());
|
|
||||||
runtime = MaemoQemuRuntimeParserV2(madInfoOutput, targetName, maddeRootPath)
|
runtime = MaemoQemuRuntimeParserV2(madInfoOutput, targetName, maddeRootPath)
|
||||||
.parseRuntime();
|
.parseRuntime();
|
||||||
if (!runtime.m_name.isEmpty()) {
|
if (!runtime.m_name.isEmpty()) {
|
||||||
|
|||||||
@@ -34,12 +34,12 @@
|
|||||||
#include "maemoremotemounter.h"
|
#include "maemoremotemounter.h"
|
||||||
|
|
||||||
#include "maemoglobal.h"
|
#include "maemoglobal.h"
|
||||||
#include "maemotoolchain.h"
|
|
||||||
#include "maemousedportsgatherer.h"
|
#include "maemousedportsgatherer.h"
|
||||||
|
|
||||||
#include <coreplugin/ssh/sftpchannel.h>
|
#include <coreplugin/ssh/sftpchannel.h>
|
||||||
#include <coreplugin/ssh/sshconnection.h>
|
#include <coreplugin/ssh/sshconnection.h>
|
||||||
#include <coreplugin/ssh/sshremoteprocess.h>
|
#include <coreplugin/ssh/sshremoteprocess.h>
|
||||||
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QtCore/QTimer>
|
#include <QtCore/QTimer>
|
||||||
@@ -70,11 +70,12 @@ void MaemoRemoteMounter::setConnection(const SshConnection::Ptr &connection)
|
|||||||
m_connection = connection;
|
m_connection = connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRemoteMounter::setToolchain(const MaemoToolChain *toolChain)
|
void MaemoRemoteMounter::setBuildConfiguration(const Qt4BuildConfiguration *bc)
|
||||||
{
|
{
|
||||||
ASSERT_STATE(Inactive);
|
ASSERT_STATE(Inactive);
|
||||||
m_remoteMountsAllowed = toolChain->allowsRemoteMounts();
|
const QtVersion * const qtVersion = bc->qtVersion();
|
||||||
m_maddeRoot = toolChain->maddeRoot();
|
m_remoteMountsAllowed = MaemoGlobal::allowsRemoteMounts(qtVersion);
|
||||||
|
m_maddeRoot = MaemoGlobal::maddeRoot(qtVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRemoteMounter::addMountSpecification(const MaemoMountSpecification &mountSpec,
|
void MaemoRemoteMounter::addMountSpecification(const MaemoMountSpecification &mountSpec,
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ class SshRemoteProcess;
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
|
class Qt4BuildConfiguration;
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class MaemoToolChain;
|
|
||||||
class MaemoUsedPortsGatherer;
|
class MaemoUsedPortsGatherer;
|
||||||
|
|
||||||
class MaemoRemoteMounter : public QObject
|
class MaemoRemoteMounter : public QObject
|
||||||
@@ -68,7 +68,7 @@ public:
|
|||||||
// Must already be connected.
|
// Must already be connected.
|
||||||
void setConnection(const QSharedPointer<Core::SshConnection> &connection);
|
void setConnection(const QSharedPointer<Core::SshConnection> &connection);
|
||||||
|
|
||||||
void setToolchain(const MaemoToolChain *toolChain);
|
void setBuildConfiguration(const Qt4BuildConfiguration *bc);
|
||||||
void addMountSpecification(const MaemoMountSpecification &mountSpec,
|
void addMountSpecification(const MaemoMountSpecification &mountSpec,
|
||||||
bool mountAsRoot);
|
bool mountAsRoot);
|
||||||
bool hasValidMountSpecifications() const;
|
bool hasValidMountSpecifications() const;
|
||||||
|
|||||||
@@ -227,9 +227,7 @@ const MaemoToolChain *MaemoRunConfiguration::toolchain() const
|
|||||||
|
|
||||||
const QString MaemoRunConfiguration::gdbCmd() const
|
const QString MaemoRunConfiguration::gdbCmd() const
|
||||||
{
|
{
|
||||||
if (const MaemoToolChain *tc = toolchain())
|
return QDir::toNativeSeparators(targetRoot() + QLatin1String("/bin/gdb"));
|
||||||
return QDir::toNativeSeparators(tc->targetRoot() + QLatin1String("/bin/gdb"));
|
|
||||||
return QString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MaemoDeployStep *MaemoRunConfiguration::deployStep() const
|
MaemoDeployStep *MaemoRunConfiguration::deployStep() const
|
||||||
@@ -241,13 +239,6 @@ MaemoDeployStep *MaemoRunConfiguration::deployStep() const
|
|||||||
return step;
|
return step;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoRunConfiguration::maddeRoot() const
|
|
||||||
{
|
|
||||||
if (const MaemoToolChain *tc = toolchain())
|
|
||||||
return tc->maddeRoot();
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString MaemoRunConfiguration::sysRoot() const
|
const QString MaemoRunConfiguration::sysRoot() const
|
||||||
{
|
{
|
||||||
if (const MaemoToolChain *tc = toolchain())
|
if (const MaemoToolChain *tc = toolchain())
|
||||||
@@ -257,9 +248,8 @@ const QString MaemoRunConfiguration::sysRoot() const
|
|||||||
|
|
||||||
const QString MaemoRunConfiguration::targetRoot() const
|
const QString MaemoRunConfiguration::targetRoot() const
|
||||||
{
|
{
|
||||||
if (const MaemoToolChain *tc = toolchain())
|
QTC_ASSERT(activeQt4BuildConfiguration(), return QString());
|
||||||
return tc->targetRoot();
|
return MaemoGlobal::targetRoot(activeQt4BuildConfiguration()->qtVersion());
|
||||||
return QString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString MaemoRunConfiguration::arguments() const
|
const QString MaemoRunConfiguration::arguments() const
|
||||||
@@ -331,7 +321,8 @@ MaemoPortList MaemoRunConfiguration::freePorts() const
|
|||||||
|
|
||||||
bool MaemoRunConfiguration::useRemoteGdb() const
|
bool MaemoRunConfiguration::useRemoteGdb() const
|
||||||
{
|
{
|
||||||
return m_useRemoteGdb && toolchain()->allowsRemoteMounts();
|
return m_useRemoteGdb
|
||||||
|
&& MaemoGlobal::allowsRemoteMounts(activeQt4BuildConfiguration()->qtVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfiguration::setArguments(const QString &args)
|
void MaemoRunConfiguration::setArguments(const QString &args)
|
||||||
@@ -341,7 +332,7 @@ void MaemoRunConfiguration::setArguments(const QString &args)
|
|||||||
|
|
||||||
MaemoRunConfiguration::DebuggingType MaemoRunConfiguration::debuggingType() const
|
MaemoRunConfiguration::DebuggingType MaemoRunConfiguration::debuggingType() const
|
||||||
{
|
{
|
||||||
if (!toolchain() || !toolchain()->allowsQmlDebugging())
|
if (!MaemoGlobal::allowsQmlDebugging(activeQt4BuildConfiguration()->qtVersion()))
|
||||||
return DebugCppOnly;
|
return DebugCppOnly;
|
||||||
if (useCppDebugger()) {
|
if (useCppDebugger()) {
|
||||||
if (useQmlDebugger())
|
if (useQmlDebugger())
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ public:
|
|||||||
MaemoRemoteMountsModel *remoteMounts() const { return m_remoteMounts; }
|
MaemoRemoteMountsModel *remoteMounts() const { return m_remoteMounts; }
|
||||||
|
|
||||||
const MaemoToolChain *toolchain() const;
|
const MaemoToolChain *toolchain() const;
|
||||||
QString maddeRoot() const;
|
|
||||||
QString localExecutableFilePath() const;
|
QString localExecutableFilePath() const;
|
||||||
QString remoteExecutableFilePath() const;
|
QString remoteExecutableFilePath() const;
|
||||||
const QString sysRoot() const;
|
const QString sysRoot() const;
|
||||||
|
|||||||
@@ -39,10 +39,10 @@
|
|||||||
#include "maemodeviceconfiglistmodel.h"
|
#include "maemodeviceconfiglistmodel.h"
|
||||||
#include "maemodeviceenvreader.h"
|
#include "maemodeviceenvreader.h"
|
||||||
#include "maemomanager.h"
|
#include "maemomanager.h"
|
||||||
|
#include "maemoglobal.h"
|
||||||
#include "maemoremotemountsmodel.h"
|
#include "maemoremotemountsmodel.h"
|
||||||
#include "maemorunconfiguration.h"
|
#include "maemorunconfiguration.h"
|
||||||
#include "maemosettingspages.h"
|
#include "maemosettingspages.h"
|
||||||
#include "maemotoolchain.h"
|
|
||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
@@ -322,12 +322,16 @@ void MaemoRunConfigurationWidget::handleBuildConfigChanged()
|
|||||||
|
|
||||||
void MaemoRunConfigurationWidget::handleToolchainChanged()
|
void MaemoRunConfigurationWidget::handleToolchainChanged()
|
||||||
{
|
{
|
||||||
const MaemoToolChain * const toolChain = m_runConfiguration->toolchain();
|
const Qt4BuildConfiguration * const bc
|
||||||
if (toolChain) {
|
= m_runConfiguration->activeQt4BuildConfiguration();
|
||||||
const bool remoteMountsAvailable = toolChain->allowsRemoteMounts();
|
if (bc) {
|
||||||
|
const QtVersion * const qtVersion = bc->qtVersion();
|
||||||
|
const bool remoteMountsAvailable
|
||||||
|
= MaemoGlobal::allowsRemoteMounts(qtVersion);
|
||||||
m_debugDetailsContainer->setVisible(remoteMountsAvailable);
|
m_debugDetailsContainer->setVisible(remoteMountsAvailable);
|
||||||
m_mountDetailsContainer->setVisible(remoteMountsAvailable);
|
m_mountDetailsContainer->setVisible(remoteMountsAvailable);
|
||||||
const bool qmlDebuggingAvailable = toolChain->allowsQmlDebugging();
|
const bool qmlDebuggingAvailable
|
||||||
|
= MaemoGlobal::allowsQmlDebugging(qtVersion);
|
||||||
m_debuggingLanguagesLabel->setVisible(qmlDebuggingAvailable);
|
m_debuggingLanguagesLabel->setVisible(qmlDebuggingAvailable);
|
||||||
m_debugCppOnlyButton->setVisible(qmlDebuggingAvailable);
|
m_debugCppOnlyButton->setVisible(qmlDebuggingAvailable);
|
||||||
m_debugQmlOnlyButton->setVisible(qmlDebuggingAvailable);
|
m_debugQmlOnlyButton->setVisible(qmlDebuggingAvailable);
|
||||||
|
|||||||
@@ -36,10 +36,10 @@
|
|||||||
|
|
||||||
#include "maemoconstants.h"
|
#include "maemoconstants.h"
|
||||||
#include "maemodebugsupport.h"
|
#include "maemodebugsupport.h"
|
||||||
|
#include "maemoglobal.h"
|
||||||
#include "maemoremotemountsmodel.h"
|
#include "maemoremotemountsmodel.h"
|
||||||
#include "maemorunconfiguration.h"
|
#include "maemorunconfiguration.h"
|
||||||
#include "maemoruncontrol.h"
|
#include "maemoruncontrol.h"
|
||||||
#include "maemotoolchain.h"
|
|
||||||
|
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <debugger/debuggerconstants.h>
|
#include <debugger/debuggerconstants.h>
|
||||||
@@ -169,10 +169,13 @@ bool MaemoRunControlFactory::canRun(RunConfiguration *runConfiguration,
|
|||||||
return false;
|
return false;
|
||||||
const int freePortCount = maemoRunConfig->freePorts().count();
|
const int freePortCount = maemoRunConfig->freePorts().count();
|
||||||
|
|
||||||
if (maemoRunConfig->toolchain()->allowsRemoteMounts() && freePortCount == 0)
|
const QtVersion * const qtVersion
|
||||||
|
= maemoRunConfig->activeQt4BuildConfiguration()->qtVersion();
|
||||||
|
const bool remoteMountsAllowed = MaemoGlobal::allowsRemoteMounts(qtVersion);
|
||||||
|
if (remoteMountsAllowed && freePortCount == 0)
|
||||||
return false;
|
return false;
|
||||||
const int mountDirCount
|
const int mountDirCount
|
||||||
= maemoRunConfig->toolchain()->allowsRemoteMounts()
|
= remoteMountsAllowed
|
||||||
? maemoRunConfig->remoteMounts()->validMountSpecificationCount()
|
? maemoRunConfig->remoteMounts()->validMountSpecificationCount()
|
||||||
: 0;
|
: 0;
|
||||||
if (mode == Debugger::Constants::DEBUGMODE)
|
if (mode == Debugger::Constants::DEBUGMODE)
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ MaemoSshRunner::MaemoSshRunner(QObject *parent,
|
|||||||
m_state(Inactive)
|
m_state(Inactive)
|
||||||
{
|
{
|
||||||
m_connection = runConfig->deployStep()->sshConnection();
|
m_connection = runConfig->deployStep()->sshConnection();
|
||||||
m_mounter->setToolchain(runConfig->toolchain());
|
m_mounter->setBuildConfiguration(runConfig->activeQt4BuildConfiguration());
|
||||||
if (debugging && runConfig->useRemoteGdb()) {
|
if (debugging && runConfig->useRemoteGdb()) {
|
||||||
m_mountSpecs << MaemoMountSpecification(runConfig->localDirToMountForRemoteGdb(),
|
m_mountSpecs << MaemoMountSpecification(runConfig->localDirToMountForRemoteGdb(),
|
||||||
runConfig->remoteProjectSourcesMountPoint());
|
runConfig->remoteProjectSourcesMountPoint());
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
#include "maemodeploystep.h"
|
#include "maemodeploystep.h"
|
||||||
#include "maemoglobal.h"
|
#include "maemoglobal.h"
|
||||||
#include "maemopackagecreationstep.h"
|
#include "maemopackagecreationstep.h"
|
||||||
#include "maemotoolchain.h"
|
|
||||||
|
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
@@ -163,12 +162,6 @@ bool MaemoTemplatesManager::createDebianTemplatesIfNecessary(const ProjectExplor
|
|||||||
Q_ASSERT_X(qt4Target, Q_FUNC_INFO, "Target ID does not match actual type.");
|
Q_ASSERT_X(qt4Target, Q_FUNC_INFO, "Target ID does not match actual type.");
|
||||||
const Qt4BuildConfiguration * const bc
|
const Qt4BuildConfiguration * const bc
|
||||||
= qt4Target->activeBuildConfiguration();
|
= qt4Target->activeBuildConfiguration();
|
||||||
const MaemoToolChain * const tc
|
|
||||||
= dynamic_cast<MaemoToolChain *>(bc->toolChain());
|
|
||||||
if (!tc) {
|
|
||||||
qDebug("Maemo target has no Maemo toolchain.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!MaemoPackageCreationStep::preparePackagingProcess(&dh_makeProc, bc,
|
if (!MaemoPackageCreationStep::preparePackagingProcess(&dh_makeProc, bc,
|
||||||
projectDir.path() + QLatin1Char('/') + PackagingDirName, &error)) {
|
projectDir.path() + QLatin1Char('/') + PackagingDirName, &error)) {
|
||||||
raiseError(error);
|
raiseError(error);
|
||||||
@@ -182,7 +175,7 @@ bool MaemoTemplatesManager::createDebianTemplatesIfNecessary(const ProjectExplor
|
|||||||
const QString command = QLatin1String("dh_make -s -n -p ")
|
const QString command = QLatin1String("dh_make -s -n -p ")
|
||||||
+ MaemoPackageCreationStep::packageName(project) + QLatin1Char('_')
|
+ MaemoPackageCreationStep::packageName(project) + QLatin1Char('_')
|
||||||
+ MaemoPackageCreationStep::DefaultVersionNumber;
|
+ MaemoPackageCreationStep::DefaultVersionNumber;
|
||||||
dh_makeProc.start(MaemoPackageCreationStep::packagingCommand(tc, command));
|
dh_makeProc.start(MaemoPackageCreationStep::packagingCommand(bc, command));
|
||||||
if (!dh_makeProc.waitForStarted()) {
|
if (!dh_makeProc.waitForStarted()) {
|
||||||
raiseError(tr("Unable to create Debian templates: dh_make failed (%1)")
|
raiseError(tr("Unable to create Debian templates: dh_make failed (%1)")
|
||||||
.arg(dh_makeProc.errorString()));
|
.arg(dh_makeProc.errorString()));
|
||||||
|
|||||||
@@ -32,20 +32,23 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "maemotoolchain.h"
|
#include "maemotoolchain.h"
|
||||||
|
|
||||||
#include "maemoconstants.h"
|
#include "maemoconstants.h"
|
||||||
|
#include "maemoglobal.h"
|
||||||
|
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
#include <QtCore/QStringBuilder>
|
#include <QtCore/QStringBuilder>
|
||||||
#include <QtCore/QTextStream>
|
#include <QtCore/QTextStream>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace Qt4ProjectManager::Internal;
|
|
||||||
|
|
||||||
MaemoToolChain::MaemoToolChain(const QString &targetRoot)
|
namespace Qt4ProjectManager {
|
||||||
: GccToolChain(targetRoot % QLatin1String("/bin/gcc"))
|
namespace Internal {
|
||||||
, m_maddeInitialized(false)
|
|
||||||
|
MaemoToolChain::MaemoToolChain(const QtVersion *qtVersion)
|
||||||
|
: GccToolChain(MaemoGlobal::targetRoot(qtVersion) % QLatin1String("/bin/gcc"))
|
||||||
, m_sysrootInitialized(false)
|
, m_sysrootInitialized(false)
|
||||||
, m_targetRoot(targetRoot)
|
, m_qtVersion(qtVersion)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,19 +63,20 @@ ProjectExplorer::ToolChainType MaemoToolChain::type() const
|
|||||||
|
|
||||||
void MaemoToolChain::addToEnvironment(Utils::Environment &env)
|
void MaemoToolChain::addToEnvironment(Utils::Environment &env)
|
||||||
{
|
{
|
||||||
|
const QString maddeRoot = MaemoGlobal::maddeRoot(m_qtVersion);
|
||||||
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin")
|
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin")
|
||||||
.arg(maddeRoot())));
|
.arg(maddeRoot)));
|
||||||
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin")
|
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin")
|
||||||
.arg(targetRoot())));
|
.arg(MaemoGlobal::targetRoot(m_qtVersion))));
|
||||||
|
|
||||||
// put this into environment to make pkg-config stuff work
|
// put this into environment to make pkg-config stuff work
|
||||||
env.prependOrSet(QLatin1String("SYSROOT_DIR"), sysrootRoot());
|
env.prependOrSet(QLatin1String("SYSROOT_DIR"), sysrootRoot());
|
||||||
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madbin")
|
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madbin")
|
||||||
.arg(maddeRoot())));
|
.arg(maddeRoot)));
|
||||||
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madlib")
|
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madlib")
|
||||||
.arg(maddeRoot())));
|
.arg(maddeRoot)));
|
||||||
env.prependOrSet(QLatin1String("PERL5LIB"),
|
env.prependOrSet(QLatin1String("PERL5LIB"),
|
||||||
QDir::toNativeSeparators(QString("%1/madlib/perl5").arg(maddeRoot())));
|
QDir::toNativeSeparators(QString("%1/madlib/perl5").arg(maddeRoot)));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoToolChain::makeCommand() const
|
QString MaemoToolChain::makeCommand() const
|
||||||
@@ -83,31 +87,7 @@ QString MaemoToolChain::makeCommand() const
|
|||||||
bool MaemoToolChain::equals(const ToolChain *other) const
|
bool MaemoToolChain::equals(const ToolChain *other) const
|
||||||
{
|
{
|
||||||
const MaemoToolChain *toolChain = static_cast<const MaemoToolChain*> (other);
|
const MaemoToolChain *toolChain = static_cast<const MaemoToolChain*> (other);
|
||||||
return other->type() == type()
|
return other->type() == type() && toolChain->m_qtVersion == m_qtVersion;
|
||||||
&& toolChain->sysrootRoot() == sysrootRoot()
|
|
||||||
&& toolChain->targetRoot() == targetRoot();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString MaemoToolChain::maddeRoot() const
|
|
||||||
{
|
|
||||||
if (!m_maddeInitialized)
|
|
||||||
setMaddeRoot();
|
|
||||||
return m_maddeRoot;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString MaemoToolChain::madAdminCommand() const
|
|
||||||
{
|
|
||||||
return maddeRoot() + QLatin1String("/bin/mad-admin");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString MaemoToolChain::targetRoot() const
|
|
||||||
{
|
|
||||||
return m_targetRoot;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString MaemoToolChain::targetName() const
|
|
||||||
{
|
|
||||||
return QDir(targetRoot()).dirName();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoToolChain::sysrootRoot() const
|
QString MaemoToolChain::sysrootRoot() const
|
||||||
@@ -117,29 +97,10 @@ QString MaemoToolChain::sysrootRoot() const
|
|||||||
return m_sysrootRoot;
|
return m_sysrootRoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
MaemoToolChain::MaemoVersion MaemoToolChain::version() const
|
|
||||||
{
|
|
||||||
const QString &name = targetName();
|
|
||||||
if (name.startsWith(QLatin1String("fremantle")))
|
|
||||||
return Maemo5;
|
|
||||||
if (name.startsWith(QLatin1String("harmattan")))
|
|
||||||
return Maemo6;
|
|
||||||
qWarning("Unknown Maemo version!");
|
|
||||||
return static_cast<MaemoVersion>(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoToolChain::setMaddeRoot() const
|
|
||||||
{
|
|
||||||
QDir dir(targetRoot());
|
|
||||||
dir.cdUp(); dir.cdUp();
|
|
||||||
|
|
||||||
m_maddeInitialized = true;
|
|
||||||
m_maddeRoot = dir.absolutePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoToolChain::setSysroot() const
|
void MaemoToolChain::setSysroot() const
|
||||||
{
|
{
|
||||||
QFile file(QDir::cleanPath(targetRoot()) + QLatin1String("/information"));
|
QFile file(QDir::cleanPath(MaemoGlobal::targetRoot(m_qtVersion))
|
||||||
|
+ QLatin1String("/information"));
|
||||||
if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
QTextStream stream(&file);
|
QTextStream stream(&file);
|
||||||
while (!stream.atEnd()) {
|
while (!stream.atEnd()) {
|
||||||
@@ -148,11 +109,14 @@ void MaemoToolChain::setSysroot() const
|
|||||||
if (list.count() <= 1)
|
if (list.count() <= 1)
|
||||||
continue;
|
continue;
|
||||||
if (list.at(0) == QLatin1String("sysroot")) {
|
if (list.at(0) == QLatin1String("sysroot")) {
|
||||||
m_sysrootRoot = maddeRoot() + QLatin1String("/sysroots/")
|
m_sysrootRoot = MaemoGlobal::maddeRoot(m_qtVersion)
|
||||||
+ list.at(1);
|
+ QLatin1String("/sysroots/") + list.at(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sysrootInitialized = true;
|
m_sysrootInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -37,49 +37,34 @@
|
|||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
class QtVersion;
|
class QtVersion;
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class MaemoToolChain : public ProjectExplorer::GccToolChain
|
class MaemoToolChain : public ProjectExplorer::GccToolChain
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MaemoToolChain(const QString &targetRoot);
|
MaemoToolChain(const QtVersion *qtVersion);
|
||||||
virtual ~MaemoToolChain();
|
virtual ~MaemoToolChain();
|
||||||
|
|
||||||
void addToEnvironment(Utils::Environment &env);
|
void addToEnvironment(Utils::Environment &env);
|
||||||
ProjectExplorer::ToolChainType type() const;
|
ProjectExplorer::ToolChainType type() const;
|
||||||
QString makeCommand() const;
|
QString makeCommand() const;
|
||||||
|
|
||||||
QString maddeRoot() const;
|
|
||||||
QString targetRoot() const;
|
|
||||||
QString targetName() const;
|
|
||||||
QString sysrootRoot() const;
|
QString sysrootRoot() const;
|
||||||
QString madAdminCommand() const;
|
|
||||||
|
|
||||||
enum MaemoVersion { Maemo5, Maemo6 };
|
|
||||||
MaemoVersion version() const;
|
|
||||||
bool allowsRemoteMounts() const { return version() == Maemo5; }
|
|
||||||
bool allowsPackagingDisabling() const { return version() == Maemo5; }
|
|
||||||
bool allowsQmlDebugging() const { return version() == Maemo6; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool equals(const ToolChain *other) const;
|
bool equals(const ToolChain *other) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setMaddeRoot() const;
|
|
||||||
void setSysroot() const;
|
void setSysroot() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable QString m_maddeRoot;
|
|
||||||
mutable bool m_maddeInitialized;
|
|
||||||
|
|
||||||
mutable QString m_sysrootRoot;
|
mutable QString m_sysrootRoot;
|
||||||
mutable bool m_sysrootInitialized;
|
mutable bool m_sysrootInitialized;
|
||||||
|
const QtVersion * const m_qtVersion;
|
||||||
const QString m_targetRoot;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|
||||||
#endif // MAEMOTOOLCHAIN_H
|
#endif // MAEMOTOOLCHAIN_H
|
||||||
|
|||||||
Reference in New Issue
Block a user