add debug header

This commit is contained in:
Tobias Fella 2020-03-06 23:03:30 +01:00
parent 8639518e6d
commit e1d0eb38da
No known key found for this signature in database
GPG Key ID: E55EDAB3CA5D9925
3 changed files with 30 additions and 4 deletions

25
src/alligator-debug.h Normal file
View File

@ -0,0 +1,25 @@
/**
* 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)

View File

@ -28,8 +28,6 @@
#include "feedListModel.h"
#include "fetcher.h"
#include <iostream>
FeedListModel::FeedListModel(QObject *parent)
: QAbstractListModel(parent)
{
@ -70,8 +68,7 @@ void FeedListModel::addFeed(QString url)
query.prepare(QStringLiteral("SELECT name FROM Feeds WHERE url=:url;"));
query.bindValue(QStringLiteral(":url"), url);
query.exec();
if(!query.next())
std::cout << "Query empty" << std::endl;
query.next()
for(int i = 0; i < feeds.length(); i++) {
if(feeds[i].url() == url) {
feeds.removeAt(i);

View File

@ -30,6 +30,10 @@
#include "entryListModel.h"
#include "feedListModel.h"
#include "alligator-debug.h"
Q_LOGGING_CATEGORY(ALLIGATOR, "alligator");
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);