m_rootUrl(),
m_currentItemUrl(),
m_createdItemUrl(),
+ m_selectedItems(),
m_expandedDragSource(0)
{
m_topLayout = new QVBoxLayout(this);
m_createdItemUrl = KUrl();
}
+void DolphinView::restoreSelection()
+{
+ disconnect(m_dirLister, SIGNAL(completed()), this, SLOT(restoreSelection()));
+ changeSelection(m_selectedItems);
+}
+
void DolphinView::emitContentsMoved()
{
// only emit the contents moved signal if:
m_loadingDirectory = true;
+ if (reload) {
+ m_selectedItems = selectedItems();
+ connect(m_dirLister, SIGNAL(completed()), this, SLOT(restoreSelection()));
+ }
+
m_dirLister->stop();
m_dirLister->openUrl(url, reload ? KDirLister::Reload : KDirLister::NoFlags);
return m_dolphinModel->mimeData(selection.indexes());
}
+
#include "dolphinview.moc"
*/
void selectAndScrollToCreatedItem();
+ /**
+ * Restore selection after view refresh.
+ */
+ void restoreSelection();
+
private:
void loadDirectory(const KUrl& url, bool reload = false);
KUrl m_rootUrl;
KUrl m_currentItemUrl;
KUrl m_createdItemUrl; // URL for a new item that got created by the "Create New..." menu
+ KFileItemList m_selectedItems; //this is used for making the View to remember selections after F5
QAbstractItemView* m_expandedDragSource;
};