views/zoomlevelinfo.cpp
dolphinremoveaction.cpp
dolphinnewfilemenu.cpp
+ dolphindebug.cpp
)
if(HAVE_BALOO)
--- /dev/null
+/***************************************************************************
+ * 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")
--- /dev/null
+/***************************************************************************
+ * 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
#include <KAboutData>
#include <KActionCollection>
-#include <KDebug>
+#include "dolphindebug.h"
#include <KIconLoader>
#include <KLocalizedString>
#include <KMessageBox>
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();
void DolphinPart::slotErrorMessage(const QString& msg)
{
- kDebug() << msg;
+ qCDebug(DolphinDebug) << msg;
emit canceled(msg);
//KMessageBox::error(m_view, msg);
}
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);
#include "dolphin_generalsettings.h"
#include <KLocalizedString>
-#include <KDebug>
+#include "dolphindebug.h"
#include "private/kfileitemmodelsortalgorithm.h"
#include "private/kfileitemmodeldirlister.h"
}
#ifdef KFILEITEMMODEL_DEBUG
- kDebug() << "[TIME] Calculating groups for" << count() << "items:" << timer.elapsed();
+ qCDebug(DolphinDebug) << "[TIME] Calculating groups for" << count() << "items:" << timer.elapsed();
#endif
}
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;
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;
}
}
}
#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
}
#ifdef KFILEITEMMODEL_DEBUG
- kDebug() << "[TIME] Resorting of" << itemCount << "items:" << timer.elapsed();
+ qCDebug(DolphinDebug) << "[TIME] Resorting of" << itemCount << "items:" << timer.elapsed();
#endif
}
{
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
void KFileItemModel::slotClear()
{
#ifdef KFILEITEMMODEL_DEBUG
- kDebug() << "Clearing all items";
+ qCDebug(DolphinDebug) << "Clearing all items";
#endif
qDeleteAll(m_filteredItems.values());
#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();
sort(newItems.begin(), newItems.end());
#ifdef KFILEITEMMODEL_DEBUG
- kDebug() << "[TIME] Sorting:" << timer.elapsed();
+ qCDebug(DolphinDebug) << "[TIME] Sorting:" << timer.elapsed();
#endif
KItemRangeList itemRanges;
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
}
// 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;
}
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;
}
}
#include "kitemlistview.h"
-#include <QDebug>
+#include "dolphindebug.h"
#include "kitemlistcontainer.h"
#include "kitemlistcontroller.h"
#include "kitemlistheader.h"
--m_activeTransactions;
if (m_activeTransactions < 0) {
m_activeTransactions = 0;
- qWarning() << "Mismatch between beginTransaction()/endTransaction()";
+ qCWarning(DolphinDebug) << "Mismatch between beginTransaction()/endTransaction()";
}
if (m_activeTransactions == 0) {
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;
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;
}
#include <kitemviews/kitemmodelbase.h>
#include "kitemlistsizehintresolver.h"
-#include <KDebug>
+#include "dolphindebug.h"
// #define 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
m_dirty = false;
}
#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)
if (url.isValid()) {
urls.append(url);
} else {
- qWarning() << "Invalid URL: " << str;
+ qCWarning(DolphinDebug) << "Invalid URL: " << str;
}
}
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!";
}
}
#include <views/draganddrophelper.h>
-#include <KDebug>
+#include "dolphindebug.h"
FoldersPanel::FoldersPanel(QWidget* parent) :
Panel(parent),
#include "placesitem.h"
#include <KBookmarkManager>
-#include <KDebug>
+#include "dolphindebug.h"
#include <KDirLister>
#include <KLocalizedString>
#include "placesitemsignalhandler.h"
#include "placesitemeditdialog.h"
#include <KAboutData>
-#include <KDebug>
+#include "dolphindebug.h"
#include <KFile>
#include <KIconButton>
#include <KLocalizedString>
#include <KBookmark>
#include <KBookmarkGroup>
#include <KBookmarkManager>
-#include <KDebug>
+#include "dolphindebug.h"
#include <QIcon>
#include <KProtocolInfo>
#include <KLocalizedString>
}
#ifdef PLACESITEMMODEL_DEBUG
- kDebug() << "Changed visibility of hidden items";
+ qCDebug(DolphinDebug) << "Changed visibility of hidden items";
showModelState();
#endif
}
}
#ifdef PLACESITEMMODEL_DEBUG
- kDebug() << "Inserted item" << index;
+ qCDebug(DolphinDebug) << "Inserted item" << index;
showModelState();
#endif
}
m_bookmarkedItems.removeAt(boomarkIndex);
#ifdef PLACESITEMMODEL_DEBUG
- kDebug() << "Removed item" << index;
+ qCDebug(DolphinDebug) << "Removed item" << index;
showModelState();
#endif
}
}
#ifdef PLACESITEMMODEL_DEBUG
- kDebug() << "Loaded bookmarks";
+ qCDebug(DolphinDebug) << "Loaded bookmarks";
showModelState();
#endif
}
#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();
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);
#include "dolphin_generalsettings.h"
#include <KFileItem>
-#include <KDebug>
+#include "dolphindebug.h"
#include <KDirNotify>
#include <QIcon>
#include <KIO/Job>
#include "serviceitemdelegate.h"
-#include <KDebug>
+#include "dolphindebug.h"
#include <QPushButton>
#include <QIcon>
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;
}
}
#include <kversioncontrolplugin2.h>
#include <QColor>
-#include <KDebug>
+#include "dolphindebug.h"
DolphinFileItemListWidget::DolphinFileItemListWidget(KItemListWidgetInformant* informant,
QGraphicsItem* parent) :
#include "dolphinremoteencoding.h"
#include "dolphinviewactionhandler.h"
-#include <KDebug>
+#include "dolphindebug.h"
#include <KActionMenu>
#include <KActionCollection>
#include <QIcon>
}
}
- 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);
}
}
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)) {
#include <KPropertiesDialog>
#include <QIcon>
-#include <KDebug>
+#include "dolphindebug.h"
#ifdef HAVE_BALOO
#include <Baloo/IndexerConfig>
#include <KLocalizedString>
#include <KService>
-#include <KDebug>
+#include "dolphindebug.h"
#include <KServiceTypeTrader>
#include <kitemviews/kfileitemmodel.h>
#include <kversioncontrolplugin2.h>
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;
}
#include "dolphin_generalsettings.h"
#include <QUrl>
-#include <KDebug>
+#include "dolphindebug.h"
#include <QCryptographicHash>
#include <QDate>
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);
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;