|
|
|
@ -37,7 +37,7 @@ MagicLabel::MagicLabel(TQString s, bool translate)
|
|
|
|
|
|
|
|
|
|
void MagicLabel::transform()
|
|
|
|
|
{
|
|
|
|
|
if (mValue.tqcontains(prefix + preUSER))
|
|
|
|
|
if (mValue.contains(prefix + preUSER))
|
|
|
|
|
getUserInfo();
|
|
|
|
|
else if (mValue.startsWith(prefix + preCMD))
|
|
|
|
|
getCommandOutput();
|
|
|
|
@ -48,12 +48,12 @@ void MagicLabel::getUserInfo()
|
|
|
|
|
{
|
|
|
|
|
static KUser user;
|
|
|
|
|
|
|
|
|
|
if (mValue.tqcontains(prefix + preUSER + "loginname"))
|
|
|
|
|
mValue = mValue.tqreplace(prefix + preUSER + "loginname", user.loginName());
|
|
|
|
|
else if (mValue.tqcontains(prefix + preUSER + "fullname"))
|
|
|
|
|
mValue = mValue.tqreplace(prefix + preUSER + "fullname", user.fullName());
|
|
|
|
|
else if (mValue.tqcontains(prefix + preUSER + "homedir"))
|
|
|
|
|
mValue = mValue.tqreplace(prefix + preUSER + "homedir", user.homeDir());
|
|
|
|
|
if (mValue.contains(prefix + preUSER + "loginname"))
|
|
|
|
|
mValue = mValue.replace(prefix + preUSER + "loginname", user.loginName());
|
|
|
|
|
else if (mValue.contains(prefix + preUSER + "fullname"))
|
|
|
|
|
mValue = mValue.replace(prefix + preUSER + "fullname", user.fullName());
|
|
|
|
|
else if (mValue.contains(prefix + preUSER + "homedir"))
|
|
|
|
|
mValue = mValue.replace(prefix + preUSER + "homedir", user.homeDir());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -80,7 +80,7 @@ void MagicLabel::getCommandOutput()
|
|
|
|
|
void MagicLabel::receivedStdout(KProcess *proc, char *buffer, int buflen)
|
|
|
|
|
{
|
|
|
|
|
TQString buf = TQString::tqfromLatin1(buffer, buflen);
|
|
|
|
|
mValue += buf.tqreplace("\n", "");
|
|
|
|
|
mValue += buf.replace("\n", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|