Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
99e8066a
Commit
99e8066a
authored
Oct 10, 2022
by
Waqar Ahmed
Committed by
Christoph Cullmann
Oct 10, 2022
Browse files
Delay project filtering
It is too slow and unusable otherwise
parent
f7b82b3e
Pipeline
#245293
canceled with stage
in 4 minutes and 23 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
addons/project/kateprojectview.cpp
View file @
99e8066a
...
...
@@ -58,12 +58,18 @@ KateProjectView::KateProjectView(KateProjectPluginView *pluginView, KateProject
});
chckbr
->
setText
(
i18n
(
"Checkout Git Branch"
));
m_filterStartTimer
.
setSingleShot
(
true
);
m_filterStartTimer
.
setInterval
(
400
);
m_filterStartTimer
.
callOnTimeout
(
this
,
&
KateProjectView
::
filterTextChanged
);
/**
* setup filter line edit
*/
m_filter
->
setPlaceholderText
(
i18n
(
"Filter..."
));
m_filter
->
setClearButtonEnabled
(
true
);
connect
(
m_filter
,
&
KLineEdit
::
textChanged
,
this
,
&
KateProjectView
::
filterTextChanged
);
connect
(
m_filter
,
&
KLineEdit
::
textChanged
,
this
,
[
this
]
{
m_filterStartTimer
.
start
();
});
/**
* Setup git checkout stuff
...
...
@@ -98,8 +104,9 @@ void KateProjectView::openSelectedDocument()
m_treeView
->
openSelectedDocument
();
}
void
KateProjectView
::
filterTextChanged
(
const
QString
&
filterText
)
void
KateProjectView
::
filterTextChanged
()
{
const
auto
filterText
=
m_filter
->
text
();
/**
* filter
*/
...
...
addons/project/kateprojectview.h
View file @
99e8066a
...
...
@@ -12,6 +12,7 @@
#include
"kateprojectviewtree.h"
#include
<QFileSystemWatcher>
#include
<QTimer>
class
KLineEdit
;
class
KateProjectPluginView
;
...
...
@@ -66,7 +67,7 @@ private Q_SLOTS:
* React on filter change
* @param filterText new filter text
*/
void
filterTextChanged
(
const
QString
&
filterText
);
void
filterTextChanged
();
/**
* On project model change, check if project
...
...
@@ -105,6 +106,11 @@ private:
* watches for changes to .git/HEAD
*/
QFileSystemWatcher
m_branchChangedWatcher
;
/**
* filter timer
*/
QTimer
m_filterStartTimer
;
};
#endif
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment