m_controller(0),
m_iconsView(0),
m_detailsView(0),
+ m_fileItemDelegate(0),
m_filterBar(0),
m_statusBar(0),
m_dirModel(0),
m_controller = new DolphinController(this);
connect(m_controller, SIGNAL(requestContextMenu(const QPoint&)),
this, SLOT(openContextMenu(const QPoint&)));
- connect(m_controller, SIGNAL(urlsDropped(const KUrl::List&, const QPoint&)),
- this, SLOT(dropUrls(const KUrl::List&, const QPoint&)));
+ connect(m_controller, SIGNAL(urlsDropped(const KUrl::List&, const QModelIndex&, QWidget*)),
+ this, SLOT(dropUrls(const KUrl::List&, const QModelIndex&, QWidget*)));
connect(m_controller, SIGNAL(sortingChanged(DolphinView::Sorting)),
this, SLOT(updateSorting(DolphinView::Sorting)));
connect(m_controller, SIGNAL(sortOrderChanged(Qt::SortOrder)),
return m_proxyModel->sortOrder();
}
+void DolphinView::setAdditionalInfo(KFileItemDelegate::AdditionalInformation info)
+{
+ ViewProperties props(m_urlNavigator->url());
+ props.setAdditionalInfo(info);
+
+ m_fileItemDelegate->setAdditionalInformation(info);
+
+ emit additionalInfoChanged(info);
+ reload();
+}
+
+KFileItemDelegate::AdditionalInformation DolphinView::additionalInfo() const
+{
+ return m_fileItemDelegate->additionalInformation();
+}
+
void DolphinView::goBack()
{
m_urlNavigator->goBack();
emit sortOrderChanged(sortOrder);
}
+ KFileItemDelegate::AdditionalInformation info = props.additionalInfo();
+ if (info != m_fileItemDelegate->additionalInformation()) {
+ m_fileItemDelegate->setAdditionalInformation(info);
+
+ emit additionalInfoChanged(info);
+ }
+
const bool showPreview = props.showPreview();
if (showPreview != m_controller->showPreview()) {
m_controller->setShowPreview(showPreview);
const QMimeData* mimeData = QApplication::clipboard()->mimeData();
if (KonqMimeData::decodeIsCutSelection(mimeData)) {
- QTimer::singleShot(1000, this, SLOT(applyCutEffect()));
+ QTimer::singleShot(0, this, SLOT(applyCutEffect()));
}
}
}
void DolphinView::dropUrls(const KUrl::List& urls,
- const QPoint& pos)
+ const QModelIndex& index,
+ QWidget* source)
{
KFileItem* directory = 0;
- const QModelIndex index = itemView()->indexAt(pos);
if (isValidNameIndex(index)) {
KFileItem* item = fileItem(index);
assert(item != 0);
}
}
+ if ((directory == 0) && (source == itemView())) {
+ // The dropping is done into the same viewport where
+ // the dragging has been started. Just ignore this...
+ return;
+ }
+
const KUrl& destination = (directory == 0) ? url() :
directory->url();
+
+ kDebug() << "DolphinView::dropUrls() - destination: " << destination.prettyUrl() << endl;
+
dropUrls(urls, destination);
}
m_topLayout->removeWidget(view);
view->close();
view->deleteLater();
+ view = 0;
m_iconsView = 0;
m_detailsView = 0;
+ m_fileItemDelegate = 0;
}
assert(m_iconsView == 0);
break;
}
+ assert(view != 0);
+
+ m_fileItemDelegate = new KFileItemDelegate(view);
+ view->setItemDelegate(m_fileItemDelegate);
+
view->setModel(m_proxyModel);
view->setSelectionMode(QAbstractItemView::ExtendedSelection);