]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Replace kDebug/kWarning by categorized logging (org.kde.dolphin)
authorEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Tue, 24 Feb 2015 12:07:35 +0000 (13:07 +0100)
committerEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Tue, 24 Feb 2015 12:07:35 +0000 (13:07 +0100)
20 files changed:
src/CMakeLists.txt
src/dolphindebug.cpp [new file with mode: 0644]
src/dolphindebug.h [new file with mode: 0644]
src/dolphinpart.cpp
src/kitemviews/kfileitemmodel.cpp
src/kitemviews/kitemlistview.cpp
src/kitemviews/private/kitemlistviewlayouter.cpp
src/main.cpp
src/panels/folders/folderspanel.cpp
src/panels/places/placesitem.cpp
src/panels/places/placesitemeditdialog.cpp
src/panels/places/placesitemmodel.cpp
src/panels/places/placespanel.cpp
src/settings/serviceitemdelegate.cpp
src/tests/kstandarditemmodeltest.cpp
src/views/dolphinfileitemlistwidget.cpp
src/views/dolphinremoteencoding.cpp
src/views/dolphinviewactionhandler.cpp
src/views/versioncontrol/versioncontrolobserver.cpp
src/views/viewproperties.cpp

index 17ac9cd21d090bd4aec79c35df0e22f3631598f4..4637e09d06fdcb5f8c2c977dbe6b0a46e16967e4 100644 (file)
@@ -72,6 +72,7 @@ set(dolphinprivate_LIB_SRCS
     views/zoomlevelinfo.cpp
     dolphinremoveaction.cpp
     dolphinnewfilemenu.cpp
+    dolphindebug.cpp
 )
 
 if(HAVE_BALOO)
diff --git a/src/dolphindebug.cpp b/src/dolphindebug.cpp
new file mode 100644 (file)
index 0000000..17f1084
--- /dev/null
@@ -0,0 +1,22 @@
+/***************************************************************************
+ * Copyright (C) 2015 by Emmanuel Pescosta <emmanuelpescosta099@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  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
+ ***************************************************************************/
+
+#include "dolphindebug.h"
+
+Q_LOGGING_CATEGORY(DolphinDebug, "org.kde.dolphin")
diff --git a/src/dolphindebug.h b/src/dolphindebug.h
new file mode 100644 (file)
index 0000000..9b4554b
--- /dev/null
@@ -0,0 +1,27 @@
+/***************************************************************************
+ * Copyright (C) 2015 by Emmanuel Pescosta <emmanuelpescosta099@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  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
+ ***************************************************************************/
+
+#ifndef DOLPHIN_DEBUG_H
+#define DOLPHIN_DEBUG_H
+
+#include <QLoggingCategory>
+
+Q_DECLARE_LOGGING_CATEGORY(DolphinDebug)
+
+#endif // DOLPHIN_DEBUG_H
index cd1ac52b8438102a2c3bbc9cac967c11579be62f..3473218e56f45ff59b12f0f8c6edad8a1fbbc111 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <KAboutData>
 #include <KActionCollection>
-#include <KDebug>
+#include "dolphindebug.h"
 #include <KIconLoader>
 #include <KLocalizedString>
 #include <KMessageBox>
@@ -138,7 +138,7 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL
         connect(lister, &KDirLister::newItems, notifyExt, &DolphinPartListingNotificationExtension::slotNewItems);
         connect(lister, &KDirLister::itemsDeleted, notifyExt, &DolphinPartListingNotificationExtension::slotItemsDeleted);
     } else {
-        kWarning() << "NULL KDirLister object! KParts::ListingNotificationExtension will NOT be supported";
+        qCWarning(DolphinDebug) << "NULL KDirLister object! KParts::ListingNotificationExtension will NOT be supported";
     }
 
     createActions();
@@ -340,7 +340,7 @@ void DolphinPart::slotMessage(const QString& msg)
 
 void DolphinPart::slotErrorMessage(const QString& msg)
 {
-    kDebug() << msg;
+    qCDebug(DolphinDebug) << msg;
     emit canceled(msg);
     //KMessageBox::error(m_view, msg);
 }
@@ -471,7 +471,7 @@ void DolphinPart::slotOpenContextMenu(const QPoint& pos,
 
 void DolphinPart::slotDirectoryRedirection(const QUrl &oldUrl, const QUrl &newUrl)
 {
-    //kDebug() << oldUrl << newUrl << "currentUrl=" << url();
+    //qCDebug(DolphinDebug) << oldUrl << newUrl << "currentUrl=" << url();
     if (oldUrl.matches(url(), QUrl::StripTrailingSlash /* #207572 */)) {
         KParts::ReadOnlyPart::setUrl(newUrl);
         const QString prettyUrl = newUrl.toDisplayString(QUrl::PreferLocalFile);
index 222a940a97dcfe1fa126acdf4947a4875220033f..eac3ddf8b5c39d4769ab3dac500f2d00a05ca33f 100644 (file)
@@ -24,7 +24,7 @@
 #include "dolphin_generalsettings.h"
 
 #include <KLocalizedString>
-#include <KDebug>
+#include "dolphindebug.h"
 
 #include "private/kfileitemmodelsortalgorithm.h"
 #include "private/kfileitemmodeldirlister.h"
@@ -339,7 +339,7 @@ QList<QPair<int, QVariant> > KFileItemModel::groups() const
         }
 
 #ifdef KFILEITEMMODEL_DEBUG
-        kDebug() << "[TIME] Calculating groups for" << count() << "items:" << timer.elapsed();
+        qCDebug(DolphinDebug) << "[TIME] Calculating groups for" << count() << "items:" << timer.elapsed();
 #endif
     }
 
@@ -408,9 +408,9 @@ int KFileItemModel::index(const QUrl& url) const
         if (m_items.count() != m_itemData.count() && printDebugInfo) {
             printDebugInfo = false;
 
-            kWarning() << "The model is in an inconsistent state.";
-            kWarning() << "m_items.count()    ==" << m_items.count();
-            kWarning() << "m_itemData.count() ==" << m_itemData.count();
+            qCWarning(DolphinDebug) << "The model is in an inconsistent state.";
+            qCWarning(DolphinDebug) << "m_items.count()    ==" << m_items.count();
+            qCWarning(DolphinDebug) << "m_itemData.count() ==" << m_itemData.count();
 
             // Check if there are multiple items with the same URL.
             QMultiHash<QUrl, int> indexesForUrl;
@@ -420,12 +420,12 @@ int KFileItemModel::index(const QUrl& url) const
 
             foreach (const QUrl& url, indexesForUrl.uniqueKeys()) {
                 if (indexesForUrl.count(url) > 1) {
-                    kWarning() << "Multiple items found with the URL" << url;
+                    qCWarning(DolphinDebug) << "Multiple items found with the URL" << url;
                     foreach (int index, indexesForUrl.values(url)) {
                         const ItemData* data = m_itemData.at(index);
-                        kWarning() << "index" << index << ":" << data->item;
+                        qCWarning(DolphinDebug) << "index" << index << ":" << data->item;
                         if (data->parent) {
-                            kWarning() << "parent" << data->parent->item;
+                            qCWarning(DolphinDebug) << "parent" << data->parent->item;
                         }
                     }
                 }
@@ -795,8 +795,8 @@ void KFileItemModel::resortAllItems()
 #ifdef KFILEITEMMODEL_DEBUG
     QElapsedTimer timer;
     timer.start();
-    kDebug() << "===========================================================";
-    kDebug() << "Resorting" << itemCount << "items";
+    qCDebug(DolphinDebug) << "===========================================================";
+    qCDebug(DolphinDebug) << "Resorting" << itemCount << "items";
 #endif
 
     // Remember the order of the current URLs so
@@ -858,7 +858,7 @@ void KFileItemModel::resortAllItems()
     }
 
 #ifdef KFILEITEMMODEL_DEBUG
-    kDebug() << "[TIME] Resorting of" << itemCount << "items:" << timer.elapsed();
+    qCDebug(DolphinDebug) << "[TIME] Resorting of" << itemCount << "items:" << timer.elapsed();
 #endif
 }
 
@@ -1013,7 +1013,7 @@ void KFileItemModel::slotRefreshItems(const QList<QPair<KFileItem, KFileItem> >&
 {
     Q_ASSERT(!items.isEmpty());
 #ifdef KFILEITEMMODEL_DEBUG
-    kDebug() << "Refreshing" << items.count() << "items";
+    qCDebug(DolphinDebug) << "Refreshing" << items.count() << "items";
 #endif
 
     // Get the indexes of all items that have been refreshed
@@ -1079,7 +1079,7 @@ void KFileItemModel::slotRefreshItems(const QList<QPair<KFileItem, KFileItem> >&
 void KFileItemModel::slotClear()
 {
 #ifdef KFILEITEMMODEL_DEBUG
-    kDebug() << "Clearing all items";
+    qCDebug(DolphinDebug) << "Clearing all items";
 #endif
 
     qDeleteAll(m_filteredItems.values());
@@ -1126,8 +1126,8 @@ void KFileItemModel::insertItems(QList<ItemData*>& newItems)
 #ifdef KFILEITEMMODEL_DEBUG
     QElapsedTimer timer;
     timer.start();
-    kDebug() << "===========================================================";
-    kDebug() << "Inserting" << newItems.count() << "items";
+    qCDebug(DolphinDebug) << "===========================================================";
+    qCDebug(DolphinDebug) << "Inserting" << newItems.count() << "items";
 #endif
 
     m_groups.clear();
@@ -1144,7 +1144,7 @@ void KFileItemModel::insertItems(QList<ItemData*>& newItems)
     sort(newItems.begin(), newItems.end());
 
 #ifdef KFILEITEMMODEL_DEBUG
-    kDebug() << "[TIME] Sorting:" << timer.elapsed();
+    qCDebug(DolphinDebug) << "[TIME] Sorting:" << timer.elapsed();
 #endif
 
     KItemRangeList itemRanges;
@@ -1208,7 +1208,7 @@ void KFileItemModel::insertItems(QList<ItemData*>& newItems)
     emit itemsInserted(itemRanges);
 
 #ifdef KFILEITEMMODEL_DEBUG
-    kDebug() << "[TIME] Inserting of" << newItems.count() << "items:" << timer.elapsed();
+    qCDebug(DolphinDebug) << "[TIME] Inserting of" << newItems.count() << "items:" << timer.elapsed();
 #endif
 }
 
@@ -2213,19 +2213,19 @@ bool KFileItemModel::isConsistent() const
         // Check if m_items and m_itemData are consistent.
         const KFileItem item = fileItem(i);
         if (item.isNull()) {
-            qWarning() << "Item" << i << "is null";
+            qCWarning(DolphinDebug) << "Item" << i << "is null";
             return false;
         }
 
         const int itemIndex = index(item);
         if (itemIndex != i) {
-            qWarning() << "Item" << i << "has a wrong index:" << itemIndex;
+            qCWarning(DolphinDebug) << "Item" << i << "has a wrong index:" << itemIndex;
             return false;
         }
 
         // Check if the items are sorted correctly.
         if (i > 0 && !lessThan(m_itemData.at(i - 1), m_itemData.at(i), m_collator)) {
-            qWarning() << "The order of items" << i - 1 << "and" << i << "is wrong:"
+            qCWarning(DolphinDebug) << "The order of items" << i - 1 << "and" << i << "is wrong:"
                 << fileItem(i - 1) << fileItem(i);
             return false;
         }
@@ -2235,13 +2235,13 @@ bool KFileItemModel::isConsistent() const
         const ItemData* parent = data->parent;
         if (parent) {
             if (expandedParentsCount(data) != expandedParentsCount(parent) + 1) {
-                qWarning() << "expandedParentsCount is inconsistent for parent" << parent->item << "and child" << data->item;
+                qCWarning(DolphinDebug) << "expandedParentsCount is inconsistent for parent" << parent->item << "and child" << data->item;
                 return false;
             }
 
             const int parentIndex = index(parent->item);
             if (parentIndex >= i) {
-                qWarning() << "Index" << parentIndex << "of parent" << parent->item << "is not smaller than index" << i << "of child" << data->item;
+                qCWarning(DolphinDebug) << "Index" << parentIndex << "of parent" << parent->item << "is not smaller than index" << i << "of child" << data->item;
                 return false;
             }
         }
index 0d0304afcb5accd3221881986ffe360280147342..9416f0dd715e84a3fcd776ac8bf210858ccec803 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "kitemlistview.h"
 
-#include <QDebug>
+#include "dolphindebug.h"
 #include "kitemlistcontainer.h"
 #include "kitemlistcontroller.h"
 #include "kitemlistheader.h"
@@ -543,7 +543,7 @@ void KItemListView::endTransaction()
     --m_activeTransactions;
     if (m_activeTransactions < 0) {
         m_activeTransactions = 0;
-        qWarning() << "Mismatch between beginTransaction()/endTransaction()";
+        qCWarning(DolphinDebug) << "Mismatch between beginTransaction()/endTransaction()";
     }
 
     if (m_activeTransactions == 0) {
@@ -1006,7 +1006,7 @@ void KItemListView::slotItemsInserted(const KItemRangeList& itemRanges)
         const int index = range.index + previouslyInsertedCount;
         const int count = range.count;
         if (index < 0 || count <= 0) {
-            qWarning() << "Invalid item range (index:" << index << ", count:" << count << ")";
+            qCWarning(DolphinDebug) << "Invalid item range (index:" << index << ", count:" << count << ")";
             continue;
         }
         previouslyInsertedCount += count;
@@ -1114,7 +1114,7 @@ void KItemListView::slotItemsRemoved(const KItemRangeList& itemRanges)
         const int index = range.index;
         const int count = range.count;
         if (index < 0 || count <= 0) {
-            qWarning() << "Invalid item range (index:" << index << ", count:" << count << ")";
+            qCWarning(DolphinDebug) << "Invalid item range (index:" << index << ", count:" << count << ")";
             continue;
         }
 
index e2dcc62e7fde6b173caeaff2c14cdbae299758d3..d54457908543be3cef192367d0d3b69baa5df1da 100644 (file)
@@ -22,7 +22,7 @@
 #include <kitemviews/kitemmodelbase.h>
 #include "kitemlistsizehintresolver.h"
 
-#include <KDebug>
+#include "dolphindebug.h"
 
 // #define KITEMLISTVIEWLAYOUTER_DEBUG
 
@@ -516,7 +516,7 @@ void KItemListViewLayouter::doLayout()
         }
 
 #ifdef KITEMLISTVIEWLAYOUTER_DEBUG
-        kDebug() << "[TIME] doLayout() for " << m_model->count() << "items:" << timer.elapsed();
+        qCDebug(DolphinDebug) << "[TIME] doLayout() for " << m_model->count() << "items:" << timer.elapsed();
 #endif
         m_dirty = false;
     }
index 14529005fe4bdf142114cc779fb160ec32f4c351..4291d2fa3b6304e8786de253b5bc65f78eda0757 100644 (file)
@@ -28,7 +28,7 @@
 #include <QCommandLineOption>
 #include <QApplication>
 #include <KLocalizedString>
-#include <KDebug>
+#include "dolphindebug.h"
 #include <kdelibs4configmigrator.h>
 
 extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
@@ -109,7 +109,7 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
         if (url.isValid()) {
             urls.append(url);
         } else {
-            qWarning() << "Invalid URL: " << str;
+            qCWarning(DolphinDebug) << "Invalid URL: " << str;
         }
     }
 
@@ -152,7 +152,7 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
         if (className == QLatin1String("DolphinMainWindow")) {
             m_mainWindow->restore(1);
         } else {
-            kWarning() << "Unknown class " << className << " in session saved data!";
+            qCWarning(DolphinDebug) << "Unknown class " << className << " in session saved data!";
         }
     }
 
index 9169ee9e35daade24468562b96465157e153d97a..e99c673bc14490e673b733032ec307c40555110b 100644 (file)
@@ -49,7 +49,7 @@
 
 #include <views/draganddrophelper.h>
 
-#include <KDebug>
+#include "dolphindebug.h"
 
 FoldersPanel::FoldersPanel(QWidget* parent) :
     Panel(parent),
index 59c2ed7332d41628919ba8d229c423a9d2ffc356..638d59ec0413693911a597f7d659659eda610bb0 100644 (file)
@@ -23,7 +23,7 @@
 #include "placesitem.h"
 
 #include <KBookmarkManager>
-#include <KDebug>
+#include "dolphindebug.h"
 #include <KDirLister>
 #include <KLocalizedString>
 #include "placesitemsignalhandler.h"
index cd04ea3f1790acccb3d5f6914898d9ff3a387f01..d5ca4bf4fd97fd5238a8e8f25fc0a9710c1dcd76 100644 (file)
@@ -24,7 +24,7 @@
 #include "placesitemeditdialog.h"
 
 #include <KAboutData>
-#include <KDebug>
+#include "dolphindebug.h"
 #include <KFile>
 #include <KIconButton>
 #include <KLocalizedString>
index 95a913e829aa98d78804e46ebd83c3fcec8f1bc8..28244c6450c6cc256ac2f3d5d8101782aca2bbd2 100644 (file)
@@ -28,7 +28,7 @@
 #include <KBookmark>
 #include <KBookmarkGroup>
 #include <KBookmarkManager>
-#include <KDebug>
+#include "dolphindebug.h"
 #include <QIcon>
 #include <KProtocolInfo>
 #include <KLocalizedString>
@@ -191,7 +191,7 @@ void PlacesItemModel::setHiddenItemsShown(bool show)
     }
 
 #ifdef PLACESITEMMODEL_DEBUG
-        kDebug() << "Changed visibility of hidden items";
+        qCDebug(DolphinDebug) << "Changed visibility of hidden items";
         showModelState();
 #endif
 }
@@ -496,7 +496,7 @@ void PlacesItemModel::onItemInserted(int index)
     }
 
 #ifdef PLACESITEMMODEL_DEBUG
-    kDebug() << "Inserted item" << index;
+    qCDebug(DolphinDebug) << "Inserted item" << index;
     showModelState();
 #endif
 }
@@ -514,7 +514,7 @@ void PlacesItemModel::onItemRemoved(int index, KStandardItem* removedItem)
     m_bookmarkedItems.removeAt(boomarkIndex);
 
 #ifdef PLACESITEMMODEL_DEBUG
-    kDebug() << "Removed item" << index;
+    qCDebug(DolphinDebug) << "Removed item" << index;
     showModelState();
 #endif
 }
@@ -807,7 +807,7 @@ void PlacesItemModel::loadBookmarks()
     }
 
 #ifdef PLACESITEMMODEL_DEBUG
-    kDebug() << "Loaded bookmarks";
+    qCDebug(DolphinDebug) << "Loaded bookmarks";
     showModelState();
 #endif
 }
@@ -1176,25 +1176,25 @@ QUrl PlacesItemModel::searchUrlForType(const QString& type)
 #ifdef PLACESITEMMODEL_DEBUG
 void PlacesItemModel::showModelState()
 {
-    kDebug() << "=================================";
-    kDebug() << "Model:";
-    kDebug() << "hidden-index model-index   text";
+    qCDebug(DolphinDebug) << "=================================";
+    qCDebug(DolphinDebug) << "Model:";
+    qCDebug(DolphinDebug) << "hidden-index model-index   text";
     int modelIndex = 0;
     for (int i = 0; i < m_bookmarkedItems.count(); ++i) {
         if (m_bookmarkedItems[i]) {
-            kDebug() <<  i << "(Hidden)    " << "             " << m_bookmarkedItems[i]->dataValue("text").toString();
+            qCDebug(DolphinDebug) <<  i << "(Hidden)    " << "             " << m_bookmarkedItems[i]->dataValue("text").toString();
         } else {
             if (item(modelIndex)) {
-                kDebug() <<  i << "          " << modelIndex << "           " << item(modelIndex)->dataValue("text").toString();
+                qCDebug(DolphinDebug) <<  i << "          " << modelIndex << "           " << item(modelIndex)->dataValue("text").toString();
             } else {
-                kDebug() <<  i << "          " << modelIndex << "           " << "(not available yet)";
+                qCDebug(DolphinDebug) <<  i << "          " << modelIndex << "           " << "(not available yet)";
             }
             ++modelIndex;
         }
     }
 
-    kDebug();
-    kDebug() << "Bookmarks:";
+    qCDebug(DolphinDebug);
+    qCDebug(DolphinDebug) << "Bookmarks:";
 
     int bookmarkIndex = 0;
     KBookmarkGroup root = m_bookmarkManager->root();
@@ -1203,9 +1203,9 @@ void PlacesItemModel::showModelState()
         const QString udi = bookmark.metaDataItem("UDI");
         const QString text = udi.isEmpty() ? bookmark.text() : udi;
         if (bookmark.metaDataItem("IsHidden") == QLatin1String("true")) {
-            kDebug() << bookmarkIndex << "(Hidden)" << text;
+            qCDebug(DolphinDebug) << bookmarkIndex << "(Hidden)" << text;
         } else {
-            kDebug() << bookmarkIndex << "        " << text;
+            qCDebug(DolphinDebug) << bookmarkIndex << "        " << text;
         }
 
         bookmark = root.next(bookmark);
index 5618cee2162a534fb6031eb4850319d85c8fd0da..50ed7e73aacfa6483122f32f7149232ab58fb302 100644 (file)
@@ -26,7 +26,7 @@
 #include "dolphin_generalsettings.h"
 
 #include <KFileItem>
-#include <KDebug>
+#include "dolphindebug.h"
 #include <KDirNotify>
 #include <QIcon>
 #include <KIO/Job>
index 774ea78ae647e3eda2e7bed6627ffb0c0df248b5..a72dd9ec8598a7e39b0a00f1fa50091d5923265e 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "serviceitemdelegate.h"
 
-#include <KDebug>
+#include "dolphindebug.h"
 #include <QPushButton>
 #include <QIcon>
 
index e83e2031d496434185b35b873150d26b7f065710..ea65cc4ce654fe0d49bce7dcc7d387b692113476 100644 (file)
@@ -98,13 +98,13 @@ bool KStandardItemModelTest::isModelConsistent() const
     for (int i = 0; i < m_model->count(); ++i) {
         const KStandardItem* item = m_model->item(i);
         if (!item) {
-            qWarning() << "Item" << i << "is null";
+            qCWarning(DolphinDebug) << "Item" << i << "is null";
             return false;
         }
 
         const int itemIndex = m_model->index(item);
         if (itemIndex != i) {
-            qWarning() << "Item" << i << "has a wrong index:" << itemIndex;
+            qCWarning(DolphinDebug) << "Item" << i << "has a wrong index:" << itemIndex;
             return false;
         }
     }
index de927d91fcae721dfa3bd6fb3604dee36fabd3b7..e8345435eb126db62c92b6d5ff03661089e4c43f 100644 (file)
@@ -24,7 +24,7 @@
 #include <kversioncontrolplugin2.h>
 #include <QColor>
 
-#include <KDebug>
+#include "dolphindebug.h"
 
 DolphinFileItemListWidget::DolphinFileItemListWidget(KItemListWidgetInformant* informant,
                                                      QGraphicsItem* parent) :
index fbf21c08f1c03edcb7ee31cd73d43032606b7727..961a7c80085f6b392076befdee2ed3a6d1bf68b7 100644 (file)
@@ -26,7 +26,7 @@
 #include "dolphinremoteencoding.h"
 #include "dolphinviewactionhandler.h"
 
-#include <KDebug>
+#include "dolphindebug.h"
 #include <KActionMenu>
 #include <KActionCollection>
 #include <QIcon>
@@ -141,10 +141,10 @@ void DolphinRemoteEncoding::updateMenu()
             }
         }
 
