Commit c59ece47 authored by loh.tar's avatar loh.tar
Browse files

Avoid unneeded updates of a hidden widget

The result of these efforts is not visible, when it becomes visible it
will be updated again anyway explicitly
parent 6b8c3aac
......@@ -304,6 +304,11 @@ GitWidget::GitWidget(KateProject *project, KTextEditor::MainWindow *mainWindow,
setLayout(new QVBoxLayout);
this->layout()->addWidget(m_stackWidget);
this->layout()->setContentsMargins(0, 0, 0, 0);
// Ensure we are looks good
QTimer::singleShot(0, [=] {
getStatus();
});
}
GitWidget::~GitWidget()
......@@ -365,6 +370,10 @@ QProcess *GitWidget::gitp(const QStringList &arguments)
void GitWidget::getStatus(bool untracked, bool submodules)
{
if (!isVisible()) {
return; // No need to update
}
auto args = QStringList{QStringLiteral("status"), QStringLiteral("-z")};
if (!untracked) {
args.append(QStringLiteral("-uno"));
......
Supports Markdown
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