}
const QModelIndex dirModelIndex = m_proxyModel->mapToSource(index);
- KFileItem* item = m_dirModel->itemForIndex(dirModelIndex);
+ KFileItem item = m_dirModel->itemForIndex(dirModelIndex);
- emit changeSelection(KFileItemList());
+ emit changeSelection(QList<KFileItem>());
TreeViewContextMenu contextMenu(this, item);
contextMenu.open();
}
void TreeViewSidebarPage::updateActiveView(const QModelIndex& index)
{
const QModelIndex dirIndex = m_proxyModel->mapToSource(index);
- const KFileItem* item = m_dirModel->itemForIndex(dirIndex);
- if (item != 0) {
- const KUrl& url = item->url();
- emit changeUrl(url);
+ const KFileItem item = m_dirModel->itemForIndex(dirIndex);
+ if (!item.isNull()) {
+ emit changeUrl(item.url());
}
}
{
if (index.isValid()) {
const QModelIndex dirIndex = m_proxyModel->mapToSource(index);
- KFileItem* item = m_dirModel->itemForIndex(dirIndex);
- Q_ASSERT(item != 0);
- if (item->isDir()) {
- emit urlsDropped(urls, item->url());
+ KFileItem item = m_dirModel->itemForIndex(dirIndex);
+ Q_ASSERT(!item.isNull());
+ if (item.isDir()) {
+ emit urlsDropped(urls, item.url());
}
}
}
{
Q_ASSERT(m_dirLister != 0);
- // adjust the root of the tree to the base bookmark
+ // adjust the root of the tree to the base place
KFilePlacesModel* placesModel = DolphinSettings::instance().placesModel();
KUrl baseUrl = placesModel->url(placesModel->closestItem(url));
if (!baseUrl.isValid()) {