mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 09:50:12 +00:00
Replace kDebug/kWarning by categorized logging (org.kde.dolphin)
This commit is contained in:
parent
6d9f5b2131
commit
169cca55b9
|
@ -72,6 +72,7 @@ set(dolphinprivate_LIB_SRCS
|
||||||
views/zoomlevelinfo.cpp
|
views/zoomlevelinfo.cpp
|
||||||
dolphinremoveaction.cpp
|
dolphinremoveaction.cpp
|
||||||
dolphinnewfilemenu.cpp
|
dolphinnewfilemenu.cpp
|
||||||
|
dolphindebug.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if(HAVE_BALOO)
|
if(HAVE_BALOO)
|
||||||
|
|
22
src/dolphindebug.cpp
Normal file
22
src/dolphindebug.cpp
Normal file
|
@ -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")
|
27
src/dolphindebug.h
Normal file
27
src/dolphindebug.h
Normal file
|
@ -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
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include <KAboutData>
|
#include <KAboutData>
|
||||||
#include <KActionCollection>
|
#include <KActionCollection>
|
||||||
#include <KDebug>
|
#include "dolphindebug.h"
|
||||||
#include <KIconLoader>
|
#include <KIconLoader>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KMessageBox>
|
#include <KMessageBox>
|
||||||
|
@ -138,7 +138,7 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL
|
||||||
connect(lister, &KDirLister::newItems, notifyExt, &DolphinPartListingNotificationExtension::slotNewItems);
|
connect(lister, &KDirLister::newItems, notifyExt, &DolphinPartListingNotificationExtension::slotNewItems);
|
||||||
connect(lister, &KDirLister::itemsDeleted, notifyExt, &DolphinPartListingNotificationExtension::slotItemsDeleted);
|
connect(lister, &KDirLister::itemsDeleted, notifyExt, &DolphinPartListingNotificationExtension::slotItemsDeleted);
|
||||||
} else {
|
} else {
|
||||||
kWarning() << "NULL KDirLister object! KParts::ListingNotificationExtension will NOT be supported";
|
qCWarning(DolphinDebug) << "NULL KDirLister object! KParts::ListingNotificationExtension will NOT be supported";
|
||||||
}
|
}
|
||||||
|
|
||||||
createActions();
|
createActions();
|
||||||
|
@ -340,7 +340,7 @@ void DolphinPart::slotMessage(const QString& msg)
|
||||||
|
|
||||||
void DolphinPart::slotErrorMessage(const QString& msg)
|
void DolphinPart::slotErrorMessage(const QString& msg)
|
||||||
{
|
{
|
||||||
kDebug() << msg;
|
qCDebug(DolphinDebug) << msg;
|
||||||
emit canceled(msg);
|
emit canceled(msg);
|
||||||
//KMessageBox::error(m_view, 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)
|
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 */)) {
|
if (oldUrl.matches(url(), QUrl::StripTrailingSlash /* #207572 */)) {
|
||||||
KParts::ReadOnlyPart::setUrl(newUrl);
|
KParts::ReadOnlyPart::setUrl(newUrl);
|
||||||
const QString prettyUrl = newUrl.toDisplayString(QUrl::PreferLocalFile);
|
const QString prettyUrl = newUrl.toDisplayString(QUrl::PreferLocalFile);
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "dolphin_generalsettings.h"
|
#include "dolphin_generalsettings.h"
|
||||||
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KDebug>
|
#include "dolphindebug.h"
|
||||||
|
|
||||||
#include "private/kfileitemmodelsortalgorithm.h"
|
#include "private/kfileitemmodelsortalgorithm.h"
|
||||||
#include "private/kfileitemmodeldirlister.h"
|
#include "private/kfileitemmodeldirlister.h"
|
||||||
|
@ -339,7 +339,7 @@ QList<QPair<int, QVariant> > KFileItemModel::groups() const
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KFILEITEMMODEL_DEBUG
|
#ifdef KFILEITEMMODEL_DEBUG
|
||||||
kDebug() << "[TIME] Calculating groups for" << count() << "items:" << timer.elapsed();
|
qCDebug(DolphinDebug) << "[TIME] Calculating groups for" << count() << "items:" << timer.elapsed();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -408,9 +408,9 @@ int KFileItemModel::index(const QUrl& url) const
|
||||||
if (m_items.count() != m_itemData.count() && printDebugInfo) {
|
if (m_items.count() != m_itemData.count() && printDebugInfo) {
|
||||||
printDebugInfo = false;
|
printDebugInfo = false;
|
||||||
|
|
||||||
kWarning() << "The model is in an inconsistent state.";
|
qCWarning(DolphinDebug) << "The model is in an inconsistent state.";
|
||||||
kWarning() << "m_items.count() ==" << m_items.count();
|
qCWarning(DolphinDebug) << "m_items.count() ==" << m_items.count();
|
||||||
kWarning() << "m_itemData.count() ==" << m_itemData.count();
|
qCWarning(DolphinDebug) << "m_itemData.count() ==" << m_itemData.count();
|
||||||
|
|
||||||
// Check if there are multiple items with the same URL.
|
// Check if there are multiple items with the same URL.
|
||||||
QMultiHash<QUrl, int> indexesForUrl;
|
QMultiHash<QUrl, int> indexesForUrl;
|
||||||
|
@ -420,12 +420,12 @@ int KFileItemModel::index(const QUrl& url) const
|
||||||
|
|
||||||
foreach (const QUrl& url, indexesForUrl.uniqueKeys()) {
|
foreach (const QUrl& url, indexesForUrl.uniqueKeys()) {
|
||||||
if (indexesForUrl.count(url) > 1) {
|
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)) {
|
foreach (int index, indexesForUrl.values(url)) {
|
||||||
const ItemData* data = m_itemData.at(index);
|
const ItemData* data = m_itemData.at(index);
|
||||||
kWarning() << "index" << index << ":" << data->item;
|
qCWarning(DolphinDebug) << "index" << index << ":" << data->item;
|
||||||
if (data->parent) {
|
if (data->parent) {
|
||||||
kWarning() << "parent" << data->parent->item;
|
qCWarning(DolphinDebug) << "parent" << data->parent->item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -795,8 +795,8 @@ void KFileItemModel::resortAllItems()
|
||||||
#ifdef KFILEITEMMODEL_DEBUG
|
#ifdef KFILEITEMMODEL_DEBUG
|
||||||
QElapsedTimer timer;
|
QElapsedTimer timer;
|
||||||
timer.start();
|
timer.start();
|
||||||
kDebug() << "===========================================================";
|
qCDebug(DolphinDebug) << "===========================================================";
|
||||||
kDebug() << "Resorting" << itemCount << "items";
|
qCDebug(DolphinDebug) << "Resorting" << itemCount << "items";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Remember the order of the current URLs so
|
// Remember the order of the current URLs so
|
||||||
|
@ -858,7 +858,7 @@ void KFileItemModel::resortAllItems()
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KFILEITEMMODEL_DEBUG
|
#ifdef KFILEITEMMODEL_DEBUG
|
||||||
kDebug() << "[TIME] Resorting of" << itemCount << "items:" << timer.elapsed();
|
qCDebug(DolphinDebug) << "[TIME] Resorting of" << itemCount << "items:" << timer.elapsed();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1013,7 +1013,7 @@ void KFileItemModel::slotRefreshItems(const QList<QPair<KFileItem, KFileItem> >&
|
||||||
{
|
{
|
||||||
Q_ASSERT(!items.isEmpty());
|
Q_ASSERT(!items.isEmpty());
|
||||||
#ifdef KFILEITEMMODEL_DEBUG
|
#ifdef KFILEITEMMODEL_DEBUG
|
||||||
kDebug() << "Refreshing" << items.count() << "items";
|
qCDebug(DolphinDebug) << "Refreshing" << items.count() << "items";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Get the indexes of all items that have been refreshed
|
// 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()
|
void KFileItemModel::slotClear()
|
||||||
{
|
{
|
||||||
#ifdef KFILEITEMMODEL_DEBUG
|
#ifdef KFILEITEMMODEL_DEBUG
|
||||||
kDebug() << "Clearing all items";
|
qCDebug(DolphinDebug) << "Clearing all items";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qDeleteAll(m_filteredItems.values());
|
qDeleteAll(m_filteredItems.values());
|
||||||
|
@ -1126,8 +1126,8 @@ void KFileItemModel::insertItems(QList<ItemData*>& newItems)
|
||||||
#ifdef KFILEITEMMODEL_DEBUG
|
#ifdef KFILEITEMMODEL_DEBUG
|
||||||
QElapsedTimer timer;
|
QElapsedTimer timer;
|
||||||
timer.start();
|
timer.start();
|
||||||
kDebug() << "===========================================================";
|
qCDebug(DolphinDebug) << "===========================================================";
|
||||||
kDebug() << "Inserting" << newItems.count() << "items";
|
qCDebug(DolphinDebug) << "Inserting" << newItems.count() << "items";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_groups.clear();
|
m_groups.clear();
|
||||||
|
@ -1144,7 +1144,7 @@ void KFileItemModel::insertItems(QList<ItemData*>& newItems)
|
||||||
sort(newItems.begin(), newItems.end());
|
sort(newItems.begin(), newItems.end());
|
||||||
|
|
||||||
#ifdef KFILEITEMMODEL_DEBUG
|
#ifdef KFILEITEMMODEL_DEBUG
|
||||||
kDebug() << "[TIME] Sorting:" << timer.elapsed();
|
qCDebug(DolphinDebug) << "[TIME] Sorting:" << timer.elapsed();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
KItemRangeList itemRanges;
|
KItemRangeList itemRanges;
|
||||||
|
@ -1208,7 +1208,7 @@ void KFileItemModel::insertItems(QList<ItemData*>& newItems)
|
||||||
emit itemsInserted(itemRanges);
|
emit itemsInserted(itemRanges);
|
||||||
|
|
||||||
#ifdef KFILEITEMMODEL_DEBUG
|
#ifdef KFILEITEMMODEL_DEBUG
|
||||||
kDebug() << "[TIME] Inserting of" << newItems.count() << "items:" << timer.elapsed();
|
qCDebug(DolphinDebug) << "[TIME] Inserting of" << newItems.count() << "items:" << timer.elapsed();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2213,19 +2213,19 @@ bool KFileItemModel::isConsistent() const
|
||||||
// Check if m_items and m_itemData are consistent.
|
// Check if m_items and m_itemData are consistent.
|
||||||
const KFileItem item = fileItem(i);
|
const KFileItem item = fileItem(i);
|
||||||
if (item.isNull()) {
|
if (item.isNull()) {
|
||||||
qWarning() << "Item" << i << "is null";
|
qCWarning(DolphinDebug) << "Item" << i << "is null";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int itemIndex = index(item);
|
const int itemIndex = index(item);
|
||||||
if (itemIndex != i) {
|
if (itemIndex != i) {
|
||||||
qWarning() << "Item" << i << "has a wrong index:" << itemIndex;
|
qCWarning(DolphinDebug) << "Item" << i << "has a wrong index:" << itemIndex;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the items are sorted correctly.
|
// Check if the items are sorted correctly.
|
||||||
if (i > 0 && !lessThan(m_itemData.at(i - 1), m_itemData.at(i), m_collator)) {
|
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);
|
<< fileItem(i - 1) << fileItem(i);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2235,13 +2235,13 @@ bool KFileItemModel::isConsistent() const
|
||||||
const ItemData* parent = data->parent;
|
const ItemData* parent = data->parent;
|
||||||
if (parent) {
|
if (parent) {
|
||||||
if (expandedParentsCount(data) != expandedParentsCount(parent) + 1) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int parentIndex = index(parent->item);
|
const int parentIndex = index(parent->item);
|
||||||
if (parentIndex >= i) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "kitemlistview.h"
|
#include "kitemlistview.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include "dolphindebug.h"
|
||||||
#include "kitemlistcontainer.h"
|
#include "kitemlistcontainer.h"
|
||||||
#include "kitemlistcontroller.h"
|
#include "kitemlistcontroller.h"
|
||||||
#include "kitemlistheader.h"
|
#include "kitemlistheader.h"
|
||||||
|
@ -543,7 +543,7 @@ void KItemListView::endTransaction()
|
||||||
--m_activeTransactions;
|
--m_activeTransactions;
|
||||||
if (m_activeTransactions < 0) {
|
if (m_activeTransactions < 0) {
|
||||||
m_activeTransactions = 0;
|
m_activeTransactions = 0;
|
||||||
qWarning() << "Mismatch between beginTransaction()/endTransaction()";
|
qCWarning(DolphinDebug) << "Mismatch between beginTransaction()/endTransaction()";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_activeTransactions == 0) {
|
if (m_activeTransactions == 0) {
|
||||||
|
@ -1006,7 +1006,7 @@ void KItemListView::slotItemsInserted(const KItemRangeList& itemRanges)
|
||||||
const int index = range.index + previouslyInsertedCount;
|
const int index = range.index + previouslyInsertedCount;
|
||||||
const int count = range.count;
|
const int count = range.count;
|
||||||
if (index < 0 || count <= 0) {
|
if (index < 0 || count <= 0) {
|
||||||
qWarning() << "Invalid item range (index:" << index << ", count:" << count << ")";
|
qCWarning(DolphinDebug) << "Invalid item range (index:" << index << ", count:" << count << ")";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
previouslyInsertedCount += count;
|
previouslyInsertedCount += count;
|
||||||
|
@ -1114,7 +1114,7 @@ void KItemListView::slotItemsRemoved(const KItemRangeList& itemRanges)
|
||||||
const int index = range.index;
|
const int index = range.index;
|
||||||
const int count = range.count;
|
const int count = range.count;
|
||||||
if (index < 0 || count <= 0) {
|
if (index < 0 || count <= 0) {
|
||||||
qWarning() << "Invalid item range (index:" << index << ", count:" << count << ")";
|
qCWarning(DolphinDebug) << "Invalid item range (index:" << index << ", count:" << count << ")";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include <kitemviews/kitemmodelbase.h>
|
#include <kitemviews/kitemmodelbase.h>
|
||||||
#include "kitemlistsizehintresolver.h"
|
#include "kitemlistsizehintresolver.h"
|
||||||
|
|
||||||
#include <KDebug>
|
#include "dolphindebug.h"
|
||||||
|
|
||||||
// #define KITEMLISTVIEWLAYOUTER_DEBUG
|
// #define KITEMLISTVIEWLAYOUTER_DEBUG
|
||||||
|
|
||||||
|
@ -516,7 +516,7 @@ void KItemListViewLayouter::doLayout()
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KITEMLISTVIEWLAYOUTER_DEBUG
|
#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
|
#endif
|
||||||
m_dirty = false;
|
m_dirty = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include <QCommandLineOption>
|
#include <QCommandLineOption>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KDebug>
|
#include "dolphindebug.h"
|
||||||
#include <kdelibs4configmigrator.h>
|
#include <kdelibs4configmigrator.h>
|
||||||
|
|
||||||
extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
|
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()) {
|
if (url.isValid()) {
|
||||||
urls.append(url);
|
urls.append(url);
|
||||||
} else {
|
} 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")) {
|
if (className == QLatin1String("DolphinMainWindow")) {
|
||||||
m_mainWindow->restore(1);
|
m_mainWindow->restore(1);
|
||||||
} else {
|
} else {
|
||||||
kWarning() << "Unknown class " << className << " in session saved data!";
|
qCWarning(DolphinDebug) << "Unknown class " << className << " in session saved data!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
|
|
||||||
#include <views/draganddrophelper.h>
|
#include <views/draganddrophelper.h>
|
||||||
|
|
||||||
#include <KDebug>
|
#include "dolphindebug.h"
|
||||||
|
|
||||||
FoldersPanel::FoldersPanel(QWidget* parent) :
|
FoldersPanel::FoldersPanel(QWidget* parent) :
|
||||||
Panel(parent),
|
Panel(parent),
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "placesitem.h"
|
#include "placesitem.h"
|
||||||
|
|
||||||
#include <KBookmarkManager>
|
#include <KBookmarkManager>
|
||||||
#include <KDebug>
|
#include "dolphindebug.h"
|
||||||
#include <KDirLister>
|
#include <KDirLister>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include "placesitemsignalhandler.h"
|
#include "placesitemsignalhandler.h"
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "placesitemeditdialog.h"
|
#include "placesitemeditdialog.h"
|
||||||
|
|
||||||
#include <KAboutData>
|
#include <KAboutData>
|
||||||
#include <KDebug>
|
#include "dolphindebug.h"
|
||||||
#include <KFile>
|
#include <KFile>
|
||||||
#include <KIconButton>
|
#include <KIconButton>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include <KBookmark>
|
#include <KBookmark>
|
||||||
#include <KBookmarkGroup>
|
#include <KBookmarkGroup>
|
||||||
#include <KBookmarkManager>
|
#include <KBookmarkManager>
|
||||||
#include <KDebug>
|
#include "dolphindebug.h"
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <KProtocolInfo>
|
#include <KProtocolInfo>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
|
@ -191,7 +191,7 @@ void PlacesItemModel::setHiddenItemsShown(bool show)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PLACESITEMMODEL_DEBUG
|
#ifdef PLACESITEMMODEL_DEBUG
|
||||||
kDebug() << "Changed visibility of hidden items";
|
qCDebug(DolphinDebug) << "Changed visibility of hidden items";
|
||||||
showModelState();
|
showModelState();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -496,7 +496,7 @@ void PlacesItemModel::onItemInserted(int index)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PLACESITEMMODEL_DEBUG
|
#ifdef PLACESITEMMODEL_DEBUG
|
||||||
kDebug() << "Inserted item" << index;
|
qCDebug(DolphinDebug) << "Inserted item" << index;
|
||||||
showModelState();
|
showModelState();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -514,7 +514,7 @@ void PlacesItemModel::onItemRemoved(int index, KStandardItem* removedItem)
|
||||||
m_bookmarkedItems.removeAt(boomarkIndex);
|
m_bookmarkedItems.removeAt(boomarkIndex);
|
||||||
|
|
||||||
#ifdef PLACESITEMMODEL_DEBUG
|
#ifdef PLACESITEMMODEL_DEBUG
|
||||||
kDebug() << "Removed item" << index;
|
qCDebug(DolphinDebug) << "Removed item" << index;
|
||||||
showModelState();
|
showModelState();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -807,7 +807,7 @@ void PlacesItemModel::loadBookmarks()
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PLACESITEMMODEL_DEBUG
|
#ifdef PLACESITEMMODEL_DEBUG
|
||||||
kDebug() << "Loaded bookmarks";
|
qCDebug(DolphinDebug) << "Loaded bookmarks";
|
||||||
showModelState();
|
showModelState();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1176,25 +1176,25 @@ QUrl PlacesItemModel::searchUrlForType(const QString& type)
|
||||||
#ifdef PLACESITEMMODEL_DEBUG
|
#ifdef PLACESITEMMODEL_DEBUG
|
||||||
void PlacesItemModel::showModelState()
|
void PlacesItemModel::showModelState()
|
||||||
{
|
{
|
||||||
kDebug() << "=================================";
|
qCDebug(DolphinDebug) << "=================================";
|
||||||
kDebug() << "Model:";
|
qCDebug(DolphinDebug) << "Model:";
|
||||||
kDebug() << "hidden-index model-index text";
|
qCDebug(DolphinDebug) << "hidden-index model-index text";
|
||||||
int modelIndex = 0;
|
int modelIndex = 0;
|
||||||
for (int i = 0; i < m_bookmarkedItems.count(); ++i) {
|
for (int i = 0; i < m_bookmarkedItems.count(); ++i) {
|
||||||
if (m_bookmarkedItems[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 {
|
} else {
|
||||||
if (item(modelIndex)) {
|
if (item(modelIndex)) {
|
||||||
kDebug() << i << " " << modelIndex << " " << item(modelIndex)->dataValue("text").toString();
|
qCDebug(DolphinDebug) << i << " " << modelIndex << " " << item(modelIndex)->dataValue("text").toString();
|
||||||
} else {
|
} else {
|
||||||
kDebug() << i << " " << modelIndex << " " << "(not available yet)";
|
qCDebug(DolphinDebug) << i << " " << modelIndex << " " << "(not available yet)";
|
||||||
}
|
}
|
||||||
++modelIndex;
|
++modelIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kDebug();
|
qCDebug(DolphinDebug);
|
||||||
kDebug() << "Bookmarks:";
|
qCDebug(DolphinDebug) << "Bookmarks:";
|
||||||
|
|
||||||
int bookmarkIndex = 0;
|
int bookmarkIndex = 0;
|
||||||
KBookmarkGroup root = m_bookmarkManager->root();
|
KBookmarkGroup root = m_bookmarkManager->root();
|
||||||
|
@ -1203,9 +1203,9 @@ void PlacesItemModel::showModelState()
|
||||||
const QString udi = bookmark.metaDataItem("UDI");
|
const QString udi = bookmark.metaDataItem("UDI");
|
||||||
const QString text = udi.isEmpty() ? bookmark.text() : udi;
|
const QString text = udi.isEmpty() ? bookmark.text() : udi;
|
||||||
if (bookmark.metaDataItem("IsHidden") == QLatin1String("true")) {
|
if (bookmark.metaDataItem("IsHidden") == QLatin1String("true")) {
|
||||||
kDebug() << bookmarkIndex << "(Hidden)" << text;
|
qCDebug(DolphinDebug) << bookmarkIndex << "(Hidden)" << text;
|
||||||
} else {
|
} else {
|
||||||
kDebug() << bookmarkIndex << " " << text;
|
qCDebug(DolphinDebug) << bookmarkIndex << " " << text;
|
||||||
}
|
}
|
||||||
|
|
||||||
bookmark = root.next(bookmark);
|
bookmark = root.next(bookmark);
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "dolphin_generalsettings.h"
|
#include "dolphin_generalsettings.h"
|
||||||
|
|
||||||
#include <KFileItem>
|
#include <KFileItem>
|
||||||
#include <KDebug>
|
#include "dolphindebug.h"
|
||||||
#include <KDirNotify>
|
#include <KDirNotify>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <KIO/Job>
|
#include <KIO/Job>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include "serviceitemdelegate.h"
|
#include "serviceitemdelegate.h"
|
||||||
|
|
||||||
#include <KDebug>
|
#include "dolphindebug.h"
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
|
||||||
|
|
|
@ -98,13 +98,13 @@ bool KStandardItemModelTest::isModelConsistent() const
|
||||||
for (int i = 0; i < m_model->count(); ++i) {
|
for (int i = 0; i < m_model->count(); ++i) {
|
||||||
const KStandardItem* item = m_model->item(i);
|
const KStandardItem* item = m_model->item(i);
|
||||||
if (!item) {
|
if (!item) {
|
||||||
qWarning() << "Item" << i << "is null";
|
qCWarning(DolphinDebug) << "Item" << i << "is null";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int itemIndex = m_model->index(item);
|
const int itemIndex = m_model->index(item);
|
||||||
if (itemIndex != i) {
|
if (itemIndex != i) {
|
||||||
qWarning() << "Item" << i << "has a wrong index:" << itemIndex;
|
qCWarning(DolphinDebug) << "Item" << i << "has a wrong index:" << itemIndex;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <kversioncontrolplugin2.h>
|
#include <kversioncontrolplugin2.h>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
|
|
||||||
#include <KDebug>
|
#include "dolphindebug.h"
|
||||||
|
|
||||||
DolphinFileItemListWidget::DolphinFileItemListWidget(KItemListWidgetInformant* informant,
|
DolphinFileItemListWidget::DolphinFileItemListWidget(KItemListWidgetInformant* informant,
|
||||||
QGraphicsItem* parent) :
|
QGraphicsItem* parent) :
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "dolphinremoteencoding.h"
|
#include "dolphinremoteencoding.h"
|
||||||
#include "dolphinviewactionhandler.h"
|
#include "dolphinviewactionhandler.h"
|
||||||
|
|
||||||
#include <KDebug>
|
#include "dolphindebug.h"
|
||||||
#include <KActionMenu>
|
#include <KActionMenu>
|
||||||
#include <KActionCollection>
|
#include <KActionCollection>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
@ -141,10 +141,10 @@ void DolphinRemoteEncoding::updateMenu()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kDebug() << "URL=" << m_currentURL << " charset=" << charset;
|
qCDebug(DolphinDebug) << "URL=" << m_currentURL << " charset=" << charset;
|
||||||
|
|
||||||
if (!isFound) {
|
if (!isFound) {
|
||||||
kWarning() << "could not find entry for charset=" << charset ;
|
qCWarning(DolphinDebug) << "could not find entry for charset=" << charset ;
|
||||||
} else {
|
} else {
|
||||||
m_menu->menu()->actions().at(id)->setChecked(true);
|
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) {
|
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)) {
|
if (config.hasGroup(*it)) {
|
||||||
config.deleteGroup(*it);
|
config.deleteGroup(*it);
|
||||||
} else if (config.group("").hasKey(*it)) {
|
} else if (config.group("").hasKey(*it)) {
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#include <KPropertiesDialog>
|
#include <KPropertiesDialog>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
|
||||||
#include <KDebug>
|
#include "dolphindebug.h"
|
||||||
|
|
||||||
#ifdef HAVE_BALOO
|
#ifdef HAVE_BALOO
|
||||||
#include <Baloo/IndexerConfig>
|
#include <Baloo/IndexerConfig>
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KService>
|
#include <KService>
|
||||||
#include <KDebug>
|
#include "dolphindebug.h"
|
||||||
#include <KServiceTypeTrader>
|
#include <KServiceTypeTrader>
|
||||||
#include <kitemviews/kfileitemmodel.h>
|
#include <kitemviews/kfileitemmodel.h>
|
||||||
#include <kversioncontrolplugin2.h>
|
#include <kversioncontrolplugin2.h>
|
||||||
|
@ -94,7 +94,7 @@ QList<QAction*> VersionControlObserver::actions(const KFileItemList& items) cons
|
||||||
bool hasNullItems = false;
|
bool hasNullItems = false;
|
||||||
foreach (const KFileItem& item, items) {
|
foreach (const KFileItem& item, items) {
|
||||||
if (item.isNull()) {
|
if (item.isNull()) {
|
||||||
kWarning() << "Requesting version-control-actions for empty items";
|
qCWarning(DolphinDebug) << "Requesting version-control-actions for empty items";
|
||||||
hasNullItems = true;
|
hasNullItems = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "dolphin_generalsettings.h"
|
#include "dolphin_generalsettings.h"
|
||||||
|
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <KDebug>
|
#include "dolphindebug.h"
|
||||||
|
|
||||||
#include <QCryptographicHash>
|
#include <QCryptographicHash>
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
|
@ -359,7 +359,7 @@ void ViewProperties::update()
|
||||||
|
|
||||||
void ViewProperties::save()
|
void ViewProperties::save()
|
||||||
{
|
{
|
||||||
kDebug() << "Saving view-properties to" << m_filePath;
|
qCDebug(DolphinDebug) << "Saving view-properties to" << m_filePath;
|
||||||
QDir dir;
|
QDir dir;
|
||||||
dir.mkpath(m_filePath);
|
dir.mkpath(m_filePath);
|
||||||
m_node->setVersion(CurrentViewPropertiesVersion);
|
m_node->setVersion(CurrentViewPropertiesVersion);
|
||||||
|
@ -388,7 +388,7 @@ QString ViewProperties::viewModePrefix() const
|
||||||
case DolphinView::IconsView: prefix = "Icons_"; break;
|
case DolphinView::IconsView: prefix = "Icons_"; break;
|
||||||
case DolphinView::CompactView: prefix = "Compact_"; break;
|
case DolphinView::CompactView: prefix = "Compact_"; break;
|
||||||
case DolphinView::DetailsView: prefix = "Details_"; 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;
|
return prefix;
|
||||||
|
|
Loading…
Reference in a new issue