Load gmail accs.

This commit is contained in:
Martin Rotter 2017-10-17 14:23:48 +02:00
parent 29be179ea1
commit 9e6a5d00be
3 changed files with 20 additions and 18 deletions

View File

@ -22,7 +22,6 @@
#include "miscellaneous/iconfactory.h" #include "miscellaneous/iconfactory.h"
#include "miscellaneous/textfactory.h" #include "miscellaneous/textfactory.h"
#include "services/abstract/category.h" #include "services/abstract/category.h"
#include "services/inoreader/definitions.h"
#include "services/owncloud/definitions.h" #include "services/owncloud/definitions.h"
#include "services/owncloud/network/owncloudnetworkfactory.h" #include "services/owncloud/network/owncloudnetworkfactory.h"
#include "services/owncloud/owncloudfeed.h" #include "services/owncloud/owncloudfeed.h"
@ -36,6 +35,9 @@
#if defined(USE_WEBENGINE) #if defined(USE_WEBENGINE)
#include "network-web/oauth2service.h" #include "network-web/oauth2service.h"
#include "services/gmail/gmailserviceroot.h"
#include "services/gmail/network/gmailnetworkfactory.h"
#include "services/inoreader/definitions.h"
#include "services/inoreader/inoreaderfeed.h" #include "services/inoreader/inoreaderfeed.h"
#include "services/inoreader/inoreaderserviceroot.h" #include "services/inoreader/inoreaderserviceroot.h"
#include "services/inoreader/network/inoreadernetworkfactory.h" #include "services/inoreader/network/inoreadernetworkfactory.h"
@ -1499,18 +1501,18 @@ QList<ServiceRoot*> DatabaseQueries::getGmailAccounts(QSqlDatabase db, bool* ok)
if (query.exec("SELECT * FROM GmailAccounts;")) { if (query.exec("SELECT * FROM GmailAccounts;")) {
while (query.next()) { while (query.next()) {
/*GmailServiceRoot* root = new GmailServiceRoot(nullptr); GmailServiceRoot* root = new GmailServiceRoot(nullptr);
root->setId(query.value(0).toInt()); root->setId(query.value(0).toInt());
root->setAccountId(query.value(0).toInt()); root->setAccountId(query.value(0).toInt());
root->network()->setUsername(query.value(1).toString()); root->network()->setUsername(query.value(1).toString());
root->network()->oauth()->setClientId(query.value(2).toString()); root->network()->oauth()->setClientId(query.value(2).toString());
root->network()->oauth()->setClientSecret(query.value(3).toString()); root->network()->oauth()->setClientSecret(query.value(3).toString());
root->network()->oauth()->setRedirectUrl(query.value(4).toString()); root->network()->oauth()->setRedirectUrl(query.value(4).toString());
root->network()->oauth()->setRefreshToken(query.value(5).toString()); root->network()->oauth()->setRefreshToken(query.value(5).toString());
root->network()->setBatchSize(query.value(6).toInt()); root->network()->setBatchSize(query.value(6).toInt());
root->updateTitle(); root->updateTitle();
roots.append(root);*/ roots.append(root);
} }
if (ok != nullptr) { if (ok != nullptr) {

View File

@ -17,8 +17,8 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>. // along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
#ifndef INOREADERSERVICEROOT_H #ifndef GMAILSERVICEROOT_H
#define INOREADERSERVICEROOT_H #define GMAILSERVICEROOT_H
#include "services/abstract/cacheforserviceroot.h" #include "services/abstract/cacheforserviceroot.h"
#include "services/abstract/serviceroot.h" #include "services/abstract/serviceroot.h"
@ -75,4 +75,4 @@ inline GmailNetworkFactory* GmailServiceRoot::network() const {
return m_network; return m_network;
} }
#endif // INOREADERSERVICEROOT_H #endif // GMAILSERVICEROOT_H

View File

@ -16,8 +16,8 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>. // along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
#ifndef INOREADERNETWORKFACTORY_H #ifndef GMAILNETWORKFACTORY_H
#define INOREADERNETWORKFACTORY_H #define GMAILNETWORKFACTORY_H
#include <QObject> #include <QObject>
@ -75,4 +75,4 @@ class GmailNetworkFactory : public QObject {
OAuth2Service* m_oauth2; OAuth2Service* m_oauth2;
}; };
#endif // INOREADERNETWORKFACTORY_H #endif // GMAILNETWORKFACTORY_H