Skip to content

Commit

Permalink
Fix display of user avatars. (#684)
Browse files Browse the repository at this point in the history
QFile::exists("...") does not understand file:// URLs, at least in Qt
5.7.0 and Qt 4.8.7.
  • Loading branch information
bastianbeischer authored and plfiorini committed Sep 2, 2016
1 parent 43c9005 commit ecb903e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/greeter/UserModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ namespace SDDM {
d->lastIndex = i;

if (avatarsEnabled) {
const QString userFace = QStringLiteral("file://%1/.face.icon").arg(user->homeDir);
const QString systemFace = QStringLiteral("file://%1/%2.face.icon").arg(facesDir).arg(user->name);
const QString userFace = QStringLiteral("%1/.face.icon").arg(user->homeDir);
const QString systemFace = QStringLiteral("%1/%2.face.icon").arg(facesDir).arg(user->name);

if (QFile::exists(userFace))
user->icon = userFace;
user->icon = QStringLiteral("file://%1").arg(userFace);
else if (QFile::exists(systemFace))
user->icon = systemFace;
user->icon = QStringLiteral("file://%1").arg(systemFace);
}
}
}
Expand Down

0 comments on commit ecb903e

Please sign in to comment.