MCPcopy Create free account
hub / github.com/KDE/kate / GitWidget

Method GitWidget

addons/project/gitwidget.cpp:229–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229GitWidget::GitWidget(KTextEditor::MainWindow *mainWindow, KateProjectPluginView *pluginView, QWidget *parent)
230 : QWidget(parent)
231 , m_gitStatusWatcher(new QFutureWatcher<GitUtils::GitParsedStatus>(this))
232 , m_mainWin(mainWindow)
233 , m_pluginView(pluginView)
234 , m_mainView(new QWidget(this))
235 , m_stackWidget(new QStackedWidget(this))
236{
237 // Init delayed because this is called from plugin view ctor and nothing is ready yet
238 QMetaObject::invokeMethod(
239 this,
240 [this] {
241 m_activeGitDirPath = m_pluginView->projectBaseDir();
242 if (!m_activeGitDirPath.endsWith(u"/")) {
243 m_activeGitDirPath.append(u"/");
244 }
245
246 connect(m_gitStatusWatcher, &QFutureWatcher<GitUtils::GitParsedStatus>::finished, this, &GitWidget::parseStatusReady);
247 // Setup update protection
248 m_updateTrigger.setSingleShot(true);
249 m_updateTrigger.setInterval(500);
250 connect(&m_updateTrigger, &QTimer::timeout, this, &GitWidget::slotUpdateStatus);
251 slotUpdateStatus();
252 },
253 Qt::QueuedConnection);
254
255 // We init delayed when the widget will be shown
256}
257
258void GitWidget::showEvent(QShowEvent *e)
259{

Callers

nothing calls this directly

Calls 1

projectBaseDirMethod · 0.80

Tested by

no test coverage detected