/***************************************************************************
- * Copyright (C) 2006-2009 by Peter Penz <peter.penz@gmx.at> *
+ * Copyright (C) 2006-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 <kcategorizedsortfilterproxymodel.h>
-#include <kdialog.h>
-#include <kfileitemdelegate.h>
+#include <KCategorizedSortFilterProxyModel>
+#include <KDialog>
+#include <KFileItemDelegate>
#include <QAbstractProxyModel>
#include <QApplication>
DolphinSortFilterProxyModel* proxyModel) :
KCategorizedView(parent),
m_dolphinViewController(dolphinViewController),
- m_viewModeController(viewModeController),
m_categoryDrawer(new DolphinCategoryDrawer(this)),
m_extensionsFactory(0),
m_font(),
m_itemSize(),
m_dropRect()
{
- Q_ASSERT(dolphinViewController != 0);
- Q_ASSERT(viewModeController != 0);
+ Q_ASSERT(dolphinViewController);
+ Q_ASSERT(viewModeController);
setModel(proxyModel);
setLayoutDirection(Qt::LeftToRight);
// apply the icons mode settings to the widget
const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
- Q_ASSERT(settings != 0);
+ Q_ASSERT(settings);
if (settings->useSystemFont()) {
m_font = KGlobalSettings::generalFont();
updateGridSize(view->showPreview(), 0);
m_extensionsFactory = new ViewExtensionsFactory(this, dolphinViewController, viewModeController);
-
- // setFocus() must be called after m_extensionsFactory is initialised (see bug 240374).
- setFocus();
}
DolphinIconsView::~DolphinIconsView()
{
const QModelIndex index = indexAt(event->pos());
const KFileItem item = m_dolphinViewController->itemForIndex(index);
- m_dolphinViewController->indicateDroppedUrls(item, m_viewModeController->url(), event);
+ m_dolphinViewController->indicateDroppedUrls(item, event);
// don't call KCategorizedView::dropEvent(event), as it moves
// the items which is not wanted
}
Q_UNUSED(category);
const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
- Q_ASSERT(settings != 0);
+ Q_ASSERT(settings);
if (settings->useSystemFont()) {
m_font = KGlobalSettings::generalFont();
}
void DolphinIconsView::updateGridSize(bool showPreview, int additionalInfoCount)
{
const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
- Q_ASSERT(settings != 0);
+ Q_ASSERT(settings);
int itemWidth = settings->itemWidth();
int itemHeight = settings->itemHeight();
setGridSizeOwn(QSize(itemWidth + spacing * 2, itemHeight + spacing));
KFileItemDelegate* delegate = dynamic_cast<KFileItemDelegate*>(itemDelegate());
- if (delegate != 0) {
+ if (delegate) {
delegate->setMaximumSize(m_itemSize);
}
}