If no user icon present, show a generic one

svn path=/trunk/KDE/kdebase/apps/; revision=685426
This commit is contained in:
Rafael Fernández López 2007-07-08 20:43:34 +00:00
parent 77d3d37246
commit 90ca3c31dc

View file

@ -274,7 +274,14 @@ void DolphinItemCategorizer::drawCategory(const QModelIndex &index,
case DolphinView::SortByOwner: {
opt.rect.setTop(option.rect.top() + (iconSize / 4));
KUser user(category);
icon = QPixmap::fromImage(QImage(user.homeDir() + QDir::separator() + ".face.icon")).scaled(iconSize, iconSize);
if (QFile::exists(user.homeDir() + QDir::separator() + ".face.icon"))
{
icon = QPixmap::fromImage(QImage(user.homeDir() + QDir::separator() + ".face.icon")).scaled(iconSize, iconSize);
}
else
{
icon = KIconLoader::global()->loadIcon("user", K3Icon::Small);
}
break;
}