#include <kcolorscheme.h>
#include <kdirlister.h>
#include <kfileitemdelegate.h>
+#include <kfilepreviewgenerator.h>
#include <kiconeffect.h>
#include <klocale.h>
#include <kio/deletejob.h>
#include "dolphinsettings.h"
#include "dolphin_generalsettings.h"
#include "folderexpander.h"
-#include "kfilepreviewgenerator.h"
#include "renamedialog.h"
#include "tooltipmanager.h"
#include "viewproperties.h"
connect(m_controller, SIGNAL(requestContextMenu(const QPoint&)),
this, SLOT(openContextMenu(const QPoint&)));
- connect(m_controller, SIGNAL(urlsDropped(const KUrl::List&, const KUrl&, const KFileItem&)),
- this, SLOT(dropUrls(const KUrl::List&, const KUrl&, const KFileItem&)));
+ connect(m_controller, SIGNAL(urlsDropped(const KFileItem&, const KUrl&, QDropEvent*)),
+ this, SLOT(dropUrls(const KFileItem&, const KUrl&, QDropEvent*)));
connect(m_controller, SIGNAL(sortingChanged(DolphinView::Sorting)),
this, SLOT(updateSorting(DolphinView::Sorting)));
connect(m_controller, SIGNAL(sortOrderChanged(Qt::SortOrder)),
KUrl newUrl = oldUrl;
newUrl.setFileName(name);
KonqOperations::rename(this, oldUrl, newUrl);
- emit doingOperation(KIO::FileUndoManager::Rename);
}
}
}
KUrl newUrl = oldUrl;
newUrl.setFileName(newName);
KonqOperations::rename(this, oldUrl, newUrl);
- emit doingOperation(KIO::FileUndoManager::Rename);
}
}
}
void DolphinView::trashSelectedItems()
{
- emit doingOperation(KIO::FileUndoManager::Trash);
const KUrl::List list = simplifiedSelectedUrls();
KonqOperations::del(this, KonqOperations::TRASH, list);
}
props.setShowPreview(show);
m_showPreview = show;
- m_previewGenerator->setShowPreview(show);
+ m_previewGenerator->setPreviewShown(show);
const int oldZoomLevel = m_controller->zoomLevel();
emit showPreviewChanged();
m_isContextMenuOpen = false;
}
-void DolphinView::dropUrls(const KUrl::List& urls,
+void DolphinView::dropUrls(const KFileItem& destItem,
const KUrl& destPath,
- const KFileItem& destItem)
+ QDropEvent* event)
{
- Q_ASSERT(!urls.isEmpty());
- const KUrl destination = !destItem.isNull() && destItem.isDir() ?
- destItem.url() : destPath;
- const KUrl sourceDir = KUrl(urls.first().directory());
- if (sourceDir != destination) {
- DolphinDropController dropController(this);
- // forward doingOperation signal up to the mainwindow
- connect(&dropController, SIGNAL(doingOperation(KIO::FileUndoManager::CommandType)),
- this, SIGNAL(doingOperation(KIO::FileUndoManager::CommandType)));
- dropController.dropUrls(urls, destination);
- }
+ DolphinDropController::dropUrls(destItem, destPath, event, this);
}
void DolphinView::updateSorting(DolphinView::Sorting sorting)
const bool showPreview = props.showPreview();
if (showPreview != m_showPreview) {
m_showPreview = showPreview;
- m_previewGenerator->setShowPreview(showPreview);
+ m_previewGenerator->setPreviewShown(showPreview);
const int oldZoomLevel = m_controller->zoomLevel();
emit showPreviewChanged();
m_controller->setItemView(view);
m_fileItemDelegate = new KFileItemDelegate(view);
+ m_fileItemDelegate->setShowToolTipWhenElided(false);
view->setItemDelegate(m_fileItemDelegate);
view->setModel(m_proxyModel);
view->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_previewGenerator = new KFilePreviewGenerator(view, m_proxyModel);
- m_previewGenerator->setShowPreview(m_showPreview);
+ m_previewGenerator->setPreviewShown(m_showPreview);
if (DolphinSettings::instance().generalSettings()->showToolTips()) {
m_toolTipManager = new ToolTipManager(view, m_proxyModel);
const KUrl::List sourceUrls = KUrl::List::fromMimeData(mimeData);
if (KonqMimeData::decodeIsCutSelection(mimeData)) {
KonqOperations::copy(this, KonqOperations::MOVE, sourceUrls, url);
- emit doingOperation(KIO::FileUndoManager::Move);
clipboard->clear();
} else {
KonqOperations::copy(this, KonqOperations::COPY, sourceUrls, url);
- emit doingOperation(KIO::FileUndoManager::Copy);
}
}