mirror of https://github.com/KDE/kasts.git
implement saving and showing the feed name
This commit is contained in:
parent
11deb2b4c3
commit
1b743f7983
|
@ -47,8 +47,3 @@ QString Feed::name() const
|
||||||
{
|
{
|
||||||
return m_name;
|
return m_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Feed::setName(QString name)
|
|
||||||
{
|
|
||||||
m_name = name;
|
|
||||||
}
|
|
||||||
|
|
|
@ -23,9 +23,8 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
class Feed : public QObject
|
class Feed
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
|
||||||
public:
|
public:
|
||||||
Feed(const QString url);
|
Feed(const QString url);
|
||||||
Feed(const Feed &other);
|
Feed(const Feed &other);
|
||||||
|
@ -34,11 +33,6 @@ public:
|
||||||
QString name() const;
|
QString name() const;
|
||||||
QString url() const;
|
QString url() const;
|
||||||
|
|
||||||
void setName(QString name);
|
|
||||||
|
|
||||||
Q_SIGNALS:
|
|
||||||
void nameChanged(const QString &name);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_url;
|
QString m_url;
|
||||||
QString m_name;
|
QString m_name;
|
||||||
|
|
|
@ -63,6 +63,10 @@ void Fetcher::fetch(QUrl url)
|
||||||
query.bindValue(QStringLiteral(":email"), author->email());
|
query.bindValue(QStringLiteral(":email"), author->email());
|
||||||
query.exec();
|
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;
|
delete reply;
|
||||||
emit finished();
|
emit finished();
|
||||||
|
|
Loading…
Reference in New Issue