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
Marco Bubke
flatpak-qt-creator
Commits
4a1f15db
Commit
4a1f15db
authored
Oct 13, 2010
by
dt
Browse files
Qt4ProjectManager: Compress the folderChanged via a small timer
Reviewed-By: hunger
parent
3cd9c596
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/qt4project.cpp
View file @
4a1f15db
...
...
@@ -1132,6 +1132,10 @@ namespace {
CentralizedFolderWatcher
::
CentralizedFolderWatcher
()
{
m_compressTimer
.
setSingleShot
(
true
);
m_compressTimer
.
setInterval
(
200
);
connect
(
&
m_compressTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
onTimer
()));
connect
(
&
m_watcher
,
SIGNAL
(
directoryChanged
(
QString
)),
this
,
SLOT
(
folderChanged
(
QString
)));
}
...
...
@@ -1225,8 +1229,20 @@ void CentralizedFolderWatcher::unwatchFolders(const QList<QString> &folders, Qt4
}
}
void
CentralizedFolderWatcher
::
folderChanged
(
const
QString
&
folder
)
{
m_changedFolders
.
insert
(
folder
);
m_compressTimer
.
start
();
}
void
CentralizedFolderWatcher
::
onTimer
()
{
foreach
(
const
QString
&
folder
,
m_changedFolders
)
delayedFolderChanged
(
folder
);
m_changedFolders
.
clear
();
}
void
CentralizedFolderWatcher
::
delayedFolderChanged
(
const
QString
&
folder
)
{
if
(
debugCFW
)
qDebug
()
<<
"CFW::folderChanged"
<<
folder
;
...
...
src/plugins/qt4projectmanager/qt4project.h
View file @
4a1f15db
...
...
@@ -122,6 +122,8 @@ public:
private
slots
:
void
folderChanged
(
const
QString
&
folder
);
void
onTimer
();
void
delayedFolderChanged
(
const
QString
&
folder
);
private:
QSet
<
QString
>
recursiveDirs
(
const
QString
&
folder
);
...
...
@@ -129,6 +131,8 @@ private:
QMultiMap
<
QString
,
Qt4PriFileNode
*>
m_map
;
QSet
<
QString
>
m_recursiveWatchedFolders
;
QTimer
m_compressTimer
;
QSet
<
QString
>
m_changedFolders
;
};
}
...
...
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