Maemo: Rename some classes.

All our classes should have the Maemo prefix because we don't have
a namespace of our own.
This commit is contained in:
ck
2010-07-28 09:36:30 +02:00
parent 8abed8a0ee
commit 5ff0d9b72f
16 changed files with 112 additions and 111 deletions

View File

@@ -29,7 +29,7 @@
#include "maemodeployablelistmodel.h" #include "maemodeployablelistmodel.h"
#include "profilewrapper.h" #include "maemoprofilewrapper.h"
#include <qt4projectmanager/qt4nodes.h> #include <qt4projectmanager/qt4nodes.h>
@@ -45,7 +45,7 @@ MaemoDeployableListModel::MaemoDeployableListModel(const Qt4ProFileNode *proFile
: QAbstractTableModel(parent), : QAbstractTableModel(parent),
m_proFileNode(proFileNode), m_proFileNode(proFileNode),
m_modified(false), m_modified(false),
m_proFileWrapper(new ProFileWrapper(m_proFileNode->path(), proFileOption)) m_proFileWrapper(new MaemoProFileWrapper(m_proFileNode->path(), proFileOption))
{ {
buildModel(); buildModel();
} }
@@ -56,7 +56,7 @@ bool MaemoDeployableListModel::buildModel()
{ {
m_deployables.clear(); m_deployables.clear();
const ProFileWrapper::InstallsList &installs = m_proFileWrapper->installs(); const MaemoProFileWrapper::InstallsList &installs = m_proFileWrapper->installs();
if (installs.targetPath.isEmpty()) { if (installs.targetPath.isEmpty()) {
const QString remoteDir = m_proFileNode->projectType() == LibraryTemplate const QString remoteDir = m_proFileNode->projectType() == LibraryTemplate
? QLatin1String("/usr/local/lib") ? QLatin1String("/usr/local/lib")
@@ -79,7 +79,7 @@ bool MaemoDeployableListModel::buildModel()
m_deployables.prepend(MaemoDeployable(localExecutableFilePath(), m_deployables.prepend(MaemoDeployable(localExecutableFilePath(),
installs.targetPath)); installs.targetPath));
} }
foreach (const ProFileWrapper::InstallsElem &elem, installs.normalElems) { foreach (const MaemoProFileWrapper::InstallsElem &elem, installs.normalElems) {
foreach (const QString &file, elem.files) { foreach (const QString &file, elem.files) {
m_deployables << MaemoDeployable(m_proFileWrapper->absFilePath(file), m_deployables << MaemoDeployable(m_proFileWrapper->absFilePath(file),
elem.path); elem.path);

View File

@@ -45,7 +45,7 @@ QT_END_NAMESPACE
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
namespace Internal { namespace Internal {
class ProFileWrapper; class MaemoProFileWrapper;
class Qt4ProFileNode; class Qt4ProFileNode;
class MaemoDeployableListModel : public QAbstractTableModel class MaemoDeployableListModel : public QAbstractTableModel
@@ -83,7 +83,7 @@ private:
const Qt4ProFileNode * const m_proFileNode; const Qt4ProFileNode * const m_proFileNode;
QList<MaemoDeployable> m_deployables; QList<MaemoDeployable> m_deployables;
mutable bool m_modified; mutable bool m_modified;
const QScopedPointer<ProFileWrapper> m_proFileWrapper; const QScopedPointer<MaemoProFileWrapper> m_proFileWrapper;
}; };
} // namespace Qt4ProjectManager } // namespace Qt4ProjectManager

View File

@@ -32,7 +32,8 @@
** **
****************************************************************************/ ****************************************************************************/
#include "deviceenvreader.h" #include "maemodeviceenvreader.h"
#include "maemorunconfiguration.h" #include "maemorunconfiguration.h"
#include <coreplugin/ssh/sshconnection.h> #include <coreplugin/ssh/sshconnection.h>
@@ -41,7 +42,7 @@
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
namespace Internal { namespace Internal {
DeviceEnvReader::DeviceEnvReader(QObject *parent, MaemoRunConfiguration *config) MaemoDeviceEnvReader::MaemoDeviceEnvReader(QObject *parent, MaemoRunConfiguration *config)
: QObject(parent) : QObject(parent)
, m_stop(false) , m_stop(false)
, m_runConfig(config) , m_runConfig(config)
@@ -49,11 +50,11 @@ DeviceEnvReader::DeviceEnvReader(QObject *parent, MaemoRunConfiguration *config)
{ {
} }
DeviceEnvReader::~DeviceEnvReader() MaemoDeviceEnvReader::~MaemoDeviceEnvReader()
{ {
} }
void DeviceEnvReader::start() void MaemoDeviceEnvReader::start()
{ {
m_stop = false; m_stop = false;
if (m_connection) if (m_connection)
@@ -77,7 +78,7 @@ void DeviceEnvReader::start()
m_connection->connectToHost(m_devConfig.server); m_connection->connectToHost(m_devConfig.server);
} }
void DeviceEnvReader::stop() void MaemoDeviceEnvReader::stop()
{ {
m_stop = true; m_stop = true;
disconnect(m_connection.data(), 0, this, 0); disconnect(m_connection.data(), 0, this, 0);
@@ -88,7 +89,7 @@ void DeviceEnvReader::stop()
} }
} }
void DeviceEnvReader::setEnvironment() void MaemoDeviceEnvReader::setEnvironment()
{ {
if (m_remoteOutput.isEmpty() && !m_runConfig.isNull()) if (m_remoteOutput.isEmpty() && !m_runConfig.isNull())
return; return;
@@ -96,7 +97,7 @@ void DeviceEnvReader::setEnvironment()
QString::SkipEmptyParts)); QString::SkipEmptyParts));
} }
void DeviceEnvReader::executeRemoteCall() void MaemoDeviceEnvReader::executeRemoteCall()
{ {
if (m_stop) if (m_stop)
return; return;
@@ -115,14 +116,14 @@ void DeviceEnvReader::executeRemoteCall()
m_remoteProcess->start(); m_remoteProcess->start();
} }
void DeviceEnvReader::handleConnectionFailure() void MaemoDeviceEnvReader::handleConnectionFailure()
{ {
emit error(tr("Could not connect to host: %1") emit error(tr("Could not connect to host: %1")
.arg(m_connection->errorString())); .arg(m_connection->errorString()));
emit finished(); emit finished();
} }
void DeviceEnvReader::remoteProcessFinished(int exitCode) void MaemoDeviceEnvReader::remoteProcessFinished(int exitCode)
{ {
Q_ASSERT(exitCode == Core::SshRemoteProcess::FailedToStart Q_ASSERT(exitCode == Core::SshRemoteProcess::FailedToStart
|| exitCode == Core::SshRemoteProcess::KilledBySignal || exitCode == Core::SshRemoteProcess::KilledBySignal
@@ -140,12 +141,12 @@ void DeviceEnvReader::remoteProcessFinished(int exitCode)
emit finished(); emit finished();
} }
void DeviceEnvReader::remoteOutput(const QByteArray &data) void MaemoDeviceEnvReader::remoteOutput(const QByteArray &data)
{ {
m_remoteOutput.append(QString::fromUtf8(data)); m_remoteOutput.append(QString::fromUtf8(data));
} }
void DeviceEnvReader::remoteErrorOutput(const QByteArray &data) void MaemoDeviceEnvReader::remoteErrorOutput(const QByteArray &data)
{ {
emit error(data); emit error(data);
} }

View File

@@ -35,12 +35,13 @@
#ifndef DEVICEENVREADER_H #ifndef DEVICEENVREADER_H
#define DEVICEENVREADER_H #define DEVICEENVREADER_H
#include "maemodeviceconfigurations.h"
#include <projectexplorer/environment.h>
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QPointer> #include <QtCore/QPointer>
#include "maemodeviceconfigurations.h"
#include <projectexplorer/environment.h>
namespace Core { namespace Core {
class SshConnection; class SshConnection;
class SshRemoteProcess; class SshRemoteProcess;
@@ -51,12 +52,12 @@ namespace Qt4ProjectManager {
class MaemoRunConfiguration; class MaemoRunConfiguration;
class DeviceEnvReader : public QObject class MaemoDeviceEnvReader : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
DeviceEnvReader(QObject *parent, MaemoRunConfiguration *config); MaemoDeviceEnvReader(QObject *parent, MaemoRunConfiguration *config);
~DeviceEnvReader(); ~MaemoDeviceEnvReader();
void start(); void start();
void stop(); void stop();
@@ -82,9 +83,8 @@ private:
bool m_stop; bool m_stop;
QString m_remoteOutput; QString m_remoteOutput;
ProjectExplorer::Environment m_env; ProjectExplorer::Environment m_env;
MaemoDeviceConfig m_devConfig;
QPointer<MaemoRunConfiguration> m_runConfig; QPointer<MaemoRunConfiguration> m_runConfig;
MaemoDeviceConfig m_devConfig;
QSharedPointer<Core::SshConnection> m_connection; QSharedPointer<Core::SshConnection> m_connection;
QSharedPointer<Core::SshRemoteProcess> m_remoteProcess; QSharedPointer<Core::SshRemoteProcess> m_remoteProcess;
}; };

View File

@@ -33,10 +33,10 @@
#include "maemodeploystepfactory.h" #include "maemodeploystepfactory.h"
#include "maemodeviceconfigurations.h" #include "maemodeviceconfigurations.h"
#include "maemopackagecreationfactory.h" #include "maemopackagecreationfactory.h"
#include "maemoqemumanager.h"
#include "maemorunfactories.h" #include "maemorunfactories.h"
#include "maemosettingspage.h" #include "maemosettingspage.h"
#include "maemotoolchain.h" #include "maemotoolchain.h"
#include "qemuruntimemanager.h"
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <qt4projectmanager/qtversionmanager.h> #include <qt4projectmanager/qtversionmanager.h>
@@ -64,7 +64,7 @@ MaemoManager::MaemoManager()
Q_ASSERT(!m_instance); Q_ASSERT(!m_instance);
m_instance = this; m_instance = this;
QemuRuntimeManager::instance(this); MaemoQemuManager::instance(this);
MaemoDeviceConfigurations::instance(this); MaemoDeviceConfigurations::instance(this);
PluginManager *pluginManager = PluginManager::instance(); PluginManager *pluginManager = PluginManager::instance();

View File

@@ -46,7 +46,7 @@ class MaemoPackageCreationFactory;
class MaemoRunControlFactory; class MaemoRunControlFactory;
class MaemoRunConfigurationFactory; class MaemoRunConfigurationFactory;
class MaemoSettingsPage; class MaemoSettingsPage;
class QemuRuntimeManager; class MaemoQemuManager;
class MaemoManager : public QObject class MaemoManager : public QObject
{ {
@@ -70,7 +70,7 @@ private:
MaemoPackageCreationFactory *m_packageCreationFactory; MaemoPackageCreationFactory *m_packageCreationFactory;
MaemoDeployStepFactory *m_deployStepFactory; MaemoDeployStepFactory *m_deployStepFactory;
MaemoSettingsPage *m_settingsPage; MaemoSettingsPage *m_settingsPage;
QemuRuntimeManager *m_qemuRuntimeManager; MaemoQemuManager *m_qemuRuntimeManager;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -42,12 +42,12 @@
#include "maemopackagecreationstep.h" #include "maemopackagecreationstep.h"
#include "maemoconstants.h" #include "maemoconstants.h"
#include "maemoglobal.h"
#include "maemopackagecreationwidget.h"
#include "maemodeployables.h" #include "maemodeployables.h"
#include "maemodeploystep.h" #include "maemodeploystep.h"
#include "maemoglobal.h"
#include "maemopackagecreationwidget.h"
#include "maemoprofilewrapper.h"
#include "maemotoolchain.h" #include "maemotoolchain.h"
#include "profilewrapper.h"
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <qt4buildconfiguration.h> #include <qt4buildconfiguration.h>

View File

@@ -56,7 +56,7 @@ namespace Internal {
class MaemoDeployStep; class MaemoDeployStep;
class MaemoToolChain; class MaemoToolChain;
class ProFileWrapper; class MaemoProFileWrapper;
class Qt4BuildConfiguration; class Qt4BuildConfiguration;
class MaemoPackageCreationStep : public ProjectExplorer::BuildStep class MaemoPackageCreationStep : public ProjectExplorer::BuildStep

View File

@@ -1,4 +1,4 @@
#include "profilewrapper.h" #include "maemoprofilewrapper.h"
#include <prowriter.h> #include <prowriter.h>
#include <qt4projectmanager/profilereader.h> #include <qt4projectmanager/profilereader.h>
@@ -26,7 +26,7 @@ namespace {
} }
ProFileWrapper::ProFileWrapper(const QString &proFileName, MaemoProFileWrapper::MaemoProFileWrapper(const QString &proFileName,
const QSharedPointer<ProFileOption> &proFileOption) const QSharedPointer<ProFileOption> &proFileOption)
: m_proFileName(proFileName), m_proDir(QFileInfo(m_proFileName).dir()), : m_proFileName(proFileName), m_proDir(QFileInfo(m_proFileName).dir()),
m_proFileOption(proFileOption) m_proFileOption(proFileOption)
@@ -34,14 +34,14 @@ ProFileWrapper::ProFileWrapper(const QString &proFileName,
parseProFile(ParseFromFile); parseProFile(ParseFromFile);
} }
ProFileWrapper::~ProFileWrapper() {} MaemoProFileWrapper::~MaemoProFileWrapper() {}
void ProFileWrapper::reload() void MaemoProFileWrapper::reload()
{ {
parseProFile(ParseFromFile); parseProFile(ParseFromFile);
} }
ProFileWrapper::InstallsList ProFileWrapper::installs() const MaemoProFileWrapper::InstallsList MaemoProFileWrapper::installs() const
{ {
InstallsList list; InstallsList list;
@@ -75,7 +75,7 @@ ProFileWrapper::InstallsList ProFileWrapper::installs() const
return list; return list;
} }
bool ProFileWrapper::addInstallsElem(const QString &path, bool MaemoProFileWrapper::addInstallsElem(const QString &path,
const QString &absFilePath, const QString &var) const QString &absFilePath, const QString &var)
{ {
QString varName = var; QString varName = var;
@@ -92,12 +92,12 @@ bool ProFileWrapper::addInstallsElem(const QString &path,
&& addVarValue(InstallsVar, varName); && addVarValue(InstallsVar, varName);
} }
bool ProFileWrapper::addInstallsTarget(const QString &path) bool MaemoProFileWrapper::addInstallsTarget(const QString &path)
{ {
return addInstallsElem(path, QString(), TargetVar); return addInstallsElem(path, QString(), TargetVar);
} }
bool ProFileWrapper::removeInstallsElem(const QString &path, bool MaemoProFileWrapper::removeInstallsElem(const QString &path,
const QString &file) const QString &file)
{ {
const InstallsElem &elem = findInstallsElem(path, file); const InstallsElem &elem = findInstallsElem(path, file);
@@ -116,7 +116,7 @@ bool ProFileWrapper::removeInstallsElem(const QString &path,
return true; return true;
} }
bool ProFileWrapper::replaceInstallPath(const QString &oldPath, bool MaemoProFileWrapper::replaceInstallPath(const QString &oldPath,
const QString &file, const QString &newPath) const QString &file, const QString &newPath)
{ {
const InstallsElem &elem = findInstallsElem(oldPath, file); const InstallsElem &elem = findInstallsElem(oldPath, file);
@@ -134,12 +134,12 @@ bool ProFileWrapper::replaceInstallPath(const QString &oldPath,
return addInstallsElem(newPath, file); return addInstallsElem(newPath, file);
} }
QStringList ProFileWrapper::varValues(const QString &var) const QStringList MaemoProFileWrapper::varValues(const QString &var) const
{ {
return m_proFileReader->values(var, m_proFile); return m_proFileReader->values(var, m_proFile);
} }
bool ProFileWrapper::addVarValue(const QString &var, const QString &value) bool MaemoProFileWrapper::addVarValue(const QString &var, const QString &value)
{ {
if (varValues(var).contains(value)) if (varValues(var).contains(value))
return true; return true;
@@ -152,7 +152,7 @@ bool ProFileWrapper::addVarValue(const QString &var, const QString &value)
return writeProFileContents(); return writeProFileContents();
} }
bool ProFileWrapper::addFile(const QString &var, const QString &absFilePath) bool MaemoProFileWrapper::addFile(const QString &var, const QString &absFilePath)
{ {
if (!readProFileContents()) if (!readProFileContents())
return false; return false;
@@ -162,7 +162,7 @@ bool ProFileWrapper::addFile(const QString &var, const QString &absFilePath)
return writeProFileContents(); return writeProFileContents();
} }
bool ProFileWrapper::removeVarValue(const QString &var, const QString &value) bool MaemoProFileWrapper::removeVarValue(const QString &var, const QString &value)
{ {
if (!readProFileContents()) if (!readProFileContents())
return false; return false;
@@ -178,7 +178,7 @@ bool ProFileWrapper::removeVarValue(const QString &var, const QString &value)
} }
} }
bool ProFileWrapper::removeFile(const QString &var, const QString &absFilePath) bool MaemoProFileWrapper::removeFile(const QString &var, const QString &absFilePath)
{ {
if (!readProFileContents()) if (!readProFileContents())
return false; return false;
@@ -193,7 +193,7 @@ bool ProFileWrapper::removeFile(const QString &var, const QString &absFilePath)
} }
} }
bool ProFileWrapper::replaceVarValue(const QString &var, bool MaemoProFileWrapper::replaceVarValue(const QString &var,
const QString &oldValue, const QString &newValue) const QString &oldValue, const QString &newValue)
{ {
if (!readProFileContents()) if (!readProFileContents())
@@ -211,7 +211,7 @@ bool ProFileWrapper::replaceVarValue(const QString &var,
return writeProFileContents(); return writeProFileContents();
} }
QString ProFileWrapper::absFilePath(const QString &relFilePath) const QString MaemoProFileWrapper::absFilePath(const QString &relFilePath) const
{ {
// I'd rather use QDir::cleanPath(), but that doesn't work well // I'd rather use QDir::cleanPath(), but that doesn't work well
// enough for redundant ".." dirs. // enough for redundant ".." dirs.
@@ -221,7 +221,7 @@ QString ProFileWrapper::absFilePath(const QString &relFilePath) const
.canonicalFilePath(); .canonicalFilePath();
} }
void ProFileWrapper::parseProFile(ParseType type) const void MaemoProFileWrapper::parseProFile(ParseType type) const
{ {
m_proFileReader.reset(new ProFileReader(m_proFileOption.data())); m_proFileReader.reset(new ProFileReader(m_proFileOption.data()));
m_proFileReader->setCumulative(false); m_proFileReader->setCumulative(false);
@@ -244,7 +244,7 @@ void ProFileWrapper::parseProFile(ParseType type) const
m_proFile->deref(); m_proFile->deref();
} }
bool ProFileWrapper::writeProFileContents() bool MaemoProFileWrapper::writeProFileContents()
{ {
QFile proFileOnDisk(m_proFileName); QFile proFileOnDisk(m_proFileName);
if (!proFileOnDisk.open(QIODevice::WriteOnly)) { if (!proFileOnDisk.open(QIODevice::WriteOnly)) {
@@ -262,7 +262,7 @@ bool ProFileWrapper::writeProFileContents()
return true; return true;
} }
bool ProFileWrapper::readProFileContents() bool MaemoProFileWrapper::readProFileContents()
{ {
if (!m_proFileContents.isEmpty()) if (!m_proFileContents.isEmpty())
return true; return true;
@@ -278,7 +278,7 @@ bool ProFileWrapper::readProFileContents()
return true; return true;
} }
ProFileWrapper::InstallsElem ProFileWrapper::findInstallsElem(const QString &path, MaemoProFileWrapper::InstallsElem MaemoProFileWrapper::findInstallsElem(const QString &path,
const QString &file) const const QString &file) const
{ {
const QStringList &elems = varValues(InstallsVar); const QStringList &elems = varValues(InstallsVar);

View File

@@ -16,12 +16,12 @@ namespace Qt4ProjectManager {
namespace Internal { namespace Internal {
class ProFileReader; class ProFileReader;
class ProFileWrapper class MaemoProFileWrapper
{ {
public: public:
ProFileWrapper(const QString &proFileName, MaemoProFileWrapper(const QString &proFileName,
const QSharedPointer<ProFileOption> &proFileOption); const QSharedPointer<ProFileOption> &proFileOption);
~ProFileWrapper(); ~MaemoProFileWrapper();
void reload(); void reload();

View File

@@ -27,7 +27,7 @@
** **
**************************************************************************/ **************************************************************************/
#include "qemuruntimemanager.h" #include "maemoqemumanager.h"
#include "maemorunconfiguration.h" #include "maemorunconfiguration.h"
#include "maemotoolchain.h" #include "maemotoolchain.h"
@@ -58,12 +58,12 @@ using namespace ProjectExplorer;
using namespace Qt4ProjectManager; using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager::Internal;
QemuRuntimeManager *QemuRuntimeManager::m_instance = 0; MaemoQemuManager *MaemoQemuManager::m_instance = 0;
const QSize iconSize = QSize(24, 20); const QSize iconSize = QSize(24, 20);
const QLatin1String binQmake("/bin/qmake" EXEC_SUFFIX); const QLatin1String binQmake("/bin/qmake" EXEC_SUFFIX);
QemuRuntimeManager::QemuRuntimeManager(QObject *parent) MaemoQemuManager::MaemoQemuManager(QObject *parent)
: QObject(parent) : QObject(parent)
, m_qemuAction(0) , m_qemuAction(0)
, m_qemuProcess(new QProcess(this)) , m_qemuProcess(new QProcess(this))
@@ -117,20 +117,20 @@ QemuRuntimeManager::QemuRuntimeManager(QObject *parent)
this, SLOT(qemuStatusChanged(QemuStatus, QString))); this, SLOT(qemuStatusChanged(QemuStatus, QString)));
} }
QemuRuntimeManager::~QemuRuntimeManager() MaemoQemuManager::~MaemoQemuManager()
{ {
terminateRuntime(); terminateRuntime();
m_instance = 0; m_instance = 0;
} }
QemuRuntimeManager &QemuRuntimeManager::instance(QObject *parent) MaemoQemuManager &MaemoQemuManager::instance(QObject *parent)
{ {
if (m_instance == 0) if (m_instance == 0)
m_instance = new QemuRuntimeManager(parent); m_instance = new MaemoQemuManager(parent);
return *m_instance; return *m_instance;
} }
bool QemuRuntimeManager::runtimeForQtVersion(int uniqueId, Runtime *rt) const bool MaemoQemuManager::runtimeForQtVersion(int uniqueId, Runtime *rt) const
{ {
bool found = m_runtimes.contains(uniqueId); bool found = m_runtimes.contains(uniqueId);
if (found) if (found)
@@ -138,7 +138,7 @@ bool QemuRuntimeManager::runtimeForQtVersion(int uniqueId, Runtime *rt) const
return found; return found;
} }
void QemuRuntimeManager::qtVersionsChanged(const QList<int> &uniqueIds) void MaemoQemuManager::qtVersionsChanged(const QList<int> &uniqueIds)
{ {
if (m_needsSetup) if (m_needsSetup)
setupRuntimes(); setupRuntimes();
@@ -172,7 +172,7 @@ void QemuRuntimeManager::qtVersionsChanged(const QList<int> &uniqueIds)
m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget()); m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget());
} }
void QemuRuntimeManager::projectAdded(ProjectExplorer::Project *project) void MaemoQemuManager::projectAdded(ProjectExplorer::Project *project)
{ {
// handle all target related changes, add, remove, etc... // handle all target related changes, add, remove, etc...
connect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)), this, connect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)), this,
@@ -187,7 +187,7 @@ void QemuRuntimeManager::projectAdded(ProjectExplorer::Project *project)
m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget()); m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget());
} }
void QemuRuntimeManager::projectRemoved(ProjectExplorer::Project *project) void MaemoQemuManager::projectRemoved(ProjectExplorer::Project *project)
{ {
disconnect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)), this, disconnect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)), this,
SLOT(targetAdded(ProjectExplorer::Target*))); SLOT(targetAdded(ProjectExplorer::Target*)));
@@ -201,7 +201,7 @@ void QemuRuntimeManager::projectRemoved(ProjectExplorer::Project *project)
m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget()); m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget());
} }
void QemuRuntimeManager::projectChanged(ProjectExplorer::Project *project) void MaemoQemuManager::projectChanged(ProjectExplorer::Project *project)
{ {
if (project) { if (project) {
toggleStarterButton(project->activeTarget()); toggleStarterButton(project->activeTarget());
@@ -214,7 +214,7 @@ bool targetIsMaemo(const QString &id)
return id == QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID); return id == QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID);
} }
void QemuRuntimeManager::targetAdded(ProjectExplorer::Target *target) void MaemoQemuManager::targetAdded(ProjectExplorer::Target *target)
{ {
if (!target || !targetIsMaemo(target->id())) if (!target || !targetIsMaemo(target->id()))
return; return;
@@ -243,7 +243,7 @@ void QemuRuntimeManager::targetAdded(ProjectExplorer::Target *target)
m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget()); m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget());
} }
void QemuRuntimeManager::targetRemoved(ProjectExplorer::Target *target) void MaemoQemuManager::targetRemoved(ProjectExplorer::Target *target)
{ {
if (!target || !targetIsMaemo(target->id())) if (!target || !targetIsMaemo(target->id()))
return; return;
@@ -269,7 +269,7 @@ void QemuRuntimeManager::targetRemoved(ProjectExplorer::Target *target)
m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget()); m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget());
} }
void QemuRuntimeManager::targetChanged(ProjectExplorer::Target *target) void MaemoQemuManager::targetChanged(ProjectExplorer::Target *target)
{ {
if (target) { if (target) {
toggleStarterButton(target); toggleStarterButton(target);
@@ -277,27 +277,27 @@ void QemuRuntimeManager::targetChanged(ProjectExplorer::Target *target)
} }
} }
void QemuRuntimeManager::runConfigurationAdded(ProjectExplorer::RunConfiguration *rc) void MaemoQemuManager::runConfigurationAdded(ProjectExplorer::RunConfiguration *rc)
{ {
if (!rc || !targetIsMaemo(rc->target()->id())) if (!rc || !targetIsMaemo(rc->target()->id()))
return; return;
toggleDeviceConnections(qobject_cast<MaemoRunConfiguration*> (rc), true); toggleDeviceConnections(qobject_cast<MaemoRunConfiguration*> (rc), true);
} }
void QemuRuntimeManager::runConfigurationRemoved(ProjectExplorer::RunConfiguration *rc) void MaemoQemuManager::runConfigurationRemoved(ProjectExplorer::RunConfiguration *rc)
{ {
if (!rc || rc->target()->id() != QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID)) if (!rc || rc->target()->id() != QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID))
return; return;
toggleDeviceConnections(qobject_cast<MaemoRunConfiguration*> (rc), false); toggleDeviceConnections(qobject_cast<MaemoRunConfiguration*> (rc), false);
} }
void QemuRuntimeManager::runConfigurationChanged(ProjectExplorer::RunConfiguration *rc) void MaemoQemuManager::runConfigurationChanged(ProjectExplorer::RunConfiguration *rc)
{ {
if (rc) if (rc)
m_qemuAction->setEnabled(targetUsesMatchingRuntimeConfig(rc->target())); m_qemuAction->setEnabled(targetUsesMatchingRuntimeConfig(rc->target()));
} }
void QemuRuntimeManager::buildConfigurationAdded(ProjectExplorer::BuildConfiguration *bc) void MaemoQemuManager::buildConfigurationAdded(ProjectExplorer::BuildConfiguration *bc)
{ {
if (!bc || !targetIsMaemo(bc->target()->id())) if (!bc || !targetIsMaemo(bc->target()->id()))
return; return;
@@ -305,7 +305,7 @@ void QemuRuntimeManager::buildConfigurationAdded(ProjectExplorer::BuildConfigura
connect(bc, SIGNAL(environmentChanged()), this, SLOT(environmentChanged())); connect(bc, SIGNAL(environmentChanged()), this, SLOT(environmentChanged()));
} }
void QemuRuntimeManager::buildConfigurationRemoved(ProjectExplorer::BuildConfiguration *bc) void MaemoQemuManager::buildConfigurationRemoved(ProjectExplorer::BuildConfiguration *bc)
{ {
if (!bc || !targetIsMaemo(bc->target()->id())) if (!bc || !targetIsMaemo(bc->target()->id()))
return; return;
@@ -313,13 +313,13 @@ void QemuRuntimeManager::buildConfigurationRemoved(ProjectExplorer::BuildConfigu
disconnect(bc, SIGNAL(environmentChanged()), this, SLOT(environmentChanged())); disconnect(bc, SIGNAL(environmentChanged()), this, SLOT(environmentChanged()));
} }
void QemuRuntimeManager::buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc) void MaemoQemuManager::buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc)
{ {
if (bc) if (bc)
toggleStarterButton(bc->target()); toggleStarterButton(bc->target());
} }
void QemuRuntimeManager::environmentChanged() void MaemoQemuManager::environmentChanged()
{ {
// likely to happen when the qt version changes the build config is using // likely to happen when the qt version changes the build config is using
if (ProjectExplorerPlugin *explorer = ProjectExplorerPlugin::instance()) { if (ProjectExplorerPlugin *explorer = ProjectExplorerPlugin::instance()) {
@@ -328,12 +328,12 @@ void QemuRuntimeManager::environmentChanged()
} }
} }
void QemuRuntimeManager::deviceConfigurationChanged(ProjectExplorer::Target *target) void MaemoQemuManager::deviceConfigurationChanged(ProjectExplorer::Target *target)
{ {
m_qemuAction->setEnabled(targetUsesMatchingRuntimeConfig(target)); m_qemuAction->setEnabled(targetUsesMatchingRuntimeConfig(target));
} }
void QemuRuntimeManager::startRuntime() void MaemoQemuManager::startRuntime()
{ {
m_userTerminated = false; m_userTerminated = false;
Project *p = ProjectExplorerPlugin::instance()->session()->startupProject(); Project *p = ProjectExplorerPlugin::instance()->session()->startupProject();
@@ -387,7 +387,7 @@ void QemuRuntimeManager::startRuntime()
disconnect(m_qemuAction, SIGNAL(triggered()), this, SLOT(startRuntime())); disconnect(m_qemuAction, SIGNAL(triggered()), this, SLOT(startRuntime()));
} }
void QemuRuntimeManager::terminateRuntime() void MaemoQemuManager::terminateRuntime()
{ {
m_userTerminated = true; m_userTerminated = true;
@@ -400,7 +400,7 @@ void QemuRuntimeManager::terminateRuntime()
disconnect(m_qemuAction, SIGNAL(triggered()), this, SLOT(terminateRuntime())); disconnect(m_qemuAction, SIGNAL(triggered()), this, SLOT(terminateRuntime()));
} }
void QemuRuntimeManager::qemuProcessFinished() void MaemoQemuManager::qemuProcessFinished()
{ {
m_runningQtId = -1; m_runningQtId = -1;
QemuStatus status = QemuFinished; QemuStatus status = QemuFinished;
@@ -420,13 +420,13 @@ void QemuRuntimeManager::qemuProcessFinished()
emit qemuProcessStatus(status, error); emit qemuProcessStatus(status, error);
} }
void QemuRuntimeManager::qemuProcessError(QProcess::ProcessError error) void MaemoQemuManager::qemuProcessError(QProcess::ProcessError error)
{ {
if (error == QProcess::FailedToStart) if (error == QProcess::FailedToStart)
emit qemuProcessStatus(QemuFailedToStart, m_qemuProcess->errorString()); emit qemuProcessStatus(QemuFailedToStart, m_qemuProcess->errorString());
} }
void QemuRuntimeManager::qemuStatusChanged(QemuStatus status, const QString &error) void MaemoQemuManager::qemuStatusChanged(QemuStatus status, const QString &error)
{ {
QString message; QString message;
bool running = false; bool running = false;
@@ -456,7 +456,7 @@ void QemuRuntimeManager::qemuStatusChanged(QemuStatus status, const QString &err
updateStarterIcon(running); updateStarterIcon(running);
} }
void QemuRuntimeManager::qemuOutput() void MaemoQemuManager::qemuOutput()
{ {
qDebug("%s", m_qemuProcess->readAllStandardOutput().data()); qDebug("%s", m_qemuProcess->readAllStandardOutput().data());
qDebug("%s", m_qemuProcess->readAllStandardError().data()); qDebug("%s", m_qemuProcess->readAllStandardError().data());
@@ -464,7 +464,7 @@ void QemuRuntimeManager::qemuOutput()
// -- private // -- private
void QemuRuntimeManager::setupRuntimes() void MaemoQemuManager::setupRuntimes()
{ {
m_needsSetup = false; m_needsSetup = false;
@@ -477,7 +477,7 @@ void QemuRuntimeManager::setupRuntimes()
qtVersionsChanged(uniqueIds); qtVersionsChanged(uniqueIds);
} }
void QemuRuntimeManager::updateStarterIcon(bool running) void MaemoQemuManager::updateStarterIcon(bool running)
{ {
QIcon::State state; QIcon::State state;
QString toolTip; QString toolTip;
@@ -494,7 +494,7 @@ void QemuRuntimeManager::updateStarterIcon(bool running)
state)); state));
} }
void QemuRuntimeManager::toggleStarterButton(Target *target) void MaemoQemuManager::toggleStarterButton(Target *target)
{ {
if (m_needsSetup) if (m_needsSetup)
setupRuntimes(); setupRuntimes();
@@ -517,7 +517,7 @@ void QemuRuntimeManager::toggleStarterButton(Target *target)
&& targetUsesMatchingRuntimeConfig(target) && !isRunning); && targetUsesMatchingRuntimeConfig(target) && !isRunning);
} }
bool QemuRuntimeManager::sessionHasMaemoTarget() const bool MaemoQemuManager::sessionHasMaemoTarget() const
{ {
bool result = false; bool result = false;
ProjectExplorerPlugin *explorer = ProjectExplorerPlugin::instance(); ProjectExplorerPlugin *explorer = ProjectExplorerPlugin::instance();
@@ -527,7 +527,7 @@ bool QemuRuntimeManager::sessionHasMaemoTarget() const
return result; return result;
} }
bool QemuRuntimeManager::targetUsesMatchingRuntimeConfig(Target *target, bool MaemoQemuManager::targetUsesMatchingRuntimeConfig(Target *target,
QtVersion **qtVersion) QtVersion **qtVersion)
{ {
if (!target) if (!target)
@@ -551,20 +551,20 @@ bool QemuRuntimeManager::targetUsesMatchingRuntimeConfig(Target *target,
return config.isValid() && config.type == MaemoDeviceConfig::Simulator; return config.isValid() && config.type == MaemoDeviceConfig::Simulator;
} }
QString QemuRuntimeManager::maddeRoot(const QString &qmake) const QString MaemoQemuManager::maddeRoot(const QString &qmake) const
{ {
QDir dir(QDir::cleanPath(qmake).remove(binQmake)); QDir dir(QDir::cleanPath(qmake).remove(binQmake));
dir.cdUp(); dir.cdUp(); dir.cdUp(); dir.cdUp();
return dir.absolutePath(); return dir.absolutePath();
} }
QString QemuRuntimeManager::targetRoot(const QString &qmake) const QString MaemoQemuManager::targetRoot(const QString &qmake) const
{ {
const QString target = QDir::cleanPath(qmake).remove(binQmake); const QString target = QDir::cleanPath(qmake).remove(binQmake);
return target.mid(target.lastIndexOf(QLatin1Char('/')) + 1); return target.mid(target.lastIndexOf(QLatin1Char('/')) + 1);
} }
bool QemuRuntimeManager::fillRuntimeInformation(Runtime *runtime) const bool MaemoQemuManager::fillRuntimeInformation(Runtime *runtime) const
{ {
const QStringList files = QDir(runtime->m_root).entryList(QDir::Files const QStringList files = QDir(runtime->m_root).entryList(QDir::Files
| QDir::NoSymLinks | QDir::NoDotAndDotDot); | QDir::NoSymLinks | QDir::NoDotAndDotDot);
@@ -597,7 +597,7 @@ bool QemuRuntimeManager::fillRuntimeInformation(Runtime *runtime) const
return false; return false;
} }
QString QemuRuntimeManager::runtimeForQtVersion(const QString &qmakeCommand) const QString MaemoQemuManager::runtimeForQtVersion(const QString &qmakeCommand) const
{ {
const QString &target = targetRoot(qmakeCommand); const QString &target = targetRoot(qmakeCommand);
const QString &madRoot = maddeRoot(qmakeCommand); const QString &madRoot = maddeRoot(qmakeCommand);
@@ -631,7 +631,7 @@ QString QemuRuntimeManager::runtimeForQtVersion(const QString &qmakeCommand) con
return QString(); return QString();
} }
void QemuRuntimeManager::toggleDeviceConnections(MaemoRunConfiguration *mrc, void MaemoQemuManager::toggleDeviceConnections(MaemoRunConfiguration *mrc,
bool _connect) bool _connect)
{ {
if (!mrc) if (!mrc)

View File

@@ -67,12 +67,12 @@ struct Runtime
QString m_gdbServerPort; QString m_gdbServerPort;
}; };
class QemuRuntimeManager : public QObject class MaemoQemuManager : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
static QemuRuntimeManager& instance(QObject *parent = 0); static MaemoQemuManager& instance(QObject *parent = 0);
bool runtimeForQtVersion(int uniqueId, Runtime *rt) const; bool runtimeForQtVersion(int uniqueId, Runtime *rt) const;
@@ -110,8 +110,8 @@ private slots:
void qemuOutput(); void qemuOutput();
private: private:
QemuRuntimeManager(QObject *parent); MaemoQemuManager(QObject *parent);
~QemuRuntimeManager(); ~MaemoQemuManager();
void setupRuntimes(); void setupRuntimes();
bool sessionHasMaemoTarget() const; bool sessionHasMaemoTarget() const;
@@ -138,7 +138,7 @@ private:
bool m_userTerminated; bool m_userTerminated;
QIcon m_qemuStarterIcon; QIcon m_qemuStarterIcon;
QMap<int, Runtime> m_runtimes; QMap<int, Runtime> m_runtimes;
static QemuRuntimeManager *m_instance; static MaemoQemuManager *m_instance;
}; };
} // namespace Qt4ProjectManager } // namespace Qt4ProjectManager

