X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/66ad27aba14cdfea777b9ebe1beb161f80f26463..d324e790d62c8a341abd06e845f8fe8d64aa8ef3:/src/dolphinfileitemdelegate.cpp diff --git a/src/dolphinfileitemdelegate.cpp b/src/dolphinfileitemdelegate.cpp index ddd4435a7..7a6ef118e 100644 --- a/src/dolphinfileitemdelegate.cpp +++ b/src/dolphinfileitemdelegate.cpp @@ -59,15 +59,15 @@ void DolphinFileItemDelegate::paint(QPainter* painter, KFileItemDelegate::paint(painter, option, index); } - if (dolphinModel->hasRevisionData() && isNameColumn) { + if (dolphinModel->hasVersionData() && isNameColumn) { // The currently shown items are under revision control. Show the current revision // state by adding an emblem. const QModelIndex dirIndex = proxyModel->mapToSource(index); - const QModelIndex revisionIndex = dolphinModel->index(dirIndex.row(), DolphinModel::Revision); + const QModelIndex revisionIndex = dolphinModel->index(dirIndex.row(), DolphinModel::Version, dirIndex.parent()); const QVariant data = dolphinModel->data(revisionIndex, Qt::DecorationRole); - const RevisionControlPlugin::RevisionState state = static_cast(data.toInt()); + const KVersionControlPlugin::VersionState state = static_cast(data.toInt()); - if (state != RevisionControlPlugin::UnversionedRevision) { + if (state != KVersionControlPlugin::UnversionedVersion) { const QRect rect = iconRect(option, index); const QPixmap emblem = emblemForState(state, rect.size()); painter->drawPixmap(rect.x(), rect.y() + rect.height() - emblem.height(), emblem); @@ -105,11 +105,11 @@ void DolphinFileItemDelegate::adjustOptionWidth(QStyleOptionViewItemV4& option, } } -QPixmap DolphinFileItemDelegate::emblemForState(RevisionControlPlugin::RevisionState state, const QSize& size) const +QPixmap DolphinFileItemDelegate::emblemForState(KVersionControlPlugin::VersionState state, const QSize& size) const { // TODO: all icons that are use here will be replaced by revision control emblems provided by the // Oxygen team before KDE 4.4 - Q_ASSERT(state <= RevisionControlPlugin::ConflictingRevision); + Q_ASSERT(state <= KVersionControlPlugin::ConflictingVersion); if ((m_cachedSize != size) || !m_cachedEmblems[state].isNull()) { m_cachedSize = size; @@ -122,19 +122,18 @@ QPixmap DolphinFileItemDelegate::emblemForState(RevisionControlPlugin::RevisionS } else if (iconHeight >= KIconLoader::SizeMedium) { emblemHeight = KIconLoader::SizeSmall; } else { - // TODO: it depends on the final icons whether a smaller size works - emblemHeight = KIconLoader::SizeSmall /* / 2 */; + emblemHeight = KIconLoader::SizeSmall / 2; } const QSize emblemSize(emblemHeight, emblemHeight); - for (int i = 0; i <= RevisionControlPlugin::ConflictingRevision; ++i) { + for (int i = 0; i <= KVersionControlPlugin::ConflictingVersion; ++i) { QString iconName; switch (state) { - case RevisionControlPlugin::NormalRevision: iconName = "dialog-ok-apply"; break; - case RevisionControlPlugin::UpdateRequiredRevision: iconName = "rating"; break; - case RevisionControlPlugin::LocallyModifiedRevision: iconName = "emblem-important"; break; - case RevisionControlPlugin::AddedRevision: iconName = "list-add"; break; - case RevisionControlPlugin::ConflictingRevision: iconName = "application-exit"; break; + case KVersionControlPlugin::NormalVersion: iconName = "vcs-normal"; break; + case KVersionControlPlugin::UpdateRequiredVersion: iconName = "vcs-update-required"; break; + case KVersionControlPlugin::LocallyModifiedVersion: iconName = "vcs-locally-modified"; break; + case KVersionControlPlugin::AddedVersion: iconName = "vcs-added"; break; + case KVersionControlPlugin::ConflictingVersion: iconName = "vcs-conflicting"; break; default: Q_ASSERT(false); break; }