this, SLOT(updateStatusBar()));
connect(m_dirLister, SIGNAL(percent(int)),
this, SLOT(updateProgress(int)));
- connect(m_dirLister, SIGNAL(deleteItem(KFileItem*)),
+ connect(m_dirLister, SIGNAL(deleteItem(const KFileItem&)),
this, SLOT(updateStatusBar()));
connect(m_dirLister, SIGNAL(completed()),
this, SLOT(updateItemCount()));
this, SLOT(showInfoMessage(const QString&)));
connect(m_view, SIGNAL(itemTriggered(KFileItem)),
this, SLOT(slotItemTriggered(KFileItem)));
+ connect(m_view, SIGNAL(startedPathLoading(const KUrl&)),
+ this, SLOT(saveRootUrl(const KUrl&)));
connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)),
- m_view, SLOT(setUrl(const KUrl&)));
+ this, SLOT(restoreView(const KUrl&)));
m_statusBar = new DolphinStatusBar(this, url);
connect(m_view, SIGNAL(urlChanged(const KUrl&)),
void DolphinViewContainer::renameSelectedItems()
{
DolphinViewContainer* view = m_mainWindow->activeViewContainer();
- const QList<KFileItem> items = m_view->selectedItems();
+ const KFileItemList items = m_view->selectedItems();
if (items.count() > 1) {
// More than one item has been selected for renaming. Open
// a rename dialog and rename all items afterwards.
Q_ASSERT(replaceIndex >= 0);
int index = 1;
- QList<KFileItem>::const_iterator it = items.begin();
- QList<KFileItem>::const_iterator end = items.end();
+ KFileItemList::const_iterator it = items.begin();
+ KFileItemList::const_iterator end = items.end();
while (it != end) {
const KUrl& oldUrl = (*it).url();
QString number;
m_folderCount = 0;
while (it != end) {
- KFileItem* item = *it;
- if (item->isDir()) {
+ const KFileItem item = *it;
+ if (item.isDir()) {
++m_folderCount;
} else {
++m_fileCount;
QString DolphinViewContainer::selectionStatusBarText() const
{
QString text;
- const QList<KFileItem> list = m_view->selectedItems();
+ const KFileItemList list = m_view->selectedItems();
if (list.isEmpty()) {
// when an item is triggered, it is temporary selected but selectedItems()
// will return an empty list
int fileCount = 0;
int folderCount = 0;
KIO::filesize_t byteSize = 0;
- QList<KFileItem>::const_iterator it = list.begin();
- const QList<KFileItem>::const_iterator end = list.end();
+ KFileItemList::const_iterator it = list.begin();
+ const KFileItemList::const_iterator end = list.end();
while (it != end) {
const KFileItem& item = *it;
if (item.isDir()) {
adjustedFilter.insert(0, '*');
adjustedFilter.append('*');
- // Use the ProxyModel to filter:
- // This code is #ifdefed as setNameFilter behaves
- // slightly different than the QSortFilterProxyModel
- // as it will not remove directories. I will ask
- // our beloved usability experts for input
- // -- z.
-#if 0
m_dirLister->setNameFilter(adjustedFilter);
m_dirLister->emitChanges();
-#else
- m_proxyModel->setFilterRegExp(nameFilter);
-#endif
updateStatusBar();
}
setActive(true);
}
+void DolphinViewContainer::restoreView(const KUrl& url)
+{
+ m_view->updateView(url, m_urlNavigator->savedRootUrl());
+}
+
+void DolphinViewContainer::saveRootUrl(const KUrl& url)
+{
+ Q_UNUSED(url);
+ m_urlNavigator->saveRootUrl(m_view->rootUrl());
+}
+
void DolphinViewContainer::slotItemTriggered(const KFileItem& item)
{
// Prefer the local path over the URL.