summaryrefslogtreecommitdiffstats
path: root/src/pvs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pvs.cpp')
-rwxr-xr-xsrc/pvs.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/pvs.cpp b/src/pvs.cpp
index 8017d8b..611aa86 100755
--- a/src/pvs.cpp
+++ b/src/pvs.cpp
@@ -941,6 +941,7 @@ QString PVS::getConfigValue(QString key)
void PVS::showProc()
{
QString settings = getConfigValue("RemoteProcess/filter");
+ _pvsServerConnection->sendMessage(PVSMsg(PVSCOMMAND, "PROCESSES", "SHOW "+settings));
QStringList filter = settings.split(" ");
//look at procfs
@@ -956,12 +957,12 @@ void PVS::showProc()
for (int i=0;i<procList.length();i++) //every directory in /proc is checked
{
write = false;
- QString tmp = procList.at(i);
- QString snd = "";
- if (!tmp.contains(QRegExp("\\D"))) //we have to check if name is number
+ QString tempFolder = procList.at(i);
+ QString tempSend = "";
+ if (!tempFolder.contains(QRegExp("\\D"))) //we have to check if name is number
{
QString name = "";
- QFile file("/proc/"+tmp+QString("/status")); //read status file
+ QFile file("/proc/"+tempFolder+QString("/status")); //read status file
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
return;
@@ -972,7 +973,7 @@ void PVS::showProc()
if (line.startsWith("Name:")) //to get the name of our process
{
name = line.remove(0,6);
- snd.append(tmp).append(QString("<#>")).append(line).append("<#>");
+ tempSend.append(tempFolder).append(QString("<#>")).append(line).append("<#>");
//lets check if the process belongs to our PVS better not to show it if we dont want to crash PVS
} else if (line.startsWith("Gid:")) //and to check that the process is a user process
//we had to read name first because every file in /proc
@@ -996,7 +997,7 @@ void PVS::showProc()
}
if (write) //if process belongs to user (and not to PVS) we go on
{
- QFile file("/proc/"+tmp+QString("/cmdline")); //and read cmdline
+ QFile file("/proc/"+tempFolder+QString("/cmdline")); //and read cmdline
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
return;
@@ -1004,13 +1005,13 @@ void PVS::showProc()
QString line = in.readLine();
while (!line.isNull())
{
- int templength = snd.length()+3;
- snd.append(line.left(150+templength)); //but only up to a length of 150-name-id-seperators
+ int templength = tempSend.length()+3;
+ tempSend.append(line.left(150+templength)); //but only up to a length of 150-name-id-seperators
break;
}
}
if (write) //if process belongs to user we send the line to client
- _pvsServerConnection->sendMessage(PVSMsg(PVSCOMMAND, "PROCESSES", "SHOW "+snd));
+ _pvsServerConnection->sendMessage(PVSMsg(PVSCOMMAND, "PROCESSES", "SHOW "+tempSend));
}
}
_pvsServerConnection->sendMessage(PVSMsg(PVSCOMMAND, "PROCESSES", "SHOW finished")); //at the end we send that every process has been sent