This commit is contained in:
Martin Rotter 2016-08-22 11:21:25 +02:00
parent 32151644a3
commit c03f91253e
6 changed files with 114 additions and 70 deletions

View File

@ -7,6 +7,9 @@ Added:
Changed: Changed:
▪ Big application core refactoring. Many functions rewritten, some bad code removed. ▪ Big application core refactoring. Many functions rewritten, some bad code removed.
Fixed:
▪ RSS Guard was not launchable in Windows XP. (bug #53)
3.3.3 3.3.3
————— —————

View File

@ -153,6 +153,17 @@ CONFIG *= c++11 debug_and_release warn_on
DEFINES *= QT_USE_QSTRINGBUILDER QT_USE_FAST_CONCATENATION QT_USE_FAST_OPERATOR_PLUS UNICODE _UNICODE DEFINES *= QT_USE_QSTRINGBUILDER QT_USE_FAST_CONCATENATION QT_USE_FAST_OPERATOR_PLUS UNICODE _UNICODE
VERSION = $$APP_VERSION VERSION = $$APP_VERSION
win32 {
# Makes sure we use correct subsystem on Windows.
!contains(QMAKE_TARGET.arch, x86_64) {
message(rssguard: Compilling x86 variant.)
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01
} else {
message(rssguard: Compilling x86_64 variant.)
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.02
}
}
MOC_DIR = $$OUT_PWD/moc MOC_DIR = $$OUT_PWD/moc
RCC_DIR = $$OUT_PWD/rcc RCC_DIR = $$OUT_PWD/rcc
UI_DIR = $$OUT_PWD/ui UI_DIR = $$OUT_PWD/ui

View File

@ -111,6 +111,22 @@ void Feed::setAutoUpdateRemainingInterval(int auto_update_remaining_interval) {
m_autoUpdateRemainingInterval = auto_update_remaining_interval; m_autoUpdateRemainingInterval = auto_update_remaining_interval;
} }
Feed::Status Feed::status() const {
return m_status;
}
void Feed::setStatus(const Feed::Status &status) {
m_status = status;
}
QString Feed::url() const {
return m_url;
}
void Feed::setUrl(const QString &url) {
m_url = url;
}
void Feed::updateCounts(bool including_total_count) { void Feed::updateCounts(bool including_total_count) {
QSqlDatabase database = qApp->database()->connection(metaObject()->className(), DatabaseFactory::FromSettings); QSqlDatabase database = qApp->database()->connection(metaObject()->className(), DatabaseFactory::FromSettings);
int account_id = getParentServiceRoot()->accountId(); int account_id = getParentServiceRoot()->accountId();

View File

@ -72,21 +72,11 @@ class Feed : public RootItem, public QRunnable {
int autoUpdateRemainingInterval() const; int autoUpdateRemainingInterval() const;
void setAutoUpdateRemainingInterval(int auto_update_remaining_interval); void setAutoUpdateRemainingInterval(int auto_update_remaining_interval);
inline Status status() const { Status status() const;
return m_status; void setStatus(const Status &status);
}
inline void setStatus(const Status &status) { QString url() const;
m_status = status; void setUrl(const QString &url);
}
inline QString url() const {
return m_url;
}
inline void setUrl(const QString &url) {
m_url = url;
}
int updateMessages(const QList<Message> &messages); int updateMessages(const QList<Message> &messages);
void updateCounts(bool including_total_count); void updateCounts(bool including_total_count);

View File

@ -376,6 +376,70 @@ ServiceRoot *RootItem::getParentServiceRoot() const {
return nullptr; return nullptr;
} }
RootItemKind::Kind RootItem::kind() const {
return m_kind;
}
void RootItem::setKind(RootItemKind::Kind kind) {
m_kind = kind;
}
QIcon RootItem::icon() const {
return m_icon;
}
void RootItem::setIcon(const QIcon &icon) {
m_icon = icon;
}
int RootItem::id() const {
return m_id;
}
void RootItem::setId(int id) {
m_id = id;
}
QString RootItem::title() const {
return m_title;
}
void RootItem::setTitle(const QString &title) {
m_title = title;
}
QDateTime RootItem::creationDate() const {
return m_creationDate;
}
void RootItem::setCreationDate(const QDateTime &creation_date) {
m_creationDate = creation_date;
}
QString RootItem::description() const {
return m_description;
}
void RootItem::setDescription(const QString &description) {
m_description = description;
}
QFont RootItem::normalFont() const {
return m_normalFont;
}
void RootItem::setNormalFont(const QFont &normal_font) {
m_normalFont = normal_font;
}
QFont RootItem::boldFont() const {
return m_boldFont;
}
void RootItem::setBoldFont(const QFont &bold_font) {
m_boldFont = bold_font;
}
bool RootItem::removeChild(RootItem *child) { bool RootItem::removeChild(RootItem *child) {
return m_childItems.removeOne(child); return m_childItems.removeOne(child);
} }

View File

@ -180,73 +180,33 @@ class RootItem : public QObject {
// Returns the service root node which is direct or indirect parent of current item. // Returns the service root node which is direct or indirect parent of current item.
ServiceRoot *getParentServiceRoot() const; ServiceRoot *getParentServiceRoot() const;
inline RootItemKind::Kind kind() const { RootItemKind::Kind kind() const;
return m_kind; void setKind(RootItemKind::Kind kind);
}
inline void setKind(RootItemKind::Kind kind) {
m_kind = kind;
}
// Each item can have icon. // Each item can have icon.
inline QIcon icon() const { QIcon icon() const;
return m_icon; void setIcon(const QIcon &icon);
}
inline void setIcon(const QIcon &icon) {
m_icon = icon;
}
// This ALWAYS represents primary column number/ID under which // This ALWAYS represents primary column number/ID under which
// the item is stored in DB. // the item is stored in DB.
inline int id() const { int id() const;
return m_id; void setId(int id);
}
inline void setId(int id) {
m_id = id;
}
// Each item has its title. // Each item has its title.
inline QString title() const { QString title() const;
return m_title; void setTitle(const QString &title);
}
inline void setTitle(const QString &title) { QDateTime creationDate() const;
m_title = title; void setCreationDate(const QDateTime &creation_date);
}
inline QDateTime creationDate() const { QString description() const;
return m_creationDate; void setDescription(const QString &description);
}
inline void setCreationDate(const QDateTime &creation_date) { QFont normalFont() const;
m_creationDate = creation_date; void setNormalFont(const QFont &normal_font);
}
inline QString description() const { QFont boldFont() const;
return m_description; void setBoldFont(const QFont &bold_font);
}
inline void setDescription(const QString &description) {
m_description = description;
}
inline QFont normalFont() const {
return m_normalFont;
}
inline void setNormalFont(const QFont &normal_font) {
m_normalFont = normal_font;
}
inline QFont boldFont() const {
return m_boldFont;
}
inline void setBoldFont(const QFont &bold_font) {
m_boldFont = bold_font;
}
// NOTE: For standard feed/category, this WILL equal to id(). // NOTE: For standard feed/category, this WILL equal to id().
int customId() const; int customId() const;