mirror of
https://github.com/KDE/konsole.git
synced 2026-05-04 04:33:38 -04:00
make Session::updateForegroundProcessInfo() easier to understand
This commit is contained in:
@@ -961,26 +961,25 @@ void Session::updateSessionProcessInfo()
|
||||
|
||||
bool Session::updateForegroundProcessInfo()
|
||||
{
|
||||
bool valid = (_foregroundProcessInfo != 0);
|
||||
|
||||
// has foreground process changed?
|
||||
Q_ASSERT(_shellProcess);
|
||||
|
||||
int pid = _shellProcess->foregroundProcessGroup();
|
||||
if (pid != _foregroundPid)
|
||||
{
|
||||
delete _foregroundProcessInfo;
|
||||
_foregroundProcessInfo = ProcessInfo::newInstance(pid);
|
||||
_foregroundPid = pid;
|
||||
valid = true;
|
||||
}
|
||||
|
||||
if (valid)
|
||||
if (_foregroundProcessInfo)
|
||||
{
|
||||
_foregroundProcessInfo->update();
|
||||
valid = _foregroundProcessInfo->isValid();
|
||||
return _foregroundProcessInfo->isValid();
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
bool Session::isRemote()
|
||||
|
||||
Reference in New Issue
Block a user