From 659e756d5ba4944de7d8d87cbf3574cd97027150 Mon Sep 17 00:00:00 2001 From: Fabian Schillinger Date: Wed, 10 Nov 2010 19:16:47 +0100 Subject: moved filter for ProcessList to pvsmgr.conf (this way the user cant modify its filter) --- src/gui/processWidget.cpp | 11 +++++++---- src/gui/processWidget.h | 2 ++ src/pvs.cpp | 11 +++++------ src/pvs.h | 2 +- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/gui/processWidget.cpp b/src/gui/processWidget.cpp index 38dd2ae..2211c93 100644 --- a/src/gui/processWidget.cpp +++ b/src/gui/processWidget.cpp @@ -23,7 +23,10 @@ ProcessWidget::ProcessWidget(QWidget *parent, PVSClient *cl): QWidget(parent), prowui(new Ui::ProcessWidget) { + //filterSettings.setValue("RemoteProcessesList/filter", "pvs pvsgui pvsmgr pvsmgrtouch"); + prowui->setupUi(this); + filter = filterSettings.value("RemoteProcessesList/filter").toString(); client = cl; @@ -33,7 +36,7 @@ ProcessWidget::ProcessWidget(QWidget *parent, PVSClient *cl): connect( client, SIGNAL( processVectorReady(bool)), this, SLOT( refrProcessList())); //tell client we want to see his processes - sendCommand("SHOWPROCESSES", ""); + sendCommand("SHOWPROCESSES", filter); } void ProcessWidget::startProcess() @@ -46,14 +49,14 @@ void ProcessWidget::startProcess() if (start == QMessageBox::Ok) { sendCommand("STARTPROCESS", prowui->processLineEdit->text()); - sendCommand("SHOWPROCESSES", ""); + sendCommand("SHOWPROCESSES", filter); } prowui->processLineEdit->clear(); } void ProcessWidget::resendProcessList() { - sendCommand("SHOWPROCESSES", ""); + sendCommand("SHOWPROCESSES", filter); } void ProcessWidget::refrProcessList(bool timerEvent) @@ -127,7 +130,7 @@ void ProcessWidget::stopProcess() } } //tell client to update his list - sendCommand("SHOWPROCESSES", ""); + sendCommand("SHOWPROCESSES", filter); } } diff --git a/src/gui/processWidget.h b/src/gui/processWidget.h index 4d696eb..7f6737c 100644 --- a/src/gui/processWidget.h +++ b/src/gui/processWidget.h @@ -25,6 +25,8 @@ private: Ui::ProcessWidget *prowui; PVSClient *client; QVector *processes; + QSettings filterSettings; + QString filter; private slots: void startProcess(); diff --git a/src/pvs.cpp b/src/pvs.cpp index 843a725..1f751b8 100755 --- a/src/pvs.cpp +++ b/src/pvs.cpp @@ -263,7 +263,7 @@ void PVS::onCommand(PVSMsg cmdMessage) if (ident.compare("SHOWPROCESSES") == 0) { _pvsServerConnection->sendMessage(PVSMsg(PVSCOMMAND, "PROCESSES", "SHOW clear")); //tell the client that we want to clear his process-list - showProc(); + showProc(message); return; } if (ident.compare("STARTPROCESS") == 0) @@ -938,10 +938,9 @@ QString PVS::getConfigValue(QString key) return _settings.value(key).toString(); } -void PVS::showProc() +void PVS::showProc(QString filter) { - QString settings = getConfigValue("RemoteProcess/filter"); - QStringList filter = settings.split(" "); + QStringList filterList = filter.split(" "); //look at procfs QDir procfs("/proc"); @@ -988,9 +987,9 @@ void PVS::showProc() } if (write) //check if user belongs to pvs { - for (int i=0;i