]> cloud.milkyroute.net Git - dolphin.git/commitdiff
* Use the term "version control" instead of "revision control" to be consistent with...
authorPeter Penz <peter.penz19@gmail.com>
Thu, 13 Aug 2009 20:48:58 +0000 (20:48 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Thu, 13 Aug 2009 20:48:58 +0000 (20:48 +0000)
* Renamed VersionControlPlugin to KVersionControlPlugin so that the interface can be moved out of Dolphin.

svn path=/trunk/KDE/kdebase/apps/; revision=1011058

15 files changed:
src/CMakeLists.txt
src/dolphincolumnwidget.cpp
src/dolphincontextmenu.cpp
src/dolphindetailsview.cpp
src/dolphinfileitemdelegate.cpp
src/dolphinfileitemdelegate.h
src/dolphinmodel.cpp
src/dolphinmodel.h
src/dolphinview.cpp
src/dolphinview.h
src/kversioncontrolplugin.cpp [moved from src/revisioncontrolplugin.cpp with 85% similarity]
src/kversioncontrolplugin.h [moved from src/revisioncontrolplugin.h with 71% similarity]
src/panels/folders/paneltreeview.cpp
src/versioncontrolobserver.cpp [moved from src/revisioncontrolobserver.cpp with 76% similarity]
src/versioncontrolobserver.h [moved from src/revisioncontrolobserver.h with 89% similarity]

index 4da9a66285479eb8d7d8717c21fc6645f6696fe0..f220597235683859c7ecadd988ca40916619cc87 100644 (file)
@@ -33,9 +33,8 @@ set(dolphinprivate_LIB_SRCS
     dolphinremoteencoding.cpp
     draganddrophelper.cpp
     folderexpander.cpp
     dolphinremoteencoding.cpp
     draganddrophelper.cpp
     folderexpander.cpp
+    kversioncontrolplugin.cpp
     renamedialog.cpp
     renamedialog.cpp
-    revisioncontrolobserver.cpp
-    revisioncontrolplugin.cpp
     selectiontoggle.cpp
     selectionmanager.cpp
     settings/additionalinfodialog.cpp
     selectiontoggle.cpp
     selectionmanager.cpp
     settings/additionalinfodialog.cpp
@@ -49,6 +48,7 @@ set(dolphinprivate_LIB_SRCS
     tooltips/ktooltipitem.cpp
     tooltips/kformattedballoontipdelegate.cpp
     tooltips/tooltipmanager.cpp
     tooltips/ktooltipitem.cpp
     tooltips/kformattedballoontipdelegate.cpp
     tooltips/tooltipmanager.cpp
+    versioncontrolobserver.cpp
     viewproperties.cpp
     zoomlevelinfo.cpp
     )
     viewproperties.cpp
     zoomlevelinfo.cpp
     )
index afa79e78f2fe3883a0877b315f3a77526136dfa7..0ad02c71e848fbf89373a1da4406fc5b2cdb92b1 100644 (file)
@@ -30,9 +30,9 @@
 #include "dolphin_generalsettings.h"
 #include "draganddrophelper.h"
 #include "folderexpander.h"
 #include "dolphin_generalsettings.h"
 #include "draganddrophelper.h"
 #include "folderexpander.h"
-#include "revisioncontrolobserver.h"
 #include "selectionmanager.h"
 #include "tooltips/tooltipmanager.h"
 #include "selectionmanager.h"
 #include "tooltips/tooltipmanager.h"
+#include "versioncontrolobserver.h"
 
 #include <kcolorscheme.h>
 #include <kdirlister.h>
 
 #include <kcolorscheme.h>
 #include <kdirlister.h>
@@ -156,7 +156,7 @@ DolphinColumnWidget::DolphinColumnWidget(QWidget* parent,
     connect (folderExpander, SIGNAL(enterDir(const QModelIndex&)),
              m_view->m_controller, SLOT(triggerItem(const QModelIndex&)));
 
     connect (folderExpander, SIGNAL(enterDir(const QModelIndex&)),
              m_view->m_controller, SLOT(triggerItem(const QModelIndex&)));
 
-    new RevisionControlObserver(this);
+    new VersionControlObserver(this);
 }
 
 DolphinColumnWidget::~DolphinColumnWidget()
 }
 
 DolphinColumnWidget::~DolphinColumnWidget()
index 86b0ff15972dbc8e166d2dd54d6cca586446dfa1..ed99a34e74fc669e41b0fb308236bf7397b3b32d 100644 (file)
@@ -223,7 +223,7 @@ void DolphinContextMenu::openItemContextMenu()
         popup->addSeparator();
     }
 
         popup->addSeparator();
     }
 
-    // insert revision control actions
+    // insert version control actions
     addRevisionControlActions(popup);
 
     // insert 'Copy To' and 'Move To' sub menus
     addRevisionControlActions(popup);
 
     // insert 'Copy To' and 'Move To' sub menus
