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<RevisionControlPlugin::RevisionState>(data.toInt());
+ const KVersionControlPlugin::VersionState state = static_cast<KVersionControlPlugin::VersionState>(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);
}
}
-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;
} 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;
}