┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/versioncontrol
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/versioncontrol')
-rw-r--r--src/views/versioncontrol/pendingthreadsmaintainer.cpp2
-rw-r--r--src/views/versioncontrol/pendingthreadsmaintainer.h2
-rw-r--r--src/views/versioncontrol/updateitemstatesthread.cpp2
-rw-r--r--src/views/versioncontrol/versioncontrolobserver.cpp29
4 files changed, 18 insertions, 17 deletions
diff --git a/src/views/versioncontrol/pendingthreadsmaintainer.cpp b/src/views/versioncontrol/pendingthreadsmaintainer.cpp
index fc463aeb3..ee143a94a 100644
--- a/src/views/versioncontrol/pendingthreadsmaintainer.cpp
+++ b/src/views/versioncontrol/pendingthreadsmaintainer.cpp
@@ -41,7 +41,7 @@ PendingThreadsMaintainer::~PendingThreadsMaintainer()
void PendingThreadsMaintainer::append(QThread* thread)
{
- Q_ASSERT(thread != 0);
+ Q_ASSERT(thread);
m_threads.append(thread);
m_timer->start();
}
diff --git a/src/views/versioncontrol/pendingthreadsmaintainer.h b/src/views/versioncontrol/pendingthreadsmaintainer.h
index a1ad35516..3e99c8657 100644
--- a/src/views/versioncontrol/pendingthreadsmaintainer.h
+++ b/src/views/versioncontrol/pendingthreadsmaintainer.h
@@ -38,7 +38,7 @@ class QTimer;
* \code
* ThreadCreator::~ThreadCreator()
* {
- * if (m_thread != 0) {
+ * if (m_thread) {
* PendingThreadsMaintainer::instance().append(m_thread);
* m_thread = 0;
* }
diff --git a/src/views/versioncontrol/updateitemstatesthread.cpp b/src/views/versioncontrol/updateitemstatesthread.cpp
index b04d66f17..e6bd761cc 100644
--- a/src/views/versioncontrol/updateitemstatesthread.cpp
+++ b/src/views/versioncontrol/updateitemstatesthread.cpp
@@ -53,7 +53,7 @@ void UpdateItemStatesThread::setData(KVersionControlPlugin* plugin,
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
diff --git a/src/views/versioncontrol/versioncontrolobserver.cpp b/src/views/versioncontrol/versioncontrolobserver.cpp
index 26528f974..62f50f30b 100644
--- a/src/views/versioncontrol/versioncontrolobserver.cpp
+++ b/src/views/versioncontrol/versioncontrolobserver.cpp
@@ -49,13 +49,14 @@ VersionControlObserver::VersionControlObserver(QAbstractItemView* view) :
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()));
@@ -75,7 +76,7 @@ VersionControlObserver::VersionControlObserver(QAbstractItemView* view) :
VersionControlObserver::~VersionControlObserver()
{
- if (m_updateItemStatesThread != 0) {
+ if (m_updateItemStatesThread) {
if (m_updateItemStatesThread->isFinished()) {
delete m_updateItemStatesThread;
m_updateItemStatesThread = 0;
@@ -91,7 +92,7 @@ VersionControlObserver::~VersionControlObserver()
}
}
- if (m_plugin != 0) {
+ if (m_plugin) {
m_plugin->disconnect();
m_plugin = 0;
}
@@ -137,12 +138,12 @@ void VersionControlObserver::verifyDirectory()
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)),
@@ -180,7 +181,7 @@ void VersionControlObserver::verifyDirectory()
void VersionControlObserver::slotThreadFinished()
{
- if (m_plugin == 0) {
+ if (!m_plugin) {
return;
}
@@ -222,8 +223,8 @@ void VersionControlObserver::slotThreadFinished()
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()));
@@ -282,7 +283,7 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const KUrl& director
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);
}
}
@@ -330,7 +331,7 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const KUrl& director
bool VersionControlObserver::isVersioned() const
{
- return m_dolphinModel->hasVersionData() && (m_plugin != 0);
+ return m_dolphinModel->hasVersionData() && m_plugin;
}
#include "versioncontrolobserver.moc"