/***************************************************************************
- * Copyright (C) 2009 by Peter Penz <peter.penz@gmx.at> *
+ * Copyright (C) 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 *
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"