/***************************************************************************
- * Copyright (C) 2007-2009 by Peter Penz <peter.penz@gmx.at> *
+ * Copyright (C) 2007-2009 by Peter Penz <peter.penz19@gmail.com> *
* *
* 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 *
#include "viewmodecontroller.h"
#include "zoomlevelinfo.h"
-#include <kcolorscheme.h>
-#include <kdirlister.h>
-#include <kfileitem.h>
-#include <kio/previewjob.h>
-#include <kicon.h>
-#include <kiconeffect.h>
-#include <kjob.h>
-#include <klocale.h>
+#include <KColorScheme>
+#include <KDirLister>
+#include <KFileItem>
+#include <KIO/PreviewJob>
+#include <KIcon>
+#include <KIconEffect>
+#include <KJob>
+#include <KLocale>
#include <konqmimedata.h>
#include <QApplication>
m_resizeWidget->installEventFilter(this);
const ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
- Q_ASSERT(settings != 0);
+ Q_ASSERT(settings);
if (settings->useSystemFont()) {
m_font = KGlobalSettings::generalFont();
updateDecorationSize(dolphinView->showPreview());
updateBackground();
-
+
DolphinViewController* dolphinViewController = m_container->m_dolphinViewController;
m_extensionsFactory = new ViewExtensionsFactory(this, dolphinViewController, viewModeController);
m_extensionsFactory->fileItemDelegate()->setMinimizedNameColumn(true);
m_dirLister = 0; // deleted by m_dolphinModel
}
+
void DolphinColumnView::setActive(bool active)
{
if (m_active != active) {
}
}
+bool DolphinColumnView::isActive() const
+{
+ return m_active;
+}
+
+void DolphinColumnView::setChildUrl(const KUrl& url)
+{
+ m_childUrl = url;
+}
+
+KUrl DolphinColumnView::childUrl() const
+{
+ return m_childUrl;
+}
+
+void DolphinColumnView::setUrl(const KUrl& url)
+{
+ if (url != m_url) {
+ m_url = url;
+ m_dirLister->openUrl(url, KDirLister::NoFlags);
+ }
+}
+
+KUrl DolphinColumnView::url() const
+{
+ return m_url;
+}
+
void DolphinColumnView::updateBackground()
{
// TODO: The alpha-value 150 is copied from DolphinView::setActive(). When
// If a change of the selection is done although the view is not active
// (e. g. by the selection markers), the column must be activated. This
// is done by listening to the current selectionChanged() signal.
- if (selectionModel() != 0) {
+ if (selectionModel()) {
disconnect(selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
this, SLOT(requestActivation()));
}
void DolphinColumnView::dragEnterEvent(QDragEnterEvent* event)
{
- if (DragAndDropHelper::instance().isMimeDataSupported(event->mimeData())) {
- event->acceptProposedAction();
- requestActivation();
- }
+ event->acceptProposedAction();
+ requestActivation();
DolphinTreeView::dragEnterEvent(event);
}
void DolphinColumnView::dragMoveEvent(QDragMoveEvent* event)
{
DolphinTreeView::dragMoveEvent(event);
-
- if (DragAndDropHelper::instance().isMimeDataSupported(event->mimeData())) {
- // accept url drops, independently from the destination item
- event->acceptProposedAction();
- }
+ event->acceptProposedAction();
}
void DolphinColumnView::dropEvent(QDropEvent* event)
m_container->m_dolphinViewController->setItemView(this);
const QModelIndex dolphinModelIndex = m_proxyModel->mapToSource(index);
const KFileItem item = m_dolphinModel->itemForIndex(dolphinModelIndex);
- m_container->m_dolphinViewController->indicateDroppedUrls(item, url(), event);
+ m_container->m_dolphinViewController->indicateDroppedUrls(item, event);
DolphinTreeView::dropEvent(event);
}
}
void DolphinColumnView::keyPressEvent(QKeyEvent* event)
-{
+{
DolphinTreeView::keyPressEvent(event);
DolphinViewController* controller = m_container->m_dolphinViewController;
void DolphinColumnView::updateFont()
{
const ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
- Q_ASSERT(settings != 0);
+ Q_ASSERT(settings);
if (settings->useSystemFont()) {
m_font = KGlobalSettings::generalFont();
selectionModel()->setCurrentIndex(current, QItemSelectionModel::NoUpdate);
connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
this, SLOT(requestActivation()));
-
+
updateBackground();
}