mirror of
https://github.com/KDE/kasts.git
synced 2025-01-13 09:02:55 +01:00
remove logging categories
This commit is contained in:
parent
451a40f9b8
commit
2c798db7c1
@ -1,25 +0,0 @@
|
||||
/**
|
||||
* Copyright 2020 Tobias Fella <fella@posteo.de>
|
||||
*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QLoggingCategory>
|
||||
|
||||
Q_DECLARE_LOGGING_CATEGORY(ALLIGATOR)
|
@ -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;
|
||||
}
|
||||
|
@ -25,8 +25,6 @@
|
||||
#include "fetcher.h"
|
||||
#include "database.h"
|
||||
|
||||
#include "alligator-debug.h"
|
||||
|
||||
EntryListModel::EntryListModel(QObject *parent)
|
||||
: QAbstractListModel(parent)
|
||||
{
|
||||
|
@ -24,8 +24,6 @@
|
||||
#include "fetcher.h"
|
||||
#include "database.h"
|
||||
|
||||
#include "alligator-debug.h"
|
||||
|
||||
FeedListModel::FeedListModel(QObject *parent)
|
||||
: QAbstractListModel(parent)
|
||||
{
|
||||
|
@ -25,7 +25,6 @@
|
||||
|
||||
#include "fetcher.h"
|
||||
#include "database.h"
|
||||
#include "alligator-debug.h"
|
||||
|
||||
Fetcher::Fetcher() {
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user