mirror of
https://github.com/KDE/konsole.git
synced 2026-05-05 05:07:06 -04:00
Add formatter %h which expands to local hostname in local session
Note: this %h is different from the %h which expands to remote hostname in remote session. REVIEW: 104490
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QTextStream>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtNetwork/QHostInfo>
|
||||
|
||||
// KDE
|
||||
#include <KConfigGroup>
|
||||
@@ -123,6 +124,7 @@ QString ProcessInfo::format(const QString& input) const
|
||||
|
||||
// search for and replace known marker
|
||||
output.replace("%u", userName());
|
||||
output.replace("%h", localHost());
|
||||
output.replace("%n", name(&ok));
|
||||
|
||||
QString dir = validCurrentDir();
|
||||
@@ -251,6 +253,11 @@ QString ProcessInfo::userHomeDir() const
|
||||
return _userHomeDir;
|
||||
}
|
||||
|
||||
QString ProcessInfo::localHost()
|
||||
{
|
||||
return QHostInfo::localHostName();
|
||||
}
|
||||
|
||||
void ProcessInfo::setPid(int aPid)
|
||||
{
|
||||
_pid = aPid;
|
||||
|
||||
Reference in New Issue
Block a user