forked from qt-creator/qt-creator
Qnx: Fixing "Show Running Processes" for BlackBerry devices
BlackBerryDeviceConfiguration is using the same QnxDeviceProcessList as QnxDeviceConfiguration. Task-number: QTCREATORBUG-9976 Change-Id: Ic07297619d4d5d4280918df4e1ea21b958fd1050 Reviewed-by: Fanda Vacek <fvacek@blackberry.com> Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com> Reviewed-by: David Kaspar <dkaspar@blackberry.com>
This commit is contained in:
@@ -31,9 +31,9 @@
|
||||
|
||||
#include "qnxdeviceconfiguration.h"
|
||||
#include "qnxdevicetester.h"
|
||||
#include "qnxdeviceprocesslist.h"
|
||||
#include "qnxdeviceprocesssignaloperation.h"
|
||||
|
||||
#include <projectexplorer/devicesupport/sshdeviceprocesslist.h>
|
||||
#include <ssh/sshconnection.h>
|
||||
|
||||
#include <QRegExp>
|
||||
@@ -80,51 +80,6 @@ class QnxPortsGatheringMethod : public ProjectExplorer::PortsGatheringMethod
|
||||
}
|
||||
};
|
||||
|
||||
class QnxDeviceProcessList : public ProjectExplorer::SshDeviceProcessList
|
||||
{
|
||||
public:
|
||||
QnxDeviceProcessList(const ProjectExplorer::IDevice::ConstPtr &device, QObject *parent)
|
||||
: SshDeviceProcessList(device, parent)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
QString listProcessesCommandLine() const
|
||||
{
|
||||
return QLatin1String("pidin -F \"%a %A '/%n'\"");
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::DeviceProcessItem> buildProcessList(const QString &listProcessesReply) const
|
||||
{
|
||||
QList<ProjectExplorer::DeviceProcessItem> processes;
|
||||
QStringList lines = listProcessesReply.split(QLatin1Char('\n'));
|
||||
if (lines.isEmpty())
|
||||
return processes;
|
||||
|
||||
lines.pop_front(); // drop headers
|
||||
QRegExp re(QLatin1String("\\s*(\\d+)\\s+(.*)'(.*)'"));
|
||||
|
||||
foreach (const QString& line, lines) {
|
||||
if (re.exactMatch(line)) {
|
||||
const QStringList captures = re.capturedTexts();
|
||||
if (captures.size() == 4) {
|
||||
const int pid = captures[1].toInt();
|
||||
const QString args = captures[2];
|
||||
const QString exe = captures[3];
|
||||
ProjectExplorer::DeviceProcessItem deviceProcess;
|
||||
deviceProcess.pid = pid;
|
||||
deviceProcess.exe = exe.trimmed();
|
||||
deviceProcess.cmdLine = args.trimmed();
|
||||
processes.append(deviceProcess);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
qSort(processes);
|
||||
return processes;
|
||||
}
|
||||
};
|
||||
|
||||
QnxDeviceConfiguration::QnxDeviceConfiguration()
|
||||
: RemoteLinux::LinuxDevice()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user