From 2c798db7c16c819f6a80e41cf6598cdba38ab6a9 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Fri, 10 Apr 2020 17:28:26 +0200 Subject: [PATCH] remove logging categories --- src/alligator-debug.h | 25 ------------------------- src/database.cpp | 17 ++++++++--------- src/entryListModel.cpp | 2 -- src/feedListModel.cpp | 2 -- src/fetcher.cpp | 1 - src/main.cpp | 4 ---- 6 files changed, 8 insertions(+), 43 deletions(-) delete mode 100644 src/alligator-debug.h diff --git a/src/alligator-debug.h b/src/alligator-debug.h deleted file mode 100644 index bc698f51..00000000 --- a/src/alligator-debug.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright 2020 Tobias Fella - * - * 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) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * 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, see . - */ - -#pragma once - -#include - -Q_DECLARE_LOGGING_CATEGORY(ALLIGATOR) diff --git a/src/database.cpp b/src/database.cpp index d0e7bd72..8d80e5a2 100644 --- a/src/database.cpp +++ b/src/database.cpp @@ -26,7 +26,6 @@ #include "database.h" #include "alligatorsettings.h" -#include "alligator-debug.h" #define TRUE_OR_RETURN(x) if(!x) return false; @@ -36,18 +35,18 @@ Database::Database() QString databasePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); QDir(databasePath).mkpath(databasePath); db.setDatabaseName(databasePath + QStringLiteral("/database.db3")); - qCDebug(ALLIGATOR) << "Opening database " << databasePath << "/database.db3"; + qDebug() << "Opening database " << databasePath << "/database.db3"; db.open(); if(!migrate()) { - qCCritical(ALLIGATOR) << "Failed to migrate the database"; + qCritical() << "Failed to migrate the database"; } cleanup(); } bool Database::migrate() { - qCDebug(ALLIGATOR) << "Migrating database"; + qDebug() << "Migrating database"; if(version() < 1) TRUE_OR_RETURN(migrateTo1()); return true; } @@ -69,9 +68,9 @@ bool Database::execute(QString query) { bool Database::execute(QSqlQuery &query) { if(!query.exec()) { - qCWarning(ALLIGATOR) << "Failed to execute SQL Query"; - qCWarning(ALLIGATOR) << query.lastQuery(); - qCWarning(ALLIGATOR) << query.lastError(); + qWarning() << "Failed to execute SQL Query"; + qWarning() << query.lastQuery(); + qWarning() << query.lastError(); return false; } return true; @@ -84,10 +83,10 @@ int Database::version() { if(query.next()) { bool ok; int value = query.value(0).toInt(&ok); - qCDebug(ALLIGATOR) << "Database version " << value; + qDebug() << "Database version " << value; if(ok) return value; } else { - qCCritical(ALLIGATOR) << "Failed to check database version"; + qCritical() << "Failed to check database version"; } return -1; } diff --git a/src/entryListModel.cpp b/src/entryListModel.cpp index 2ed779b6..aa37c70d 100644 --- a/src/entryListModel.cpp +++ b/src/entryListModel.cpp @@ -25,8 +25,6 @@ #include "fetcher.h" #include "database.h" -#include "alligator-debug.h" - EntryListModel::EntryListModel(QObject *parent) : QAbstractListModel(parent) { diff --git a/src/feedListModel.cpp b/src/feedListModel.cpp index 6a99258a..06297879 100644 --- a/src/feedListModel.cpp +++ b/src/feedListModel.cpp @@ -24,8 +24,6 @@ #include "fetcher.h" #include "database.h" -#include "alligator-debug.h" - FeedListModel::FeedListModel(QObject *parent) : QAbstractListModel(parent) { diff --git a/src/fetcher.cpp b/src/fetcher.cpp index ed7306de..e5a6136c 100644 --- a/src/fetcher.cpp +++ b/src/fetcher.cpp @@ -25,7 +25,6 @@ #include "fetcher.h" #include "database.h" -#include "alligator-debug.h" Fetcher::Fetcher() { } diff --git a/src/main.cpp b/src/main.cpp index d1d5078c..3bfc36a3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,10 +31,6 @@ #include "alligatorsettings.h" #include "feed.h" -#include "alligator-debug.h" - -Q_LOGGING_CATEGORY(ALLIGATOR, "alligator"); - Q_DECL_EXPORT int main(int argc, char *argv[]) { QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);