Commit 5539ed41 authored by hjk's avatar hjk Committed by hjk
Browse files

remotelinux: make RemoteProcess struct public



Change-Id: I2ff78047cfcc36570b9c17852bd3b05d2d21df58
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent 5aef8ac4
......@@ -59,7 +59,7 @@ public:
const LinuxDeviceConfiguration::ConstPtr deviceConfiguration;
SshRemoteProcessRunner process;
QList<AbstractRemoteLinuxProcessList::RemoteProcess> remoteProcesses;
QList<RemoteProcess> remoteProcesses;
QByteArray remoteStdout;
QByteArray remoteStderr;
QString errorMsg;
......@@ -108,14 +108,9 @@ void AbstractRemoteLinuxProcessList::killProcess(int row)
startProcess(killProcessCommandLine(d->remoteProcesses.at(row)));
}
int AbstractRemoteLinuxProcessList::pidAt(int row) const
RemoteProcess AbstractRemoteLinuxProcessList::at(int row) const
{
return d->remoteProcesses.at(row).pid;
}
QString AbstractRemoteLinuxProcessList::commandLineAt(int row) const
{
return d->remoteProcesses.at(row).cmdLine;
return d->remoteProcesses.at(row);
}
int AbstractRemoteLinuxProcessList::rowCount(const QModelIndex &parent) const
......@@ -260,7 +255,7 @@ QString GenericRemoteLinuxProcessList::killProcessCommandLine(const RemoteProces
return QLatin1String("kill -9 ") + QString::number(process.pid);
}
QList<AbstractRemoteLinuxProcessList::RemoteProcess> GenericRemoteLinuxProcessList::buildProcessList(const QString &listProcessesReply) const
QList<RemoteProcess> GenericRemoteLinuxProcessList::buildProcessList(const QString &listProcessesReply) const
{
QList<RemoteProcess> processes;
const QStringList &lines = listProcessesReply.split(QLatin1Char('\n'), QString::SkipEmptyParts);
......
......@@ -44,6 +44,15 @@ namespace Internal {
class AbstractRemoteLinuxProcessListPrivate;
}
class REMOTELINUX_EXPORT RemoteProcess
{
public:
RemoteProcess(int pid, const QString &cmdLine) : pid(pid), cmdLine(cmdLine) {}
int pid;
QString cmdLine;
};
class REMOTELINUX_EXPORT AbstractRemoteLinuxProcessList : public QAbstractTableModel
{
Q_OBJECT
......@@ -53,8 +62,7 @@ public:
void update();
void killProcess(int row);
int pidAt(int row) const;
QString commandLineAt(int row) const;
RemoteProcess at(int row) const;
signals:
void processListUpdated();
......@@ -67,13 +75,6 @@ protected:
QSharedPointer<const LinuxDeviceConfiguration> deviceConfiguration() const;
struct RemoteProcess {
RemoteProcess(int pid, const QString &cmdLine) : pid(pid), cmdLine(cmdLine) {}
int pid;
QString cmdLine;
};
private slots:
void handleRemoteStdOut(const QByteArray &output);
void handleRemoteStdErr(const QByteArray &output);
......
......@@ -271,8 +271,8 @@ void StartGdbServerDialog::attachToProcess()
const int port = d->gatherer.getNextFreePort(&ports);
const int row = d->proxyModel.mapToSource(indexes.first()).row();
QTC_ASSERT(row >= 0, return);
const int pid = d->processList->pidAt(row);
d->remoteCommandLine = d->processList->commandLineAt(row);
RemoteProcess process = d->processList->at(row);
d->remoteCommandLine = process.cmdLine;
if (port == -1) {
reportFailure();
return;
......@@ -282,7 +282,7 @@ void StartGdbServerDialog::attachToProcess()
d->settings->setValue(LastDevice, d->deviceComboBox->currentIndex());
d->settings->setValue(LastProcessName, d->processFilterLineEdit->text());
startGdbServerOnPort(port, pid);
startGdbServerOnPort(port, process.pid);
}
void StartGdbServerDialog::reportFailure()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment