summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index ce4471a6..ce2c02b6 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1578,6 +1578,13 @@ void MainWindow::updateTo(QTreeWidgetItem *subTree, const std::wstring &director
subTree->sortChildren(0, Qt::AscendingOrder);
}
+void MainWindow::delayedRemove()
+{
+ foreach (QTreeWidgetItem *item, m_RemoveWidget) {
+ item->removeChild(item->child(0));
+ }
+ m_RemoveWidget.clear();
+}
void MainWindow::expandDataTreeItem(QTreeWidgetItem *item)
{
@@ -1586,7 +1593,6 @@ void MainWindow::expandDataTreeItem(QTreeWidgetItem *item)
QTreeWidgetItem *onDemandDataItem = item->child(0);
std::wstring path = ToWString(onDemandDataItem->data(0, Qt::UserRole + 1).toString());
bool conflictsOnly = onDemandDataItem->data(0, Qt::UserRole + 2).toBool();
- item->removeChild(onDemandDataItem);
std::wstring virtualPath = (path + L"\\").substr(6) + ToWString(item->text(0));
DirectoryEntry *dir = m_DirectoryStructure->findSubDirectoryRecursive(virtualPath);
@@ -1595,7 +1601,8 @@ void MainWindow::expandDataTreeItem(QTreeWidgetItem *item)
} else {
qWarning("failed to update view of %ls", path.c_str());
}
-
+ m_RemoveWidget.push_back(item);
+ QTimer::singleShot(5, this, SLOT(delayedRemove()));
}
}