diff options
author | Fabian Schillinger | 2010-11-05 19:00:35 +0100 |
---|---|---|
committer | Fabian Schillinger | 2010-11-05 19:00:35 +0100 |
commit | 4abdb02c37032ecd8087deca8037e0811b1b677e (patch) | |
tree | bcfbddcab0c4a10db514490b4fb2e1f2c75de487 /src | |
parent | Aktualisierung Projektdoku ... (diff) | |
download | pvs-4abdb02c37032ecd8087deca8037e0811b1b677e.tar.gz pvs-4abdb02c37032ecd8087deca8037e0811b1b677e.tar.xz pvs-4abdb02c37032ecd8087deca8037e0811b1b677e.zip |
Cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/mainWindow.cpp | 7 | ||||
-rwxr-xr-x | src/pvs.cpp | 19 |
2 files changed, 15 insertions, 11 deletions
diff --git a/src/gui/mainWindow.cpp b/src/gui/mainWindow.cpp index 469248e..beb80f4 100644 --- a/src/gui/mainWindow.cpp +++ b/src/gui/mainWindow.cpp @@ -794,8 +794,11 @@ void MainWindow::unCloseUp(ConnectionFrame* connFrame) // Perform some action if actionShowProcesses button was pressed void MainWindow::showProcesses() { - ProcessDialog procShowDialog(0,displayedClientNameEnum); - procShowDialog.exec(); + if (PVSConnectionManager::getManager()->getConnections().size() > 0) + { + ProcessDialog procShowDialog(0,displayedClientNameEnum); + procShowDialog.exec(); + } } 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 |