Changeset View
Changeset View
Standalone View
Standalone View
src/views/versioncontrol/versioncontrolobserver.cpp
Show All 15 Lines | |||||
16 | * Free Software Foundation, Inc., * | 16 | * Free Software Foundation, Inc., * | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * | ||
18 | ***************************************************************************/ | 18 | ***************************************************************************/ | ||
19 | 19 | | |||
20 | #include "versioncontrolobserver.h" | 20 | #include "versioncontrolobserver.h" | ||
21 | 21 | | |||
22 | #include "dolphin_versioncontrolsettings.h" | 22 | #include "dolphin_versioncontrolsettings.h" | ||
23 | #include "dolphindebug.h" | 23 | #include "dolphindebug.h" | ||
24 | #include "views/dolphinview.h" | ||||
24 | #include "kitemviews/kfileitemmodel.h" | 25 | #include "kitemviews/kfileitemmodel.h" | ||
25 | #include "updateitemstatesthread.h" | 26 | #include "updateitemstatesthread.h" | ||
26 | 27 | | |||
27 | #include <KLocalizedString> | 28 | #include <KLocalizedString> | ||
28 | #include <KService> | 29 | #include <KService> | ||
29 | #include <KServiceTypeTrader> | 30 | #include <KServiceTypeTrader> | ||
30 | 31 | | |||
31 | #include <QTimer> | 32 | #include <QTimer> | ||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 66 | { | |||
80 | } | 81 | } | ||
81 | } | 82 | } | ||
82 | 83 | | |||
83 | KFileItemModel* VersionControlObserver::model() const | 84 | KFileItemModel* VersionControlObserver::model() const | ||
84 | { | 85 | { | ||
85 | return m_model; | 86 | return m_model; | ||
86 | } | 87 | } | ||
87 | 88 | | |||
89 | void VersionControlObserver::setView(DolphinView* view) | ||||
90 | { | ||||
91 | if (m_view) { | ||||
92 | disconnect(m_view, &DolphinView::activated, | ||||
93 | this, &VersionControlObserver::delayedDirectoryVerification); | ||||
94 | } | ||||
95 | | ||||
96 | m_view = view; | ||||
97 | | ||||
98 | if (m_view) { | ||||
99 | connect(m_view, &DolphinView::activated, | ||||
100 | this, &VersionControlObserver::delayedDirectoryVerification); | ||||
101 | } | ||||
102 | } | ||||
103 | | ||||
104 | DolphinView* VersionControlObserver::view() const | ||||
105 | { | ||||
106 | return m_view; | ||||
107 | } | ||||
108 | | ||||
88 | QList<QAction*> VersionControlObserver::actions(const KFileItemList& items) const | 109 | QList<QAction*> VersionControlObserver::actions(const KFileItemList& items) const | ||
89 | { | 110 | { | ||
90 | bool hasNullItems = false; | 111 | bool hasNullItems = false; | ||
91 | foreach (const KFileItem& item, items) { | 112 | foreach (const KFileItem& item, items) { | ||
92 | if (item.isNull()) { | 113 | if (item.isNull()) { | ||
93 | qCWarning(DolphinDebug) << "Requesting version-control-actions for empty items"; | 114 | qCWarning(DolphinDebug) << "Requesting version-control-actions for empty items"; | ||
94 | hasNullItems = true; | 115 | hasNullItems = true; | ||
95 | break; | 116 | break; | ||
▲ Show 20 Lines • Show All 238 Lines • Show Last 20 Lines |