implement saving and showing the feed name

This commit is contained in:
Tobias Fella 2020-02-29 19:13:30 +01:00
parent 11deb2b4c3
commit 1b743f7983
No known key found for this signature in database
GPG Key ID: E55EDAB3CA5D9925
3 changed files with 5 additions and 12 deletions

View File

@ -47,8 +47,3 @@ QString Feed::name() const
{
return m_name;
}
void Feed::setName(QString name)
{
m_name = name;
}

View File

@ -23,9 +23,8 @@
#include <QObject>
#include <QString>
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;

View File

@ -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();