Commit 1e5db63a authored by André Wöbbeking's avatar André Wöbbeking

- unfoldTree(): reduced flicker and improved perfomance by disabling updates.

- un/foldTree() removed QPtrStack.

TODO: get rid of QApplication::processEvents().

svn path=/trunk/kdesdk/cervisia/; revision=198969
parent dc59382e
......@@ -21,7 +21,6 @@
#include <qapplication.h>
#include <qdir.h>
#include <qfileinfo.h>
#include <qheader.h>
#include <qptrstack.h>
#include <kconfig.h>
#include <kdebug.h>
......@@ -888,36 +887,41 @@ const QColor& UpdateView::remoteChangeColor() const
void UpdateView::unfoldTree()
{
QApplication::setOverrideCursor(waitCursor);
QPtrStack<QListViewItem> s;
for ( QListViewItem *item = firstChild(); item;
item = item->nextSibling()? item->nextSibling() : s.pop() )
{
if (isDirItem(item))
item->setOpen(true);
if (item->firstChild())
s.push(item->firstChild());
qApp->processEvents();
}
triggerUpdate();
const bool updatesEnabled(isUpdatesEnabled());
setUpdatesEnabled(false);
QListViewItemIterator it(this);
while (QListViewItem* item = it.current())
{
if (isDirItem(item))
item->setOpen(true);
++it;
qApp->processEvents();
}
setUpdatesEnabled(updatesEnabled);
triggerUpdate();
QApplication::restoreOverrideCursor();
}
void UpdateView::foldTree()
{
QPtrStack<QListViewItem> s;
for ( QListViewItem *item = firstChild(); item;
item = item->nextSibling()? item->nextSibling() : s.pop() )
{
if (isDirItem(item) && item != firstChild())
item->setOpen(false);
if (item->firstChild())
s.push(item->firstChild());
}
QListViewItemIterator it(this);
while (QListViewItem* item = it.current())
{
// don't close the top level directory
if (isDirItem(item) && item->parent())
item->setOpen(false);
triggerUpdate();
++it;
}
}
......
Markdown is supported
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