summaryrefslogtreecommitdiff
path: root/noncore/settings
Side-by-side diff
Diffstat (limited to 'noncore/settings') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/modulesinfo.cpp5
-rw-r--r--noncore/settings/sysinfo/processinfo.cpp7
2 files changed, 11 insertions, 1 deletions
diff --git a/noncore/settings/sysinfo/modulesinfo.cpp b/noncore/settings/sysinfo/modulesinfo.cpp
index 8b58fe9..29cce90 100644
--- a/noncore/settings/sysinfo/modulesinfo.cpp
+++ b/noncore/settings/sysinfo/modulesinfo.cpp
@@ -113,24 +113,29 @@ void ModulesInfo::updateData()
QString qusecount = QString::number( usecount ).rightJustify( 2, ' ' );
QString qusage = QString( usage );
( void ) new QListViewItem( ModulesView, qmodname, qmodsize, qusecount, qusage );
}
fclose( procfile );
}
}
void ModulesInfo::slotSendClicked()
{
+ if ( !ModulesView->currentItem() )
+ {
+ return;
+ }
+
QString capstr = tr( "You really want to execute\n" );
capstr.append( CommandCB->currentText() );
capstr.append( "\nfor this module?" );
QString modname = ModulesView->currentItem()->text( 0 );
if ( QMessageBox::warning( this, modname, capstr,
QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes )
{
QString command = "/sbin/";
command.append( CommandCB->currentText() );
command.append( " " );
diff --git a/noncore/settings/sysinfo/processinfo.cpp b/noncore/settings/sysinfo/processinfo.cpp
index 35d7ba1..9a5446a 100644
--- a/noncore/settings/sysinfo/processinfo.cpp
+++ b/noncore/settings/sysinfo/processinfo.cpp
@@ -135,29 +135,34 @@ void ProcessInfo::updateData()
( void ) new QListViewItem( ProcessView, processnum, processcmd, processstatus, processtime );
}
}
}
}
delete proclist;
delete procdir;
}
void ProcessInfo::slotSendClicked()
{
+ QListViewItem *currprocess = ProcessView->currentItem();
+ if ( !currprocess )
+ {
+ return;
+ }
+
QString capstr = tr( "You really want to send\n" );
capstr.append( SignalCB->currentText() );
capstr.append( "\nto this process?" );
- QListViewItem *currprocess = ProcessView->currentItem();
if ( QMessageBox::warning( this, currprocess->text( 1 ), capstr,
QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes )
{
QString sigstr = SignalCB->currentText();
sigstr.truncate(2);
int sigid = sigstr.toUInt();
if ( kill( currprocess->text( 0 ).stripWhiteSpace().toUInt(), sigid ) == 0 )
{
hide();
}
}