some files for reddit
This commit is contained in:
parent
453363c4b8
commit
5bb5048dd2
@ -26,7 +26,7 @@
|
||||
<url type="donation">https://github.com/sponsors/martinrotter</url>
|
||||
<content_rating type="oars-1.1" />
|
||||
<releases>
|
||||
<release version="4.0.4" date="2021-11-15"/>
|
||||
<release version="4.0.4" date="2021-11-16"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.0">
|
||||
<content_attribute id="violence-cartoon">none</content_attribute>
|
||||
|
@ -195,9 +195,11 @@ HEADERS += core/feeddownloader.h \
|
||||
services/reddit/definitions.h \
|
||||
services/reddit/gui/formeditredditaccount.h \
|
||||
services/reddit/gui/redditaccountdetails.h \
|
||||
services/reddit/redditcategory.h \
|
||||
services/reddit/redditentrypoint.h \
|
||||
services/reddit/redditnetworkfactory.h \
|
||||
services/reddit/redditserviceroot.h \
|
||||
services/reddit/redditsubscription.h \
|
||||
services/standard/atomparser.h \
|
||||
services/standard/definitions.h \
|
||||
services/standard/feedparser.h \
|
||||
@ -376,9 +378,11 @@ SOURCES += core/feeddownloader.cpp \
|
||||
services/owncloud/owncloudserviceroot.cpp \
|
||||
services/reddit/gui/formeditredditaccount.cpp \
|
||||
services/reddit/gui/redditaccountdetails.cpp \
|
||||
services/reddit/redditcategory.cpp \
|
||||
services/reddit/redditentrypoint.cpp \
|
||||
services/reddit/redditnetworkfactory.cpp \
|
||||
services/reddit/redditserviceroot.cpp \
|
||||
services/reddit/redditsubscription.cpp \
|
||||
services/standard/atomparser.cpp \
|
||||
services/standard/feedparser.cpp \
|
||||
services/standard/gui/formeditstandardaccount.cpp \
|
||||
|
20
src/librssguard/services/reddit/redditcategory.cpp
Executable file
20
src/librssguard/services/reddit/redditcategory.cpp
Executable file
@ -0,0 +1,20 @@
|
||||
// For license of this file, see <project-root-folder>/LICENSE.md.
|
||||
|
||||
#include "services/reddit/redditcategory.h"
|
||||
|
||||
RedditCategory::RedditCategory(Type type, RootItem* parent_item)
|
||||
: Category(parent_item), m_type(type) {
|
||||
updateTitle();
|
||||
}
|
||||
|
||||
RedditCategory::Type RedditCategory::type() const {
|
||||
return m_type;
|
||||
}
|
||||
|
||||
void RedditCategory::updateTitle() {
|
||||
switch (m_type) {
|
||||
case Type::Subscriptions:
|
||||
setTitle(tr("Subscriptions"));
|
||||
break;
|
||||
}
|
||||
}
|
27
src/librssguard/services/reddit/redditcategory.h
Executable file
27
src/librssguard/services/reddit/redditcategory.h
Executable file
@ -0,0 +1,27 @@
|
||||
// For license of this file, see <project-root-folder>/LICENSE.md.
|
||||
|
||||
#ifndef REDDITCATEGORY_H
|
||||
#define REDDITCATEGORY_H
|
||||
|
||||
#include "services/abstract/category.h"
|
||||
|
||||
class RedditCategory : public Category {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum class Type {
|
||||
Subscriptions = 1
|
||||
};
|
||||
|
||||
explicit RedditCategory(Type type = Type::Subscriptions, RootItem* parent_item = nullptr);
|
||||
|
||||
Type type() const;
|
||||
|
||||
private:
|
||||
void updateTitle();
|
||||
|
||||
private:
|
||||
Type m_type;
|
||||
};
|
||||
|
||||
#endif // REDDITCATEGORY_H
|
@ -11,6 +11,7 @@
|
||||
#include "services/abstract/recyclebin.h"
|
||||
#include "services/reddit/definitions.h"
|
||||
#include "services/reddit/gui/formeditredditaccount.h"
|
||||
#include "services/reddit/redditcategory.h"
|
||||
#include "services/reddit/redditentrypoint.h"
|
||||
#include "services/reddit/redditnetworkfactory.h"
|
||||
|
||||
@ -93,7 +94,7 @@ bool RedditServiceRoot::supportsCategoryAdding() const {
|
||||
|
||||
void RedditServiceRoot::start(bool freshly_activated) {
|
||||
if (!freshly_activated) {
|
||||
DatabaseQueries::loadFromDatabase<Category, Feed>(this);
|
||||
DatabaseQueries::loadFromDatabase<RedditCategory, Feed>(this);
|
||||
loadCacheFromFile();
|
||||
}
|
||||
|
||||
|
11
src/librssguard/services/reddit/redditsubscription.cpp
Executable file
11
src/librssguard/services/reddit/redditsubscription.cpp
Executable file
@ -0,0 +1,11 @@
|
||||
// For license of this file, see <project-root-folder>/LICENSE.md.
|
||||
|
||||
#include "services/reddit/redditsubscription.h"
|
||||
|
||||
#include "services/reddit/redditserviceroot.h"
|
||||
|
||||
RedditSubscription::RedditSubscription(RootItem* parent) : Feed(parent) {}
|
||||
|
||||
RedditServiceRoot* RedditSubscription::serviceRoot() const {
|
||||
return qobject_cast<RedditServiceRoot*>(getParentServiceRoot());
|
||||
}
|
19
src/librssguard/services/reddit/redditsubscription.h
Executable file
19
src/librssguard/services/reddit/redditsubscription.h
Executable file
@ -0,0 +1,19 @@
|
||||
// For license of this file, see <project-root-folder>/LICENSE.md.
|
||||
|
||||
#ifndef REDDITSUBSCRIPTION_H
|
||||
#define REDDITSUBSCRIPTION_H
|
||||
|
||||
#include "services/abstract/feed.h"
|
||||
|
||||
class RedditServiceRoot;
|
||||
|
||||
class RedditSubscription : public Feed {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit RedditSubscription(RootItem* parent = nullptr);
|
||||
|
||||
RedditServiceRoot* serviceRoot() const;
|
||||
};
|
||||
|
||||
#endif // REDDITSUBSCRIPTION_H
|
Loading…
x
Reference in New Issue
Block a user