Skip to content
Snippets Groups Projects
Commit 2be1f9c6 authored by ck's avatar ck
Browse files

Maemo: Preparation for deploying executable to arbitrary location.

Reviewed-by: kh1
parent 38673255
No related branches found
No related tags found
No related merge requests found
......@@ -32,8 +32,10 @@
#include "maemopackagecreationstep.h"
namespace {
const char * const MODIFIED_KEY =
"Qt4ProjectManager.BuildStep.MaemoPackage.Modified";
const char * const MODIFIED_KEY
= "Qt4ProjectManager.BuildStep.MaemoPackage.Modified";
const char * const REMOTE_EXE_KEY
= "Qt4ProjectManager.BuildStep.MaemoPackage.RemoteExe";
const char * const LOCAL_FILES_KEY
= "Qt4ProjectManager.BuildStep.MaemoPackage.LocalFiles";
const char * const REMOTE_FILES_KEY
......@@ -55,7 +57,7 @@ MaemoPackageContents::Deployable MaemoPackageContents::deployableAt(int row) con
Q_ASSERT(row >= 0 && row < rowCount());
return row == 0
? Deployable(m_packageStep->localExecutableFilePath(),
m_packageStep->remoteExecutableFilePath())
remoteExecutableFilePath())
: m_deployables.at(row - 1);
}
......@@ -112,6 +114,7 @@ QVariantMap MaemoPackageContents::toMap() const
{
QVariantMap map;
map.insert(MODIFIED_KEY, m_modified);
map.insert(REMOTE_EXE_KEY, remoteExecutableFilePath());
QStringList localFiles;
QStringList remoteFiles;
foreach (const Deployable &p, m_deployables) {
......@@ -126,6 +129,7 @@ QVariantMap MaemoPackageContents::toMap() const
void MaemoPackageContents::fromMap(const QVariantMap &map)
{
m_modified = map.value(MODIFIED_KEY).toBool();
m_remoteExecutableFilePath = map.value(REMOTE_EXE_KEY).toString();
const QStringList localFiles = map.value(LOCAL_FILES_KEY).toStringList();
const QStringList remoteFiles = map.value(REMOTE_FILES_KEY).toStringList();
if (localFiles.count() != remoteFiles.count())
......@@ -135,5 +139,14 @@ void MaemoPackageContents::fromMap(const QVariantMap &map)
m_deployables << Deployable(localFiles.at(i), remoteFiles.at(i));
}
QString MaemoPackageContents::remoteExecutableFilePath() const
{
if (m_remoteExecutableFilePath.isEmpty()) {
m_remoteExecutableFilePath = QLatin1String("/usr/local/bin/")
+ m_packageStep->executableFileName();
}
return m_remoteExecutableFilePath;
}
} // namespace Qt4ProjectManager
} // namespace Internal
......@@ -71,6 +71,7 @@ public:
void removeDeployableAt(int row);
bool isModified() const { return m_modified; }
void setUnModified() { m_modified = false; }
QString remoteExecutableFilePath() const;
private:
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
......@@ -86,6 +87,7 @@ private:
const MaemoPackageCreationStep * const m_packageStep;
QList<Deployable> m_deployables;
bool m_modified;
mutable QString m_remoteExecutableFilePath;
};
} // namespace Qt4ProjectManager
......
......@@ -302,11 +302,6 @@ QString MaemoPackageCreationStep::packageFilePath() const
% versionString() % QLatin1String("_armel.deb");
}
QString MaemoPackageCreationStep::remoteExecutableFilePath() const
{
return QLatin1String("/usr/local/bin/") % executableFileName();
}
QString MaemoPackageCreationStep::versionString() const
{
return QLatin1String("_0.1");
......
......@@ -64,8 +64,8 @@ public:
MaemoPackageCreationStep(ProjectExplorer::BuildConfiguration *buildConfig);
QString packageFilePath() const;
QString remoteExecutableFilePath() const;
QString localExecutableFilePath() const;
QString executableFileName() const;
MaemoPackageContents *packageContents() const { return m_packageContents; }
private:
......@@ -83,7 +83,6 @@ private:
bool runCommand(QProcess &proc, const QString &command);
const Qt4BuildConfiguration *qt4BuildConfiguration() const;
const MaemoToolChain *maemoToolChain() const;
QString executableFileName() const;
QString maddeRoot() const;
QString targetRoot() const;
QString nativePath(const QFile &file) const;
......
......@@ -34,6 +34,7 @@
#include "maemoruncontrol.h"
#include "maemopackagecontents.h"
#include "maemopackagecreationstep.h"
#include "maemosshthread.h"
#include "maemorunconfiguration.h"
......@@ -199,7 +200,7 @@ QString AbstractMaemoRunControl::packageFilePath() const
QString AbstractMaemoRunControl::executableFilePathOnTarget() const
{
return m_runConfig->packageStep()->remoteExecutableFilePath();
return m_runConfig->packageStep()->packageContents()->remoteExecutableFilePath();
}
bool AbstractMaemoRunControl::isCleaning() const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment