From 4abdb02c37032ecd8087deca8037e0811b1b677e Mon Sep 17 00:00:00 2001 From: Fabian Schillinger Date: Fri, 5 Nov 2010 19:00:35 +0100 Subject: Cleanup --- src/gui/mainWindow.cpp | 7 +++++-- src/pvs.cpp | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'src') 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")).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 -- cgit v1.2.3-55-g7522