Added empty gmail entry point.

This commit is contained in:
Martin Rotter 2017-10-16 14:36:53 +02:00
parent a10a78ab47
commit 67254d209c
8 changed files with 172 additions and 45 deletions

View File

@ -497,7 +497,9 @@ equals(USE_WEBENGINE, true) {
src/services/inoreader/gui/formeditinoreaderaccount.h \
src/services/inoreader/inoreaderfeed.h \
src/network-web/oauth2service.h \
src/gui/dialogs/oauthlogin.h
src/gui/dialogs/oauthlogin.h \
src/services/gmail/definitions.h \
src/services/gmail/gmailentrypoint.h
SOURCES += src/gui/locationlineedit.cpp \
src/gui/webviewer.cpp \
@ -512,7 +514,8 @@ equals(USE_WEBENGINE, true) {
src/services/inoreader/gui/formeditinoreaderaccount.cpp \
src/services/inoreader/inoreaderfeed.cpp \
src/network-web/oauth2service.cpp \
src/gui/dialogs/oauthlogin.cpp
src/gui/dialogs/oauthlogin.cpp \
src/services/gmail/gmailentrypoint.cpp
# Add AdBlock sources.
HEADERS += src/network-web/adblock/adblockaddsubscriptiondialog.h \

View File

@ -25,6 +25,7 @@
#define SERVICE_CODE_TT_RSS "tt-rss"
#define SERVICE_CODE_OWNCLOUD "owncloud"
#define SERVICE_CODE_INOREADER "inoreader"
#define SERVICE_CODE_GMAIL "gmail"
#define ARGUMENTS_LIST_SEPARATOR "\n"

View File

@ -21,6 +21,7 @@
#include "services/abstract/serviceroot.h"
#if defined(USE_WEBENGINE)
#include "services/gmail/gmailentrypoint.h"
#include "services/inoreader/inoreaderentrypoint.h"
#endif
@ -70,6 +71,7 @@ QList<ServiceEntryPoint*> FeedReader::feedServices() {
if (m_feedServices.isEmpty()) {
// NOTE: All installed services create their entry points here.
#if defined(USE_WEBENGINE)
m_feedServices.append(new GmailEntryPoint());
m_feedServices.append(new InoreaderEntryPoint());
#endif
m_feedServices.append(new OwnCloudServiceEntryPoint());

View File

@ -289,7 +289,8 @@ void OAuth2Service::killRefreshTimer() {
void OAuth2Service::retrieveAuthCode() {
QString auth_url = m_authUrl + QString("?client_id=%1&scope=%2&"
"redirect_uri=%3&response_type=code&state=abcdef").arg(m_clientId,
"redirect_uri=%3&response_type=code&state=abcdef&"
"prompt=consent&access_type=offline").arg(m_clientId,
m_scope,
m_redirectUrl);
OAuthLogin login_page(qApp->mainFormWidget());

View File

@ -0,0 +1,22 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2017 by Martin Rotter <rotter.martinos@gmail.com>
//
// RSS Guard is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// RSS Guard is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
#ifndef GMAIL_DEFINITIONS_H
#define GMAIL_DEFINITIONS_H
#endif // GMAIL_DEFINITIONS_H

View File

@ -0,0 +1,61 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2017 by Martin Rotter <rotter.martinos@gmail.com>
//
// RSS Guard is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// RSS Guard is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
#include "services/gmail/gmailentrypoint.h"
#include "definitions/definitions.h"
#include "miscellaneous/application.h"
#include "miscellaneous/databasequeries.h"
#include "miscellaneous/iconfactory.h"
#include "services/gmail/definitions.h"
ServiceRoot* GmailEntryPoint::createNewRoot() const {
return nullptr;
}
QList<ServiceRoot*> GmailEntryPoint::initializeSubtree() const {
QSqlDatabase database = qApp->database()->connection(QSL("GmailEntryPoint"), DatabaseFactory::FromSettings);
return QList<ServiceRoot*>();
//return DatabaseQueries::getInoreaderAccounts(database);
}
bool GmailEntryPoint::isSingleInstanceService() const {
return false;
}
QString GmailEntryPoint::name() const {
return QSL("Gmail (not yet implemented)");
}
QString GmailEntryPoint::code() const {
return SERVICE_CODE_GMAIL;
}
QString GmailEntryPoint::description() const {
return QObject::tr("Simple Gmail integration via JSON API. Allows sending e-mails too.");
}
QString GmailEntryPoint::author() const {
return APP_AUTHOR;
}
QIcon GmailEntryPoint::icon() const {
return qApp->icons()->miscIcon(QSL("gmail"));
}

View File

@ -0,0 +1,37 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2017 by Martin Rotter <rotter.martinos@gmail.com>
//
// RSS Guard is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// RSS Guard is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
#ifndef GMAILENTRYPOINT_H
#define GMAILENTRYPOINT_H
#include "services/abstract/serviceentrypoint.h"
class GmailEntryPoint : public ServiceEntryPoint {
public:
ServiceRoot* createNewRoot() const;
QList<ServiceRoot*> initializeSubtree() const;
bool isSingleInstanceService() const;
QString name() const;
QString code() const;
QString description() const;
QString author() const;
QIcon icon() const;
};
#endif // GMAILENTRYPOINT_H