QString KUser::faceIconPath() const { QString pathToFaceIcon(homeDir() + QDir::separator() + QLatin1String(".face.icon")); if (QFile::exists(pathToFaceIcon)) { return pathToFaceIcon; } return QString(); }
KUserProxy::KUserProxy (QObject *parent) : QObject(parent), m_temporaryEmptyFaceIconPath(false) { QString pathToFaceIcon(m_user.faceIconPath()); if (pathToFaceIcon.isEmpty()) { //KUser returns null if the current faceIconPath is empty //so we should explicitly watch ~/.face.icon rather than faceIconPath() //as we want to watch for this file being created pathToFaceIcon = QDir::homePath() + QStringLiteral("/.face.icon"); } m_dirWatch.addFile(pathToFaceIcon); if (QFile::exists(etcPasswd)) { m_dirWatch.addFile(etcPasswd); } connect(&m_dirWatch, &KDirWatch::dirty, this, &KUserProxy::update); connect(&m_dirWatch, &KDirWatch::created, this, &KUserProxy::update); }