kdepasswm kcm: Fall back to the system full name when necessary.

When loading the KCM data and KEmailSettings::RealName is empty, fall
back to using the user's real name from /etc/passwd or equivalent via
KUser.

To quote the original review request: "Besides, such method seems
natural, considering that change of real username in kcm module calls
chfn to change real name in finger db, which will be reflected back in
KUser::FullName."

REVIEW:		104965
Submitted by:	Aleksey Yermakov <alexey.yermakov@rosalab.ru>
This commit is contained in:
Raphael Kubo da Costa 2012-06-27 15:04:15 -03:00
parent f4fbf758ce
commit a277b80df8

View file

@ -144,7 +144,13 @@ void KCMUserAccount::load()
_kes->setProfile(_kes->defaultProfileName());
_mw->leRealname->setText( _kes->getSetting( KEMailSettings::RealName ));
QString realName = _kes->getSetting( KEMailSettings::RealName );
if (realName.isEmpty()) {
realName = _ku->property(KUser::FullName).toString();
}
_mw->leRealname->setText( realName );
_mw->leEmail->setText( _kes->getSetting( KEMailSettings::EmailAddress ));
_mw->leOrganization->setText( _kes->getSetting( KEMailSettings::Organization ));
_mw->leSMTP->setText( _kes->getSetting( KEMailSettings::OutServer ));