From d288b1cda477623297c6e25eb63bb1295a99878f Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 19 Jul 2009 22:29:59 +0000 Subject: - interface cleanups - the subversion test plugin is at least capable of indicating the revision state for files svn path=/trunk/KDE/kdebase/apps/; revision=999489 --- src/dolphinfileitemdelegate.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/dolphinfileitemdelegate.cpp') diff --git a/src/dolphinfileitemdelegate.cpp b/src/dolphinfileitemdelegate.cpp index 7232c38f5..367435ced 100644 --- a/src/dolphinfileitemdelegate.cpp +++ b/src/dolphinfileitemdelegate.cpp @@ -63,9 +63,9 @@ void DolphinFileItemDelegate::paint(QPainter* painter, const QModelIndex dirIndex = proxyModel->mapToSource(index); const QModelIndex revisionIndex = dolphinModel->index(dirIndex.row(), DolphinModel::Revision); const QVariant data = dolphinModel->data(revisionIndex, Qt::DecorationRole); - const DolphinModel::RevisionState state = static_cast(data.toInt()); + const RevisionControlPlugin::RevisionState state = static_cast(data.toInt()); - if (state != DolphinModel::LocalRevision) { + if (state != RevisionControlPlugin::LocalRevision) { // TODO: extend KFileItemDelegate to be able to get the icon boundaries const QRect iconRect(option.rect.x(), option.rect.y(), KIconLoader::SizeSmall, KIconLoader::SizeSmall); @@ -105,22 +105,20 @@ void DolphinFileItemDelegate::adjustOptionWidth(QStyleOptionViewItemV4& option, } } -QPixmap DolphinFileItemDelegate::emblemForState(DolphinModel::RevisionState state, const QSize& size) +QPixmap DolphinFileItemDelegate::emblemForState(RevisionControlPlugin::RevisionState state, const QSize& size) { // TODO #1: all icons that are use here will be replaced by revision control emblems provided by the // Oxygen team before KDE 4.4 // TODO #2: cache the icons switch (state) { - case DolphinModel::LatestRevision: + case RevisionControlPlugin::LatestRevision: return KIcon("dialog-ok-apply").pixmap(size); - break; - - case DolphinModel::ConflictingRevision: + case RevisionControlPlugin::ConflictingRevision: + return KIcon("application-exit").pixmap(size); + case RevisionControlPlugin::UpdateRequiredRevision: + return KIcon("rating").pixmap(size); + case RevisionControlPlugin::EditingRevision: return KIcon("emblem-important").pixmap(size); - break; - - // ... - default: break; } -- cgit v1.3