This commit is contained in:
Martin Rotter 2024-03-20 08:06:58 +01:00 committed by martinrotter
parent 4f1386a837
commit 6713925658
35 changed files with 208 additions and 125 deletions

View file

@ -326,6 +326,7 @@ add_subdirectory(localization)
add_subdirectory(src/librssguard-standard)
add_subdirectory(src/librssguard-feedly)
add_subdirectory(src/librssguard-gmail)
add_subdirectory(src/librssguard-greader)
# GUI executable.
add_subdirectory(src/rssguard)

View file

@ -49,7 +49,3 @@ QString FeedlyEntryPoint::author() const {
QIcon FeedlyEntryPoint::icon() const {
return qApp->icons()->miscIcon(QSL("feedly"));
}
bool FeedlyEntryPoint::isDynamicallyLoaded() const {
return true;
}

View file

@ -21,7 +21,6 @@ class FeedlyEntryPoint : public QObject, public ServiceEntryPoint {
virtual QString description() const;
virtual QString author() const;
virtual QIcon icon() const;
virtual bool isDynamicallyLoaded() const;
};
#endif // FEEDLYENTRYPOINT_H

View file

@ -49,7 +49,3 @@ QString GmailEntryPoint::author() const {
QIcon GmailEntryPoint::icon() const {
return qApp->icons()->miscIcon(QSL("gmail"));
}
bool GmailEntryPoint::isDynamicallyLoaded() const {
return true;
}

View file

@ -21,7 +21,6 @@ class GmailEntryPoint : public QObject, public ServiceEntryPoint {
virtual QString description() const;
virtual QString author() const;
virtual QIcon icon() const;
virtual bool isDynamicallyLoaded() const;
};
#endif // GMAILENTRYPOINT_H

View file

@ -0,0 +1,84 @@
if(NOT DEFINED LIBRSSGUARD_BINARY_PATH)
set(LIBRSSGUARD_SOURCE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..")
endif()
set(SOURCES
src/definitions.h
src/greaderentrypoint.cpp
src/greaderentrypoint.h
src/greaderfeed.cpp
src/greaderfeed.h
src/greadernetwork.cpp
src/greadernetwork.h
src/greaderserviceroot.cpp
src/greaderserviceroot.h
src/gui/formeditgreaderaccount.cpp
src/gui/formeditgreaderaccount.h
src/gui/formgreaderfeeddetails.cpp
src/gui/formgreaderfeeddetails.h
src/gui/greaderaccountdetails.cpp
src/gui/greaderaccountdetails.h
src/gui/greaderfeeddetails.cpp
src/gui/greaderfeeddetails.h
)
set(UI_FILES
src/gui/greaderaccountdetails.ui
src/gui/greaderfeeddetails.ui
)
# Deal with .ui files.
qt_wrap_ui(SOURCES ${UI_FILES})
# Bundle version info.
if(WIN32)
enable_language("RC")
list(APPEND SOURCES "${CMAKE_BINARY_DIR}/rssguard.rc")
endif()
add_library(rssguard-greader SHARED ${SOURCES} ${QM_FILES})
# Add specific definitions.
target_compile_definitions(rssguard-greader
PRIVATE
RSSGUARD_DLLSPEC=Q_DECL_IMPORT
RSSGUARD_DLLSPEC_EXPORT=Q_DECL_EXPORT
)
target_include_directories(rssguard-greader
PUBLIC
${LIBRSSGUARD_SOURCE_PATH}
src/3rd-party/richtexteditor
)
# Qt.
target_link_libraries(rssguard-greader PUBLIC
rssguard
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Network
Qt${QT_VERSION_MAJOR}::Qml
Qt${QT_VERSION_MAJOR}::Sql
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Xml
Qt${QT_VERSION_MAJOR}::Concurrent
)
#if(QT_VERSION_MAJOR EQUAL 6)
# target_link_libraries(rssguard-feedly PUBLIC
# Qt${QT_VERSION_MAJOR}::Core5Compat
# )
#endif()
if(WIN32 OR OS2)
install(TARGETS rssguard-greader DESTINATION plugins)
elseif(UNIX AND NOT APPLE AND NOT ANDROID)
include (GNUInstallDirs)
install(TARGETS rssguard-greader
DESTINATION ${CMAKE_INSTALL_LIBDIR}/rssguard
)
elseif(APPLE)
install(TARGETS rssguard-greader
DESTINATION Contents/MacOS
)
endif()

View file

@ -0,0 +1,5 @@
{
"name": "Google Reader API",
"author": "Martin Rotter",
"website": "https://github.com/martinrotter/rssguard"
}

View file

@ -1,13 +1,20 @@
// For license of this file, see <project-root-folder>/LICENSE.md.
#include "services/greader/greaderentrypoint.h"
#include "src/greaderentrypoint.h"
#include "database/databasequeries.h"
#include "definitions/definitions.h"
#include "miscellaneous/application.h"
#include "miscellaneous/iconfactory.h"
#include "services/greader/greaderserviceroot.h"
#include "services/greader/gui/formeditgreaderaccount.h"
#include "src/greaderserviceroot.h"
#include "src/gui/formeditgreaderaccount.h"
#include <librssguard/database/databasequeries.h>
#include <librssguard/definitions/definitions.h>
#include <librssguard/miscellaneous/application.h>
#include <librssguard/miscellaneous/iconfactory.h>
GreaderEntryPoint::GreaderEntryPoint(QObject* parent) : QObject(parent) {}
GreaderEntryPoint::~GreaderEntryPoint() {
qDebugNN << LOGSEC_CORE << "Destructing" << QUOTE_W_SPACE(QSL(SERVICE_CODE_GREADER)) << "plugin.";
}
ServiceRoot* GreaderEntryPoint::createNewRoot() const {
FormEditGreaderAccount form_acc(qApp->mainFormWidget());

View file

@ -3,10 +3,17 @@
#ifndef GREADERENTRYPOINT_H
#define GREADERENTRYPOINT_H
#include "services/abstract/serviceentrypoint.h"
#include <librssguard/services/abstract/serviceentrypoint.h>
class GreaderEntryPoint : public QObject, public ServiceEntryPoint {
Q_OBJECT
Q_PLUGIN_METADATA(IID "io.github.martinrotter.rssguard.greader" FILE "plugin.json")
Q_INTERFACES(ServiceEntryPoint)
class GreaderEntryPoint : public ServiceEntryPoint {
public:
explicit GreaderEntryPoint(QObject* parent = nullptr);
virtual ~GreaderEntryPoint();
virtual ServiceRoot* createNewRoot() const;
virtual QList<ServiceRoot*> initializeSubtree() const;
virtual QString name() const;

View file

@ -1,14 +1,15 @@
// For license of this file, see <project-root-folder>/LICENSE.md.
#include "services/greader/greaderfeed.h"
#include "src/greaderfeed.h"
#include "database/databasequeries.h"
#include "definitions/definitions.h"
#include "miscellaneous/application.h"
#include "miscellaneous/iconfactory.h"
#include "services/greader/definitions.h"
#include "services/greader/greadernetwork.h"
#include "services/greader/greaderserviceroot.h"
#include "src/definitions.h"
#include "src/greadernetwork.h"
#include "src/greaderserviceroot.h"
#include <librssguard/database/databasequeries.h>
#include <librssguard/definitions/definitions.h>
#include <librssguard/miscellaneous/application.h>
#include <librssguard/miscellaneous/iconfactory.h>
#include <QPointer>

View file

@ -3,7 +3,7 @@
#ifndef GREADERFEED_H
#define GREADERFEED_H
#include "services/abstract/feed.h"
#include <librssguard/services/abstract/feed.h>
class GreaderServiceRoot;

View file

@ -1,22 +1,21 @@
// For license of this file, see <project-root-folder>/LICENSE.md.
#include "services/greader/greadernetwork.h"
#include "src/greadernetwork.h"
#include "3rd-party/boolinq/boolinq.h"
#include "database/databasequeries.h"
#include "exceptions/applicationexception.h"
#include "exceptions/feedfetchexception.h"
#include "exceptions/networkexception.h"
#include "miscellaneous/application.h"
#include "miscellaneous/settings.h"
#include "network-web/networkfactory.h"
#include "network-web/oauth2service.h"
#include "network-web/webfactory.h"
#include "services/abstract/category.h"
#include "services/abstract/label.h"
#include "services/abstract/labelsnode.h"
#include "services/greader/definitions.h"
#include "services/greader/greaderfeed.h"
#include "src/definitions.h"
#include "src/greaderfeed.h"
#include <librssguard/3rd-party/boolinq/boolinq.h>
#include <librssguard/database/databasequeries.h>
#include <librssguard/exceptions/applicationexception.h>
#include <librssguard/exceptions/feedfetchexception.h>
#include <librssguard/exceptions/networkexception.h>
#include <librssguard/miscellaneous/application.h>
#include <librssguard/miscellaneous/settings.h>
#include <librssguard/network-web/networkfactory.h>
#include <librssguard/network-web/oauth2service.h>
#include <librssguard/network-web/webfactory.h>
#include <librssguard/services/abstract/labelsnode.h>
#include <QJsonArray>
#include <QJsonDocument>

View file

@ -3,9 +3,9 @@
#ifndef GREADERNETWORK_H
#define GREADERNETWORK_H
#include "network-web/networkfactory.h"
#include "services/abstract/feed.h"
#include "services/greader/greaderserviceroot.h"
#include "src/greaderserviceroot.h"
#include <librssguard/network-web/networkfactory.h>
#include <QObject>

View file

@ -1,21 +1,22 @@
// For license of this file, see <project-root-folder>/LICENSE.md.
#include "services/greader/greaderserviceroot.h"
#include "src/greaderserviceroot.h"
#include "database/databasequeries.h"
#include "definitions/definitions.h"
#include "gui/messagebox.h"
#include "miscellaneous/application.h"
#include "miscellaneous/iconfactory.h"
#include "miscellaneous/mutex.h"
#include "miscellaneous/textfactory.h"
#include "network-web/oauth2service.h"
#include "services/greader/definitions.h"
#include "services/greader/greaderentrypoint.h"
#include "services/greader/greaderfeed.h"
#include "services/greader/greadernetwork.h"
#include "services/greader/gui/formeditgreaderaccount.h"
#include "services/greader/gui/formgreaderfeeddetails.h"
#include "src/definitions.h"
#include "src/greaderentrypoint.h"
#include "src/greaderfeed.h"
#include "src/greadernetwork.h"
#include "src/gui/formeditgreaderaccount.h"
#include "src/gui/formgreaderfeeddetails.h"
#include <librssguard/database/databasequeries.h>
#include <librssguard/definitions/definitions.h>
#include <librssguard/gui/messagebox.h>
#include <librssguard/miscellaneous/application.h>
#include <librssguard/miscellaneous/iconfactory.h>
#include <librssguard/miscellaneous/mutex.h>
#include <librssguard/miscellaneous/textfactory.h>
#include <librssguard/network-web/oauth2service.h>
#include <QFileDialog>

View file

@ -3,8 +3,8 @@
#ifndef GREADERSERVICEROOT_H
#define GREADERSERVICEROOT_H
#include "services/abstract/cacheforserviceroot.h"
#include "services/abstract/serviceroot.h"
#include <librssguard/services/abstract/cacheforserviceroot.h>
#include <librssguard/services/abstract/serviceroot.h>
class GreaderNetwork;

View file

@ -1,12 +1,13 @@
// For license of this file, see <project-root-folder>/LICENSE.md.
#include "services/greader/gui/formeditgreaderaccount.h"
#include "src/gui/formeditgreaderaccount.h"
#include "miscellaneous/iconfactory.h"
#include "network-web/oauth2service.h"
#include "services/greader/greadernetwork.h"
#include "services/greader/greaderserviceroot.h"
#include "services/greader/gui/greaderaccountdetails.h"
#include "src/greadernetwork.h"
#include "src/greaderserviceroot.h"
#include "src/gui/greaderaccountdetails.h"
#include <librssguard/miscellaneous/iconfactory.h>
#include <librssguard/network-web/oauth2service.h>
FormEditGreaderAccount::FormEditGreaderAccount(QWidget* parent)
: FormAccountDetails(qApp->icons()->miscIcon(QSL("google")), parent), m_details(new GreaderAccountDetails(this)) {

View file

@ -3,7 +3,7 @@
#ifndef FORMEDITGREADERACCOUNT_H
#define FORMEDITGREADERACCOUNT_H
#include "services/abstract/gui/formaccountdetails.h"
#include <librssguard/services/abstract/gui/formaccountdetails.h>
class GreaderAccountDetails;
class GreaderServiceRoot;

View file

@ -1,15 +1,16 @@
// For license of this file, see <project-root-folder>/LICENSE.md.
#include "services/greader/gui/formgreaderfeeddetails.h"
#include "src/gui/formgreaderfeeddetails.h"
#include "database/databasequeries.h"
#include "exceptions/applicationexception.h"
#include "miscellaneous/application.h"
#include "services/greader/definitions.h"
#include "services/greader/greaderfeed.h"
#include "services/greader/greadernetwork.h"
#include "services/greader/greaderserviceroot.h"
#include "services/greader/gui/greaderfeeddetails.h"
#include "src/definitions.h"
#include "src/greaderfeed.h"
#include "src/greadernetwork.h"
#include "src/greaderserviceroot.h"
#include "src/gui/greaderfeeddetails.h"
#include <librssguard/database/databasequeries.h>
#include <librssguard/exceptions/applicationexception.h>
#include <librssguard/miscellaneous/application.h>
#include <QMimeData>
#include <QTimer>

View file

@ -3,7 +3,7 @@
#ifndef FORMGREADERFEEDDETAILS_H
#define FORMGREADERFEEDDETAILS_H
#include "services/abstract/gui/formfeeddetails.h"
#include <librssguard/services/abstract/gui/formfeeddetails.h>
class GreaderFeed;
class GreaderFeedDetails;

View file

@ -1,15 +1,16 @@
// For license of this file, see <project-root-folder>/LICENSE.md.
#include "services/greader/gui/greaderaccountdetails.h"
#include "src/gui/greaderaccountdetails.h"
#include "definitions/definitions.h"
#include "exceptions/applicationexception.h"
#include "miscellaneous/application.h"
#include "miscellaneous/iconfactory.h"
#include "network-web/oauth2service.h"
#include "network-web/webfactory.h"
#include "services/greader/definitions.h"
#include "services/greader/greadernetwork.h"
#include "src/definitions.h"
#include "src/greadernetwork.h"
#include <librssguard/definitions/definitions.h>
#include <librssguard/exceptions/applicationexception.h>
#include <librssguard/miscellaneous/application.h>
#include <librssguard/miscellaneous/iconfactory.h>
#include <librssguard/network-web/oauth2service.h>
#include <librssguard/network-web/webfactory.h>
#include <QMetaEnum>
#include <QVariantHash>

View file

@ -3,7 +3,7 @@
#ifndef GREADERACCOUNTDETAILS_H
#define GREADERACCOUNTDETAILS_H
#include "services/greader/greaderserviceroot.h"
#include "src/greaderserviceroot.h"
#include "ui_greaderaccountdetails.h"

View file

@ -1,9 +1,11 @@
// For license of this file, see <project-root-folder>/LICENSE.md.
#include "services/greader/gui/greaderfeeddetails.h"
#include "src/gui/greaderfeeddetails.h"
#include "definitions/definitions.h"
#include "services/abstract/category.h"
#include <librssguard/definitions/definitions.h>
#include <librssguard/services/abstract/category.h>
#include <librssguard/services/abstract/labelsnode.h>
#include <librssguard/services/abstract/rootitem.h>
GreaderFeedDetails::GreaderFeedDetails(QWidget* parent) : QWidget(parent) {
ui.setupUi(this);

View file

@ -48,7 +48,3 @@ QList<ServiceRoot*> StandardServiceEntryPoint::initializeSubtree() const {
return DatabaseQueries::getAccounts<StandardServiceRoot>(database, code());
}
bool StandardServiceEntryPoint::isDynamicallyLoaded() const {
return true;
}

View file

@ -21,7 +21,6 @@ class RSSGUARD_DLLSPEC_EXPORT StandardServiceEntryPoint : public QObject, public
virtual QString code() const;
virtual ServiceRoot* createNewRoot() const;
virtual QList<ServiceRoot*> initializeSubtree() const;
virtual bool isDynamicallyLoaded() const;
};
#endif // STANDARDSERVICEENTRYPOINT_H

View file

@ -324,23 +324,6 @@ set(SOURCES
services/abstract/serviceroot.h
services/abstract/unreadnode.cpp
services/abstract/unreadnode.h
services/greader/definitions.h
services/greader/greaderentrypoint.cpp
services/greader/greaderentrypoint.h
services/greader/greaderfeed.cpp
services/greader/greaderfeed.h
services/greader/greadernetwork.cpp
services/greader/greadernetwork.h
services/greader/greaderserviceroot.cpp
services/greader/greaderserviceroot.h
services/greader/gui/formeditgreaderaccount.cpp
services/greader/gui/formeditgreaderaccount.h
services/greader/gui/formgreaderfeeddetails.cpp
services/greader/gui/formgreaderfeeddetails.h
services/greader/gui/greaderaccountdetails.cpp
services/greader/gui/greaderaccountdetails.h
services/greader/gui/greaderfeeddetails.cpp
services/greader/gui/greaderfeeddetails.h
services/owncloud/definitions.h
services/owncloud/gui/formeditowncloudaccount.cpp
services/owncloud/gui/formeditowncloudaccount.h
@ -432,8 +415,6 @@ set(UI_FILES
services/abstract/gui/formaddeditprobe.ui
services/abstract/gui/formcategorydetails.ui
services/abstract/gui/formfeeddetails.ui
services/greader/gui/greaderaccountdetails.ui
services/greader/gui/greaderfeeddetails.ui
services/owncloud/gui/owncloudaccountdetails.ui
services/reddit/gui/redditaccountdetails.ui
services/tt-rss/gui/formttrssnote.ui

View file

@ -5,7 +5,7 @@
#include <QLineEdit>
class BaseLineEdit : public QLineEdit {
class RSSGUARD_DLLSPEC BaseLineEdit : public QLineEdit {
Q_OBJECT
public:

View file

@ -5,7 +5,7 @@
#include <QTreeView>
class BaseTreeView : public QTreeView {
class RSSGUARD_DLLSPEC BaseTreeView : public QTreeView {
Q_OBJECT
public:

View file

@ -5,7 +5,7 @@
#include <QStackedWidget>
class ResizableStackedWidget : public QStackedWidget {
class RSSGUARD_DLLSPEC ResizableStackedWidget : public QStackedWidget {
public:
explicit ResizableStackedWidget(QWidget* parent = nullptr);

View file

@ -16,7 +16,6 @@
#include "miscellaneous/settings.h"
#include "services/abstract/cacheforserviceroot.h"
#include "services/abstract/serviceroot.h"
#include "services/greader/greaderentrypoint.h"
#include "services/owncloud/owncloudserviceentrypoint.h"
#include "services/reddit/redditentrypoint.h"
#include "services/tt-rss/ttrssserviceentrypoint.h"
@ -67,7 +66,6 @@ FeedReader::~FeedReader() {
QList<ServiceEntryPoint*> FeedReader::feedServices() {
if (m_feedServices.isEmpty()) {
m_feedServices.append(new GreaderEntryPoint());
m_feedServices.append(new OwnCloudServiceEntryPoint());
#if !defined(NDEBUG)

View file

@ -45,6 +45,7 @@ QList<ServiceEntryPoint*> PluginFactory::loadPlugins() const {
else {
qDebugNN << LOGSEC_CORE << "Plugin" << QUOTE_W_SPACE(plugin_file.absoluteFilePath()) << "loaded.";
plugin_instance->setIsDynamicallyLoaded(true);
plugins.append(plugin_instance);
}
}

View file

@ -44,11 +44,19 @@ class RSSGUARD_DLLSPEC ServiceEntryPoint {
// Icon of the service.
virtual QIcon icon() const = 0;
virtual bool isDynamicallyLoaded() const;
bool isDynamicallyLoaded() const;
void setIsDynamicallyLoaded(bool dynamic);
private:
bool m_isDynamicallyLoaded = false;
};
inline bool ServiceEntryPoint::isDynamicallyLoaded() const {
return false;
return m_isDynamicallyLoaded;
}
inline void ServiceEntryPoint::setIsDynamicallyLoaded(bool dynamic) {
m_isDynamicallyLoaded = dynamic;
}
Q_DECLARE_INTERFACE(ServiceEntryPoint, "io.github.martinrotter.rssguard.serviceentrypoint")