mirror of
https://github.com/KDE/konsole.git
synced 2026-05-05 13:14:22 -04:00
Initial implementation of session management in Konsole.
Patch from Stefan Becker <stefan.becker@nokia.com> Thank-you very much Stefan! CCBUG: 152761 svn path=/trunk/KDE/kdebase/apps/konsole/; revision=867323
This commit is contained in:
@@ -64,18 +64,10 @@ void ProcessInfo::update()
|
||||
readProcessInfo(_pid,_enableEnvironmentRead);
|
||||
}
|
||||
|
||||
QString ProcessInfo::format(const QString& input) const
|
||||
QString ProcessInfo::validCurrentDir() const
|
||||
{
|
||||
bool ok = false;
|
||||
|
||||
QString output(input);
|
||||
|
||||
// search for and replace known marker
|
||||
output.replace("%u","NOT IMPLEMENTED YET");
|
||||
output.replace("%n",name(&ok));
|
||||
output.replace("%c",formatCommand(name(&ok),arguments(&ok),ShortCommandFormat));
|
||||
output.replace("%C",formatCommand(name(&ok),arguments(&ok),LongCommandFormat));
|
||||
|
||||
// read current dir, if an error occurs try the parent as the next
|
||||
// best option
|
||||
int currentPid = parentPid(&ok);
|
||||
@@ -88,7 +80,23 @@ QString ProcessInfo::format(const QString& input) const
|
||||
dir = current->currentDir(&ok);
|
||||
delete current;
|
||||
}
|
||||
|
||||
|
||||
return dir;
|
||||
}
|
||||
|
||||
QString ProcessInfo::format(const QString& input) const
|
||||
{
|
||||
bool ok = false;
|
||||
|
||||
QString output(input);
|
||||
|
||||
// search for and replace known marker
|
||||
output.replace("%u","NOT IMPLEMENTED YET");
|
||||
output.replace("%n",name(&ok));
|
||||
output.replace("%c",formatCommand(name(&ok),arguments(&ok),ShortCommandFormat));
|
||||
output.replace("%C",formatCommand(name(&ok),arguments(&ok),LongCommandFormat));
|
||||
|
||||
QString dir = validCurrentDir();
|
||||
output.replace("%D",dir);
|
||||
output.replace("%d",formatShortDir(dir));
|
||||
|
||||
@@ -731,3 +739,11 @@ ProcessInfo* ProcessInfo::newInstance(int pid,bool enableEnvironmentRead)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
Local Variables:
|
||||
mode: c++
|
||||
c-file-style: "stroustrup"
|
||||
indent-tabs-mode: nil
|
||||
tab-width: 4
|
||||
End:
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user