From 1b743f798326a382b45c02cddbe2c29aac40bd23 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Sat, 29 Feb 2020 19:13:30 +0100 Subject: [PATCH] implement saving and showing the feed name --- src/feed.cpp | 5 ----- src/feed.h | 8 +------- src/fetcher.cpp | 4 ++++ 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/feed.cpp b/src/feed.cpp index 41b5a2d0..fd2868e8 100644 --- a/src/feed.cpp +++ b/src/feed.cpp @@ -47,8 +47,3 @@ QString Feed::name() const { return m_name; } - -void Feed::setName(QString name) -{ - m_name = name; -} diff --git a/src/feed.h b/src/feed.h index 8d8b98e1..1daeead8 100644 --- a/src/feed.h +++ b/src/feed.h @@ -23,9 +23,8 @@ #include #include -class Feed : public QObject +class Feed { - Q_OBJECT public: Feed(const QString url); Feed(const Feed &other); @@ -34,11 +33,6 @@ public: QString name() const; QString url() const; - void setName(QString name); - -Q_SIGNALS: - void nameChanged(const QString &name); - private: QString m_url; QString m_name; diff --git a/src/fetcher.cpp b/src/fetcher.cpp index dfe012f1..d0879f4d 100644 --- a/src/fetcher.cpp +++ b/src/fetcher.cpp @@ -63,6 +63,10 @@ void Fetcher::fetch(QUrl url) query.bindValue(QStringLiteral(":email"), author->email()); query.exec(); } + query.prepare(QStringLiteral("UPDATE Feeds SET name=:name WHERE url=:url;")); + query.bindValue(QStringLiteral(":name"), feed->title()); + query.bindValue(QStringLiteral(":url"), url.toString()); + query.exec(); } delete reply; emit finished();