@@ -393,9 +393,9 @@ KFileItemListProperties& DolphinContextMenu::capabilities()
 void DolphinContextMenu::addRevisionControlActions(KMenu* menu)
 {
     const DolphinView* view = m_mainWindow->activeViewContainer()->view();
 void DolphinContextMenu::addRevisionControlActions(KMenu* menu)
 {
     const DolphinView* view = m_mainWindow->activeViewContainer()->view();
-    const QList<QAction*> revControlActions = view->revisionControlActions(m_selectedItems);
-    if (!revControlActions.isEmpty()) {
-        foreach (QAction* action, revControlActions) {
+    const QList<QAction*> versionControlActions = view->versionControlActions(m_selectedItems);
+    if (!versionControlActions.isEmpty()) {
+        foreach (QAction* action, versionControlActions) {
             menu->addAction(action);
         }
         menu->addSeparator();
             menu->addAction(action);
         }
         menu->addSeparator();
index 4a9b9038d3a4ff9df3d41ca5a196b4cf55cadcb5..8c1e6bf3b08c5927814f58069b8155c4dfe17499 100644 (file)
@@ -563,7 +563,7 @@ void DolphinDetailsView::configureSettings(const QPoint& pos)
 
     // add checkbox items for each column
     QHeaderView* headerView = header();
 
     // add checkbox items for each column
     QHeaderView* headerView = header();
-    for (int i = DolphinModel::Size; i <= DolphinModel::Revision; ++i) {
+    for (int i = DolphinModel::Size; i <= DolphinModel::Version; ++i) {
         const int logicalIndex = headerView->logicalIndex(i);
         const QString text = model()->headerData(i, Qt::Horizontal).toString();
         QAction* action = popup.addAction(text);
         const int logicalIndex = headerView->logicalIndex(i);
         const QString text = model()->headerData(i, Qt::Horizontal).toString();
         QAction* action = popup.addAction(text);
@@ -598,7 +598,7 @@ void DolphinDetailsView::configureSettings(const QPoint& pos)
 void DolphinDetailsView::updateColumnVisibility()
 {
     const KFileItemDelegate::InformationList list = m_controller->dolphinView()->additionalInfo();
 void DolphinDetailsView::updateColumnVisibility()
 {
     const KFileItemDelegate::InformationList list = m_controller->dolphinView()->additionalInfo();
-    for (int i = DolphinModel::Size; i <= DolphinModel::Revision; ++i) {
+    for (int i = DolphinModel::Size; i <= DolphinModel::Version; ++i) {
         const KFileItemDelegate::Information info = infoForColumn(i);
         const bool hide = !list.contains(info);
         if (isColumnHidden(i) != hide) {
         const KFileItemDelegate::Information info = infoForColumn(i);
         const bool hide = !list.contains(info);
         if (isColumnHidden(i) != hide) {
@@ -899,14 +899,14 @@ void DolphinDetailsView::resizeColumns()
     QHeaderView* headerView = header();
     QFontMetrics fontMetrics(viewport()->font());
 
     QHeaderView* headerView = header();
     QFontMetrics fontMetrics(viewport()->font());
 
-    int columnWidth[DolphinModel::Revision + 1];
+    int columnWidth[DolphinModel::Version + 1];
     columnWidth[DolphinModel::Size] = fontMetrics.width("00000 Items");
     columnWidth[DolphinModel::ModifiedTime] = fontMetrics.width("0000-00-00 00:00");
     columnWidth[DolphinModel::Permissions] = fontMetrics.width("xxxxxxxxxx");
     columnWidth[DolphinModel::Owner] = fontMetrics.width("xxxxxxxxxx");
     columnWidth[DolphinModel::Group] = fontMetrics.width("xxxxxxxxxx");
     columnWidth[DolphinModel::Type] = fontMetrics.width("XXXX Xxxxxxx");
     columnWidth[DolphinModel::Size] = fontMetrics.width("00000 Items");
     columnWidth[DolphinModel::ModifiedTime] = fontMetrics.width("0000-00-00 00:00");
     columnWidth[DolphinModel::Permissions] = fontMetrics.width("xxxxxxxxxx");
     columnWidth[DolphinModel::Owner] = fontMetrics.width("xxxxxxxxxx");
     columnWidth[DolphinModel::Group] = fontMetrics.width("xxxxxxxxxx");
     columnWidth[DolphinModel::Type] = fontMetrics.width("XXXX Xxxxxxx");
-    columnWidth[DolphinModel::Revision] = fontMetrics.width("xxxxxxxx");
+    columnWidth[DolphinModel::Version] = fontMetrics.width("xxxxxxxx");
 
     int requiredWidth = 0;
     for (int i = KDirModel::Size; i <= KDirModel::Type; ++i) {
 
     int requiredWidth = 0;
     for (int i = KDirModel::Size; i <= KDirModel::Type; ++i) {
index d0c84a6bb3e0de12b0f33ce11b7491bc0d43d5e0..5060dd0d7786a971a3bdbe1dda95c9c3d9371fef 100644 (file)
@@ -59,15 +59,15 @@ void DolphinFileItemDelegate::paint(QPainter* painter,
         KFileItemDelegate::paint(painter, option, index);
     }
 
         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);
         // 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, dirIndex.parent());
+        const QModelIndex revisionIndex = dolphinModel->index(dirIndex.row(), DolphinModel::Version, dirIndex.parent());
         const QVariant data = dolphinModel->data(revisionIndex, Qt::DecorationRole);
         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);
             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
 {
     // 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;
 
     if ((m_cachedSize != size) || !m_cachedEmblems[state].isNull()) {
         m_cachedSize = size;
 
@@ -127,14 +127,14 @@ QPixmap DolphinFileItemDelegate::emblemForState(RevisionControlPlugin::RevisionS
         }
 
         const QSize emblemSize(emblemHeight, emblemHeight);
         }
 
         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) {
             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 = "dialog-ok-apply"; break;
+            case KVersionControlPlugin::UpdateRequiredVersion:  iconName = "rating"; break;
+            case KVersionControlPlugin::LocallyModifiedVersion: iconName = "emblem-important"; break;
+            case KVersionControlPlugin::AddedVersion:           iconName = "list-add"; break;
+            case KVersionControlPlugin::ConflictingVersion:     iconName = "application-exit"; break;
             default: Q_ASSERT(false); break;
             }
 
             default: Q_ASSERT(false); break;
             }
 
index bd6bfdf073f0cd0a6f5f23e3f30e7ca85f792d12..287136862bfff212950fda6d1d60a8d52f4c6dbf 100644 (file)
@@ -66,12 +66,12 @@ private:
                                   const DolphinModel* dolphinModel,
                                   const QModelIndex& index);
 
                                   const DolphinModel* dolphinModel,
                                   const QModelIndex& index);
 
-    QPixmap emblemForState(RevisionControlPlugin::RevisionState state, const QSize& size) const;
+    QPixmap emblemForState(KVersionControlPlugin::VersionState state, const QSize& size) const;
 
 private:
     bool m_hasMinimizedNameColumn;
     mutable QSize m_cachedSize;
 
 private:
     bool m_hasMinimizedNameColumn;
     mutable QSize m_cachedSize;
-    mutable QPixmap m_cachedEmblems[RevisionControlPlugin::ConflictingRevision + 1];
+    mutable QPixmap m_cachedEmblems[KVersionControlPlugin::ConflictingVersion + 1];
 };
 
 inline void DolphinFileItemDelegate::setMinimizedNameColumn(bool minimized)
 };
 
 inline void DolphinFileItemDelegate::setMinimizedNameColumn(bool minimized)
index 04bf4486e677228dbf069ee3c7c26d33e22c8476..3b507a8957d7ced2c63bfcc4ab28bfa0fe8f7a6f 100644 (file)
@@ -53,7 +53,7 @@ const char* DolphinModel::m_others = I18N_NOOP2("@title:group Name", "Others");
 
 DolphinModel::DolphinModel(QObject* parent) :
     KDirModel(parent),
 
 DolphinModel::DolphinModel(QObject* parent) :
     KDirModel(parent),
-    m_hasRevisionData(false),
+    m_hasVersionData(false),
     m_revisionHash()
 {
 }
     m_revisionHash()
 {
 }
@@ -64,16 +64,16 @@ DolphinModel::~DolphinModel()
 
 bool DolphinModel::setData(const QModelIndex& index, const QVariant& value, int role)
 {
 
 bool DolphinModel::setData(const QModelIndex& index, const QVariant& value, int role)
 {
-    if ((index.column() == DolphinModel::Revision) && (role == Qt::DecorationRole)) {
+    if ((index.column() == DolphinModel::Version) && (role == Qt::DecorationRole)) {
         // TODO: remove data again when items are deleted...
 
         const QPersistentModelIndex key = index;
         // TODO: remove data again when items are deleted...
 
         const QPersistentModelIndex key = index;
-        const RevisionControlPlugin::RevisionState state = static_cast<RevisionControlPlugin::RevisionState>(value.toInt());
-        if (m_revisionHash.value(key, RevisionControlPlugin::UnversionedRevision) != state) {
-            if (!m_hasRevisionData) {
+        const KVersionControlPlugin::VersionState state = static_cast<KVersionControlPlugin::VersionState>(value.toInt());
+        if (m_revisionHash.value(key, KVersionControlPlugin::UnversionedVersion) != state) {
+            if (!m_hasVersionData) {
                 connect(this, SIGNAL(rowsRemoved (const QModelIndex&, int, int)),
                         this, SLOT(slotRowsRemoved(const QModelIndex&, int, int)));
                 connect(this, SIGNAL(rowsRemoved (const QModelIndex&, int, int)),
                         this, SLOT(slotRowsRemoved(const QModelIndex&, int, int)));
-                m_hasRevisionData = true;
+                m_hasVersionData = true;
             }
 
             m_revisionHash.insert(key, state);
             }
 
             m_revisionHash.insert(key, state);
@@ -95,27 +95,27 @@ QVariant DolphinModel::data(const QModelIndex& index, int role) const
         return sortRoleData(index);
 
     case Qt::DecorationRole:
         return sortRoleData(index);
 
     case Qt::DecorationRole:
-        if (index.column() == DolphinModel::Revision) {
-            return m_revisionHash.value(index, RevisionControlPlugin::UnversionedRevision);
+        if (index.column() == DolphinModel::Version) {
+            return m_revisionHash.value(index, KVersionControlPlugin::UnversionedVersion);
         }
         break;
 
     case Qt::DisplayRole:
         }
         break;
 
     case Qt::DisplayRole:
-        if (index.column() == DolphinModel::Revision) {
-            switch (m_revisionHash.value(index, RevisionControlPlugin::UnversionedRevision)) {
-            case RevisionControlPlugin::NormalRevision:
+        if (index.column() == DolphinModel::Version) {
+            switch (m_revisionHash.value(index, KVersionControlPlugin::UnversionedVersion)) {
+            case KVersionControlPlugin::NormalVersion:
                 return i18nc("@item::intable", "Normal");
                 return i18nc("@item::intable", "Normal");
-            case RevisionControlPlugin::UpdateRequiredRevision:
+            case KVersionControlPlugin::UpdateRequiredVersion:
                 return i18nc("@item::intable", "Update required");
                 return i18nc("@item::intable", "Update required");
-            case RevisionControlPlugin::LocallyModifiedRevision:
+            case KVersionControlPlugin::LocallyModifiedVersion:
                 return i18nc("@item::intable", "Locally modified");
                 return i18nc("@item::intable", "Locally modified");
-            case RevisionControlPlugin::AddedRevision:
+            case KVersionControlPlugin::AddedVersion:
                 return i18nc("@item::intable", "Added");
                 return i18nc("@item::intable", "Added");
-            case RevisionControlPlugin::RemovedRevision:
+            case KVersionControlPlugin::RemovedVersion:
                 return i18nc("@item::intable", "Removed");
                 return i18nc("@item::intable", "Removed");
-            case RevisionControlPlugin::ConflictingRevision:
+            case KVersionControlPlugin::ConflictingVersion:
                 return i18nc("@item::intable", "Conflicting");
                 return i18nc("@item::intable", "Conflicting");
-            case RevisionControlPlugin::UnversionedRevision:
+            case KVersionControlPlugin::UnversionedVersion:
             default:
                 return i18nc("@item::intable", "Unversioned");
             }
             default:
                 return i18nc("@item::intable", "Unversioned");
             }
@@ -136,8 +136,8 @@ QVariant DolphinModel::headerData(int section, Qt::Orientation orientation, int
             return KDirModel::headerData(section, orientation, role);
         }
 
             return KDirModel::headerData(section, orientation, role);
         }
 
-        Q_ASSERT(section == DolphinModel::Revision);
-        return i18nc("@title::column", "Revision");
+        Q_ASSERT(section == DolphinModel::Version);
+        return i18nc("@title::column", "Version");
     }
     return QVariant();
 }
     }
     return QVariant();
 }
@@ -147,20 +147,20 @@ int DolphinModel::columnCount(const QModelIndex& parent) const
     return KDirModel::columnCount(parent) + (ExtraColumnCount - ColumnCount);
 }
 
     return KDirModel::columnCount(parent) + (ExtraColumnCount - ColumnCount);
 }
 
-void DolphinModel::clearRevisionData()
+void DolphinModel::clearVersionData()
 {
     m_revisionHash.clear();
 {
     m_revisionHash.clear();
-    m_hasRevisionData = false;
+    m_hasVersionData = false;
 }
 
 }
 
-bool DolphinModel::hasRevisionData() const
+bool DolphinModel::hasVersionData() const
 {
 {
-    return m_hasRevisionData;
+    return m_hasVersionData;
 }
 
 void DolphinModel::slotRowsRemoved(const QModelIndex& parent, int start, int end)
 {
 }
 
 void DolphinModel::slotRowsRemoved(const QModelIndex& parent, int start, int end)
 {
-    if (m_hasRevisionData) {
+    if (m_hasVersionData) {
         const int column = parent.column();
         for (int row = start; row <= end; ++row) {
             m_revisionHash.remove(parent.child(row, column));
         const int column = parent.column();
         for (int row = start; row <= end; ++row) {
             m_revisionHash.remove(parent.child(row, column));
@@ -369,7 +369,7 @@ QVariant DolphinModel::displayRoleData(const QModelIndex& index) const
         retString = item.mimeComment();
         break;
 
         retString = item.mimeComment();
         break;
 
-    case DolphinModel::Revision:
+    case DolphinModel::Version:
         retString = "test";
         break;
     }
         retString = "test";
         break;
     }
index 1fd96c5f6eb6f01aa2a802141d6ead236d3825e1..89a0a761c00d7684820cc3bfe93ad2f7f6c78b7f 100644 (file)
@@ -22,7 +22,7 @@
 #define DOLPHINMODEL_H
 
 #include <kdirmodel.h>
 #define DOLPHINMODEL_H
 
 #include <kdirmodel.h>
-#include <revisioncontrolplugin.h>
+#include <kversioncontrolplugin.h>
 #include <libdolphin_export.h>
 
 #include <QHash>
 #include <libdolphin_export.h>
 
 #include <QHash>
@@ -34,7 +34,7 @@ class LIBDOLPHINPRIVATE_EXPORT DolphinModel : public KDirModel
 
 public:
     enum AdditionalColumns {
 
 public:
     enum AdditionalColumns {
-        Revision = KDirModel::ColumnCount,
+        Version = KDirModel::ColumnCount,
         ExtraColumnCount
     };
 
         ExtraColumnCount
     };
 
@@ -46,8 +46,8 @@ public:
     virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
     virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
 
     virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
     virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
 
-    void clearRevisionData();
-    bool hasRevisionData() const;
+    void clearVersionData();
+    bool hasVersionData() const;
 
 private slots:
     void slotRowsRemoved(const QModelIndex& parent, int start, int end);
 
 private slots:
     void slotRowsRemoved(const QModelIndex& parent, int start, int end);
@@ -57,8 +57,8 @@ private:
     QVariant sortRoleData(const QModelIndex& index) const;
 
 private:
     QVariant sortRoleData(const QModelIndex& index) const;
 
 private:
-    bool m_hasRevisionData;
-    QHash<QPersistentModelIndex, RevisionControlPlugin::RevisionState> m_revisionHash;
+    bool m_hasVersionData;
+    QHash<QPersistentModelIndex, KVersionControlPlugin::VersionState> m_revisionHash;
 
     static const char* m_others;
 };
 
     static const char* m_others;
 };
index 5899404793361b156efcdd43e8175cfc81c451fb..aa0bb96194631c6ff6d7f8d70ef62205ab135f6e 100644 (file)
@@ -62,9 +62,9 @@
 #include "draganddrophelper.h"
 #include "folderexpander.h"
 #include "renamedialog.h"
 #include "draganddrophelper.h"
 #include "folderexpander.h"
 #include "renamedialog.h"
-#include "revisioncontrolobserver.h"
 #include "tooltips/tooltipmanager.h"
 #include "settings/dolphinsettings.h"
 #include "tooltips/tooltipmanager.h"
 #include "settings/dolphinsettings.h"
+#include "versioncontrolobserver.h"
 #include "viewproperties.h"
 #include "zoomlevelinfo.h"
 
 #include "viewproperties.h"
 #include "zoomlevelinfo.h"
 
@@ -105,7 +105,7 @@ DolphinView::DolphinView(QWidget* parent,
     m_proxyModel(proxyModel),
     m_previewGenerator(0),
     m_toolTipManager(0),
     m_proxyModel(proxyModel),
     m_previewGenerator(0),
     m_toolTipManager(0),
-    m_revisionControlObserver(0),
+    m_versionControlObserver(0),
     m_rootUrl(),
     m_activeItemUrl(),
     m_createdItemUrl(),
     m_rootUrl(),
     m_activeItemUrl(),
     m_createdItemUrl(),
@@ -522,9 +522,9 @@ void DolphinView::updateView(const KUrl& url, const KUrl& rootUrl)
         loadDirectory(url);
     }
 
         loadDirectory(url);
     }
 
-    // When changing the URL there is no need to keep the revision
+    // When changing the URL there is no need to keep the version
     // data of the previous URL.
     // data of the previous URL.
-    m_dolphinModel->clearRevisionData();
+    m_dolphinModel->clearVersionData();
 
     emit startedPathLoading(url);
 }
 
     emit startedPathLoading(url);
 }
@@ -613,11 +613,11 @@ QString DolphinView::statusBarText() const
     return text;
 }
 
     return text;
 }
 
-QList<QAction*> DolphinView::revisionControlActions(const KFileItemList& items) const
+QList<QAction*> DolphinView::versionControlActions(const KFileItemList& items) const
 {
     return items.isEmpty()
 {
     return items.isEmpty()
-           ? m_revisionControlObserver->contextMenuActions(url().path(KUrl::AddTrailingSlash))
-           : m_revisionControlObserver->contextMenuActions(items);
+           ? m_versionControlObserver->contextMenuActions(url().path(KUrl::AddTrailingSlash))
+           : m_versionControlObserver->contextMenuActions(items);
 }
 
 void DolphinView::setUrl(const KUrl& url)
 }
 
 void DolphinView::setUrl(const KUrl& url)
@@ -1473,12 +1473,12 @@ void DolphinView::createView()
     m_previewGenerator = new KFilePreviewGenerator(view);
     m_previewGenerator->setPreviewShown(m_showPreview);
 
     m_previewGenerator = new KFilePreviewGenerator(view);
     m_previewGenerator->setPreviewShown(m_showPreview);
 
-    m_revisionControlObserver = new RevisionControlObserver(view);
-    connect(m_revisionControlObserver, SIGNAL(infoMessage(const QString&)),
+    m_versionControlObserver = new VersionControlObserver(view);
+    connect(m_versionControlObserver, SIGNAL(infoMessage(const QString&)),
             this, SIGNAL(infoMessage(const QString&)));
             this, SIGNAL(infoMessage(const QString&)));
-    connect(m_revisionControlObserver, SIGNAL(errorMessage(const QString&)),
+    connect(m_versionControlObserver, SIGNAL(errorMessage(const QString&)),
             this, SIGNAL(errorMessage(const QString&)));
             this, SIGNAL(errorMessage(const QString&)));
-    connect(m_revisionControlObserver, SIGNAL(operationCompletedMessage(const QString&)),
+    connect(m_versionControlObserver, SIGNAL(operationCompletedMessage(const QString&)),
             this, SIGNAL(operationCompletedMessage(const QString&)));
 
     if (DolphinSettings::instance().generalSettings()->showToolTips()) {
             this, SIGNAL(operationCompletedMessage(const QString&)));
 
     if (DolphinSettings::instance().generalSettings()->showToolTips()) {
index 0aa3c4b74ebe530ee994c4d87c944fa9bdda307f..58924697ed20bbc7635c2a8ece53656f41807a72 100644 (file)
@@ -54,8 +54,8 @@ class KAction;
 class KActionCollection;
 class KDirLister;
 class KUrl;
 class KActionCollection;
 class KDirLister;
 class KUrl;
-class RevisionControlObserver;
 class ToolTipManager;
 class ToolTipManager;
+class VersionControlObserver;
 class ViewProperties;
 
 /**
 class ViewProperties;
 
 /**
@@ -324,10 +324,10 @@ public:
     QString statusBarText() const;
 
     /**
     QString statusBarText() const;
 
     /**
-     * Returns the revision control actions that are provided for the items \p items.
+     * Returns the version control actions that are provided for the items \p items.
      * Usually the actions are presented in the context menu.
      */
      * Usually the actions are presented in the context menu.
      */
-    QList<QAction*> revisionControlActions(const KFileItemList& items) const;
+    QList<QAction*> versionControlActions(const KFileItemList& items) const;
 
     /**
      * Updates the state of the 'Additional Information' actions in \a collection.
 
     /**
      * Updates the state of the 'Additional Information' actions in \a collection.
@@ -814,7 +814,7 @@ private:
     KFilePreviewGenerator* m_previewGenerator;
     ToolTipManager* m_toolTipManager;
 
     KFilePreviewGenerator* m_previewGenerator;
     ToolTipManager* m_toolTipManager;
 
-    RevisionControlObserver* m_revisionControlObserver;
+    VersionControlObserver* m_versionControlObserver;
 
     KUrl m_rootUrl;
     KUrl m_activeItemUrl;
 
     KUrl m_rootUrl;
     KUrl m_activeItemUrl;
similarity index 85%
rename from src/revisioncontrolplugin.cpp
rename to src/kversioncontrolplugin.cpp
index 683398879f4102bfd4762db45cbc65a878737272..eb683c17cc391d1619f4db26ecabeb2d6d4ff1bc 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
-#include "revisioncontrolplugin.h"
+#include "kversioncontrolplugin.h"
 
 
-RevisionControlPlugin::RevisionControlPlugin()
+KVersionControlPlugin::KVersionControlPlugin()
 {
 }
 
 {
 }
 
-RevisionControlPlugin::~RevisionControlPlugin()
+KVersionControlPlugin::~KVersionControlPlugin()
 {
 }
 
 {
 }
 
-#include "revisioncontrolplugin.moc"
+#include "kversioncontrolplugin.moc"
 
 // ----------------------------------------------------------------------------
 
 
 // ----------------------------------------------------------------------------
 
@@ -48,8 +48,8 @@ RevisionControlPlugin::~RevisionControlPlugin()
 #include <QTextStream>
 
 SubversionPlugin::SubversionPlugin() :
 #include <QTextStream>
 
 SubversionPlugin::SubversionPlugin() :
-    m_revisionInfoHash(),
-    m_revisionInfoKeys(),
+    m_versionInfoHash(),
+    m_versionInfoKeys(),
     m_updateAction(0),
     m_showLocalChangesAction(0),
     m_commitAction(0),
     m_updateAction(0),
     m_showLocalChangesAction(0),
     m_commitAction(0),
@@ -113,18 +113,18 @@ bool SubversionPlugin::beginRetrieval(const QString& directory)
     while (process.waitForReadyRead()) {
         char buffer[1024];
         while (process.readLine(buffer, sizeof(buffer)) > 0)  {
     while (process.waitForReadyRead()) {
         char buffer[1024];
         while (process.readLine(buffer, sizeof(buffer)) > 0)  {
-            RevisionState state = NormalRevision;
+            VersionState state = NormalVersion;
             QString filePath(buffer);
 
             switch (buffer[0]) {
             QString filePath(buffer);
 
             switch (buffer[0]) {
-            case '?': state = UnversionedRevision; break;
-            case 'M': state = LocallyModifiedRevision; break;
-            case 'A': state = AddedRevision; break;
-            case 'D': state = RemovedRevision; break;
-            case 'C': state = ConflictingRevision; break;
+            case '?': state = UnversionedVersion; break;
+            case 'M': state = LocallyModifiedVersion; break;
+            case 'A': state = AddedVersion; break;
+            case 'D': state = RemovedVersion; break;
+            case 'C': state = ConflictingVersion; break;
             default:
                 if (filePath.contains('*')) {
             default:
                 if (filePath.contains('*')) {
-                    state = UpdateRequiredRevision;
+                    state = UpdateRequiredVersion;
                 }
                 break;
             }
                 }
                 break;
             }
@@ -133,12 +133,12 @@ bool SubversionPlugin::beginRetrieval(const QString& directory)
             const int length = filePath.length() - pos - 1;
             filePath = filePath.mid(pos, length);
             if (!filePath.isEmpty()) {
             const int length = filePath.length() - pos - 1;
             filePath = filePath.mid(pos, length);
             if (!filePath.isEmpty()) {
-                m_revisionInfoHash.insert(filePath, state);
+                m_versionInfoHash.insert(filePath, state);
             }
         }
     }
 
             }
         }
     }
 
-    m_revisionInfoKeys = m_revisionInfoHash.keys();
+    m_versionInfoKeys = m_versionInfoHash.keys();
     return true;
 }
 
     return true;
 }
 
@@ -146,32 +146,32 @@ void SubversionPlugin::endRetrieval()
 {
 }
 
 {
 }
 
-RevisionControlPlugin::RevisionState SubversionPlugin::revisionState(const KFileItem& item)
+KVersionControlPlugin::VersionState SubversionPlugin::versionState(const KFileItem& item)
 {
     const QString itemUrl = item.localPath();
 {
     const QString itemUrl = item.localPath();
-    if (m_revisionInfoHash.contains(itemUrl)) {
-        return m_revisionInfoHash.value(itemUrl);
+    if (m_versionInfoHash.contains(itemUrl)) {
+        return m_versionInfoHash.value(itemUrl);
     }
 
     if (!item.isDir()) {
     }
 
     if (!item.isDir()) {
-        // files that have not been listed by 'svn status' (= m_revisionInfoHash)
-        // are under revision control per definition
-        return NormalRevision;
+        // files that have not been listed by 'svn status' (= m_versionInfoHash)
+        // are under version control per definition
+        return NormalVersion;
     }
 
     }
 
-    // The item is a directory. Check whether an item listed by 'svn status' (= m_revisionInfoHash)
+    // The item is a directory. Check whether an item listed by 'svn status' (= m_versionInfoHash)
     // is part of this directory. In this case a local modification should be indicated in the
     // directory already.
     // is part of this directory. In this case a local modification should be indicated in the
     // directory already.
-    foreach (const QString& key, m_revisionInfoKeys) {
+    foreach (const QString& key, m_versionInfoKeys) {
         if (key.startsWith(itemUrl)) {
         if (key.startsWith(itemUrl)) {
-            const RevisionState state = m_revisionInfoHash.value(key);
-            if (state == LocallyModifiedRevision) {
-                return LocallyModifiedRevision;
+            const VersionState state = m_versionInfoHash.value(key);
+            if (state == LocallyModifiedVersion) {
+                return LocallyModifiedVersion;
             }
         }
     }
 
             }
         }
     }
 
-    return NormalRevision;
+    return NormalVersion;
 }
 
 QList<QAction*> SubversionPlugin::contextMenuActions(const KFileItemList& items)
 }
 
 QList<QAction*> SubversionPlugin::contextMenuActions(const KFileItemList& items)
@@ -182,20 +182,20 @@ QList<QAction*> SubversionPlugin::contextMenuActions(const KFileItemList& items)
     }
     m_contextDir.clear();
 
     }
     m_contextDir.clear();
 
-    // iterate all items and check the revision state to know which
+    // iterate all items and check the version state to know which
     // actions can be enabled
     const int itemsCount = items.count();
     // actions can be enabled
     const int itemsCount = items.count();
-    int revisionedCount = 0;
+    int versionedCount = 0;
     int editingCount = 0;
     foreach (const KFileItem& item, items) {
     int editingCount = 0;
     foreach (const KFileItem& item, items) {
-        const RevisionState state = revisionState(item);
-        if (state != UnversionedRevision) {
-            ++revisionedCount;
+        const VersionState state = versionState(item);
+        if (state != UnversionedVersion) {
+            ++versionedCount;
         }
 
         switch (state) {
         }
 
         switch (state) {
-        case LocallyModifiedRevision:
-        case ConflictingRevision:
+        case LocallyModifiedVersion:
+        case ConflictingVersion:
             ++editingCount;
             break;
         default:
             ++editingCount;
             break;
         default:
@@ -203,8 +203,8 @@ QList<QAction*> SubversionPlugin::contextMenuActions(const KFileItemList& items)
         }
     }
     m_commitAction->setEnabled(editingCount > 0);
         }
     }
     m_commitAction->setEnabled(editingCount > 0);
-    m_addAction->setEnabled(revisionedCount == 0);
-    m_removeAction->setEnabled(revisionedCount == itemsCount);
+    m_addAction->setEnabled(versionedCount == 0);
+    m_removeAction->setEnabled(versionedCount == itemsCount);
 
     QList<QAction*> actions;
     actions.append(m_updateAction);
 
     QList<QAction*> actions;
     actions.append(m_updateAction);
@@ -276,7 +276,7 @@ void SubversionPlugin::commitFiles()
         // Write the commit description into a temporary file, so
         // that it can be read by the command "svn commit -F". The temporary
         // file must stay alive until slotOperationCompleted() is invoked and will
         // Write the commit description into a temporary file, so
         // that it can be read by the command "svn commit -F". The temporary
         // file must stay alive until slotOperationCompleted() is invoked and will
-        // be destroyed when the revision plugin is destructed.
+        // be destroyed when the version plugin is destructed.
         if (!m_tempFile.open())  {
             emit errorMessage(i18nc("@info:status", "Commit of SVN changes failed."));
             return;
         if (!m_tempFile.open())  {
             emit errorMessage(i18nc("@info:status", "Commit of SVN changes failed."));
             return;
@@ -316,7 +316,7 @@ void SubversionPlugin::slotOperationCompleted()
 {
     if (m_contextItems.isEmpty()) {
         emit operationCompletedMessage(m_operationCompletedMsg);
 {
     if (m_contextItems.isEmpty()) {
         emit operationCompletedMessage(m_operationCompletedMsg);
-        emit revisionStatesChanged();
+        emit versionStatesChanged();
     } else {
         startSvnCommandProcess();
     }
     } else {
         startSvnCommandProcess();
     }
similarity index 71%
rename from src/revisioncontrolplugin.h
rename to src/kversioncontrolplugin.h
index d9767cf746e72e0727fd4cc37e10cbdf7d306715..e4f55a1c21c544a4bc0ebcd1d23ce39c2441f832 100644 (file)
@@ -31,65 +31,65 @@ class KFileItemList;
 class QAction;
 
 /**
 class QAction;
 
 /**
- * @brief Base class for revision control plugins.
+ * @brief Base class for version control plugins.
  *
  *
- * Enables the file manager to show the revision state
- * of a revisioned file.
+ * Enables the file manager to show the version state
+ * of a versioned file.
  */
  */
-class LIBDOLPHINPRIVATE_EXPORT RevisionControlPlugin : public QObject
+class LIBDOLPHINPRIVATE_EXPORT KVersionControlPlugin : public QObject
 {
     Q_OBJECT
 
 public:
 {
     Q_OBJECT
 
 public:
-    enum RevisionState
+    enum VersionState
     {
     {
-        /** The file is not under revision control. */
-        UnversionedRevision,
+        /** The file is not under version control. */
+        UnversionedVersion,
         /**
         /**
-         * The file is under revision control and represents
+         * The file is under version control and represents
          * the latest version.
          */
          * the latest version.
          */
-        NormalRevision,
+        NormalVersion,
         /**
         /**
-         * The file is under revision control and a newer
+         * The file is under version control and a newer
          * version exists on the main branch.
          */
          * version exists on the main branch.
          */
-        UpdateRequiredRevision,
+        UpdateRequiredVersion,
         /**
         /**
-         * The file is under revision control and has been
+         * The file is under version control and has been
          * modified locally.
          */
          * modified locally.
          */
-        LocallyModifiedRevision,
+        LocallyModifiedVersion,
         /**
         /**
-         * The file has not been under revision control but
+         * The file has not been under version control but
          * has been marked to get added with the next commit.
          */
          * has been marked to get added with the next commit.
          */
-        AddedRevision,
+        AddedVersion,
         /**
         /**
-         * The file is under revision control but has been marked
+         * The file is under version control but has been marked
          * for getting removed with the next commit.
          */
          * for getting removed with the next commit.
          */
-        RemovedRevision,
+        RemovedVersion,
         /**
         /**
-         * The file is under revision control and has been locally
+         * The file is under version control and has been locally
          * modified. A modification has also been done on the main
          * branch.
          */
          * modified. A modification has also been done on the main
          * branch.
          */
-        ConflictingRevision
+        ConflictingVersion
     };
 
     };
 
-    RevisionControlPlugin();
-    virtual ~RevisionControlPlugin();
+    KVersionControlPlugin();
+    virtual ~KVersionControlPlugin();
 
     /**
      * Returns the name of the file which stores
 
     /**
      * Returns the name of the file which stores
-     * the revision control informations.
+     * the version control informations.
      * (e. g. .svn, .cvs, .git).
      */
     virtual QString fileName() const = 0;
 
     /**
      * (e. g. .svn, .cvs, .git).
      */
     virtual QString fileName() const = 0;
 
     /**
-     * Is invoked whenever the revision control
+     * Is invoked whenever the version control
      * information will get retrieved for the directory
      * \p directory. It is assured that the directory
      * contains a trailing slash.
      * information will get retrieved for the directory
      * \p directory. It is assured that the directory
      * contains a trailing slash.
@@ -97,47 +97,47 @@ public:
     virtual bool beginRetrieval(const QString& directory) = 0;
 
     /**
     virtual bool beginRetrieval(const QString& directory) = 0;
 
     /**
-     * Is invoked after the revision control information has been
+     * Is invoked after the version control information has been
      * received. It is assured that
      * received. It is assured that
-     * RevisionControlPlugin::beginInfoRetrieval() has been
+     * KVersionControlPlugin::beginInfoRetrieval() has been
      * invoked before.
      */
     virtual void endRetrieval() = 0;
 
     /**
      * invoked before.
      */
     virtual void endRetrieval() = 0;
 
     /**
-     * Returns the revision state for the file \p item.
-     * It is assured that RevisionControlPlugin::beginInfoRetrieval() has been
+     * Returns the version state for the file \p item.
+     * It is assured that KVersionControlPlugin::beginInfoRetrieval() has been
      * invoked before and that the file is part of the directory specified
      * in beginInfoRetrieval().
      */
      * invoked before and that the file is part of the directory specified
      * in beginInfoRetrieval().
      */
-    virtual RevisionState revisionState(const KFileItem& item) = 0;
+    virtual VersionState versionState(const KFileItem& item) = 0;
     
     /**
      * Returns the list of actions that should be shown in the context menu
      * for the files \p items. It is assured that the passed list is not empty.
     
     /**
      * Returns the list of actions that should be shown in the context menu
      * for the files \p items. It is assured that the passed list is not empty.
-     * If an action triggers a change of the revisions, the signal
-     * RevisionControlPlugin::revisionStatesChanged() must be emitted.
+     * If an action triggers a change of the versions, the signal
+     * KVersionControlPlugin::versionStatesChanged() must be emitted.
      */
     virtual QList<QAction*> contextMenuActions(const KFileItemList& items) = 0;
 
     /**
      * Returns the list of actions that should be shown in the context menu
      */
     virtual QList<QAction*> contextMenuActions(const KFileItemList& items) = 0;
 
     /**
      * Returns the list of actions that should be shown in the context menu
-     * for the directory \p directory. If an action triggers a change of the revisions,
-     * the signal RevisionControlPlugin::revisionStatesChanged() must be emitted.
+     * for the directory \p directory. If an action triggers a change of the versions,
+     * the signal KVersionControlPlugin::versionStatesChanged() must be emitted.
      */
     virtual QList<QAction*> contextMenuActions(const QString& directory) = 0;
 
 signals:
     /**
      */
     virtual QList<QAction*> contextMenuActions(const QString& directory) = 0;
 
 signals:
     /**
-     * Should be emitted when the revision state of files might have been changed
+     * Should be emitted when the version state of files might have been changed
      * after the last retrieval (e. g. by executing a context menu action
      * after the last retrieval (e. g. by executing a context menu action
-     * of the revision control plugin). The file manager will be triggered to
-     * update the revision states of the directory \p directory by invoking
-     * RevisionControlPlugin::beginRetrieval(),
-     * RevisionControlPlugin::revisionState() and
-     * RevisionControlPlugin::endRetrieval().
+     * of the version control plugin). The file manager will be triggered to
+     * update the version states of the directory \p directory by invoking
+     * KVersionControlPlugin::beginRetrieval(),
+     * KVersionControlPlugin::versionState() and
+     * KVersionControlPlugin::endRetrieval().
      */
      */
-    void revisionStatesChanged();
+    void versionStatesChanged();
 
     /**
      * Is emitted if an information message with the content \a msg
 
     /**
      * Is emitted if an information message with the content \a msg
@@ -168,7 +168,7 @@ signals:
 #include <QHash>
 #include <QTemporaryFile>
 
 #include <QHash>
 #include <QTemporaryFile>
 
-class LIBDOLPHINPRIVATE_EXPORT SubversionPlugin : public RevisionControlPlugin
+class LIBDOLPHINPRIVATE_EXPORT SubversionPlugin : public KVersionControlPlugin
 {
     Q_OBJECT
 
 {
     Q_OBJECT
 
@@ -178,7 +178,7 @@ public:
     virtual QString fileName() const;
     virtual bool beginRetrieval(const QString& directory);
     virtual void endRetrieval();
     virtual QString fileName() const;
     virtual bool beginRetrieval(const QString& directory);
     virtual void endRetrieval();
-    virtual RevisionControlPlugin::RevisionState revisionState(const KFileItem& item);
+    virtual KVersionControlPlugin::VersionState versionState(const KFileItem& item);
     virtual QList<QAction*> contextMenuActions(const KFileItemList& items);
     virtual QList<QAction*> contextMenuActions(const QString& directory);
 
     virtual QList<QAction*> contextMenuActions(const KFileItemList& items);
     virtual QList<QAction*> contextMenuActions(const QString& directory);
 
@@ -211,8 +211,8 @@ private:
     void startSvnCommandProcess();
 
 private:
     void startSvnCommandProcess();
 
 private:
-    QHash<QString, RevisionState> m_revisionInfoHash;
-    QList<QString> m_revisionInfoKeys; // cache for accessing the keys of the hash
+    QHash<QString, VersionState> m_versionInfoHash;
+    QList<QString> m_versionInfoKeys; // cache for accessing the keys of the hash
 
     QAction* m_updateAction;
     QAction* m_showLocalChangesAction;
 
     QAction* m_updateAction;
     QAction* m_showLocalChangesAction;
index 5d3f8a9b8c143d3d4fd231cefc313b4e7753cd2d..a162d54e3d5a98ce21808b3d9c334dc9116f0264 100644 (file)
@@ -75,7 +75,7 @@ bool PanelTreeView::event(QEvent* event)
         hideColumn(DolphinModel::Owner);
         hideColumn(DolphinModel::Group);
         hideColumn(DolphinModel::Type);
         hideColumn(DolphinModel::Owner);
         hideColumn(DolphinModel::Group);
         hideColumn(DolphinModel::Type);
-        hideColumn(DolphinModel::Revision);
+        hideColumn(DolphinModel::Version);
         header()->hide();
         break;
 
         header()->hide();
         break;
 
similarity index 76%
rename from src/revisioncontrolobserver.cpp
rename to src/versioncontrolobserver.cpp
index 87f0a3aa7dcd2435ca7fe2bfa7fdd386aec5cd31..03bba9f02a39d243ca48e89b5777aa1824717e94 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
-#include "revisioncontrolobserver.h"
+#include "versioncontrolobserver.h"
 
 #include "dolphinmodel.h"
 
 #include "dolphinmodel.h"
-#include "revisioncontrolplugin.h"
+#include "kversioncontrolplugin.h"
 
 #include <kdirlister.h>
 #include <klocale.h>
 
 #include <kdirlister.h>
 #include <klocale.h>
@@ -31,7 +31,7 @@
 #include <QTimer>
 
 /**
 #include <QTimer>
 
 /**
- * The performance of updating the revision state of items depends
+ * The performance of updating the version state of items depends
  * on the used plugin. To prevent that Dolphin gets blocked by a
  * slow plugin, the updating is delegated to a thread.
  */
  * on the used plugin. To prevent that Dolphin gets blocked by a
  * slow plugin, the updating is delegated to a thread.
  */
@@ -39,9 +39,9 @@ class UpdateItemStatesThread : public QThread
 {
 public:
     UpdateItemStatesThread(QObject* parent, QMutex* pluginMutex);
 {
 public:
     UpdateItemStatesThread(QObject* parent, QMutex* pluginMutex);
-    void setData(RevisionControlPlugin* plugin,
-                 const QList<RevisionControlObserver::ItemState>& itemStates);
-    QList<RevisionControlObserver::ItemState> itemStates() const;
+    void setData(KVersionControlPlugin* plugin,
+                 const QList<VersionControlObserver::ItemState>& itemStates);
+    QList<VersionControlObserver::ItemState> itemStates() const;
     bool retrievedItems() const;
 
 protected:
     bool retrievedItems() const;
 
 protected:
@@ -49,9 +49,9 @@ protected:
     
 private:
     bool m_retrievedItems;
     
 private:
     bool m_retrievedItems;
-    RevisionControlPlugin* m_plugin;
+    KVersionControlPlugin* m_plugin;
     QMutex* m_pluginMutex;
     QMutex* m_pluginMutex;
-    QList<RevisionControlObserver::ItemState> m_itemStates;
+    QList<VersionControlObserver::ItemState> m_itemStates;
 };
 
 UpdateItemStatesThread::UpdateItemStatesThread(QObject* parent, QMutex* pluginMutex) :
 };
 
 UpdateItemStatesThread::UpdateItemStatesThread(QObject* parent, QMutex* pluginMutex) :
@@ -62,8 +62,8 @@ UpdateItemStatesThread::UpdateItemStatesThread(QObject* parent, QMutex* pluginMu
 {
 }
 
 {
 }
 
-void UpdateItemStatesThread::setData(RevisionControlPlugin* plugin,
-                                     const QList<RevisionControlObserver::ItemState>& itemStates)
+void UpdateItemStatesThread::setData(KVersionControlPlugin* plugin,
+                                     const QList<VersionControlObserver::ItemState>& itemStates)
 {
     m_plugin = plugin;
     m_itemStates = itemStates;
 {
     m_plugin = plugin;
     m_itemStates = itemStates;
@@ -74,10 +74,10 @@ void UpdateItemStatesThread::run()
     Q_ASSERT(!m_itemStates.isEmpty());
     Q_ASSERT(m_plugin != 0);
 
     Q_ASSERT(!m_itemStates.isEmpty());
     Q_ASSERT(m_plugin != 0);
 
-    // The items from m_itemStates may be located in different directory levels. The revision
-    // plugin requires the root directory for RevisionControlPlugin::beginRetrieval(). Instead
+    // The items from m_itemStates may be located in different directory levels. The version
+    // plugin requires the root directory for KVersionControlPlugin::beginRetrieval(). Instead
     // of doing an expensive search, we utilize the knowledge of the implementation of
     // of doing an expensive search, we utilize the knowledge of the implementation of
-    // RevisionControlObserver::addDirectory() to be sure that the last item contains the root.
+    // VersionControlObserver::addDirectory() to be sure that the last item contains the root.
     const QString directory = m_itemStates.last().item.url().directory(KUrl::AppendTrailingSlash);
 
     QMutexLocker locker(m_pluginMutex);
     const QString directory = m_itemStates.last().item.url().directory(KUrl::AppendTrailingSlash);
 
     QMutexLocker locker(m_pluginMutex);
@@ -85,14 +85,14 @@ void UpdateItemStatesThread::run()
     if (m_plugin->beginRetrieval(directory)) {
         const int count = m_itemStates.count();
         for (int i = 0; i < count; ++i) {
     if (m_plugin->beginRetrieval(directory)) {
         const int count = m_itemStates.count();
         for (int i = 0; i < count; ++i) {
-            m_itemStates[i].revision = m_plugin->revisionState(m_itemStates[i].item);
+            m_itemStates[i].version = m_plugin->versionState(m_itemStates[i].item);
         }
         m_plugin->endRetrieval();
         m_retrievedItems = true;
     }
 }
 
         }
         m_plugin->endRetrieval();
         m_retrievedItems = true;
     }
 }
 
-QList<RevisionControlObserver::ItemState> UpdateItemStatesThread::itemStates() const
+QList<VersionControlObserver::ItemState> UpdateItemStatesThread::itemStates() const
 {
     return m_itemStates;
 }
 {
     return m_itemStates;
 }
@@ -104,10 +104,10 @@ bool UpdateItemStatesThread::retrievedItems() const
 
 // ------------------------------------------------------------------------------------------------
 
 
 // ------------------------------------------------------------------------------------------------
 
-RevisionControlObserver::RevisionControlObserver(QAbstractItemView* view) :
+VersionControlObserver::VersionControlObserver(QAbstractItemView* view) :
     QObject(view),
     m_pendingItemStatesUpdate(false),
     QObject(view),
     m_pendingItemStatesUpdate(false),
-    m_revisionedDirectory(false),
+    m_versionedDirectory(false),
     m_silentUpdate(false),
     m_view(view),
     m_dirLister(0),
     m_silentUpdate(false),
     m_view(view),
     m_dirLister(0),
@@ -141,7 +141,7 @@ RevisionControlObserver::RevisionControlObserver(QAbstractItemView* view) :
     }
 }
 
     }
 }
 
-RevisionControlObserver::~RevisionControlObserver()
+VersionControlObserver::~VersionControlObserver()
 {
     if (m_updateItemStatesThread != 0) {
         m_updateItemStatesThread->terminate();
 {
     if (m_updateItemStatesThread != 0) {
         m_updateItemStatesThread->terminate();
@@ -151,18 +151,18 @@ RevisionControlObserver::~RevisionControlObserver()
     m_plugin = 0;
 }
 
     m_plugin = 0;
 }
 
-QList<QAction*> RevisionControlObserver::contextMenuActions(const KFileItemList& items) const
+QList<QAction*> VersionControlObserver::contextMenuActions(const KFileItemList& items) const
 {
 {
-    if (m_dolphinModel->hasRevisionData() && (m_plugin != 0)) {
+    if (m_dolphinModel->hasVersionData() && (m_plugin != 0)) {
         QMutexLocker locker(&m_pluginMutex);
         return m_plugin->contextMenuActions(items);
     }
     return QList<QAction*>();
 }
 
         QMutexLocker locker(&m_pluginMutex);
         return m_plugin->contextMenuActions(items);
     }
     return QList<QAction*>();
 }
 
-QList<QAction*> RevisionControlObserver::contextMenuActions(const QString& directory) const
+QList<QAction*> VersionControlObserver::contextMenuActions(const QString& directory) const
 {
 {
-    if (m_dolphinModel->hasRevisionData() && (m_plugin != 0)) {
+    if (m_dolphinModel->hasVersionData() && (m_plugin != 0)) {
         QMutexLocker locker(&m_pluginMutex);
         return m_plugin->contextMenuActions(directory);
     }
         QMutexLocker locker(&m_pluginMutex);
         return m_plugin->contextMenuActions(directory);
     }
@@ -170,22 +170,22 @@ QList<QAction*> RevisionControlObserver::contextMenuActions(const QString& direc
     return QList<QAction*>();
 }
 
     return QList<QAction*>();
 }
 
-void RevisionControlObserver::delayedDirectoryVerification()
+void VersionControlObserver::delayedDirectoryVerification()
 {
     m_silentUpdate = false;
     m_dirVerificationTimer->start();
 }
 
 {
     m_silentUpdate = false;
     m_dirVerificationTimer->start();
 }
 
-void RevisionControlObserver::silentDirectoryVerification()
+void VersionControlObserver::silentDirectoryVerification()
 {
     m_silentUpdate = true;
     m_dirVerificationTimer->start();
 }
 
 {
     m_silentUpdate = true;
     m_dirVerificationTimer->start();
 }
 
-void RevisionControlObserver::verifyDirectory()
+void VersionControlObserver::verifyDirectory()
 {
 {
-    KUrl revisionControlUrl = m_dirLister->url();
-    if (!revisionControlUrl.isLocalFile()) {
+    KUrl versionControlUrl = m_dirLister->url();
+    if (!versionControlUrl.isLocalFile()) {
         return;
     }
 
         return;
     }
 
@@ -200,21 +200,21 @@ void RevisionControlObserver::verifyDirectory()
                 this, SIGNAL(operationCompletedMessage(const QString&)));
     }
 
                 this, SIGNAL(operationCompletedMessage(const QString&)));
     }
 
-    revisionControlUrl.addPath(m_plugin->fileName());
-    const KFileItem item = m_dirLister->findByUrl(revisionControlUrl);
+    versionControlUrl.addPath(m_plugin->fileName());
+    const KFileItem item = m_dirLister->findByUrl(versionControlUrl);
 
 
-    bool foundRevisionInfo = !item.isNull();
-    if (!foundRevisionInfo && m_revisionedDirectory) {
-        // Revision control systems like Git provide the revision information
-        // file only in the root directory. Check whether the revision information file can
+    bool foundVersionInfo = !item.isNull();
+    if (!foundVersionInfo && m_versionedDirectory) {
+        // Version control systems like Git provide the version information
+        // file only in the root directory. Check whether the version information file can
         // be found in one of the parent directories.
 
         // TODO...
     }
 
         // be found in one of the parent directories.
 
         // TODO...
     }
 
-    if (foundRevisionInfo) {
-        if (!m_revisionedDirectory) {
-            m_revisionedDirectory = true;
+    if (foundVersionInfo) {
+        if (!m_versionedDirectory) {
+            m_versionedDirectory = true;
 
             // The directory is versioned. Assume that the user will further browse through
             // versioned directories and decrease the verification timer.
 
             // The directory is versioned. Assume that the user will further browse through
             // versioned directories and decrease the verification timer.
@@ -223,12 +223,12 @@ void RevisionControlObserver::verifyDirectory()
                     this, SLOT(delayedDirectoryVerification()));
             connect(m_dirLister, SIGNAL(newItems(const KFileItemList&)),
                     this, SLOT(delayedDirectoryVerification()));
                     this, SLOT(delayedDirectoryVerification()));
             connect(m_dirLister, SIGNAL(newItems(const KFileItemList&)),
                     this, SLOT(delayedDirectoryVerification()));
-            connect(m_plugin, SIGNAL(revisionStatesChanged()),
+            connect(m_plugin, SIGNAL(versionStatesChanged()),
                     this, SLOT(silentDirectoryVerification()));
         }
         updateItemStates();
                     this, SLOT(silentDirectoryVerification()));
         }
         updateItemStates();
-    } else if (m_revisionedDirectory) {
-        m_revisionedDirectory = false;
+    } else if (m_versionedDirectory) {
+        m_versionedDirectory = false;
 
         // The directory is not versioned. Reset the verification timer to a higher
         // value, so that browsing through non-versioned directories is not slown down
 
         // The directory is not versioned. Reset the verification timer to a higher
         // value, so that browsing through non-versioned directories is not slown down
@@ -238,16 +238,16 @@ void RevisionControlObserver::verifyDirectory()
                    this, SLOT(delayedDirectoryVerification()));
         disconnect(m_dirLister, SIGNAL(newItems(const KFileItemList&)),
                    this, SLOT(delayedDirectoryVerification()));
                    this, SLOT(delayedDirectoryVerification()));
         disconnect(m_dirLister, SIGNAL(newItems(const KFileItemList&)),
                    this, SLOT(delayedDirectoryVerification()));
-        disconnect(m_plugin, SIGNAL(revisionStatesChanged()),
+        disconnect(m_plugin, SIGNAL(versionStatesChanged()),
                    this, SLOT(silentDirectoryVerification()));
     }
 }
 
                    this, SLOT(silentDirectoryVerification()));
     }
 }
 
-void RevisionControlObserver::applyUpdatedItemStates()
+void VersionControlObserver::applyUpdatedItemStates()
 {
     if (!m_updateItemStatesThread->retrievedItems()) {
         // ignore m_silentUpdate for an error message
 {
     if (!m_updateItemStatesThread->retrievedItems()) {
         // ignore m_silentUpdate for an error message
-        emit errorMessage(i18nc("@info:status", "Update of revision information failed."));
+        emit errorMessage(i18nc("@info:status", "Update of version information failed."));
         return;
     }
 
         return;
     }
 
@@ -261,7 +261,7 @@ void RevisionControlObserver::applyUpdatedItemStates()
     const QList<ItemState> itemStates = m_updateItemStatesThread->itemStates();
     foreach (const ItemState& itemState, itemStates) {
         m_dolphinModel->setData(itemState.index,
     const QList<ItemState> itemStates = m_updateItemStatesThread->itemStates();
     foreach (const ItemState& itemState, itemStates) {
         m_dolphinModel->setData(itemState.index,
-                                QVariant(static_cast<int>(itemState.revision)),
+                                QVariant(static_cast<int>(itemState.version)),
                                 Qt::DecorationRole);
     }
 
                                 Qt::DecorationRole);
     }
 
@@ -281,7 +281,7 @@ void RevisionControlObserver::applyUpdatedItemStates()
     }
 }
 
     }
 }
 
