Updates in response to KVersionControlPlugin interface changes.

Summary:
Updates VCS-plugins for the new KVersionControlPlugin interface. Updates available in the separate commit D29041.
Plugins unversionedActions() functions now do nothing so it doesn't change any current plugin behaviour.

Reviewers: #dolphin, meven, elvisangelaccio

Reviewed By: #dolphin, meven, elvisangelaccio

Differential Revision: https://phabricator.kde.org/D29042
parent c64770b9
......@@ -254,7 +254,7 @@ KVersionControlPlugin::ItemVersion FileViewBazaarPlugin::itemVersion(const KFile
return NormalVersion;
}
QList<QAction*> FileViewBazaarPlugin::actions(const KFileItemList &items) const
QList<QAction*> FileViewBazaarPlugin::versionControlActions(const KFileItemList &items) const
{
if (items.count() == 1 && items.first().isDir()) {
QString directory = items.first().localPath();
......@@ -272,6 +272,13 @@ QList<QAction*> FileViewBazaarPlugin::actions(const KFileItemList &items) const
}
}
QList<QAction*> FileViewBazaarPlugin::outOfVersionControlActions(const KFileItemList& items) const
{
Q_UNUSED(items)
return {};
}
QList<QAction*> FileViewBazaarPlugin::contextMenuFilesActions(const KFileItemList& items) const
{
Q_ASSERT(!items.isEmpty());
......
......@@ -44,7 +44,8 @@ public:
bool beginRetrieval(const QString& directory) Q_DECL_OVERRIDE;
void endRetrieval() Q_DECL_OVERRIDE;
KVersionControlPlugin::ItemVersion itemVersion(const KFileItem& item) const Q_DECL_OVERRIDE;
QList<QAction*> actions(const KFileItemList& items) const Q_DECL_OVERRIDE;
QList<QAction*> versionControlActions(const KFileItemList& items) const override;
QList<QAction*> outOfVersionControlActions(const KFileItemList& items) const override;
......
......@@ -132,7 +132,7 @@ void FileViewDropboxPlugin::endRetrieval()
delete d->itemStateSocket;
}
QList<QAction*> FileViewDropboxPlugin::actions(const KFileItemList& items) const
QList<QAction*> FileViewDropboxPlugin::versionControlActions(const KFileItemList &items) const
{
Q_ASSERT(!items.isEmpty());
......@@ -170,6 +170,13 @@ QList<QAction*> FileViewDropboxPlugin::actions(const KFileItemList& items) const
return d->contextActions->actions();
}
QList<QAction*> FileViewDropboxPlugin::outOfVersionControlActions(const KFileItemList& items) const
{
Q_UNUSED(items)
return {};
}
void FileViewDropboxPlugin::handleContextAction(QAction* action)
{
sendCommand("icon_overlay_context_action\nverb\t" % action->objectName() % "\npaths\t", d->contextFilePaths, d->controlSocket);
......
......@@ -63,7 +63,8 @@ public:
KVersionControlPlugin::ItemVersion itemVersion(const KFileItem& item) const override;
void endRetrieval() override;
QList<QAction*> actions(const KFileItemList& items) const override;
QList<QAction*> versionControlActions(const KFileItemList& items) const override;
QList<QAction*> outOfVersionControlActions(const KFileItemList& items) const override;
private slots:
void handleContextAction(QAction* action);
......
......@@ -276,7 +276,7 @@ KVersionControlPlugin::ItemVersion FileViewGitPlugin::itemVersion(const KFileIte
}
}
QList<QAction*> FileViewGitPlugin::actions(const KFileItemList &items) const
QList<QAction*> FileViewGitPlugin::versionControlActions(const KFileItemList& items) const
{
if (items.count() == 1 && items.first().isDir()) {
QString directory = items.first().localPath();
......@@ -294,6 +294,13 @@ QList<QAction*> FileViewGitPlugin::actions(const KFileItemList &items) const
}
}
QList<QAction*> FileViewGitPlugin::outOfVersionControlActions(const KFileItemList& items) const
{
Q_UNUSED(items)
return {};
}
QList<QAction*> FileViewGitPlugin::contextMenuFilesActions(const KFileItemList& items) const
{
Q_ASSERT(!items.isEmpty());
......
......@@ -44,7 +44,8 @@ public:
bool beginRetrieval(const QString& directory) override;
void endRetrieval() override;
ItemVersion itemVersion(const KFileItem& item) const override;
QList<QAction*> actions(const KFileItemList &items) const override;
QList<QAction*> versionControlActions(const KFileItemList& items) const override;
QList<QAction*> outOfVersionControlActions(const KFileItemList& items) const override;
private slots:
void addFiles();
......
......@@ -380,7 +380,7 @@ KVersionControlPlugin::ItemVersion FileViewHgPlugin::itemVersion(const KFileItem
return NormalVersion;
}
QList<QAction*> FileViewHgPlugin::actions(const KFileItemList &items) const
QList<QAction*> FileViewHgPlugin::versionControlActions(const KFileItemList &items) const
{
//TODO: Make it work with universal context menu when implemented
// in dolphin
......@@ -394,6 +394,13 @@ QList<QAction*> FileViewHgPlugin::actions(const KFileItemList &items) const
return QList<QAction*>();
}
QList<QAction*> FileViewHgPlugin::outOfVersionControlActions(const KFileItemList &items) const
{
Q_UNUSED(items)
return {};
}
QList<QAction*> FileViewHgPlugin::universalContextMenuActions(const QString &directory) const
{
QList<QAction*> result;
......
......@@ -42,7 +42,8 @@ public:
bool beginRetrieval(const QString& directory) override;
void endRetrieval() override;
KVersionControlPlugin::ItemVersion itemVersion(const KFileItem& item) const override;
QList<QAction*> actions(const KFileItemList &items) const override;
QList<QAction*> versionControlActions(const KFileItemList& items) const override;
virtual QList<QAction*> outOfVersionControlActions(const KFileItemList& items) const override;
private:
......
......@@ -257,7 +257,7 @@ KVersionControlPlugin::ItemVersion FileViewSvnPlugin::itemVersion(const KFileIte
return NormalVersion;
}
QList<QAction*> FileViewSvnPlugin::actions(const KFileItemList& items) const
QList<QAction*> FileViewSvnPlugin::versionControlActions(const KFileItemList& items) const
{
// Special case: if any item is in unversioned directory we shouldn't add any actions because
// we can do nothing with this item.
......@@ -322,6 +322,12 @@ QList<QAction*> FileViewSvnPlugin::actions(const KFileItemList& items) const
return actions;
}
QList<QAction*> FileViewSvnPlugin::outOfVersionControlActions(const KFileItemList& items) const
{
Q_UNUSED(items)
return {};
}
void FileViewSvnPlugin::updateFiles()
{
......
......@@ -42,7 +42,8 @@ public:
bool beginRetrieval(const QString& directory) override;
void endRetrieval() override;
ItemVersion itemVersion(const KFileItem& item) const override;
QList<QAction*> actions(const KFileItemList& items) const override;
QList<QAction*> versionControlActions(const KFileItemList& items) const override;
QList<QAction*> outOfVersionControlActions(const KFileItemList& items) const override;
signals:
/// Invokes m_showUpdatesAction->setChecked(checked) on the UI thread.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment