DolphinApplication::~DolphinApplication()
{
// cleanup what ever is left from the MainWindows
- while (m_mainWindows.count() != 0) {
+ while (!m_mainWindows.isEmpty()) {
delete m_mainWindows.takeFirst();
}
}
const DolphinView* view = m_mainWindow->activeViewContainer()->view();
m_selectedItems = view->selectedItems();
- if (m_keyInfo != 0) {
+ if (m_keyInfo) {
if (m_keyInfo->isKeyPressed(Qt::Key_Shift) || m_keyInfo->isKeyLatched(Qt::Key_Shift)) {
m_shiftPressed = true;
}
m_popup->addAction(propertiesAction);
QAction* activatedAction = m_popup->exec(QCursor::pos());
- if (activatedAction != 0) {
+ if (activatedAction) {
if (activatedAction == addToPlacesAction) {
const KUrl selectedUrl(m_fileInfo.url());
if (selectedUrl.isValid()) {
KPropertiesDialog* dialog = new KPropertiesDialog(url, m_mainWindow);
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
- } else if ((addToPlacesAction != 0) && (action == addToPlacesAction)) {
+ } else if (addToPlacesAction && (action == addToPlacesAction)) {
const KUrl& url = m_mainWindow->activeViewContainer()->url();
if (url.isValid()) {
DolphinSettings::instance().placesModel()->addPlace(placesName(url), url);
KFileItemListProperties& DolphinContextMenu::selectedItemsProperties()
{
- if (m_selectedItemsProperties == 0) {
+ if (!m_selectedItemsProperties) {
m_selectedItemsProperties = new KFileItemListProperties(m_selectedItems);
}
return *m_selectedItemsProperties;
KFileItem DolphinContextMenu::baseFileItem()
{
- if (m_baseFileItem == 0) {
+ if (!m_baseFileItem) {
m_baseFileItem = new KFileItem(KFileItem::Unknown, KFileItem::Unknown, m_baseUrl);
}
return *m_baseFileItem;
m_locked = lock;
if (lock) {
- if (m_dockTitleBar == 0) {
+ if (!m_dockTitleBar) {
m_dockTitleBar = new DolphinDockTitleBar(this);
}
setTitleBarWidget(m_dockTitleBar);
const int tabCount = m_viewTab.count();
for (int i = 0; i < tabCount; ++i) {
m_viewTab[i].primaryView->view()->markUrlsAsSelected(files);
- if (m_viewTab[i].secondaryView != 0) {
+ if (m_viewTab[i].secondaryView) {
m_viewTab[i].secondaryView->view()->markUrlsAsSelected(files);
}
}
void DolphinMainWindow::refreshViews()
{
- Q_ASSERT(m_viewTab[m_tabIndex].primaryView != 0);
+ Q_ASSERT(m_viewTab[m_tabIndex].primaryView);
// remember the current active view, as because of
// the refreshing the active view might change to
const int tabCount = m_viewTab.count();
for (int i = 0; i < tabCount; ++i) {
m_viewTab[i].primaryView->refresh();
- if (m_viewTab[i].secondaryView != 0) {
+ if (m_viewTab[i].secondaryView) {
m_viewTab[i].secondaryView->refresh();
}
}
// Synchronize the split-view setting with the active view:
const bool splitView = generalSettings->splitView();
const ViewTab& activeTab = m_viewTab[m_tabIndex];
- const bool toggle = ( splitView && (activeTab.secondaryView == 0))
- || (!splitView && (activeTab.secondaryView != 0));
+ const bool toggle = ( splitView && !activeTab.secondaryView)
+ || (!splitView && activeTab.secondaryView);
if (toggle) {
toggleSplitView();
}
}
DolphinViewContainer* view = activeViewContainer();
- if (view != 0) {
+ if (view) {
view->setUrl(url);
updateEditActions();
updateViewActions();
{
updateEditActions();
- Q_ASSERT(m_viewTab[m_tabIndex].primaryView != 0);
+ Q_ASSERT(m_viewTab[m_tabIndex].primaryView);
int selectedUrlsCount = m_viewTab[m_tabIndex].primaryView->view()->selectedItemsCount();
- if (m_viewTab[m_tabIndex].secondaryView != 0) {
+ if (m_viewTab[m_tabIndex].secondaryView) {
selectedUrlsCount += m_viewTab[m_tabIndex].secondaryView->view()->selectedItemsCount();
}
QAction* backAction = actionCollection()->action("go_back");
backAction->setToolTip(i18nc("@info", "Go back"));
- if (backAction != 0) {
+ if (backAction) {
backAction->setEnabled(index < urlNavigator->historySize() - 1);
}
QAction* forwardAction = actionCollection()->action("go_forward");
forwardAction->setToolTip(i18nc("@info", "Go forward"));
- if (forwardAction != 0) {
+ if (forwardAction) {
forwardAction->setEnabled(index > 0);
}
}
m_viewTab[tabIndex].isPrimaryViewActive = false;
}
- if (focusWidget != 0) {
+ if (focusWidget) {
// The DolphinViewContainer grabbed the keyboard focus. As the tab is opened
// in background, assure that the previous focused widget gets the focus back.
focusWidget->setFocus();
void DolphinMainWindow::toggleActiveView()
{
- if (m_viewTab[m_tabIndex].secondaryView == 0) {
+ if (!m_viewTab[m_tabIndex].secondaryView) {
// only one view is available
return;
}
- Q_ASSERT(m_activeViewContainer != 0);
- Q_ASSERT(m_viewTab[m_tabIndex].primaryView != 0);
+ Q_ASSERT(m_activeViewContainer);
+ Q_ASSERT(m_viewTab[m_tabIndex].primaryView);
DolphinViewContainer* left = m_viewTab[m_tabIndex].primaryView;
DolphinViewContainer* right = m_viewTab[m_tabIndex].secondaryView;
if (m_filterDockIsTemporaryVisible) {
QDockWidget* filterDock = findChild<QDockWidget*>("filterDock");
- if (filterDock != 0) {
+ if (filterDock) {
filterDock->hide();
}
m_filterDockIsTemporaryVisible = false;
cont->urlNavigator()->isUrlEditable());
cont = m_viewTab[i].secondaryView;
- if (cont != 0) {
+ if (cont) {
group.writeEntry(tabProperty("Secondary URL", i), cont->url().url());
group.writeEntry(tabProperty("Secondary Editable", i),
cont->urlNavigator()->isUrlEditable());
cont = m_viewTab[i].secondaryView;
const QString secondaryUrl = group.readEntry(tabProperty("Secondary URL", i));
if (!secondaryUrl.isEmpty()) {
- if (cont == 0) {
+ if (!cont) {
// a secondary view should be shown, but no one is available
// currently -> create a new view
toggleSplitView();
cont = m_viewTab[i].secondaryView;
- Q_ASSERT(cont != 0);
+ Q_ASSERT(cont);
}
cont->setUrl(secondaryUrl);
const bool editable = group.readEntry(tabProperty("Secondary Editable", i), false);
cont->urlNavigator()->setUrlEditable(editable);
- } else if (cont != 0) {
+ } else if (cont) {
// no secondary view should be shown, but the default setting shows
// one already -> close the view
toggleSplitView();
void DolphinMainWindow::slotUndoAvailable(bool available)
{
QAction* undoAction = actionCollection()->action(KStandardAction::name(KStandardAction::Undo));
- if (undoAction != 0) {
+ if (undoAction) {
undoAction->setEnabled(available);
}
}
void DolphinMainWindow::slotUndoTextChanged(const QString& text)
{
QAction* undoAction = actionCollection()->action(KStandardAction::name(KStandardAction::Undo));
- if (undoAction != 0) {
+ if (undoAction) {
undoAction->setText(text);
}
}
void DolphinMainWindow::toggleSplitView()
{
- if (m_viewTab[m_tabIndex].secondaryView == 0) {
+ if (!m_viewTab[m_tabIndex].secondaryView) {
createSecondaryView(m_tabIndex);
setActiveViewContainer(m_viewTab[m_tabIndex].secondaryView);
} else if (m_activeViewContainer == m_viewTab[m_tabIndex].secondaryView) {
const bool newLockState = !generalSettings->lockPanels();
foreach (QObject* child, children()) {
DolphinDockWidget* dock = qobject_cast<DolphinDockWidget*>(child);
- if (dock != 0) {
+ if (dock) {
dock->setLocked(newLockState);
}
}
// - both in the secondary view
// - one in the primary view and the other in the secondary
// view
- Q_ASSERT(m_viewTab[m_tabIndex].primaryView != 0);
+ Q_ASSERT(m_viewTab[m_tabIndex].primaryView);
KUrl urlA;
KUrl urlB;
switch (items.count()) {
case 0: {
- Q_ASSERT(m_viewTab[m_tabIndex].secondaryView != 0);
+ Q_ASSERT(m_viewTab[m_tabIndex].secondaryView);
items = m_viewTab[m_tabIndex].secondaryView->view()->selectedItems();
Q_ASSERT(items.count() == 2);
urlA = items[0].url();
case 1: {
urlA = items[0].url();
- Q_ASSERT(m_viewTab[m_tabIndex].secondaryView != 0);
+ Q_ASSERT(m_viewTab[m_tabIndex].secondaryView);
items = m_viewTab[m_tabIndex].secondaryView->view()->selectedItems();
Q_ASSERT(items.count() == 1);
urlB = items[0].url();
void DolphinMainWindow::editSettings()
{
- if (m_settingsDialog == 0) {
+ if (!m_settingsDialog) {
const KUrl url = activeViewContainer()->url();
m_settingsDialog = new DolphinSettingsDialog(url, this);
m_settingsDialog->setAttribute(Qt::WA_DeleteOnClose);
ViewTab& hiddenTab = m_viewTab[m_tabIndex];
hiddenTab.isPrimaryViewActive = hiddenTab.primaryView->isActive();
hiddenTab.primaryView->setActive(false);
- if (hiddenTab.secondaryView != 0) {
+ if (hiddenTab.secondaryView) {
hiddenTab.secondaryView->setActive(false);
}
QSplitter* splitter = m_viewTab[m_tabIndex].splitter;
ViewTab& viewTab = m_viewTab[index];
m_centralWidgetLayout->addWidget(viewTab.splitter, 1);
viewTab.primaryView->show();
- if (viewTab.secondaryView != 0) {
+ if (viewTab.secondaryView) {
viewTab.secondaryView->show();
}
viewTab.splitter->show();
// delete tab
m_viewTab[index].primaryView->deleteLater();
- if (m_viewTab[index].secondaryView != 0) {
+ if (m_viewTab[index].secondaryView) {
m_viewTab[index].secondaryView->deleteLater();
}
m_viewTab[index].splitter->deleteLater();
QAction* selectedAction = menu.exec(pos);
if (selectedAction == newTabAction) {
const ViewTab& tab = m_viewTab[index];
- Q_ASSERT(tab.primaryView != 0);
- const KUrl url = (tab.secondaryView != 0) && tab.secondaryView->isActive() ?
+ Q_ASSERT(tab.primaryView);
+ const KUrl url = tab.secondaryView && tab.secondaryView->isActive() ?
tab.secondaryView->url() : tab.primaryView->url();
openNewTab(url);
m_tabBar->setCurrentIndex(m_viewTab.count() - 1);
} else if (selectedAction == detachTabAction) {
const ViewTab& tab = m_viewTab[index];
- Q_ASSERT(tab.primaryView != 0);
+ Q_ASSERT(tab.primaryView);
const KUrl primaryUrl = tab.primaryView->url();
DolphinMainWindow* window = DolphinApplication::app()->createMainWindow();
window->changeUrl(primaryUrl);
- if (tab.secondaryView != 0) {
+ if (tab.secondaryView) {
const KUrl secondaryUrl = tab.secondaryView->url();
- if (window->m_viewTab[0].secondaryView == 0) {
+ if (!window->m_viewTab[0].secondaryView) {
window->toggleSplitView();
}
window->m_viewTab[0].secondaryView->setUrl(secondaryUrl);
}
QDockWidget* filterDock = findChild<QDockWidget*>("filterDock");
- if (filterDock == 0) {
+ if (!filterDock) {
return;
}
void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* viewContainer)
{
- Q_ASSERT(viewContainer != 0);
+ Q_ASSERT(viewContainer);
Q_ASSERT((viewContainer == m_viewTab[m_tabIndex].primaryView) ||
(viewContainer == m_viewTab[m_tabIndex].secondaryView));
if (m_activeViewContainer == viewContainer) {
ClosedTab closedTab;
closedTab.primaryUrl = m_viewTab[index].primaryView->url();
- if (m_viewTab[index].secondaryView != 0) {
+ if (m_viewTab[index].secondaryView) {
closedTab.secondaryUrl = m_viewTab[index].secondaryView->url();
closedTab.isSplit = true;
} else {
void DolphinMainWindow::updateSplitAction()
{
QAction* splitAction = actionCollection()->action("split_view");
- if (m_viewTab[m_tabIndex].secondaryView != 0) {
+ if (m_viewTab[m_tabIndex].secondaryView) {
if (m_activeViewContainer == m_viewTab[m_tabIndex].secondaryView) {
splitAction->setText(i18nc("@action:intoolbar Close right view", "Close"));
splitAction->setToolTip(i18nc("@info", "Close right view"));
void DolphinViewContainer::setFilterBarVisible(bool visible)
{
- Q_ASSERT(m_filterBar != 0);
+ Q_ASSERT(m_filterBar);
if (visible) {
m_filterBar->show();
m_filterBar->setFocus();
m_statusBar->setProgress(100);
}
- if (isSearchUrl(url()) && (m_view->items().count() == 0)) {
+ if (isSearchUrl(url()) && m_view->items().isEmpty()) {
// The dir lister has been completed on a Nepomuk-URI and no items have been found. Instead
// of showing the default status bar information ("0 items") a more helpful information is given:
m_statusBar->setMessage(i18nc("@info:status", "No items found."), DolphinStatusBar::Information);
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setMargin(0);
- Q_ASSERT(m_facetWidget == 0);
+ Q_ASSERT(!m_facetWidget);
m_facetWidget = new Nepomuk::Utils::FacetWidget(this);
layout->addWidget(m_facetWidget, 1);
m_facetWidget->addFacet(Nepomuk::Utils::Facet::createRatingFacet());
m_facetWidget->addFacet(Nepomuk::Utils::Facet::createTagFacet());
- Q_ASSERT(m_lastSetUrlStatJob == 0);
+ Q_ASSERT(!m_lastSetUrlStatJob);
m_lastSetUrlStatJob = KIO::stat(url(), KIO::HideProgressInfo);
connect(m_lastSetUrlStatJob, SIGNAL(result(KJob*)),
this, SLOT(slotSetUrlStatFinished(KJob*)));
void FoldersPanel::setShowHiddenFiles(bool show)
{
FoldersPanelSettings::setShowHiddenFiles(show);
- if (m_dirLister != 0) {
+ if (m_dirLister) {
m_dirLister->setShowingDotFiles(show);
m_dirLister->openUrl(m_dirLister->url(), KDirLister::Reload);
}
return false;
}
- if (m_dirLister != 0) {
+ if (m_dirLister) {
m_setLeafVisible = true;
loadTree(url());
}
return;
}
- if (m_dirLister == 0) {
+ if (!m_dirLister) {
// Postpone the creating of the dir lister to the first show event.
// This assures that no performance and memory overhead is given when the TreeView is not
// used at all (see FoldersPanel::setUrl()).
m_dirLister->setShowingDotFiles(FoldersPanelSettings::showHiddenFiles());
connect(m_dirLister, SIGNAL(completed()), this, SLOT(slotDirListerCompleted()));
- Q_ASSERT(m_dolphinModel == 0);
+ Q_ASSERT(!m_dolphinModel);
m_dolphinModel = new DolphinModel(this);
m_dolphinModel->setDirLister(m_dirLister);
m_dolphinModel->setDropsAllowed(DolphinModel::DropOnDirectory);
connect(m_dolphinModel, SIGNAL(expand(const QModelIndex&)),
this, SLOT(expandToDir(const QModelIndex&)));
- Q_ASSERT(m_proxyModel == 0);
+ Q_ASSERT(!m_proxyModel);
m_proxyModel = new DolphinSortFilterProxyModel(this);
m_proxyModel->setSourceModel(m_dolphinModel);
- Q_ASSERT(m_treeView == 0);
+ Q_ASSERT(!m_treeView);
m_treeView = new PanelTreeView(this);
m_treeView->setModel(m_proxyModel);
m_proxyModel->setSorting(DolphinView::SortByName);
void FoldersPanel::loadTree(const KUrl& url)
{
- Q_ASSERT(m_dirLister != 0);
+ Q_ASSERT(m_dirLister);
m_leafDir = url;
KUrl baseUrl;
return;
}
- if ((selection.count() == 0) && (m_selection.count() == 0)) {
+ if (selection.isEmpty() && m_selection.isEmpty()) {
// The selection has not really changed, only the current index.
// QItemSelectionModel emits a signal in this case and it is less
// expensive doing the check this way instead of patching
}
}
- if (m_metaDataWidget != 0) {
+ if (m_metaDataWidget) {
m_metaDataWidget->show();
m_metaDataWidget->setItems(KFileItemList() << item);
}
m_preview->setPixmap(icon);
setNameLabelText(i18ncp("@info", "%1 item selected", "%1 items selected", items.count()));
- if (m_metaDataWidget != 0) {
+ if (m_metaDataWidget) {
m_metaDataWidget->setItems(items);
}
// Open the popup and adjust the settings for the
// selected action.
QAction* action = popup.exec(QCursor::pos());
- if (action == 0) {
+ if (!action) {
return;
}
// The metadata widget also contains a text widget which may return
// a large preferred width.
- if (m_metaDataWidget != 0) {
+ if (m_metaDataWidget) {
m_metaDataWidget->setMaximumWidth(maxWidth);
}
return;
}
- if (m_topLayout == 0) {
+ if (!m_topLayout) {
m_topLayout = new QVBoxLayout(this);
m_topLayout->setMargin(0);
m_topLayout->setSpacing(KDialog::spacingHint());
{
switch (m_mode) {
case Audio:
- if (m_audioMedia == 0) {
+ if (!m_audioMedia) {
m_audioMedia = Phonon::createPlayer(Phonon::MusicCategory, m_url);
m_audioMedia->setParent(this);
}
break;
case Video:
- if (m_videoPlayer == 0) {
+ if (!m_videoPlayer) {
m_videoPlayer = new EmbeddedVideoPlayer(Phonon::VideoCategory, this);
m_topLayout->insertWidget(0, m_videoPlayer);
}
break;
}
- Q_ASSERT(m_media != 0);
+ Q_ASSERT(m_media);
connect(m_media, SIGNAL(stateChanged(Phonon::State, Phonon::State)),
this, SLOT(stateChanged(Phonon::State)));
m_seekSlider->setMediaObject(m_media);
void PhononWidget::stop()
{
- if (m_media != 0) {
+ if (m_media) {
m_media->stop();
disconnect(m_media, SIGNAL(stateChanged(Phonon::State, Phonon::State)),
this, SLOT(stateChanged(Phonon::State)));
m_playButton->show();
}
- if (m_videoPlayer != 0) {
+ if (m_videoPlayer) {
m_videoPlayer->hide();
}
}
void PhononWidget::applyVideoSize()
{
- if ((m_videoPlayer != 0) && m_videoSize.isValid()) {
+ if ((m_videoPlayer) && m_videoSize.isValid()) {
m_videoPlayer->setSizeHint(m_videoSize);
}
}
return false;
}
- const bool sendInput = (m_terminal != 0)
- && (m_terminal->foregroundProcessId() == -1)
- && isVisible();
+ const bool sendInput = m_terminal && (m_terminal->foregroundProcessId() == -1) && isVisible();
if (sendInput) {
changeDir(url());
}
return;
}
- if (m_terminal == 0) {
+ if (!m_terminal) {
m_clearTerminal = true;
KPluginFactory* factory = KPluginLoader("libkonsolepart").factory();
KParts::ReadOnlyPart* part = factory ? (factory->create<KParts::ReadOnlyPart>(this)) : 0;
- if (part != 0) {
+ if (part) {
connect(part, SIGNAL(destroyed(QObject*)), this, SLOT(terminalExited()));
m_terminalWidget = part->widget();
m_layout->addWidget(m_terminalWidget);
m_terminal = qobject_cast<TerminalInterfaceV2 *>(part);
}
}
- if (m_terminal != 0) {
+ if (m_terminal) {
m_terminal->showShellInDir(url().toLocalFile());
changeDir(url());
m_terminalWidget->setFocus();
const KFileItemList items = dirLister->items();
foreach (const KFileItem& item, items) {
bool addItem = false;
- if ((m_regExp == 0) || item.name().contains(*m_regExp)) {
+ if (!m_regExp || item.name().contains(*m_regExp)) {
addItem = true;
} else if (m_checkContent && item.mimetype().startsWith(QLatin1String("text/"))) {
addItem = contentContainsPattern(item.url());
bool FileNameSearchProtocol::contentContainsPattern(const KUrl& fileName) const
{
- Q_ASSERT(m_regExp != 0);
+ Q_ASSERT(m_regExp);
QString path;
KTemporaryFile tempFile;
KUrl url(m_dir);
url.addPath(name);
- Q_ASSERT(m_viewProps != 0);
+ Q_ASSERT(m_viewProps);
ViewProperties props(url);
props.setDirProperties(*m_viewProps);
m_applyToAllFolders(0),
m_useAsDefault(0)
{
- Q_ASSERT(dolphinView != 0);
+ Q_ASSERT(dolphinView);
const bool useGlobalViewProps = DolphinSettings::instance().generalSettings()->globalViewProps();
setCaption(i18nc("@title:window", "View Properties"));
return;
}
- const bool applyToSubFolders = (m_applyToSubFolders != 0) &&
- m_applyToSubFolders->isChecked();
+ const bool applyToSubFolders = m_applyToSubFolders && m_applyToSubFolders->isChecked();
if (applyToSubFolders) {
const QString text(i18nc("@info", "The view properties of all sub-folders will be changed. Do you want to continue?"));
if (KMessageBox::questionYesNo(this, text) == KMessageBox::No) {
info->show();
}
- const bool applyToAllFolders = (m_applyToAllFolders != 0) &&
- m_applyToAllFolders->isChecked();
+ const bool applyToAllFolders = m_applyToAllFolders && m_applyToAllFolders->isChecked();
// If the user selected 'Apply To All Folders' the view properties implicitely
// are also used as default for new folders.
- const bool useAsDefault = applyToAllFolders ||
- ((m_useAsDefault != 0) && m_useAsDefault->isChecked());
+ const bool useAsDefault = applyToAllFolders || (m_useAsDefault && m_useAsDefault->isChecked());
if (useAsDefault) {
// For directories where no .directory file is available, the .directory
// file stored for the global view properties is used as fallback. To update
void ViewPropsProgressInfo::updateProgress()
{
- if (m_dirSizeJob != 0) {
+ if (m_dirSizeJob) {
const int subdirs = m_dirSizeJob->totalSubdirs();
m_label->setText(i18nc("@info:progress", "Counting folders: %1", subdirs));
}
- if (m_applyViewPropsJob != 0) {
+ if (m_applyViewPropsJob) {
const int progress = m_applyViewPropsJob->progress();
m_progressBar->setValue(progress);
}
void ViewPropsProgressInfo::cancelApplying()
{
- if (m_dirSizeJob != 0) {
+ if (m_dirSizeJob) {
m_dirSizeJob->kill();
m_dirSizeJob = 0;
}
- if (m_applyViewPropsJob != 0) {
+ if (m_applyViewPropsJob) {
m_applyViewPropsJob->kill();
m_applyViewPropsJob = 0;
}
QCOMPARE(m_view->selectedItemsCount(), itemsCount);
QCOMPARE(spySelectionChanged.count(), 1);
QCOMPARE(qvariant_cast<KFileItemList>(spySelectionChanged.at(0).at(0)).count(), itemsCount);
- if (itemsCount != 0) {
+ if (itemsCount) {
QVERIFY(m_view->hasSelection());
}
else {
m_resizeWidget->installEventFilter(this);
const ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
- Q_ASSERT(settings != 0);
+ Q_ASSERT(settings);
if (settings->useSystemFont()) {
m_font = KGlobalSettings::generalFont();
// 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::updateFont()
{
const ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
- Q_ASSERT(settings != 0);
+ Q_ASSERT(settings);
if (settings->useSystemFont()) {
m_font = KGlobalSettings::generalFont();
m_activeUrlTimer(0),
m_assureVisibleActiveColumnTimer(0)
{
- Q_ASSERT(dolphinViewController != 0);
- Q_ASSERT(viewModeController != 0);
+ Q_ASSERT(dolphinViewController);
+ Q_ASSERT(viewModeController);
setAcceptDrops(true);
setFocusPolicy(Qt::NoFocus);
void DolphinColumnViewContainer::deleteColumn(DolphinColumnView* column)
{
- if (column == 0) {
+ if (!column) {
return;
}
// during drag operations" is used). Deleting the view
// during an ongoing drag operation is not allowed, so
// this will postponed.
- if (m_dragSource != 0) {
+ if (m_dragSource) {
// the old stored view is obviously not the drag source anymore
m_dragSource->deleteLater();
m_dragSource = 0;
m_decorationSize()
{
const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
- Q_ASSERT(settings != 0);
- Q_ASSERT(dolphinViewController != 0);
- Q_ASSERT(viewModeController != 0);
+ Q_ASSERT(settings);
+ Q_ASSERT(dolphinViewController);
+ Q_ASSERT(viewModeController);
setLayoutDirection(Qt::LeftToRight);
setAcceptDrops(true);
popup.addSeparator();
QAction* activatedAction = popup.exec(header()->mapToGlobal(pos));
- if (activatedAction != 0) {
+ if (activatedAction) {
const bool show = activatedAction->isChecked();
const int columnIndex = activatedAction->data().toInt();
Q_UNUSED(category);
const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
- Q_ASSERT(settings != 0);
+ Q_ASSERT(settings);
if (settings->useSystemFont()) {
m_font = KGlobalSettings::generalFont();
}
m_dolphinModel(0),
m_proxyModel(0)
{
- Q_ASSERT(parent != 0);
+ Q_ASSERT(parent);
m_proxyModel = qobject_cast<const DolphinSortFilterProxyModel*>(parent->model());
- Q_ASSERT(m_proxyModel != 0);
+ Q_ASSERT(m_proxyModel);
m_dolphinModel = qobject_cast<const DolphinModel*>(m_proxyModel->sourceModel());
- Q_ASSERT(m_dolphinModel != 0);
+ Q_ASSERT(m_dolphinModel);
m_dirLister = m_dolphinModel->dirLister();
- Q_ASSERT(m_dirLister != 0);
+ Q_ASSERT(m_dirLister);
// The URLs must be sorted. E.g. /home/user/ cannot be expanded before /home/
// because it is not known to the dir model before.
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();
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);
}
}
void DolphinRemoteEncoding::slotItemSelected(QAction* action)
{
- if (action != 0) {
+ if (action) {
int id = action->data().toInt();
KConfig config(("kio_" + m_currentURL.protocol() + "rc").toLatin1());
// Remove the exact name match...
domains << m_currentURL.host();
- while (partList.count()) {
+ while (!partList.isEmpty()) {
if (partList.count() == 2) {
if (partList[0].length() <= 2 && partList[1].length() == 2) {
break;
{
KFileItemList itemList;
const QAbstractItemView* view = m_viewAccessor.itemView();
- if (view == 0) {
+ if (!view) {
return itemList;
}
int DolphinView::selectedItemsCount() const
{
const QAbstractItemView* view = m_viewAccessor.itemView();
- if (view == 0) {
+ if (!view) {
return 0;
}
foreach (const KFileItemDelegate::Information& info, infoKeys) {
const QString name = infoAccessor.actionCollectionName(info, AdditionalInfoAccessor::AdditionalInfoType);
QAction* action = collection->action(name);
- Q_ASSERT(action != 0);
+ Q_ASSERT(action);
action->setEnabled(enable);
action->setChecked(checkedInfo.contains(info));
}
QSet<KUrl> urlsToExpand;
stream >> urlsToExpand;
const DolphinDetailsViewExpander* expander = m_viewAccessor.setExpandedUrls(urlsToExpand);
- if (expander != 0) {
+ if (expander) {
m_expanderActive = true;
connect (expander, SIGNAL(completed()), this, SLOT(slotLoadingCompleted()));
}
KFileItem currentItem;
const QAbstractItemView* view = m_viewAccessor.itemView();
- if (view != 0) {
+ if (view) {
const QModelIndex proxyIndex = view->currentIndex();
const QModelIndex dirModelIndex = m_viewAccessor.proxyModel()->mapToSource(proxyIndex);
currentItem = m_viewAccessor.dirModel()->itemForIndex(dirModelIndex);
bool DolphinView::hasSelection() const
{
const QAbstractItemView* view = m_viewAccessor.itemView();
- return (view != 0) && view->selectionModel()->hasSelection();
+ return view && view->selectionModel()->hasSelection();
}
void DolphinView::observeCreatedItem(const KUrl& url)
m_restoredContentsPosition = QPoint();
QAbstractItemView* view = m_viewAccessor.itemView();
- Q_ASSERT(view != 0);
+ Q_ASSERT(view);
view->horizontalScrollBar()->setValue(x);
view->verticalScrollBar()->setValue(y);
}
updateZoomLevel(oldZoomLevel);
}
- if (m_viewAccessor.itemView() == 0) {
+ if (!m_viewAccessor.itemView()) {
createView();
}
- Q_ASSERT(m_viewAccessor.itemView() != 0);
- Q_ASSERT(m_viewAccessor.itemDelegate() != 0);
+ Q_ASSERT(m_viewAccessor.itemView());
+ Q_ASSERT(m_viewAccessor.itemDelegate());
const bool showHiddenFiles = props.showHiddenFiles();
if (showHiddenFiles != m_viewAccessor.dirLister()->showingDotFiles()) {
{
deleteView();
- Q_ASSERT(m_viewAccessor.itemView() == 0);
- Q_ASSERT(m_dolphinViewController->itemView() == 0);
+ Q_ASSERT(!m_viewAccessor.itemView());
+ Q_ASSERT(!m_dolphinViewController->itemView());
m_viewAccessor.createView(this, m_dolphinViewController, m_viewModeController, m_mode);
QAbstractItemView* view = m_viewAccessor.itemView();
- Q_ASSERT(view != 0);
+ Q_ASSERT(view);
view->installEventFilter(this);
view->viewport()->installEventFilter(this);
void DolphinView::deleteView()
{
QAbstractItemView* view = m_viewAccessor.itemView();
- Q_ASSERT((m_dolphinViewController->itemView() == 0) || (m_dolphinViewController->itemView() == view));
+ Q_ASSERT(!m_dolphinViewController->itemView() || (m_dolphinViewController->itemView() == view));
m_dolphinViewController->setItemView(0);
- if (view != 0) {
+ if (view) {
disconnectViewAccessor();
if (hasFocus()) {
QMimeData* DolphinView::selectionMimeData() const
{
const QAbstractItemView* view = m_viewAccessor.itemView();
- Q_ASSERT((view != 0) && (view->selectionModel() != 0));
+ Q_ASSERT((view) && (view->selectionModel()));
const QItemSelection selection = m_viewAccessor.proxyModel()->mapSelectionToSource(view->selectionModel()->selection());
return m_viewAccessor.dirModel()->mimeData(selection.indexes());
}
const ViewModeController* viewModeController,
Mode mode)
{
- Q_ASSERT(itemView() == 0);
+ Q_ASSERT(!itemView());
switch (mode) {
case IconsView:
void DolphinView::ViewAccessor::deleteView()
{
- if (m_columnsContainer != 0) {
+ if (m_columnsContainer) {
m_columnsContainer->close();
m_columnsContainer->disconnect();
m_columnsContainer->deleteLater();
m_columnsContainer = 0;
} else {
QAbstractItemView* view = itemView();
- if (view != 0) {
+ if (view) {
view->close();
view->disconnect();
// during drag operations" is used). Deleting the view
// during an ongoing drag operation is not allowed, so
// this will postponed.
- if (m_dragSource != 0) {
+ if (m_dragSource) {
// the old stored view is obviously not the drag source anymore
m_dragSource->deleteLater();
m_dragSource = 0;
void DolphinView::ViewAccessor::prepareUrlChange(const KUrl& url)
{
- if (m_columnsContainer != 0) {
+ if (m_columnsContainer) {
m_columnsContainer->showColumn(url);
}
}
QAbstractItemView* DolphinView::ViewAccessor::itemView() const
{
- if (m_iconsView != 0) {
+ if (m_iconsView) {
return m_iconsView;
}
- if (m_detailsView != 0) {
+ if (m_detailsView) {
return m_detailsView;
}
- if (m_columnsContainer != 0) {
+ if (m_columnsContainer) {
return m_columnsContainer->activeColumn();
}
QWidget* DolphinView::ViewAccessor::layoutTarget() const
{
- if (m_columnsContainer != 0) {
+ if (m_columnsContainer) {
return m_columnsContainer;
}
return itemView();
KUrl DolphinView::ViewAccessor::rootUrl() const
{
- return (m_columnsContainer != 0) ? m_columnsContainer->rootUrl() : m_rootUrl;
+ return m_columnsContainer ? m_columnsContainer->rootUrl() : m_rootUrl;
}
bool DolphinView::ViewAccessor::supportsCategorizedSorting() const
bool DolphinView::ViewAccessor::itemsExpandable() const
{
- return (m_detailsView != 0) && m_detailsView->itemsExpandable();
+ return m_detailsView && m_detailsView->itemsExpandable();
}
QSet<KUrl> DolphinView::ViewAccessor::expandedUrls() const
{
- if (m_detailsView != 0) {
+ if (m_detailsView) {
return m_detailsView->expandedUrls();
}
const DolphinDetailsViewExpander* DolphinView::ViewAccessor::setExpandedUrls(const QSet<KUrl>& urlsToExpand)
{
- if ((m_detailsView != 0) && m_detailsView->itemsExpandable() && !urlsToExpand.isEmpty()) {
+ if (m_detailsView && m_detailsView->itemsExpandable() && !urlsToExpand.isEmpty()) {
// Check if another expander is already active and stop it if necessary.
if(!m_detailsViewExpander.isNull()) {
m_detailsViewExpander->stop();
DolphinSortFilterProxyModel* DolphinView::ViewAccessor::proxyModel() const
{
- if (m_columnsContainer != 0) {
+ if (m_columnsContainer) {
return static_cast<DolphinSortFilterProxyModel*>(m_columnsContainer->activeColumn()->model());
}
return m_proxyModel;
void DolphinViewActionHandler::updateViewActions()
{
QAction* viewModeAction = m_actionCollection->action(currentViewModeActionName());
- if (viewModeAction != 0) {
+ if (viewModeAction) {
viewModeAction->setChecked(true);
QAction* viewModeMenu = m_actionCollection->action("view_mode");
}
}
- if (action != 0) {
+ if (action) {
action->setChecked(true);
QAction* sortByMenu = m_actionCollection->action("sort");
void DolphinViewActionHandler::slotZoomLevelChanged(int level)
{
QAction* zoomInAction = m_actionCollection->action(KStandardAction::name(KStandardAction::ZoomIn));
- if (zoomInAction != 0) {
+ if (zoomInAction) {
zoomInAction->setEnabled(level < ZoomLevelInfo::maximumLevel());
}
QAction* zoomOutAction = m_actionCollection->action(KStandardAction::name(KStandardAction::ZoomOut));
- if (zoomOutAction != 0) {
+ if (zoomOutAction) {
zoomOutAction->setEnabled(level > ZoomLevelInfo::minimumLevel());
}
}
}
QScrollBar* verticalScrollBar = m_itemView->verticalScrollBar();
- if (verticalScrollBar != 0) {
+ if (verticalScrollBar) {
const int value = verticalScrollBar->value();
verticalScrollBar->setValue(value + m_verticalScrollInc);
}
QScrollBar* horizontalScrollBar = m_itemView->horizontalScrollBar();
- if (horizontalScrollBar != 0) {
+ if (horizontalScrollBar) {
const int value = horizontalScrollBar->value();
horizontalScrollBar->setValue(value + m_horizontalScrollInc);
void DolphinViewAutoScroller::triggerAutoScroll()
{
- const bool verticalScrolling = (m_itemView->verticalScrollBar() != 0) &&
+ const bool verticalScrolling = m_itemView->verticalScrollBar() &&
m_itemView->verticalScrollBar()->isVisible();
- const bool horizontalScrolling = (m_itemView->horizontalScrollBar() != 0) &&
+ const bool horizontalScrolling = m_itemView->horizontalScrollBar() &&
m_itemView->horizontalScrollBar()->isVisible();
if (!verticalScrolling && !horizontalScrolling) {
// no scrollbars are shown at all, so no autoscrolling is necessary
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());
}
const QModelIndexList indexes = itemView->selectionModel()->selectedIndexes();
if (!indexes.isEmpty()) {
QMimeData *data = itemView->model()->mimeData(indexes);
- if (data == 0) {
+ if (!data) {
return;
}
- if (dolphinViewController != 0) {
+ if (dolphinViewController) {
dolphinViewController->requestToolTipHiding();
}
bool DragAndDropHelper::isDragSource(QAbstractItemView* itemView) const
{
- return (m_dragSource != 0) && (m_dragSource == itemView);
+ return m_dragSource && (m_dragSource == itemView);
}
void DragAndDropHelper::dropUrls(const KFileItem& destItem,
m_autoExpandTriggerTimer(0),
m_autoExpandPos()
{
- if (m_view == 0) {
- return;
- }
- if (m_proxyModel == 0) {
+ if (!m_view || !m_proxyModel) {
return;
}
KDirModel *m_dirModel = qobject_cast<KDirModel*>(m_proxyModel->sourceModel());
- if (m_dirModel == 0) {
+ if (!m_dirModel) {
return;
}
QModelIndex proxyIndexToExpand = m_view->indexAt(m_autoExpandPos);
QModelIndex indexToExpand = m_proxyModel->mapToSource(proxyIndexToExpand);
KDirModel* m_dirModel = qobject_cast< KDirModel* >(m_proxyModel->sourceModel());
- Q_ASSERT(m_dirModel != 0);
+ Q_ASSERT(m_dirModel);
KFileItem itemToExpand = m_dirModel->itemForIndex(indexToExpand);
if (itemToExpand.isNull() || itemToExpand == m_dirModel->itemForIndex(QModelIndex())) {
if (itemToExpand.isDir()) {
QTreeView* treeView = qobject_cast<QTreeView*>(m_view);
- if ((treeView != 0) && treeView->itemsExpandable()) {
+ if (treeView && treeView->itemsExpandable()) {
// Toggle expanded state of this directory.
treeView->setExpanded(proxyIndexToExpand, !treeView->isExpanded(proxyIndexToExpand));
}
if (watched == m_view->viewport()) {
switch (event->type()) {
case QEvent::Leave:
- if (m_toggle != 0) {
+ if (m_toggle) {
m_toggle->hide();
}
restoreCursor();
// Set the toggle invisible, if a mouse button has been pressed
// outside the toggle boundaries. This e.g. assures, that the toggle
// gets invisible during dragging items.
- if (m_toggle != 0) {
+ if (m_toggle) {
const QRect toggleBounds(m_toggle->mapToGlobal(QPoint(0, 0)), m_toggle->size());
m_toggle->setVisible(toggleBounds.contains(QCursor::pos()));
}
void SelectionManager::reset()
{
- if (m_toggle != 0) {
+ if (m_toggle) {
m_toggle->reset();
}
}
m_connected = false;
}
- if (m_toggle == 0) {
+ if (!m_toggle) {
return;
}
void SelectionManager::slotViewportEntered()
{
- if (m_toggle != 0) {
+ if (m_toggle) {
m_toggle->hide();
}
restoreCursor();
{
emit selectionChanged();
- if ((m_toggle != 0) && !m_toggle->url().isEmpty()) {
+ if (m_toggle && !m_toggle->url().isEmpty()) {
const QModelIndex index = indexForUrl(m_toggle->url());
if (index.isValid()) {
QItemSelectionModel* selModel = m_view->selectionModel();
Q_UNUSED(parent);
Q_UNUSED(start);
Q_UNUSED(end);
- if (m_toggle != 0) {
+ if (m_toggle) {
m_toggle->hide();
}
restoreCursor();
// The selection has been changed outside the scope of the selection manager
// (e. g. by the rubberband or the "Select All" action). Take care updating
// the state of the toggle button.
- if ((m_toggle != 0) && !m_toggle->url().isEmpty()) {
+ if (m_toggle && !m_toggle->url().isEmpty()) {
const QModelIndex index = indexForUrl(m_toggle->url());
if (index.isValid()) {
if (selected.contains(index)) {
// if the mouse cursor is above the selection toggle, display
// it immediately without fading timer
m_isHovered = true;
- if (m_fadingTimeLine != 0) {
+ if (m_fadingTimeLine) {
m_fadingTimeLine->stop();
}
m_fadingValue = 255;
{
m_fadingValue = value;
if (m_fadingValue >= 255) {
- Q_ASSERT(m_fadingTimeLine != 0);
+ Q_ASSERT(m_fadingTimeLine);
m_fadingTimeLine->stop();
}
update();
void SelectionToggle::startFading()
{
- Q_ASSERT(m_fadingTimeLine == 0);
+ Q_ASSERT(!m_fadingTimeLine);
const bool animate = KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects;
const int duration = animate ? 600 : 1;
void SelectionToggle::stopFading()
{
- if (m_fadingTimeLine != 0) {
+ if (m_fadingTimeLine) {
m_fadingTimeLine->stop();
delete m_fadingTimeLine;
m_fadingTimeLine = 0;
QPixmap FileMetaDataToolTip::preview() const
{
- if (m_preview->pixmap() != 0) {
+ if (m_preview->pixmap()) {
return *m_preview->pixmap();
}
return QPixmap();
m_enabledPlugins()
{
static FileMetaDataToolTip* sharedToolTip = 0;
- if (sharedToolTip == 0) {
+ if (!sharedToolTip) {
sharedToolTip = new FileMetaDataToolTip();
// TODO: Using K_GLOBAL_STATIC would be preferable to maintain the
// instance, but the cleanup of KFileMetaDataWidget at this stage does
void PendingThreadsMaintainer::append(QThread* thread)
{
- Q_ASSERT(thread != 0);
+ Q_ASSERT(thread);
m_threads.append(thread);
m_timer->start();
}
* \code
* ThreadCreator::~ThreadCreator()
* {
- * if (m_thread != 0) {
+ * if (m_thread) {
* PendingThreadsMaintainer::instance().append(m_thread);
* m_thread = 0;
* }
void UpdateItemStatesThread::run()
{
Q_ASSERT(!m_itemStates.isEmpty());
- Q_ASSERT(m_plugin != 0);
+ Q_ASSERT(m_plugin);
// The items from m_itemStates may be located in different directory levels. The version
// plugin requires the root directory for KVersionControlPlugin::beginRetrieval(). Instead
m_plugin(0),
m_updateItemStatesThread(0)
{
- Q_ASSERT(view != 0);
+ Q_ASSERT(view);
QAbstractProxyModel* proxyModel = qobject_cast<QAbstractProxyModel*>(view->model());
- m_dolphinModel = (proxyModel == 0) ?
- qobject_cast<DolphinModel*>(view->model()) :
- qobject_cast<DolphinModel*>(proxyModel->sourceModel());
- if (m_dolphinModel != 0) {
+ m_dolphinModel = proxyModel ?
+ qobject_cast<DolphinModel*>(proxyModel->sourceModel()) :
+ qobject_cast<DolphinModel*>(view->model());
+
+ if (m_dolphinModel) {
m_dirLister = m_dolphinModel->dirLister();
connect(m_dirLister, SIGNAL(completed()),
this, SLOT(delayedDirectoryVerification()));
VersionControlObserver::~VersionControlObserver()
{
- if (m_updateItemStatesThread != 0) {
+ if (m_updateItemStatesThread) {
if (m_updateItemStatesThread->isFinished()) {
delete m_updateItemStatesThread;
m_updateItemStatesThread = 0;
}
}
- if (m_plugin != 0) {
+ if (m_plugin) {
m_plugin->disconnect();
m_plugin = 0;
}
return;
}
- if (m_plugin != 0) {
+ if (m_plugin) {
m_plugin->disconnect();
}
m_plugin = searchPlugin(versionControlUrl);
- if (m_plugin != 0) {
+ if (m_plugin) {
connect(m_plugin, SIGNAL(versionStatesChanged()),
this, SLOT(silentDirectoryVerification()));
connect(m_plugin, SIGNAL(infoMessage(QString)),
void VersionControlObserver::slotThreadFinished()
{
- if (m_plugin == 0) {
+ if (!m_plugin) {
return;
}
void VersionControlObserver::updateItemStates()
{
- Q_ASSERT(m_plugin != 0);
- if (m_updateItemStatesThread == 0) {
+ Q_ASSERT(m_plugin);
+ if (!m_updateItemStatesThread) {
m_updateItemStatesThread = new UpdateItemStatesThread();
connect(m_updateItemStatesThread, SIGNAL(finished()),
this, SLOT(slotThreadFinished()));
for (KService::List::ConstIterator it = pluginServices.constBegin(); it != pluginServices.constEnd(); ++it) {
if (enabledPlugins.contains((*it)->name())) {
KVersionControlPlugin* plugin = (*it)->createInstance<KVersionControlPlugin>();
- if (plugin != 0) {
+ if (plugin) {
plugins.append(plugin);
}
}
bool VersionControlObserver::isVersioned() const
{
- return m_dolphinModel->hasVersionData() && (m_plugin != 0);
+ return m_dolphinModel->hasVersionData() && m_plugin;
}
#include "versioncontrolobserver.moc"
bool ViewExtensionsFactory::eventFilter(QObject* watched, QEvent* event)
{
Q_UNUSED(watched);
- if ((event->type() == QEvent::Wheel) && (m_selectionManager != 0)) {
+ if ((event->type() == QEvent::Wheel) && m_selectionManager) {
m_selectionManager->reset();
}
return false;
void ViewExtensionsFactory::slotZoomLevelChanged()
{
m_previewGenerator->updateIcons();
- if (m_selectionManager != 0) {
+ if (m_selectionManager) {
m_selectionManager->reset();
}
}