forked from qt-creator/qt-creator
ProjectExplorer: Allow text filtering in issues pane
Task-number: QTCREATORBUG-21893 Fixes: QTCREATORBUG-22083 Change-Id: Ida227ce21d90fc2487cf3009e957eedeec507fd0 Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
@@ -100,6 +100,7 @@ protected:
|
|||||||
void setupFilterUi(const QString &historyKey);
|
void setupFilterUi(const QString &historyKey);
|
||||||
QString filterText() const;
|
QString filterText() const;
|
||||||
void setFilteringEnabled(bool enable);
|
void setFilteringEnabled(bool enable);
|
||||||
|
QWidget *filterWidget() const { return m_filterOutputLineEdit; }
|
||||||
|
|
||||||
void setZoomButtonsEnabled(bool enabled);
|
void setZoomButtonsEnabled(bool enabled);
|
||||||
|
|
||||||
|
@@ -362,9 +362,14 @@ bool TaskFilterModel::filterAcceptsTask(const Task &task) const
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_categoryIds.contains(task.category))
|
if (accept && m_categoryIds.contains(task.category))
|
||||||
accept = false;
|
accept = false;
|
||||||
|
|
||||||
|
if (accept && !filterRegExp().isEmpty() && !task.file.toString().contains(filterRegExp())
|
||||||
|
&& !task.description.contains(filterRegExp())) {
|
||||||
|
accept = false;
|
||||||
|
}
|
||||||
|
|
||||||
return accept;
|
return accept;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -289,6 +289,9 @@ TaskWindow::TaskWindow() : d(std::make_unique<TaskWindowPrivate>())
|
|||||||
|
|
||||||
d->m_categoriesButton->setMenu(d->m_categoriesMenu);
|
d->m_categoriesButton->setMenu(d->m_categoriesMenu);
|
||||||
|
|
||||||
|
setupFilterUi("IssuesPane.Filter");
|
||||||
|
setFilteringEnabled(true);
|
||||||
|
|
||||||
TaskHub *hub = TaskHub::instance();
|
TaskHub *hub = TaskHub::instance();
|
||||||
connect(hub, &TaskHub::categoryAdded, this, &TaskWindow::addCategory);
|
connect(hub, &TaskHub::categoryAdded, this, &TaskWindow::addCategory);
|
||||||
connect(hub, &TaskHub::taskAdded, this, &TaskWindow::addTask);
|
connect(hub, &TaskHub::taskAdded, this, &TaskWindow::addTask);
|
||||||
@@ -355,7 +358,7 @@ void TaskWindow::delayedInitialization()
|
|||||||
|
|
||||||
QList<QWidget*> TaskWindow::toolBarWidgets() const
|
QList<QWidget*> TaskWindow::toolBarWidgets() const
|
||||||
{
|
{
|
||||||
return {d->m_filterWarningsButton, d->m_categoriesButton};
|
return {d->m_filterWarningsButton, d->m_categoriesButton, filterWidget()};
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *TaskWindow::outputWidget(QWidget *)
|
QWidget *TaskWindow::outputWidget(QWidget *)
|
||||||
@@ -664,6 +667,11 @@ void TaskWindow::goToPrev()
|
|||||||
triggerDefaultHandler(currentIndex);
|
triggerDefaultHandler(currentIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TaskWindow::updateFilter()
|
||||||
|
{
|
||||||
|
d->m_filter->setFilterRegExp(filterText());
|
||||||
|
}
|
||||||
|
|
||||||
bool TaskWindow::canNavigate() const
|
bool TaskWindow::canNavigate() const
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@@ -82,6 +82,8 @@ signals:
|
|||||||
void tasksCleared();
|
void tasksCleared();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void updateFilter() override;
|
||||||
|
|
||||||
void addCategory(Core::Id categoryId, const QString &displayName, bool visible);
|
void addCategory(Core::Id categoryId, const QString &displayName, bool visible);
|
||||||
void addTask(const ProjectExplorer::Task &task);
|
void addTask(const ProjectExplorer::Task &task);
|
||||||
void removeTask(const ProjectExplorer::Task &task);
|
void removeTask(const ProjectExplorer::Task &task);
|
||||||
|
Reference in New Issue
Block a user