summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-01-29 00:23:16 +0100
committerTannin <devnull@localhost>2014-01-29 00:23:16 +0100
commitaf50eedbe275062eda933ccc200be66a9d3ee94d (patch)
treef6df3e578ca0d466d55b455e9d3ac9b3fe9c012a /src/mainwindow.cpp
parent52e5dd3c5781d45fa3a929de6c7cce7405366300 (diff)
- bugfix: dds preview or transparent textures looked odd
- bugfix: lazy loaded data tree deleted the placeholder
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()));
}
}