-        kDebug() << "URL=" << m_currentURL << " charset=" << charset;
+        qCDebug(DolphinDebug) << "URL=" << m_currentURL << " charset=" << charset;
 
         if (!isFound) {
-            kWarning() << "could not find entry for charset=" << charset ;
+            qCWarning(DolphinDebug) << "could not find entry for charset=" << charset ;
         } else {
             m_menu->menu()->actions().at(id)->setChecked(true);
         }
@@ -211,7 +211,7 @@ void DolphinRemoteEncoding::slotDefault()
         }
 
         for (QStringList::const_iterator it = domains.constBegin(); it != domains.constEnd();++it) {
-            kDebug() << "Domain to remove: " << *it;
+            qCDebug(DolphinDebug) << "Domain to remove: " << *it;
             if (config.hasGroup(*it)) {
                 config.deleteGroup(*it);
             } else if (config.group("").hasKey(*it)) {
index 4eec88ff822a284bdd966959395f5fc737d071f5..ac538a6485972f6726423b06604f12a15839fb65 100644 (file)
@@ -39,7 +39,7 @@
 #include <KPropertiesDialog>
 #include <QIcon>
 
-#include <KDebug>
+#include "dolphindebug.h"
 
 #ifdef HAVE_BALOO
     #include <Baloo/IndexerConfig>
index 79ba8dcc4bcb68f21722bc3a60bf47b8313f6263..47e3da357a01a6329bacdb1f0fe45bad64f940e7 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <KLocalizedString>
 #include <KService>
-#include <KDebug>
+#include "dolphindebug.h"
 #include <KServiceTypeTrader>
 #include <kitemviews/kfileitemmodel.h>
 #include <kversioncontrolplugin2.h>
@@ -94,7 +94,7 @@ QList<QAction*> VersionControlObserver::actions(const KFileItemList& items) cons
     bool hasNullItems = false;
     foreach (const KFileItem& item, items) {
         if (item.isNull()) {
-            kWarning() << "Requesting version-control-actions for empty items";
+            qCWarning(DolphinDebug) << "Requesting version-control-actions for empty items";
             hasNullItems = true;
             break;
         }
index c8d92be6dfb3eb7935cb6aa772d4868e5368e56f..05c9935858aeecba142a7224ae16944de0900b92 100644 (file)
@@ -24,7 +24,7 @@
 #include "dolphin_generalsettings.h"
 
 #include <QUrl>
-#include <KDebug>
+#include "dolphindebug.h"
 
 #include <QCryptographicHash>
 #include <QDate>
@@ -359,7 +359,7 @@ void ViewProperties::update()
 
 void ViewProperties::save()
 {
-    kDebug() << "Saving view-properties to" << m_filePath;
+    qCDebug(DolphinDebug) << "Saving view-properties to" << m_filePath;
     QDir dir;
     dir.mkpath(m_filePath);
     m_node->setVersion(CurrentViewPropertiesVersion);
@@ -388,7 +388,7 @@ QString ViewProperties::viewModePrefix() const
     case DolphinView::IconsView:   prefix = "Icons_"; break;
     case DolphinView::CompactView: prefix = "Compact_"; break;
     case DolphinView::DetailsView: prefix = "Details_"; break;
-    default: kWarning() << "Unknown view-mode of the view properties";
+    default: qCWarning(DolphinDebug) << "Unknown view-mode of the view properties";
     }
 
     return prefix;