mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
[versioncontrolobserver] Update working directory on tab activation
Differential Revision: https://phabricator.kde.org/D18605 Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
This commit is contained in:
parent
d728853027
commit
ec29cfff20
|
@ -182,6 +182,7 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) :
|
|||
#endif
|
||||
|
||||
m_versionControlObserver = new VersionControlObserver(this);
|
||||
m_versionControlObserver->setView(this);
|
||||
m_versionControlObserver->setModel(m_model);
|
||||
connect(m_versionControlObserver, &VersionControlObserver::infoMessage, this, &DolphinView::infoMessage);
|
||||
connect(m_versionControlObserver, &VersionControlObserver::errorMessage, this, &DolphinView::errorMessage);
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "dolphin_versioncontrolsettings.h"
|
||||
#include "dolphindebug.h"
|
||||
#include "views/dolphinview.h"
|
||||
#include "kitemviews/kfileitemmodel.h"
|
||||
#include "updateitemstatesthread.h"
|
||||
|
||||
|
@ -85,6 +86,26 @@ KFileItemModel* VersionControlObserver::model() const
|
|||
return m_model;
|
||||
}
|
||||
|
||||
void VersionControlObserver::setView(DolphinView* view)
|
||||
{
|
||||
if (m_view) {
|
||||
disconnect(m_view, &DolphinView::activated,
|
||||
this, &VersionControlObserver::delayedDirectoryVerification);
|
||||
}
|
||||
|
||||
m_view = view;
|
||||
|
||||
if (m_view) {
|
||||
connect(m_view, &DolphinView::activated,
|
||||
this, &VersionControlObserver::delayedDirectoryVerification);
|
||||
}
|
||||
}
|
||||
|
||||
DolphinView* VersionControlObserver::view() const
|
||||
{
|
||||
return m_view;
|
||||
}
|
||||
|
||||
QList<QAction*> VersionControlObserver::actions(const KFileItemList& items) const
|
||||
{
|
||||
bool hasNullItems = false;
|
||||
|
|
|
@ -37,6 +37,8 @@ class QAction;
|
|||
class QTimer;
|
||||
class UpdateItemStatesThread;
|
||||
|
||||
class DolphinView;
|
||||
|
||||
/**
|
||||
* @brief Observes all version control plugins.
|
||||
*
|
||||
|
@ -55,6 +57,8 @@ public:
|
|||
|
||||
void setModel(KFileItemModel* model);
|
||||
KFileItemModel* model() const;
|
||||
void setView(DolphinView* view);
|
||||
DolphinView* view() const;
|
||||
|
||||
QList<QAction*> actions(const KFileItemList& items) const;
|
||||
|
||||
|
@ -139,6 +143,7 @@ private:
|
|||
bool m_silentUpdate; // if true, no messages will be send during the update
|
||||
// of version states
|
||||
|
||||
DolphinView* m_view;
|
||||
KFileItemModel* m_model;
|
||||
|
||||
QTimer* m_dirVerificationTimer;
|
||||
|
|
Loading…
Reference in a new issue