View File

@@ -33,10 +33,10 @@
#include "maemodeploystep.h" #include "maemodeploystep.h"
#include "maemodeviceconfiglistmodel.h" #include "maemodeviceconfiglistmodel.h"
#include "maemoglobal.h" #include "maemoglobal.h"
#include "maemoqemumanager.h"
#include "maemoremotemountsmodel.h" #include "maemoremotemountsmodel.h"
#include "maemorunconfigurationwidget.h" #include "maemorunconfigurationwidget.h"
#include "maemotoolchain.h" #include "maemotoolchain.h"
#include "qemuruntimemanager.h"
#include "qtoutputformatter.h" #include "qtoutputformatter.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
@@ -259,7 +259,7 @@ QString MaemoRunConfiguration::runtimeGdbServerPort() const
if (Qt4BuildConfiguration *qt4bc = activeQt4BuildConfiguration()) { if (Qt4BuildConfiguration *qt4bc = activeQt4BuildConfiguration()) {
Runtime rt; Runtime rt;
const int id = qt4bc->qtVersion()->uniqueId(); const int id = qt4bc->qtVersion()->uniqueId();
if (QemuRuntimeManager::instance().runtimeForQtVersion(id, &rt)) if (MaemoQemuManager::instance().runtimeForQtVersion(id, &rt))
return rt.m_gdbServerPort; return rt.m_gdbServerPort;
} }
return QLatin1String("13219"); return QLatin1String("13219");

View File

@@ -34,8 +34,8 @@
#include "maemorunconfigurationwidget.h" #include "maemorunconfigurationwidget.h"
#include "deviceenvreader.h"
#include "maemodeviceconfiglistmodel.h" #include "maemodeviceconfiglistmodel.h"
#include "maemodeviceenvreader.h"
#include "maemomanager.h" #include "maemomanager.h"
#include "maemoremotemountsmodel.h" #include "maemoremotemountsmodel.h"
#include "maemorunconfiguration.h" #include "maemorunconfiguration.h"
@@ -63,7 +63,7 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
MaemoRunConfiguration *runConfiguration, QWidget *parent) MaemoRunConfiguration *runConfiguration, QWidget *parent)
: QWidget(parent), : QWidget(parent),
m_runConfiguration(runConfiguration), m_runConfiguration(runConfiguration),
m_deviceEnvReader(new DeviceEnvReader(this, runConfiguration)) m_deviceEnvReader(new MaemoDeviceEnvReader(this, runConfiguration))
{ {
QVBoxLayout *mainLayout = new QVBoxLayout; QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout); setLayout(mainLayout);

View File

@@ -54,7 +54,7 @@ namespace ProjectExplorer {
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
namespace Internal { namespace Internal {
class DeviceEnvReader; class MaemoDeviceEnvReader;
class MaemoRunConfiguration; class MaemoRunConfiguration;
class MaemoRunConfigurationWidget : public QWidget class MaemoRunConfigurationWidget : public QWidget
@@ -90,7 +90,7 @@ private:
MaemoRunConfiguration *m_runConfiguration; MaemoRunConfiguration *m_runConfiguration;
QPushButton *m_fetchEnv; QPushButton *m_fetchEnv;
DeviceEnvReader *m_deviceEnvReader; MaemoDeviceEnvReader *m_deviceEnvReader;
ProjectExplorer::EnvironmentWidget *m_environmentWidget; ProjectExplorer::EnvironmentWidget *m_environmentWidget;
}; };

View File

@@ -15,8 +15,8 @@ HEADERS += \
$$PWD/maemopackagecreationfactory.h \ $$PWD/maemopackagecreationfactory.h \
$$PWD/maemopackagecreationwidget.h \ $$PWD/maemopackagecreationwidget.h \
$$PWD/maemodeployablelistmodel.h \ $$PWD/maemodeployablelistmodel.h \
$$PWD/qemuruntimemanager.h \ $$PWD/maemoqemumanager.h \
$$PWD/profilewrapper.h \ $$PWD/maemoprofilewrapper.h \
$$PWD/maemodeployables.h \ $$PWD/maemodeployables.h \
$$PWD/maemodeployable.h \ $$PWD/maemodeployable.h \
$$PWD/maemodeployablelistwidget.h \ $$PWD/maemodeployablelistwidget.h \
@@ -28,7 +28,7 @@ HEADERS += \
$$PWD/maemodebugsupport.h \ $$PWD/maemodebugsupport.h \
$$PWD/maemodeviceconfiglistmodel.h \ $$PWD/maemodeviceconfiglistmodel.h \
$$PWD/maemoremotemountsmodel.h \ $$PWD/maemoremotemountsmodel.h \
$$PWD/deviceenvreader.h $$PWD/maemodeviceenvreader.h
SOURCES += \ SOURCES += \
$$PWD/maemoconfigtestdialog.cpp \ $$PWD/maemoconfigtestdialog.cpp \
@@ -46,8 +46,8 @@ SOURCES += \
$$PWD/maemopackagecreationfactory.cpp \ $$PWD/maemopackagecreationfactory.cpp \
$$PWD/maemopackagecreationwidget.cpp \ $$PWD/maemopackagecreationwidget.cpp \
$$PWD/maemodeployablelistmodel.cpp \ $$PWD/maemodeployablelistmodel.cpp \
$$PWD/qemuruntimemanager.cpp \ $$PWD/maemoqemumanager.cpp \
$$PWD/profilewrapper.cpp \ $$PWD/maemoprofilewrapper.cpp \
$$PWD/maemodeployables.cpp \ $$PWD/maemodeployables.cpp \
$$PWD/maemodeployablelistwidget.cpp \ $$PWD/maemodeployablelistwidget.cpp \
$$PWD/maemodeploystep.cpp \ $$PWD/maemodeploystep.cpp \
@@ -58,7 +58,7 @@ SOURCES += \
$$PWD/maemodebugsupport.cpp \ $$PWD/maemodebugsupport.cpp \
$$PWD/maemodeviceconfiglistmodel.cpp \ $$PWD/maemodeviceconfiglistmodel.cpp \
$$PWD/maemoremotemountsmodel.cpp \ $$PWD/maemoremotemountsmodel.cpp \
$$PWD/deviceenvreader.cpp $$PWD/maemodeviceenvreader.cpp
FORMS += \ FORMS += \
$$PWD/maemoconfigtestdialog.ui \ $$PWD/maemoconfigtestdialog.ui \