Commit 5ff0d9b7 authored by ck's avatar ck
Browse files

Maemo: Rename some classes.

All our classes should have the Maemo prefix because we don't have
a namespace of our own.
parent 8abed8a0
......@@ -29,7 +29,7 @@
#include "maemodeployablelistmodel.h"
#include "profilewrapper.h"
#include "maemoprofilewrapper.h"
#include <qt4projectmanager/qt4nodes.h>
......@@ -45,7 +45,7 @@ MaemoDeployableListModel::MaemoDeployableListModel(const Qt4ProFileNode *proFile
: QAbstractTableModel(parent),
m_proFileNode(proFileNode),
m_modified(false),
m_proFileWrapper(new ProFileWrapper(m_proFileNode->path(), proFileOption))
m_proFileWrapper(new MaemoProFileWrapper(m_proFileNode->path(), proFileOption))
{
buildModel();
}
......@@ -56,7 +56,7 @@ bool MaemoDeployableListModel::buildModel()
{
m_deployables.clear();
const ProFileWrapper::InstallsList &installs = m_proFileWrapper->installs();
const MaemoProFileWrapper::InstallsList &installs = m_proFileWrapper->installs();
if (installs.targetPath.isEmpty()) {
const QString remoteDir = m_proFileNode->projectType() == LibraryTemplate
? QLatin1String("/usr/local/lib")
......@@ -79,7 +79,7 @@ bool MaemoDeployableListModel::buildModel()
m_deployables.prepend(MaemoDeployable(localExecutableFilePath(),
installs.targetPath));
}
foreach (const ProFileWrapper::InstallsElem &elem, installs.normalElems) {
foreach (const MaemoProFileWrapper::InstallsElem &elem, installs.normalElems) {
foreach (const QString &file, elem.files) {
m_deployables << MaemoDeployable(m_proFileWrapper->absFilePath(file),
elem.path);
......
......@@ -45,7 +45,7 @@ QT_END_NAMESPACE
namespace Qt4ProjectManager {
namespace Internal {
class ProFileWrapper;
class MaemoProFileWrapper;
class Qt4ProFileNode;
class MaemoDeployableListModel : public QAbstractTableModel
......@@ -83,7 +83,7 @@ private:
const Qt4ProFileNode * const m_proFileNode;
QList<MaemoDeployable> m_deployables;
mutable bool m_modified;
const QScopedPointer<ProFileWrapper> m_proFileWrapper;
const QScopedPointer<MaemoProFileWrapper> m_proFileWrapper;
};
} // namespace Qt4ProjectManager
......
......@@ -32,7 +32,8 @@
**
****************************************************************************/
#include "deviceenvreader.h"
#include "maemodeviceenvreader.h"
#include "maemorunconfiguration.h"
#include <coreplugin/ssh/sshconnection.h>
......@@ -41,7 +42,7 @@
namespace Qt4ProjectManager {
namespace Internal {
DeviceEnvReader::DeviceEnvReader(QObject *parent, MaemoRunConfiguration *config)
MaemoDeviceEnvReader::MaemoDeviceEnvReader(QObject *parent, MaemoRunConfiguration *config)
: QObject(parent)
, m_stop(false)
, 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;
if (m_connection)
......@@ -77,7 +78,7 @@ void DeviceEnvReader::start()
m_connection->connectToHost(m_devConfig.server);
}
void DeviceEnvReader::stop()
void MaemoDeviceEnvReader::stop()
{
m_stop = true;
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())
return;
......@@ -96,7 +97,7 @@ void DeviceEnvReader::setEnvironment()
QString::SkipEmptyParts));
}
void DeviceEnvReader::executeRemoteCall()
void MaemoDeviceEnvReader::executeRemoteCall()
{
if (m_stop)
return;
......@@ -115,14 +116,14 @@ void DeviceEnvReader::executeRemoteCall()
m_remoteProcess->start();
}
void DeviceEnvReader::handleConnectionFailure()
void MaemoDeviceEnvReader::handleConnectionFailure()
{
emit error(tr("Could not connect to host: %1")
.arg(m_connection->errorString()));
emit finished();
}
void DeviceEnvReader::remoteProcessFinished(int exitCode)
void MaemoDeviceEnvReader::remoteProcessFinished(int exitCode)
{
Q_ASSERT(exitCode == Core::SshRemoteProcess::FailedToStart
|| exitCode == Core::SshRemoteProcess::KilledBySignal
......@@ -140,12 +141,12 @@ void DeviceEnvReader::remoteProcessFinished(int exitCode)
emit finished();
}
void DeviceEnvReader::remoteOutput(const QByteArray &data)
void MaemoDeviceEnvReader::remoteOutput(const QByteArray &data)
{
m_remoteOutput.append(QString::fromUtf8(data));
}
void DeviceEnvReader::remoteErrorOutput(const QByteArray &data)
void MaemoDeviceEnvReader::remoteErrorOutput(const QByteArray &data)
{
emit error(data);
}
......
......@@ -35,12 +35,13 @@
#ifndef DEVICEENVREADER_H
#define DEVICEENVREADER_H
#include <QtCore/QObject>
#include <QtCore/QPointer>
#include "maemodeviceconfigurations.h"
#include <projectexplorer/environment.h>
#include <QtCore/QObject>
#include <QtCore/QPointer>
namespace Core {
class SshConnection;
class SshRemoteProcess;
......@@ -51,12 +52,12 @@ namespace Qt4ProjectManager {
class MaemoRunConfiguration;
class DeviceEnvReader : public QObject
class MaemoDeviceEnvReader : public QObject
{
Q_OBJECT
public:
DeviceEnvReader(QObject *parent, MaemoRunConfiguration *config);
~DeviceEnvReader();
MaemoDeviceEnvReader(QObject *parent, MaemoRunConfiguration *config);
~MaemoDeviceEnvReader();
void start();
void stop();
......@@ -82,9 +83,8 @@ private:
bool m_stop;
QString m_remoteOutput;
ProjectExplorer::Environment m_env;
MaemoDeviceConfig m_devConfig;
QPointer<MaemoRunConfiguration> m_runConfig;
MaemoDeviceConfig m_devConfig;
QSharedPointer<Core::SshConnection> m_connection;
QSharedPointer<Core::SshRemoteProcess> m_remoteProcess;
};
......
......@@ -33,10 +33,10 @@
#include "maemodeploystepfactory.h"
#include "maemodeviceconfigurations.h"
#include "maemopackagecreationfactory.h"
#include "maemoqemumanager.h"
#include "maemorunfactories.h"
#include "maemosettingspage.h"
#include "maemotoolchain.h"
#include "qemuruntimemanager.h"
#include <extensionsystem/pluginmanager.h>
#include <qt4projectmanager/qtversionmanager.h>
......@@ -64,7 +64,7 @@ MaemoManager::MaemoManager()
Q_ASSERT(!m_instance);
m_instance = this;
QemuRuntimeManager::instance(this);
MaemoQemuManager::instance(this);
MaemoDeviceConfigurations::instance(this);
PluginManager *pluginManager = PluginManager::instance();
......
......@@ -46,7 +46,7 @@ class MaemoPackageCreationFactory;
class MaemoRunControlFactory;
class MaemoRunConfigurationFactory;
class MaemoSettingsPage;
class QemuRuntimeManager;
class MaemoQemuManager;
class MaemoManager : public QObject
{
......@@ -70,7 +70,7 @@ private:
MaemoPackageCreationFactory *m_packageCreationFactory;
MaemoDeployStepFactory *m_deployStepFactory;
MaemoSettingsPage *m_settingsPage;
QemuRuntimeManager *m_qemuRuntimeManager;
MaemoQemuManager *m_qemuRuntimeManager;
};
} // namespace Internal
......
......@@ -42,12 +42,12 @@
#include "maemopackagecreationstep.h"
#include "maemoconstants.h"
#include "maemoglobal.h"
#include "maemopackagecreationwidget.h"
#include "maemodeployables.h"
#include "maemodeploystep.h"
#include "maemoglobal.h"
#include "maemopackagecreationwidget.h"
#include "maemoprofilewrapper.h"
#include "maemotoolchain.h"
#include "profilewrapper.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <qt4buildconfiguration.h>
......
......@@ -56,7 +56,7 @@ namespace Internal {
class MaemoDeployStep;
class MaemoToolChain;
class ProFileWrapper;
class MaemoProFileWrapper;
class Qt4BuildConfiguration;
class MaemoPackageCreationStep : public ProjectExplorer::BuildStep
......
#include "profilewrapper.h"
#include "maemoprofilewrapper.h"
#include <prowriter.h>
#include <qt4projectmanager/profilereader.h>
......@@ -26,7 +26,7 @@ namespace {
}
ProFileWrapper::ProFileWrapper(const QString &proFileName,
MaemoProFileWrapper::MaemoProFileWrapper(const QString &proFileName,
const QSharedPointer<ProFileOption> &proFileOption)
: m_proFileName(proFileName), m_proDir(QFileInfo(m_proFileName).dir()),
m_proFileOption(proFileOption)
......@@ -34,14 +34,14 @@ ProFileWrapper::ProFileWrapper(const QString &proFileName,
parseProFile(ParseFromFile);
}
ProFileWrapper::~ProFileWrapper() {}
MaemoProFileWrapper::~MaemoProFileWrapper() {}
void ProFileWrapper::reload()
void MaemoProFileWrapper::reload()
{
parseProFile(ParseFromFile);
}
ProFileWrapper::InstallsList ProFileWrapper::installs() const
MaemoProFileWrapper::InstallsList MaemoProFileWrapper::installs() const
{
InstallsList list;
......@@ -75,7 +75,7 @@ ProFileWrapper::InstallsList ProFileWrapper::installs() const
return list;
}
bool ProFileWrapper::addInstallsElem(const QString &path,
bool MaemoProFileWrapper::addInstallsElem(const QString &path,
const QString &absFilePath, const QString &var)
{
QString varName = var;
......@@ -92,12 +92,12 @@ bool ProFileWrapper::addInstallsElem(const QString &path,
&& addVarValue(InstallsVar, varName);
}
bool ProFileWrapper::addInstallsTarget(const QString &path)
bool MaemoProFileWrapper::addInstallsTarget(const QString &path)
{
return addInstallsElem(path, QString(), TargetVar);
}
bool ProFileWrapper::removeInstallsElem(const QString &path,
bool MaemoProFileWrapper::removeInstallsElem(const QString &path,
const QString &file)
{
const InstallsElem &elem = findInstallsElem(path, file);
......@@ -116,7 +116,7 @@ bool ProFileWrapper::removeInstallsElem(const QString &path,
return true;
}
bool ProFileWrapper::replaceInstallPath(const QString &oldPath,
bool MaemoProFileWrapper::replaceInstallPath(const QString &oldPath,
const QString &file, const QString &newPath)
{
const InstallsElem &elem = findInstallsElem(oldPath, file);
......@@ -134,12 +134,12 @@ bool ProFileWrapper::replaceInstallPath(const QString &oldPath,
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);
}
bool ProFileWrapper::addVarValue(const QString &var, const QString &value)
bool MaemoProFileWrapper::addVarValue(const QString &var, const QString &value)
{
if (varValues(var).contains(value))
return true;
......@@ -152,7 +152,7 @@ bool ProFileWrapper::addVarValue(const QString &var, const QString &value)
return writeProFileContents();
}
bool ProFileWrapper::addFile(const QString &var, const QString &absFilePath)
bool MaemoProFileWrapper::addFile(const QString &var, const QString &absFilePath)
{
if (!readProFileContents())
return false;
......@@ -162,7 +162,7 @@ bool ProFileWrapper::addFile(const QString &var, const QString &absFilePath)
return writeProFileContents();
}
bool ProFileWrapper::removeVarValue(const QString &var, const QString &value)
bool MaemoProFileWrapper::removeVarValue(const QString &var, const QString &value)
{
if (!readProFileContents())
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())
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)
{
if (!readProFileContents())
......@@ -211,7 +211,7 @@ bool ProFileWrapper::replaceVarValue(const QString &var,
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
// enough for redundant ".." dirs.
......@@ -221,7 +221,7 @@ QString ProFileWrapper::absFilePath(const QString &relFilePath) const
.canonicalFilePath();
}
void ProFileWrapper::parseProFile(ParseType type) const
void MaemoProFileWrapper::parseProFile(ParseType type) const
{
m_proFileReader.reset(new ProFileReader(m_proFileOption.data()));
m_proFileReader->setCumulative(false);
......@@ -244,7 +244,7 @@ void ProFileWrapper::parseProFile(ParseType type) const
m_proFile->deref();
}
bool ProFileWrapper::writeProFileContents()
bool MaemoProFileWrapper::writeProFileContents()
{
QFile proFileOnDisk(m_proFileName);
if (!proFileOnDisk.open(QIODevice::WriteOnly)) {
......@@ -262,7 +262,7 @@ bool ProFileWrapper::writeProFileContents()
return true;
}
bool ProFileWrapper::readProFileContents()
bool MaemoProFileWrapper::readProFileContents()
{
if (!m_proFileContents.isEmpty())
return true;
......@@ -278,7 +278,7 @@ bool ProFileWrapper::readProFileContents()
return true;
}
ProFileWrapper::InstallsElem ProFileWrapper::findInstallsElem(const QString &path,
MaemoProFileWrapper::InstallsElem MaemoProFileWrapper::findInstallsElem(const QString &path,
const QString &file) const
{
const QStringList &elems = varValues(InstallsVar);
......
......@@ -16,12 +16,12 @@ namespace Qt4ProjectManager {
namespace Internal {
class ProFileReader;
class ProFileWrapper
class MaemoProFileWrapper
{
public:
ProFileWrapper(const QString &proFileName,
MaemoProFileWrapper(const QString &proFileName,
const QSharedPointer<ProFileOption> &proFileOption);
~ProFileWrapper();
~MaemoProFileWrapper();
void reload();
......
......@@ -27,7 +27,7 @@
**
**************************************************************************/
#include "qemuruntimemanager.h"
#include "maemoqemumanager.h"
#include "maemorunconfiguration.h"
#include "maemotoolchain.h"
......@@ -58,12 +58,12 @@ using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
QemuRuntimeManager *QemuRuntimeManager::m_instance = 0;
MaemoQemuManager *MaemoQemuManager::m_instance = 0;
const QSize iconSize = QSize(24, 20);
const QLatin1String binQmake("/bin/qmake" EXEC_SUFFIX);
QemuRuntimeManager::QemuRuntimeManager(QObject *parent)
MaemoQemuManager::MaemoQemuManager(QObject *parent)
: QObject(parent)
, m_qemuAction(0)
, m_qemuProcess(new QProcess(this))
......@@ -117,20 +117,20 @@ QemuRuntimeManager::QemuRuntimeManager(QObject *parent)
this, SLOT(qemuStatusChanged(QemuStatus, QString)));
}
QemuRuntimeManager::~QemuRuntimeManager()
MaemoQemuManager::~MaemoQemuManager()
{
terminateRuntime();
m_instance = 0;
}
QemuRuntimeManager &QemuRuntimeManager::instance(QObject *parent)
MaemoQemuManager &MaemoQemuManager::instance(QObject *parent)
{
if (m_instance == 0)
m_instance = new QemuRuntimeManager(parent);
m_instance = new MaemoQemuManager(parent);
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);
if (found)
......@@ -138,7 +138,7 @@ bool QemuRuntimeManager::runtimeForQtVersion(int uniqueId, Runtime *rt) const
return found;
}
void QemuRuntimeManager::qtVersionsChanged(const QList<int> &uniqueIds)
void MaemoQemuManager::qtVersionsChanged(const QList<int> &uniqueIds)
{
if (m_needsSetup)
setupRuntimes();
......@@ -172,7 +172,7 @@ void QemuRuntimeManager::qtVersionsChanged(const QList<int> &uniqueIds)
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...
connect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)), this,
......@@ -187,7 +187,7 @@ void QemuRuntimeManager::projectAdded(ProjectExplorer::Project *project)
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,
SLOT(targetAdded(ProjectExplorer::Target*)));
......@@ -201,7 +201,7 @@ void QemuRuntimeManager::projectRemoved(ProjectExplorer::Project *project)
m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget());
}
void QemuRuntimeManager::projectChanged(ProjectExplorer::Project *project)
void MaemoQemuManager::projectChanged(ProjectExplorer::Project *project)
{
if (project) {
toggleStarterButton(project->activeTarget());
......@@ -214,7 +214,7 @@ bool targetIsMaemo(const QString &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()))
return;
......@@ -243,7 +243,7 @@ void QemuRuntimeManager::targetAdded(ProjectExplorer::Target *target)
m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget());
}
void QemuRuntimeManager::targetRemoved(ProjectExplorer::Target *target)
void MaemoQemuManager::targetRemoved(ProjectExplorer::Target *target)
{
if (!target || !targetIsMaemo(target->id()))
return;
......@@ -269,7 +269,7 @@ void QemuRuntimeManager::targetRemoved(ProjectExplorer::Target *target)
m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget());
}
void QemuRuntimeManager::targetChanged(ProjectExplorer::Target *target)
void MaemoQemuManager::targetChanged(ProjectExplorer::Target *target)
{
if (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()))
return;
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))
return;
toggleDeviceConnections(qobject_cast<MaemoRunConfiguration*> (rc), false);
}
void QemuRuntimeManager::runConfigurationChanged(ProjectExplorer::RunConfiguration *rc)
void MaemoQemuManager::runConfigurationChanged(ProjectExplorer::RunConfiguration *rc)
{
if (rc)
m_qemuAction->setEnabled(targetUsesMatchingRuntimeConfig(rc->target()));
}
void QemuRuntimeManager::buildConfigurationAdded(ProjectExplorer::BuildConfiguration *bc)
void MaemoQemuManager::buildConfigurationAdded(ProjectExplorer::BuildConfiguration *bc)
{
if (!bc || !targetIsMaemo(bc->target()->id()))
return;
......@@ -305,7 +305,7 @@ void QemuRuntimeManager::buildConfigurationAdded(ProjectExplorer::BuildConfigura
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()))
return;
......@@ -313,13 +313,13 @@ void QemuRuntimeManager::buildConfigurationRemoved(ProjectExplorer::BuildConfigu
disconnect(bc, SIGNAL(environmentChanged()), this, SLOT(environmentChanged()));
}
void QemuRuntimeManager::buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc)
void MaemoQemuManager::buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc)
{
if (bc)
toggleStarterButton(bc->target());
}
void QemuRuntimeManager::environmentChanged()
void MaemoQemuManager::environmentChanged()
{
// likely to happen when the qt version changes the build config is using
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));
}
void QemuRuntimeManager::startRuntime()
void MaemoQemuManager::startRuntime()
{
m_userTerminated = false;