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:
Robert Knight
2008-10-03 10:38:50 +00:00
parent 4023b86754
commit ef3e43e11d
14 changed files with 584 additions and 204 deletions

View File

@@ -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:
*/