┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphiniconsview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-02-14 21:54:24 +0000
committerPeter Penz <[email protected]>2007-02-14 21:54:24 +0000
commitc91365ab8d7582255aa0de8f403ec0787446a74f (patch)
treea4499e7043a5a0277094af621e5bf1ef8df7faa1 /src/dolphiniconsview.cpp
parent8134fd34d5e49dbdd1d0c8a26b300f6e07b9575b (diff)
Step one for having DolphinParts for the icons and details view, which can be used by Konqueror. TODO: currently dropping of items is deactivated, as I want to wait for Davids feedback whether the direction is ok.
svn path=/trunk/KDE/kdebase/apps/; revision=633703
Diffstat (limited to 'src/dolphiniconsview.cpp')
-rw-r--r--src/dolphiniconsview.cpp40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp
index 840d7f5fb..7c32715db 100644
--- a/src/dolphiniconsview.cpp
+++ b/src/dolphiniconsview.cpp
@@ -1,6 +1,5 @@
/***************************************************************************
- * Copyright (C) 2006 by Peter Penz *
+ * Copyright (C) 2006 by Peter Penz ([email protected]) *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -19,8 +18,8 @@
***************************************************************************/
#include "dolphiniconsview.h"
-#include "dolphinmainwindow.h"
-#include "dolphinview.h"
+
+#include "dolphincontroller.h"
#include <assert.h>
#include <kdirmodel.h>
@@ -28,11 +27,20 @@
#include <QAbstractProxyModel>
-DolphinIconsView::DolphinIconsView(DolphinView* parent) :
+DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controller) :
QListView(parent),
- m_dolphinView(parent)
+ m_controller(controller)
{
+ assert(controller != 0);
+
setResizeMode(QListView::Adjust);
+
+ // TODO: read out settings
+ setViewMode(QListView::IconMode);
+ setSpacing(32);
+
+ connect(this, SIGNAL(clicked(const QModelIndex&)),
+ controller, SLOT(triggerItem(const QModelIndex&)));
}
DolphinIconsView::~DolphinIconsView()
@@ -57,21 +65,14 @@ QStyleOptionViewItem DolphinIconsView::viewOptions() const
void DolphinIconsView::contextMenuEvent(QContextMenuEvent* event)
{
QListView::contextMenuEvent(event);
-
- KFileItem* item = 0;
-
- const QModelIndex index = indexAt(event->pos());
- if (index.isValid()) {
- item = m_dolphinView->fileItem(index);
- }
-
- m_dolphinView->openContextMenu(item, event->globalPos());
+ m_controller->triggerContextMenuRequest(event->pos(),
+ event->globalPos());
}
void DolphinIconsView::mouseReleaseEvent(QMouseEvent* event)
{
QListView::mouseReleaseEvent(event);
- m_dolphinView->declareViewActive();
+ m_controller->triggerActivation();
}
void DolphinIconsView::dragEnterEvent(QDragEnterEvent* event)
@@ -83,7 +84,10 @@ void DolphinIconsView::dragEnterEvent(QDragEnterEvent* event)
void DolphinIconsView::dropEvent(QDropEvent* event)
{
- KFileItem* directory = 0;
+ QListView::dropEvent(event);
+ // TODO: temporary deactivated until DolphinController will support this
+
+ /* KFileItem* directory = 0;
bool dropIntoDirectory = false;
const QModelIndex index = indexAt(event->pos());
if (index.isValid()) {
@@ -104,7 +108,7 @@ void DolphinIconsView::dropEvent(QDropEvent* event)
const KUrl& destination = (directory == 0) ? m_dolphinView->url() :
directory->url();
m_dolphinView->mainWindow()->dropUrls(urls, destination);
- }
+ }*/
}
#include "dolphiniconsview.moc"