-void RevisionControlObserver::updateItemStates()
+void VersionControlObserver::updateItemStates()
 {
     Q_ASSERT(m_plugin != 0);
     if (m_updateItemStatesThread == 0) {
 {
     Q_ASSERT(m_plugin != 0);
     if (m_updateItemStatesThread == 0) {
@@ -300,27 +300,27 @@ void RevisionControlObserver::updateItemStates()
     addDirectory(QModelIndex(), itemStates);
     if (!itemStates.isEmpty()) {
         if (!m_silentUpdate) {
     addDirectory(QModelIndex(), itemStates);
     if (!itemStates.isEmpty()) {
         if (!m_silentUpdate) {
-            emit infoMessage(i18nc("@info:status", "Updating revision information..."));
+            emit infoMessage(i18nc("@info:status", "Updating version information..."));
         }
         m_updateItemStatesThread->setData(m_plugin, itemStates);
         m_updateItemStatesThread->start(); // applyUpdatedItemStates() is called when finished
     }
 }
 
         }
         m_updateItemStatesThread->setData(m_plugin, itemStates);
         m_updateItemStatesThread->start(); // applyUpdatedItemStates() is called when finished
     }
 }
 
-void RevisionControlObserver::addDirectory(const QModelIndex& parentIndex, QList<ItemState>& itemStates)
+void VersionControlObserver::addDirectory(const QModelIndex& parentIndex, QList<ItemState>& itemStates)
 {
     const int rowCount = m_dolphinModel->rowCount(parentIndex);
     for (int row = 0; row < rowCount; ++row) {
 {
     const int rowCount = m_dolphinModel->rowCount(parentIndex);
     for (int row = 0; row < rowCount; ++row) {
-        const QModelIndex index = m_dolphinModel->index(row, DolphinModel::Revision, parentIndex);
+        const QModelIndex index = m_dolphinModel->index(row, DolphinModel::Version, parentIndex);
         addDirectory(index, itemStates);
         
         ItemState itemState;
         itemState.index = index;
         itemState.item = m_dolphinModel->itemForIndex(index);
         addDirectory(index, itemStates);
         
         ItemState itemState;
         itemState.index = index;
         itemState.item = m_dolphinModel->itemForIndex(index);
-        itemState.revision = RevisionControlPlugin::UnversionedRevision;
+        itemState.version = KVersionControlPlugin::UnversionedVersion;
 
         itemStates.append(itemState);
     }
 }
 
 
         itemStates.append(itemState);
     }
 }
 
-#include "revisioncontrolobserver.moc"
+#include "versioncontrolobserver.moc"
similarity index 89%
rename from src/revisioncontrolobserver.h
rename to src/versioncontrolobserver.h
index 2fbd20fb558bfe12256ba43d18fdc55c8c9d26a5..44a0adcadc84c7ccba8789507220dedbd1eb54b0 100644 (file)
@@ -23,7 +23,7 @@
 #include <libdolphin_export.h>
 
 #include <kfileitem.h>
 #include <libdolphin_export.h>
 
 #include <kfileitem.h>
-#include <revisioncontrolplugin.h>
+#include <kversioncontrolplugin.h>
 #include <QList>
 #include <QMutex>
 #include <QObject>
 #include <QList>
 #include <QMutex>
 #include <QObject>
@@ -39,20 +39,20 @@ class QTimer;
 class UpdateItemStatesThread;
 
 /**
 class UpdateItemStatesThread;
 
 /**
- * @brief Observes all revision control plugins.
+ * @brief Observes all version control plugins.
  *
  * The item view gets updated automatically if the currently shown
  *
  * The item view gets updated automatically if the currently shown
- * directory is under revision control.
+ * directory is under version control.
  *
  *
- * @see RevisionControlPlugin
+ * @see VersionControlPlugin
  */
  */
-class LIBDOLPHINPRIVATE_EXPORT RevisionControlObserver : public QObject
+class LIBDOLPHINPRIVATE_EXPORT VersionControlObserver : public QObject
 {
     Q_OBJECT
 
 public:
 {
     Q_OBJECT
 
 public:
-    RevisionControlObserver(QAbstractItemView* view);
-    virtual ~RevisionControlObserver();
+    VersionControlObserver(QAbstractItemView* view);
+    virtual ~VersionControlObserver();
 
     QList<QAction*> contextMenuActions(const KFileItemList& items) const;
     QList<QAction*> contextMenuActions(const QString& directory) const;
 
     QList<QAction*> contextMenuActions(const KFileItemList& items) const;
     QList<QAction*> contextMenuActions(const QString& directory) const;
@@ -100,7 +100,7 @@ private:
     {
         QPersistentModelIndex index;
         KFileItem item;
     {
         QPersistentModelIndex index;
         KFileItem item;
-        RevisionControlPlugin::RevisionState revision;
+        KVersionControlPlugin::VersionState version;
     };
 
     void updateItemStates();
     };
 
     void updateItemStates();
@@ -113,9 +113,9 @@ private:
 
 private:
     bool m_pendingItemStatesUpdate;
 
 private:
     bool m_pendingItemStatesUpdate;
-    bool m_revisionedDirectory;
+    bool m_versionedDirectory;
     bool m_silentUpdate; // if true, no messages will be send during the update
     bool m_silentUpdate; // if true, no messages will be send during the update
-                         // of revision states
+                         // of version states
     
     QAbstractItemView* m_view;
     KDirLister* m_dirLister;
     
     QAbstractItemView* m_view;
     KDirLister* m_dirLister;
@@ -124,7 +124,7 @@ private:
     QTimer* m_dirVerificationTimer;
     
     mutable QMutex m_pluginMutex;
     QTimer* m_dirVerificationTimer;
     
     mutable QMutex m_pluginMutex;
-    RevisionControlPlugin* m_plugin;
+    KVersionControlPlugin* m_plugin;
     UpdateItemStatesThread* m_updateItemStatesThread;
 
     friend class UpdateItemStatesThread;
     UpdateItemStatesThread* m_updateItemStatesThread;
 
     friend class UpdateItemStatesThread;