Maemo: Fix ProFileOption settings, write INSTALLS in maemo scope.

Task-number: QTCREATORBUG-1951
Reviewed-by: kh1
This commit is contained in:
ck
2010-07-27 17:27:04 +02:00
parent 3bc473c0c2
commit 11d0951924
7 changed files with 44 additions and 20 deletions

View File

@@ -34,17 +34,18 @@
#include <qt4projectmanager/qt4nodes.h>
#include <QtCore/QCryptographicHash>
#include <QtCore/QFile>
#include <QtCore/QFileInfo>
namespace Qt4ProjectManager {
namespace Internal {
MaemoDeployableListModel::MaemoDeployableListModel(const Qt4ProFileNode *proFileNode,
const QString &qConfigFile, QObject *parent)
const QSharedPointer<ProFileOption> &proFileOption, QObject *parent)
: QAbstractTableModel(parent),
m_proFileNode(proFileNode),
m_modified(false),
m_proFileWrapper(new ProFileWrapper(m_proFileNode->path(), qConfigFile))
m_proFileWrapper(new ProFileWrapper(m_proFileNode->path(), proFileOption))
{
buildModel();
}
@@ -62,8 +63,18 @@ bool MaemoDeployableListModel::buildModel()
: QLatin1String("/usr/local/bin");
m_deployables.prepend(MaemoDeployable(localExecutableFilePath(),
remoteDir));
if (!m_proFileWrapper->addInstallsTarget(remoteDir))
QFile projectFile(m_proFileNode->path());
if (!projectFile.open(QIODevice::WriteOnly | QIODevice::Append)) {
qWarning("Error updating .pro file.");
return false;
}
QString installsString
= QLatin1String("maemo5|maemo6 {\n target.path = ")
+ remoteDir + QLatin1String("\n INSTALLS += target\n}\n");
if (!projectFile.write(installsString.toLocal8Bit())) {
qWarning("Error updating .pro file.");
return false;
}
} else {
m_deployables.prepend(MaemoDeployable(localExecutableFilePath(),
installs.targetPath));