forked from qt-creator/qt-creator
Axivion: Remove a delay when typing in search field
Don't call cancel() for the task tree runner - the next call to start() will reset it anyway, what will be faster. Change-Id: Ib0aae67ab6ec9bc3835931e0b20b0e4cb381cf35 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -31,7 +31,6 @@
|
|||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QStackedWidget>
|
#include <QStackedWidget>
|
||||||
#include <QTextBrowser>
|
#include <QTextBrowser>
|
||||||
#include <QTimer>
|
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
@@ -248,7 +247,6 @@ private:
|
|||||||
int m_totalRowCount = 0;
|
int m_totalRowCount = 0;
|
||||||
int m_lastRequestedOffset = 0;
|
int m_lastRequestedOffset = 0;
|
||||||
TaskTreeRunner m_taskTreeRunner;
|
TaskTreeRunner m_taskTreeRunner;
|
||||||
QTimer m_pathGlobTimer;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IssuesWidget::IssuesWidget(QWidget *parent)
|
IssuesWidget::IssuesWidget(QWidget *parent)
|
||||||
@@ -305,10 +303,7 @@ IssuesWidget::IssuesWidget(QWidget *parent)
|
|||||||
m_filtersLayout->addWidget(m_ownerFilter);
|
m_filtersLayout->addWidget(m_ownerFilter);
|
||||||
m_pathGlobFilter = new QLineEdit(this);
|
m_pathGlobFilter = new QLineEdit(this);
|
||||||
m_pathGlobFilter->setPlaceholderText(Tr::tr("Path globbing"));
|
m_pathGlobFilter->setPlaceholderText(Tr::tr("Path globbing"));
|
||||||
m_pathGlobTimer.setSingleShot(true);
|
connect(m_pathGlobFilter, &QLineEdit::textEdited, this, &IssuesWidget::onSearchParameterChanged);
|
||||||
m_pathGlobTimer.setInterval(300); // avoid multiple network requests when typing a pattern
|
|
||||||
connect(&m_pathGlobTimer, &QTimer::timeout, this, &IssuesWidget::onSearchParameterChanged);
|
|
||||||
connect(m_pathGlobFilter, &QLineEdit::textEdited, this, [this] { m_pathGlobTimer.start(); });
|
|
||||||
m_filtersLayout->addWidget(m_pathGlobFilter);
|
m_filtersLayout->addWidget(m_pathGlobFilter);
|
||||||
layout->addLayout(m_filtersLayout);
|
layout->addLayout(m_filtersLayout);
|
||||||
m_issuesView = new BaseTreeView(this);
|
m_issuesView = new BaseTreeView(this);
|
||||||
@@ -444,8 +439,6 @@ void IssuesWidget::addIssues(const Dto::IssueTableDto &dto)
|
|||||||
|
|
||||||
void IssuesWidget::onSearchParameterChanged()
|
void IssuesWidget::onSearchParameterChanged()
|
||||||
{
|
{
|
||||||
m_taskTreeRunner.cancel();
|
|
||||||
|
|
||||||
m_addedFilter->setText("0");
|
m_addedFilter->setText("0");
|
||||||
m_removedFilter->setText("0");
|
m_removedFilter->setText("0");
|
||||||
m_totalRows->setText(Tr::tr("Total rows:"));
|
m_totalRows->setText(Tr::tr("Total rows:"));
|
||||||
|
Reference in New Issue
Block a user