/***************************************************************************
- * Copyright (C) 2010 by Peter Penz <peter.penz@gmx.at> *
+ * Copyright (C) 2010 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 *
void DolphinViewController::setItemView(QAbstractItemView* view)
{
- if (m_itemView != 0) {
+ if (m_itemView) {
disconnect(m_itemView, SIGNAL(pressed(const QModelIndex&)),
this, SLOT(updateMouseButtonState()));
}
m_itemView = view;
- if (m_itemView != 0) {
+ if (m_itemView) {
// TODO: this is a workaround until Qt-issue 176832 has been fixed
connect(m_itemView, SIGNAL(pressed(const QModelIndex&)),
this, SLOT(updateMouseButtonState()));
void DolphinViewController::handleKeyPressEvent(QKeyEvent* event)
{
- if (m_itemView == 0) {
+ if (!m_itemView) {
return;
}
KFileItem DolphinViewController::itemForIndex(const QModelIndex& index) const
{
- if (m_itemView != 0) {
+ if (m_itemView) {
QAbstractProxyModel* proxyModel = static_cast<QAbstractProxyModel*>(m_itemView->model());
- if (proxyModel != 0) {
+ if (proxyModel) {
KDirModel* dirModel = static_cast<KDirModel*>(proxyModel->sourceModel());
const QModelIndex dirIndex = proxyModel->mapToSource(index);
return dirModel->itemForIndex(dirIndex);
const KFileItem item = itemForIndex(index);
if (index.isValid() && (index.column() == KDirModel::Name)) {
emit itemTriggered(item);
- } else if (m_itemView != 0) {
+ } else if (m_itemView) {
m_itemView->clearSelection();
emit itemEntered(KFileItem());
}