mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-02-06 20:33:38 +01:00
Refactoring, long way to go bro.
This commit is contained in:
parent
e0790bb6a2
commit
1395ba2478
@ -71,6 +71,14 @@ QList<QAction*> StandardFeed::contextMenu() {
|
||||
return serviceRoot()->getContextMenuForFeed(this);
|
||||
}
|
||||
|
||||
bool StandardFeed::canBeEdited() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool StandardFeed::canBeDeleted() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
StandardServiceRoot* StandardFeed::serviceRoot() const {
|
||||
return qobject_cast<StandardServiceRoot*>(getParentServiceRoot());
|
||||
}
|
||||
@ -108,7 +116,7 @@ QVariant StandardFeed::data(int column, int role) const {
|
||||
NetworkFactory::networkErrorText(m_networkError));
|
||||
}
|
||||
else {
|
||||
return QVariant();
|
||||
return Feed::data(column, role);
|
||||
}
|
||||
|
||||
default:
|
||||
@ -379,6 +387,46 @@ bool StandardFeed::editItself(StandardFeed* new_feed_data) {
|
||||
return true;
|
||||
}
|
||||
|
||||
StandardFeed::Type StandardFeed::type() const {
|
||||
return m_type;
|
||||
}
|
||||
|
||||
void StandardFeed::setType(StandardFeed::Type type) {
|
||||
m_type = type;
|
||||
}
|
||||
|
||||
bool StandardFeed::passwordProtected() const {
|
||||
return m_passwordProtected;
|
||||
}
|
||||
|
||||
void StandardFeed::setPasswordProtected(bool passwordProtected) {
|
||||
m_passwordProtected = passwordProtected;
|
||||
}
|
||||
|
||||
QString StandardFeed::username() const {
|
||||
return m_username;
|
||||
}
|
||||
|
||||
void StandardFeed::setUsername(const QString& username) {
|
||||
m_username = username;
|
||||
}
|
||||
|
||||
QString StandardFeed::password() const {
|
||||
return m_password;
|
||||
}
|
||||
|
||||
void StandardFeed::setPassword(const QString& password) {
|
||||
m_password = password;
|
||||
}
|
||||
|
||||
QString StandardFeed::encoding() const {
|
||||
return m_encoding;
|
||||
}
|
||||
|
||||
void StandardFeed::setEncoding(const QString& encoding) {
|
||||
m_encoding = encoding;
|
||||
}
|
||||
|
||||
QList<Message> StandardFeed::obtainNewMessages(bool* error_during_obtaining) {
|
||||
QByteArray feed_contents;
|
||||
int download_timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt();
|
||||
|
@ -28,8 +28,6 @@
|
||||
#include <QPair>
|
||||
#include <QSqlRecord>
|
||||
|
||||
class Message;
|
||||
class FeedsModel;
|
||||
class StandardServiceRoot;
|
||||
|
||||
// Represents BASE class for feeds contained in FeedsModel.
|
||||
@ -38,9 +36,6 @@ class StandardFeed : public Feed {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
// Describes possible types of feeds.
|
||||
// NOTE: This is equivalent to attribute Feeds(type).
|
||||
enum Type {
|
||||
Rss0X = 0,
|
||||
Rss2X = 1,
|
||||
@ -58,13 +53,8 @@ class StandardFeed : public Feed {
|
||||
|
||||
QList<QAction*> contextMenu();
|
||||
|
||||
bool canBeEdited() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool canBeDeleted() const {
|
||||
return true;
|
||||
}
|
||||
bool canBeEdited() const;
|
||||
bool canBeDeleted() const;
|
||||
|
||||
bool editViaGui();
|
||||
bool deleteViaGui();
|
||||
@ -82,45 +72,16 @@ class StandardFeed : public Feed {
|
||||
bool editItself(StandardFeed* new_feed_data);
|
||||
|
||||
// Other getters/setters.
|
||||
inline Type type() const {
|
||||
return m_type;
|
||||
}
|
||||
|
||||
inline void setType(Type type) {
|
||||
m_type = type;
|
||||
}
|
||||
|
||||
inline bool passwordProtected() const {
|
||||
return m_passwordProtected;
|
||||
}
|
||||
|
||||
inline void setPasswordProtected(bool passwordProtected) {
|
||||
m_passwordProtected = passwordProtected;
|
||||
}
|
||||
|
||||
inline QString username() const {
|
||||
return m_username;
|
||||
}
|
||||
|
||||
inline void setUsername(const QString& username) {
|
||||
m_username = username;
|
||||
}
|
||||
|
||||
inline QString password() const {
|
||||
return m_password;
|
||||
}
|
||||
|
||||
inline void setPassword(const QString& password) {
|
||||
m_password = password;
|
||||
}
|
||||
|
||||
inline QString encoding() const {
|
||||
return m_encoding;
|
||||
}
|
||||
|
||||
inline void setEncoding(const QString& encoding) {
|
||||
m_encoding = encoding;
|
||||
}
|
||||
inline Type type() const;
|
||||
inline void setType(Type type);
|
||||
inline bool passwordProtected() const;
|
||||
inline void setPasswordProtected(bool passwordProtected);
|
||||
inline QString username() const;
|
||||
inline void setUsername(const QString& username);
|
||||
inline QString password() const;
|
||||
inline void setPassword(const QString& password);
|
||||
inline QString encoding() const;
|
||||
inline void setEncoding(const QString& encoding);
|
||||
|
||||
QNetworkReply::NetworkError networkError() const;
|
||||
|
||||
@ -137,8 +98,6 @@ class StandardFeed : public Feed {
|
||||
static QString typeToString(Type type);
|
||||
|
||||
public slots:
|
||||
|
||||
// Fetches metadata for the feed.
|
||||
void fetchMetadataForItself();
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user