parent
d7d3be2914
commit
139e014d2a
@ -12,6 +12,7 @@
|
|||||||
<file>sql/db_update_mysql_9_10.sql</file>
|
<file>sql/db_update_mysql_9_10.sql</file>
|
||||||
<file>sql/db_update_mysql_10_11.sql</file>
|
<file>sql/db_update_mysql_10_11.sql</file>
|
||||||
<file>sql/db_update_mysql_11_12.sql</file>
|
<file>sql/db_update_mysql_11_12.sql</file>
|
||||||
|
<file>sql/db_update_mysql_12_13.sql</file>
|
||||||
|
|
||||||
<file>sql/db_init_sqlite.sql</file>
|
<file>sql/db_init_sqlite.sql</file>
|
||||||
<file>sql/db_update_sqlite_1_2.sql</file>
|
<file>sql/db_update_sqlite_1_2.sql</file>
|
||||||
@ -25,5 +26,6 @@
|
|||||||
<file>sql/db_update_sqlite_9_10.sql</file>
|
<file>sql/db_update_sqlite_9_10.sql</file>
|
||||||
<file>sql/db_update_sqlite_10_11.sql</file>
|
<file>sql/db_update_sqlite_10_11.sql</file>
|
||||||
<file>sql/db_update_sqlite_11_12.sql</file>
|
<file>sql/db_update_sqlite_11_12.sql</file>
|
||||||
|
<file>sql/db_update_sqlite_12_13.sql</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS Information (
|
|||||||
inf_value TEXT NOT NULL
|
inf_value TEXT NOT NULL
|
||||||
);
|
);
|
||||||
-- !
|
-- !
|
||||||
INSERT INTO Information VALUES (1, 'schema_version', '12');
|
INSERT INTO Information VALUES (1, 'schema_version', '13');
|
||||||
-- !
|
-- !
|
||||||
CREATE TABLE IF NOT EXISTS Accounts (
|
CREATE TABLE IF NOT EXISTS Accounts (
|
||||||
id INTEGER PRIMARY KEY,
|
id INTEGER PRIMARY KEY,
|
||||||
@ -28,6 +28,7 @@ CREATE TABLE IF NOT EXISTS TtRssAccounts (
|
|||||||
auth_password TEXT,
|
auth_password TEXT,
|
||||||
url TEXT NOT NULL,
|
url TEXT NOT NULL,
|
||||||
force_update INTEGER(1) NOT NULL DEFAULT 0 CHECK (force_update >= 0 AND force_update <= 1),
|
force_update INTEGER(1) NOT NULL DEFAULT 0 CHECK (force_update >= 0 AND force_update <= 1),
|
||||||
|
update_only_unread INTEGER(1) NOT NULL DEFAULT 0 CHECK (update_only_unread >= 0 AND update_only_unread <= 1),
|
||||||
|
|
||||||
FOREIGN KEY (id) REFERENCES Accounts (id)
|
FOREIGN KEY (id) REFERENCES Accounts (id)
|
||||||
);
|
);
|
||||||
|
@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS Information (
|
|||||||
inf_value TEXT NOT NULL
|
inf_value TEXT NOT NULL
|
||||||
);
|
);
|
||||||
-- !
|
-- !
|
||||||
INSERT INTO Information VALUES (1, 'schema_version', '12');
|
INSERT INTO Information VALUES (1, 'schema_version', '13');
|
||||||
-- !
|
-- !
|
||||||
CREATE TABLE IF NOT EXISTS Accounts (
|
CREATE TABLE IF NOT EXISTS Accounts (
|
||||||
id INTEGER PRIMARY KEY,
|
id INTEGER PRIMARY KEY,
|
||||||
@ -22,6 +22,7 @@ CREATE TABLE IF NOT EXISTS TtRssAccounts (
|
|||||||
auth_password TEXT,
|
auth_password TEXT,
|
||||||
url TEXT NOT NULL,
|
url TEXT NOT NULL,
|
||||||
force_update INTEGER(1) NOT NULL CHECK (force_update >= 0 AND force_update <= 1) DEFAULT 0,
|
force_update INTEGER(1) NOT NULL CHECK (force_update >= 0 AND force_update <= 1) DEFAULT 0,
|
||||||
|
update_only_unread INTEGER(1) NOT NULL CHECK (update_only_unread >= 0 AND update_only_unread <= 1) DEFAULT 0,
|
||||||
|
|
||||||
FOREIGN KEY (id) REFERENCES Accounts (id)
|
FOREIGN KEY (id) REFERENCES Accounts (id)
|
||||||
);
|
);
|
||||||
|
@ -113,7 +113,7 @@
|
|||||||
#define APP_DB_SQLITE_FILE "database.db"
|
#define APP_DB_SQLITE_FILE "database.db"
|
||||||
|
|
||||||
// Keep this in sync with schema versions declared in SQL initialization code.
|
// Keep this in sync with schema versions declared in SQL initialization code.
|
||||||
#define APP_DB_SCHEMA_VERSION "12"
|
#define APP_DB_SCHEMA_VERSION "13"
|
||||||
#define APP_DB_UPDATE_FILE_PATTERN "db_update_%1_%2_%3.sql"
|
#define APP_DB_UPDATE_FILE_PATTERN "db_update_%1_%2_%3.sql"
|
||||||
#define APP_DB_COMMENT_SPLIT "-- !\n"
|
#define APP_DB_COMMENT_SPLIT "-- !\n"
|
||||||
#define APP_DB_NAME_PLACEHOLDER "##"
|
#define APP_DB_NAME_PLACEHOLDER "##"
|
||||||
|
@ -898,7 +898,6 @@ QStringList DatabaseQueries::customIdsOfMessagesFromFeed(const QSqlDatabase& db,
|
|||||||
|
|
||||||
QList<ServiceRoot*> DatabaseQueries::getOwnCloudAccounts(const QSqlDatabase& db, bool* ok) {
|
QList<ServiceRoot*> DatabaseQueries::getOwnCloudAccounts(const QSqlDatabase& db, bool* ok) {
|
||||||
QSqlQuery query(db);
|
QSqlQuery query(db);
|
||||||
|
|
||||||
QList<ServiceRoot*> roots;
|
QList<ServiceRoot*> roots;
|
||||||
|
|
||||||
if (query.exec("SELECT * FROM OwnCloudAccounts;")) {
|
if (query.exec("SELECT * FROM OwnCloudAccounts;")) {
|
||||||
@ -933,7 +932,6 @@ QList<ServiceRoot*> DatabaseQueries::getOwnCloudAccounts(const QSqlDatabase& db,
|
|||||||
|
|
||||||
QList<ServiceRoot*> DatabaseQueries::getTtRssAccounts(const QSqlDatabase& db, bool* ok) {
|
QList<ServiceRoot*> DatabaseQueries::getTtRssAccounts(const QSqlDatabase& db, bool* ok) {
|
||||||
QSqlQuery query(db);
|
QSqlQuery query(db);
|
||||||
|
|
||||||
QList<ServiceRoot*> roots;
|
QList<ServiceRoot*> roots;
|
||||||
|
|
||||||
if (query.exec("SELECT * FROM TtRssAccounts;")) {
|
if (query.exec("SELECT * FROM TtRssAccounts;")) {
|
||||||
@ -949,6 +947,7 @@ QList<ServiceRoot*> DatabaseQueries::getTtRssAccounts(const QSqlDatabase& db, bo
|
|||||||
root->network()->setAuthPassword(TextFactory::decrypt(query.value(5).toString()));
|
root->network()->setAuthPassword(TextFactory::decrypt(query.value(5).toString()));
|
||||||
root->network()->setUrl(query.value(6).toString());
|
root->network()->setUrl(query.value(6).toString());
|
||||||
root->network()->setForceServerSideUpdate(query.value(7).toBool());
|
root->network()->setForceServerSideUpdate(query.value(7).toBool());
|
||||||
|
root->network()->setDownloadOnlyUnreadMessages(query.value(8).toBool());
|
||||||
root->updateTitle();
|
root->updateTitle();
|
||||||
roots.append(root);
|
roots.append(root);
|
||||||
}
|
}
|
||||||
@ -1298,8 +1297,8 @@ bool DatabaseQueries::editBaseFeed(const QSqlDatabase& db, int feed_id, Feed::Au
|
|||||||
|
|
||||||
QList<ServiceRoot*> DatabaseQueries::getAccounts(const QSqlDatabase& db, bool* ok) {
|
QList<ServiceRoot*> DatabaseQueries::getAccounts(const QSqlDatabase& db, bool* ok) {
|
||||||
QSqlQuery q(db);
|
QSqlQuery q(db);
|
||||||
|
|
||||||
QList<ServiceRoot*> roots;
|
QList<ServiceRoot*> roots;
|
||||||
|
|
||||||
q.setForwardOnly(true);
|
q.setForwardOnly(true);
|
||||||
q.prepare(QSL("SELECT id FROM Accounts WHERE type = :type;"));
|
q.prepare(QSL("SELECT id FROM Accounts WHERE type = :type;"));
|
||||||
q.bindValue(QSL(":type"), SERVICE_CODE_STD_RSS);
|
q.bindValue(QSL(":type"), SERVICE_CODE_STD_RSS);
|
||||||
@ -1419,14 +1418,17 @@ bool DatabaseQueries::deleteTtRssAccount(const QSqlDatabase& db, int account_id)
|
|||||||
return q.exec();
|
return q.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DatabaseQueries::overwriteTtRssAccount(const QSqlDatabase& db, const QString& username, const QString& password,
|
bool DatabaseQueries::overwriteTtRssAccount(const QSqlDatabase& db, const QString& username,
|
||||||
bool auth_protected, const QString& auth_username, const QString& auth_password,
|
const QString& password, bool auth_protected,
|
||||||
const QString& url, bool force_server_side_feed_update, int account_id) {
|
const QString& auth_username, const QString& auth_password,
|
||||||
|
const QString& url, bool force_server_side_feed_update,
|
||||||
|
bool download_only_unread_messages, int account_id) {
|
||||||
QSqlQuery q(db);
|
QSqlQuery q(db);
|
||||||
|
|
||||||
q.prepare("UPDATE TtRssAccounts "
|
q.prepare("UPDATE TtRssAccounts "
|
||||||
"SET username = :username, password = :password, url = :url, auth_protected = :auth_protected, "
|
"SET username = :username, password = :password, url = :url, auth_protected = :auth_protected, "
|
||||||
"auth_username = :auth_username, auth_password = :auth_password, force_update = :force_update "
|
"auth_username = :auth_username, auth_password = :auth_password, force_update = :force_update, "
|
||||||
|
"update_only_unread = :update_only_unread "
|
||||||
"WHERE id = :id;");
|
"WHERE id = :id;");
|
||||||
q.bindValue(QSL(":username"), username);
|
q.bindValue(QSL(":username"), username);
|
||||||
q.bindValue(QSL(":password"), TextFactory::encrypt(password));
|
q.bindValue(QSL(":password"), TextFactory::encrypt(password));
|
||||||
@ -1435,6 +1437,7 @@ bool DatabaseQueries::overwriteTtRssAccount(const QSqlDatabase& db, const QStrin
|
|||||||
q.bindValue(QSL(":auth_username"), auth_username);
|
q.bindValue(QSL(":auth_username"), auth_username);
|
||||||
q.bindValue(QSL(":auth_password"), TextFactory::encrypt(auth_password));
|
q.bindValue(QSL(":auth_password"), TextFactory::encrypt(auth_password));
|
||||||
q.bindValue(QSL(":force_update"), force_server_side_feed_update ? 1 : 0);
|
q.bindValue(QSL(":force_update"), force_server_side_feed_update ? 1 : 0);
|
||||||
|
q.bindValue(QSL(":update_only_unread"), download_only_unread_messages ? 1 : 0);
|
||||||
q.bindValue(QSL(":id"), account_id);
|
q.bindValue(QSL(":id"), account_id);
|
||||||
|
|
||||||
if (q.exec()) {
|
if (q.exec()) {
|
||||||
@ -1449,11 +1452,11 @@ bool DatabaseQueries::overwriteTtRssAccount(const QSqlDatabase& db, const QStrin
|
|||||||
bool DatabaseQueries::createTtRssAccount(const QSqlDatabase& db, int id_to_assign, const QString& username,
|
bool DatabaseQueries::createTtRssAccount(const QSqlDatabase& db, int id_to_assign, const QString& username,
|
||||||
const QString& password, bool auth_protected, const QString& auth_username,
|
const QString& password, bool auth_protected, const QString& auth_username,
|
||||||
const QString& auth_password, const QString& url,
|
const QString& auth_password, const QString& url,
|
||||||
bool force_server_side_feed_update) {
|
bool force_server_side_feed_update, bool download_only_unread_messages) {
|
||||||
QSqlQuery q(db);
|
QSqlQuery q(db);
|
||||||
|
|
||||||
q.prepare("INSERT INTO TtRssAccounts (id, username, password, auth_protected, auth_username, auth_password, url, force_update) "
|
q.prepare("INSERT INTO TtRssAccounts (id, username, password, auth_protected, auth_username, auth_password, url, force_update, update_only_unread) "
|
||||||
"VALUES (:id, :username, :password, :auth_protected, :auth_username, :auth_password, :url, :force_update);");
|
"VALUES (:id, :username, :password, :auth_protected, :auth_username, :auth_password, :url, :force_update, :update_only_unread);");
|
||||||
q.bindValue(QSL(":id"), id_to_assign);
|
q.bindValue(QSL(":id"), id_to_assign);
|
||||||
q.bindValue(QSL(":username"), username);
|
q.bindValue(QSL(":username"), username);
|
||||||
q.bindValue(QSL(":password"), TextFactory::encrypt(password));
|
q.bindValue(QSL(":password"), TextFactory::encrypt(password));
|
||||||
@ -1462,6 +1465,7 @@ bool DatabaseQueries::createTtRssAccount(const QSqlDatabase& db, int id_to_assig
|
|||||||
q.bindValue(QSL(":auth_password"), TextFactory::encrypt(auth_password));
|
q.bindValue(QSL(":auth_password"), TextFactory::encrypt(auth_password));
|
||||||
q.bindValue(QSL(":url"), url);
|
q.bindValue(QSL(":url"), url);
|
||||||
q.bindValue(QSL(":force_update"), force_server_side_feed_update ? 1 : 0);
|
q.bindValue(QSL(":force_update"), force_server_side_feed_update ? 1 : 0);
|
||||||
|
q.bindValue(QSL(":update_only_unread"), download_only_unread_messages ? 1 : 0);
|
||||||
|
|
||||||
if (q.exec()) {
|
if (q.exec()) {
|
||||||
return true;
|
return true;
|
||||||
@ -1539,7 +1543,6 @@ Assignment DatabaseQueries::getGmailFeeds(const QSqlDatabase& db, int account_id
|
|||||||
|
|
||||||
QList<ServiceRoot*> DatabaseQueries::getGmailAccounts(const QSqlDatabase& db, bool* ok) {
|
QList<ServiceRoot*> DatabaseQueries::getGmailAccounts(const QSqlDatabase& db, bool* ok) {
|
||||||
QSqlQuery query(db);
|
QSqlQuery query(db);
|
||||||
|
|
||||||
QList<ServiceRoot*> roots;
|
QList<ServiceRoot*> roots;
|
||||||
|
|
||||||
if (query.exec("SELECT * FROM GmailAccounts;")) {
|
if (query.exec("SELECT * FROM GmailAccounts;")) {
|
||||||
@ -1642,7 +1645,6 @@ bool DatabaseQueries::storeNewInoreaderTokens(const QSqlDatabase& db, const QStr
|
|||||||
|
|
||||||
QList<ServiceRoot*> DatabaseQueries::getInoreaderAccounts(const QSqlDatabase& db, bool* ok) {
|
QList<ServiceRoot*> DatabaseQueries::getInoreaderAccounts(const QSqlDatabase& db, bool* ok) {
|
||||||
QSqlQuery query(db);
|
QSqlQuery query(db);
|
||||||
|
|
||||||
QList<ServiceRoot*> roots;
|
QList<ServiceRoot*> roots;
|
||||||
|
|
||||||
if (query.exec("SELECT * FROM InoreaderAccounts;")) {
|
if (query.exec("SELECT * FROM InoreaderAccounts;")) {
|
||||||
|
@ -42,14 +42,18 @@ class DatabaseQueries {
|
|||||||
static int getMessageCountsForBin(const QSqlDatabase& db, int account_id, bool including_total_counts, bool* ok = nullptr);
|
static int getMessageCountsForBin(const QSqlDatabase& db, int account_id, bool including_total_counts, bool* ok = nullptr);
|
||||||
|
|
||||||
// Get messages (for newspaper view for example).
|
// Get messages (for newspaper view for example).
|
||||||
static QList<Message> getUndeletedMessagesForFeed(const QSqlDatabase& db, const QString& feed_custom_id, int account_id, bool* ok = nullptr);
|
static QList<Message> getUndeletedMessagesForFeed(const QSqlDatabase& db,
|
||||||
|
const QString& feed_custom_id,
|
||||||
|
int account_id,
|
||||||
|
bool* ok = nullptr);
|
||||||
static QList<Message> getUndeletedMessagesForBin(const QSqlDatabase& db, int account_id, bool* ok = nullptr);
|
static QList<Message> getUndeletedMessagesForBin(const QSqlDatabase& db, int account_id, bool* ok = nullptr);
|
||||||
static QList<Message> getUndeletedMessagesForAccount(const QSqlDatabase& db, int account_id, bool* ok = nullptr);
|
static QList<Message> getUndeletedMessagesForAccount(const QSqlDatabase& db, int account_id, bool* ok = nullptr);
|
||||||
|
|
||||||
// Custom ID accumulators.
|
// Custom ID accumulators.
|
||||||
static QStringList customIdsOfMessagesFromAccount(const QSqlDatabase& db, int account_id, bool* ok = nullptr);
|
static QStringList customIdsOfMessagesFromAccount(const QSqlDatabase& db, int account_id, bool* ok = nullptr);
|
||||||
static QStringList customIdsOfMessagesFromBin(const QSqlDatabase& db, int account_id, bool* ok = nullptr);
|
static QStringList customIdsOfMessagesFromBin(const QSqlDatabase& db, int account_id, bool* ok = nullptr);
|
||||||
static QStringList customIdsOfMessagesFromFeed(const QSqlDatabase& db, const QString& feed_custom_id, int account_id, bool* ok = nullptr);
|
static QStringList customIdsOfMessagesFromFeed(const QSqlDatabase& db, const QString& feed_custom_id, int account_id,
|
||||||
|
bool* ok = nullptr);
|
||||||
|
|
||||||
// Common accounts methods.
|
// Common accounts methods.
|
||||||
static int updateMessages(QSqlDatabase db, const QList<Message>& messages, const QString& feed_custom_id,
|
static int updateMessages(QSqlDatabase db, const QList<Message>& messages, const QString& feed_custom_id,
|
||||||
@ -122,11 +126,12 @@ class DatabaseQueries {
|
|||||||
static bool deleteTtRssAccount(const QSqlDatabase& db, int account_id);
|
static bool deleteTtRssAccount(const QSqlDatabase& db, int account_id);
|
||||||
static bool overwriteTtRssAccount(const QSqlDatabase& db, const QString& username, const QString& password,
|
static bool overwriteTtRssAccount(const QSqlDatabase& db, const QString& username, const QString& password,
|
||||||
bool auth_protected, const QString& auth_username, const QString& auth_password,
|
bool auth_protected, const QString& auth_username, const QString& auth_password,
|
||||||
const QString& url, bool force_server_side_feed_update, int account_id);
|
const QString& url, bool force_server_side_feed_update,
|
||||||
|
bool download_only_unread_messages, int account_id);
|
||||||
static bool createTtRssAccount(const QSqlDatabase& db, int id_to_assign, const QString& username,
|
static bool createTtRssAccount(const QSqlDatabase& db, int id_to_assign, const QString& username,
|
||||||
const QString& password, bool auth_protected, const QString& auth_username,
|
const QString& password, bool auth_protected, const QString& auth_username,
|
||||||
const QString& auth_password, const QString& url,
|
const QString& auth_password, const QString& url,
|
||||||
bool force_server_side_feed_update);
|
bool force_server_side_feed_update, bool download_only_unread_messages);
|
||||||
static Assignment getTtRssFeeds(const QSqlDatabase& db, int account_id, bool* ok = nullptr);
|
static Assignment getTtRssFeeds(const QSqlDatabase& db, int account_id, bool* ok = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -35,14 +35,14 @@
|
|||||||
|
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
|
|
||||||
|
#include "network-web/downloader.h"
|
||||||
|
|
||||||
class LocationLineEdit;
|
class LocationLineEdit;
|
||||||
|
|
||||||
class QTimer;
|
class QTimer;
|
||||||
|
|
||||||
class QListWidget;
|
class QListWidget;
|
||||||
|
|
||||||
class Downloader;
|
|
||||||
|
|
||||||
class GoogleSuggest : public QObject {
|
class GoogleSuggest : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@ -87,6 +87,7 @@ void FormEditTtRssAccount::execForEdit(TtRssServiceRoot* existing_root) {
|
|||||||
m_ui->m_txtPassword->lineEdit()->setText(existing_root->network()->password());
|
m_ui->m_txtPassword->lineEdit()->setText(existing_root->network()->password());
|
||||||
m_ui->m_txtUrl->lineEdit()->setText(existing_root->network()->url());
|
m_ui->m_txtUrl->lineEdit()->setText(existing_root->network()->url());
|
||||||
m_ui->m_checkServerSideUpdate->setChecked(existing_root->network()->forceServerSideUpdate());
|
m_ui->m_checkServerSideUpdate->setChecked(existing_root->network()->forceServerSideUpdate());
|
||||||
|
m_ui->m_checkDownloadOnlyUnreadMessages->setChecked(existing_root->network()->downloadOnlyUnreadMessages());
|
||||||
exec();
|
exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,6 +109,7 @@ void FormEditTtRssAccount::performTest() {
|
|||||||
factory.setAuthUsername(m_ui->m_txtHttpUsername->lineEdit()->text());
|
factory.setAuthUsername(m_ui->m_txtHttpUsername->lineEdit()->text());
|
||||||
factory.setAuthPassword(m_ui->m_txtHttpPassword->lineEdit()->text());
|
factory.setAuthPassword(m_ui->m_txtHttpPassword->lineEdit()->text());
|
||||||
factory.setForceServerSideUpdate(m_ui->m_checkServerSideUpdate->isChecked());
|
factory.setForceServerSideUpdate(m_ui->m_checkServerSideUpdate->isChecked());
|
||||||
|
|
||||||
TtRssLoginResponse result = factory.login();
|
TtRssLoginResponse result = factory.login();
|
||||||
|
|
||||||
if (result.isLoaded()) {
|
if (result.isLoaded()) {
|
||||||
@ -186,6 +188,8 @@ void FormEditTtRssAccount::onClickedOk() {
|
|||||||
m_editableRoot->network()->setAuthUsername(m_ui->m_txtHttpUsername->lineEdit()->text());
|
m_editableRoot->network()->setAuthUsername(m_ui->m_txtHttpUsername->lineEdit()->text());
|
||||||
m_editableRoot->network()->setAuthPassword(m_ui->m_txtHttpPassword->lineEdit()->text());
|
m_editableRoot->network()->setAuthPassword(m_ui->m_txtHttpPassword->lineEdit()->text());
|
||||||
m_editableRoot->network()->setForceServerSideUpdate(m_ui->m_checkServerSideUpdate->isChecked());
|
m_editableRoot->network()->setForceServerSideUpdate(m_ui->m_checkServerSideUpdate->isChecked());
|
||||||
|
m_editableRoot->network()->setDownloadOnlyUnreadMessages(m_ui->m_checkDownloadOnlyUnreadMessages->isChecked());
|
||||||
|
|
||||||
m_editableRoot->saveAccountDataToDatabase();
|
m_editableRoot->saveAccountDataToDatabase();
|
||||||
accept();
|
accept();
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>604</width>
|
<width>604</width>
|
||||||
<height>502</height>
|
<height>442</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -16,24 +16,14 @@
|
|||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QFormLayout" name="formLayout">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
<item row="0" column="0" colspan="2">
|
<item row="7" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<widget class="QPushButton" name="m_btnTestSetup">
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="m_lblTitle">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>URL</string>
|
<string>&Test setup</string>
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>m_txtUrl</cstring>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="5" column="0" colspan="2">
|
||||||
<widget class="LineEditWithStatus" name="m_txtUrl" native="true"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0" colspan="2">
|
|
||||||
<widget class="QGroupBox" name="m_gbAuthentication">
|
<widget class="QGroupBox" name="m_gbAuthentication">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Some feeds require authentication, including GMail feeds. BASIC, NTLM-2 and DIGEST-MD5 authentication schemes are supported.</string>
|
<string>Some feeds require authentication, including GMail feeds. BASIC, NTLM-2 and DIGEST-MD5 authentication schemes are supported.</string>
|
||||||
@ -84,7 +74,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0" colspan="2">
|
<item row="6" column="0" colspan="2">
|
||||||
<widget class="QGroupBox" name="m_gbHttpAuthentication">
|
<widget class="QGroupBox" name="m_gbHttpAuthentication">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Some feeds require authentication, including GMail feeds. BASIC, NTLM-2 and DIGEST-MD5 authentication schemes are supported.</string>
|
<string>Some feeds require authentication, including GMail feeds. BASIC, NTLM-2 and DIGEST-MD5 authentication schemes are supported.</string>
|
||||||
@ -108,7 +98,7 @@
|
|||||||
<string>Username</string>
|
<string>Username</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>m_txtUsername</cstring>
|
<cstring>m_txtHttpUsername</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -121,7 +111,7 @@
|
|||||||
<string>Password</string>
|
<string>Password</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>m_txtPassword</cstring>
|
<cstring>m_txtHttpPassword</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -138,14 +128,58 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="0" column="0" colspan="2">
|
||||||
<widget class="QPushButton" name="m_btnTestSetup">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="m_lblTitle">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Test setup</string>
|
<string>URL</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>m_txtUrl</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="1">
|
<item>
|
||||||
|
<widget class="LineEditWithStatus" name="m_txtUrl" native="true"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="m_lblDescription">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="m_lblServerSideUpdateInformation">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="m_checkServerSideUpdate">
|
||||||
|
<property name="text">
|
||||||
|
<string>Force execution of server-side update when updating feeds from RSS Guard</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="m_checkDownloadOnlyUnreadMessages">
|
||||||
|
<property name="text">
|
||||||
|
<string>Download only unread messages.</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="1">
|
||||||
<widget class="LabelWithStatus" name="m_lblTestResult" native="true">
|
<widget class="LabelWithStatus" name="m_lblTestResult" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
@ -158,35 +192,21 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" colspan="2">
|
|
||||||
<widget class="QCheckBox" name="m_checkServerSideUpdate">
|
|
||||||
<property name="text">
|
|
||||||
<string>Force execution of server-side update when updating feeds from RSS Guard</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="m_lblDescription">
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="m_lblServerSideUpdateInformation">
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>68</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="m_buttonBox">
|
<widget class="QDialogButtonBox" name="m_buttonBox">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -213,6 +233,14 @@
|
|||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>m_checkDownloadOnlyUnreadMessages</tabstop>
|
||||||
|
<tabstop>m_checkServerSideUpdate</tabstop>
|
||||||
|
<tabstop>m_checkShowPassword</tabstop>
|
||||||
|
<tabstop>m_gbHttpAuthentication</tabstop>
|
||||||
|
<tabstop>m_checkShowHttpPassword</tabstop>
|
||||||
|
<tabstop>m_btnTestSetup</tabstop>
|
||||||
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
@ -78,8 +78,8 @@ TtRssLoginResponse TtRssNetworkFactory::login() {
|
|||||||
json["password"] = m_password;
|
json["password"] = m_password;
|
||||||
|
|
||||||
QByteArray result_raw;
|
QByteArray result_raw;
|
||||||
|
|
||||||
QList<QPair<QByteArray, QByteArray>> headers;
|
QList<QPair<QByteArray, QByteArray>> headers;
|
||||||
|
|
||||||
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
|
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
|
||||||
headers << NetworkFactory::generateBasicAuthHeader(m_authUsername, m_authPassword);
|
headers << NetworkFactory::generateBasicAuthHeader(m_authUsername, m_authPassword);
|
||||||
|
|
||||||
@ -112,8 +112,8 @@ TtRssResponse TtRssNetworkFactory::logout() {
|
|||||||
json["op"] = QSL("logout");
|
json["op"] = QSL("logout");
|
||||||
json["sid"] = m_sessionId;
|
json["sid"] = m_sessionId;
|
||||||
QByteArray result_raw;
|
QByteArray result_raw;
|
||||||
|
|
||||||
QList<QPair<QByteArray, QByteArray>> headers;
|
QList<QPair<QByteArray, QByteArray>> headers;
|
||||||
|
|
||||||
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
|
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
|
||||||
headers << NetworkFactory::generateBasicAuthHeader(m_authUsername, m_authPassword);
|
headers << NetworkFactory::generateBasicAuthHeader(m_authUsername, m_authPassword);
|
||||||
|
|
||||||
@ -152,8 +152,8 @@ TtRssGetFeedsCategoriesResponse TtRssNetworkFactory::getFeedsCategories() {
|
|||||||
json["include_empty"] = true;
|
json["include_empty"] = true;
|
||||||
const int timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt();
|
const int timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt();
|
||||||
QByteArray result_raw;
|
QByteArray result_raw;
|
||||||
|
|
||||||
QList<QPair<QByteArray, QByteArray>> headers;
|
QList<QPair<QByteArray, QByteArray>> headers;
|
||||||
|
|
||||||
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
|
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
|
||||||
headers << NetworkFactory::generateBasicAuthHeader(m_authUsername, m_authPassword);
|
headers << NetworkFactory::generateBasicAuthHeader(m_authUsername, m_authPassword);
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ TtRssGetFeedsCategoriesResponse TtRssNetworkFactory::getFeedsCategories() {
|
|||||||
|
|
||||||
TtRssGetHeadlinesResponse TtRssNetworkFactory::getHeadlines(int feed_id, int limit, int skip,
|
TtRssGetHeadlinesResponse TtRssNetworkFactory::getHeadlines(int feed_id, int limit, int skip,
|
||||||
bool show_content, bool include_attachments,
|
bool show_content, bool include_attachments,
|
||||||
bool sanitize) {
|
bool sanitize, bool unread_only) {
|
||||||
QJsonObject json;
|
QJsonObject json;
|
||||||
|
|
||||||
json["op"] = QSL("getHeadlines");
|
json["op"] = QSL("getHeadlines");
|
||||||
@ -194,13 +194,14 @@ TtRssGetHeadlinesResponse TtRssNetworkFactory::getHeadlines(int feed_id, int lim
|
|||||||
json["force_update"] = m_forceServerSideUpdate;
|
json["force_update"] = m_forceServerSideUpdate;
|
||||||
json["limit"] = limit;
|
json["limit"] = limit;
|
||||||
json["skip"] = skip;
|
json["skip"] = skip;
|
||||||
|
json["view_mode"] = unread_only ? QSL("unread") : QSL("all_articles");
|
||||||
json["show_content"] = show_content;
|
json["show_content"] = show_content;
|
||||||
json["include_attachments"] = include_attachments;
|
json["include_attachments"] = include_attachments;
|
||||||
json["sanitize"] = sanitize;
|
json["sanitize"] = sanitize;
|
||||||
const int timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt();
|
const int timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt();
|
||||||
QByteArray result_raw;
|
QByteArray result_raw;
|
||||||
|
|
||||||
QList<QPair<QByteArray, QByteArray>> headers;
|
QList<QPair<QByteArray, QByteArray>> headers;
|
||||||
|
|
||||||
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
|
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
|
||||||
headers << NetworkFactory::generateBasicAuthHeader(m_authUsername, m_authPassword);
|
headers << NetworkFactory::generateBasicAuthHeader(m_authUsername, m_authPassword);
|
||||||
|
|
||||||
@ -246,8 +247,8 @@ TtRssUpdateArticleResponse TtRssNetworkFactory::updateArticles(const QStringList
|
|||||||
json["field"] = (int) field;
|
json["field"] = (int) field;
|
||||||
const int timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt();
|
const int timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt();
|
||||||
QByteArray result_raw;
|
QByteArray result_raw;
|
||||||
|
|
||||||
QList<QPair<QByteArray, QByteArray>> headers;
|
QList<QPair<QByteArray, QByteArray>> headers;
|
||||||
|
|
||||||
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
|
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
|
||||||
headers << NetworkFactory::generateBasicAuthHeader(m_authUsername, m_authPassword);
|
headers << NetworkFactory::generateBasicAuthHeader(m_authUsername, m_authPassword);
|
||||||
|
|
||||||
@ -294,8 +295,8 @@ TtRssSubscribeToFeedResponse TtRssNetworkFactory::subscribeToFeed(const QString&
|
|||||||
|
|
||||||
const int timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt();
|
const int timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt();
|
||||||
QByteArray result_raw;
|
QByteArray result_raw;
|
||||||
|
|
||||||
QList<QPair<QByteArray, QByteArray>> headers;
|
QList<QPair<QByteArray, QByteArray>> headers;
|
||||||
|
|
||||||
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
|
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
|
||||||
headers << NetworkFactory::generateBasicAuthHeader(m_authUsername, m_authPassword);
|
headers << NetworkFactory::generateBasicAuthHeader(m_authUsername, m_authPassword);
|
||||||
|
|
||||||
@ -333,8 +334,8 @@ TtRssUnsubscribeFeedResponse TtRssNetworkFactory::unsubscribeFeed(int feed_id) {
|
|||||||
json["feed_id"] = feed_id;
|
json["feed_id"] = feed_id;
|
||||||
const int timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt();
|
const int timeout = qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt();
|
||||||
QByteArray result_raw;
|
QByteArray result_raw;
|
||||||
|
|
||||||
QList<QPair<QByteArray, QByteArray>> headers;
|
QList<QPair<QByteArray, QByteArray>> headers;
|
||||||
|
|
||||||
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
|
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
|
||||||
headers << NetworkFactory::generateBasicAuthHeader(m_authUsername, m_authPassword);
|
headers << NetworkFactory::generateBasicAuthHeader(m_authUsername, m_authPassword);
|
||||||
|
|
||||||
@ -365,6 +366,14 @@ TtRssUnsubscribeFeedResponse TtRssNetworkFactory::unsubscribeFeed(int feed_id) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TtRssNetworkFactory::downloadOnlyUnreadMessages() const {
|
||||||
|
return m_downloadOnlyUnreadMessages;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TtRssNetworkFactory::setDownloadOnlyUnreadMessages(bool download_only_unread_messages) {
|
||||||
|
m_downloadOnlyUnreadMessages = download_only_unread_messages;
|
||||||
|
}
|
||||||
|
|
||||||
bool TtRssNetworkFactory::forceServerSideUpdate() const {
|
bool TtRssNetworkFactory::forceServerSideUpdate() const {
|
||||||
return m_forceServerSideUpdate;
|
return m_forceServerSideUpdate;
|
||||||
}
|
}
|
||||||
@ -484,7 +493,6 @@ RootItem* TtRssGetFeedsCategoriesResponse::feedsCategories(bool obtain_icons, QS
|
|||||||
if (status() == TTRSS_API_STATUS_OK) {
|
if (status() == TTRSS_API_STATUS_OK) {
|
||||||
// We have data, construct object tree according to data.
|
// We have data, construct object tree according to data.
|
||||||
QJsonArray items_to_process = m_rawContent["content"].toObject()["categories"].toObject()["items"].toArray();
|
QJsonArray items_to_process = m_rawContent["content"].toObject()["categories"].toObject()["items"].toArray();
|
||||||
|
|
||||||
QVector<QPair<RootItem*, QJsonValue>> pairs;
|
QVector<QPair<RootItem*, QJsonValue>> pairs;
|
||||||
|
|
||||||
for (const QJsonValue& item : items_to_process) {
|
for (const QJsonValue& item : items_to_process) {
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
class RootItem;
|
class RootItem;
|
||||||
|
|
||||||
class TtRssFeed;
|
class TtRssFeed;
|
||||||
|
|
||||||
class TtRssResponse {
|
class TtRssResponse {
|
||||||
@ -123,6 +124,9 @@ class TtRssNetworkFactory {
|
|||||||
bool forceServerSideUpdate() const;
|
bool forceServerSideUpdate() const;
|
||||||
void setForceServerSideUpdate(bool force_server_side_update);
|
void setForceServerSideUpdate(bool force_server_side_update);
|
||||||
|
|
||||||
|
bool downloadOnlyUnreadMessages() const;
|
||||||
|
void setDownloadOnlyUnreadMessages(bool download_only_unread_messages);
|
||||||
|
|
||||||
// Metadata.
|
// Metadata.
|
||||||
QDateTime lastLoginTime() const;
|
QDateTime lastLoginTime() const;
|
||||||
QNetworkReply::NetworkError lastError() const;
|
QNetworkReply::NetworkError lastError() const;
|
||||||
@ -141,7 +145,7 @@ class TtRssNetworkFactory {
|
|||||||
// Gets headlines (messages) from the server.
|
// Gets headlines (messages) from the server.
|
||||||
TtRssGetHeadlinesResponse getHeadlines(int feed_id, int limit, int skip,
|
TtRssGetHeadlinesResponse getHeadlines(int feed_id, int limit, int skip,
|
||||||
bool show_content, bool include_attachments,
|
bool show_content, bool include_attachments,
|
||||||
bool sanitize);
|
bool sanitize, bool unread_only);
|
||||||
|
|
||||||
TtRssUpdateArticleResponse updateArticles(const QStringList& ids, UpdateArticle::OperatingField field,
|
TtRssUpdateArticleResponse updateArticles(const QStringList& ids, UpdateArticle::OperatingField field,
|
||||||
UpdateArticle::Mode mode, bool async = true);
|
UpdateArticle::Mode mode, bool async = true);
|
||||||
@ -151,14 +155,13 @@ class TtRssNetworkFactory {
|
|||||||
|
|
||||||
TtRssUnsubscribeFeedResponse unsubscribeFeed(int feed_id);
|
TtRssUnsubscribeFeedResponse unsubscribeFeed(int feed_id);
|
||||||
|
|
||||||
//TtRssGetConfigResponse getConfig();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_bareUrl;
|
QString m_bareUrl;
|
||||||
QString m_fullUrl;
|
QString m_fullUrl;
|
||||||
QString m_username;
|
QString m_username;
|
||||||
QString m_password;
|
QString m_password;
|
||||||
bool m_forceServerSideUpdate;
|
bool m_forceServerSideUpdate;
|
||||||
|
bool m_downloadOnlyUnreadMessages;
|
||||||
bool m_authIsUsed;
|
bool m_authIsUsed;
|
||||||
QString m_authUsername;
|
QString m_authUsername;
|
||||||
QString m_authPassword;
|
QString m_authPassword;
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
TtRssFeed::TtRssFeed(RootItem* parent)
|
TtRssFeed::TtRssFeed(RootItem* parent) : Feed(parent) {}
|
||||||
: Feed(parent) {}
|
|
||||||
|
|
||||||
TtRssFeed::TtRssFeed(const QSqlRecord& record) : Feed(record) {}
|
TtRssFeed::TtRssFeed(const QSqlRecord& record) : Feed(record) {}
|
||||||
|
|
||||||
@ -31,6 +30,7 @@ bool TtRssFeed::canBeEdited() const {
|
|||||||
|
|
||||||
bool TtRssFeed::editViaGui() {
|
bool TtRssFeed::editViaGui() {
|
||||||
QPointer<FormTtRssFeedDetails> form_pointer = new FormTtRssFeedDetails(serviceRoot(), qApp->mainFormWidget());
|
QPointer<FormTtRssFeedDetails> form_pointer = new FormTtRssFeedDetails(serviceRoot(), qApp->mainFormWidget());
|
||||||
|
|
||||||
form_pointer.data()->addEditFeed(this, nullptr);
|
form_pointer.data()->addEditFeed(this, nullptr);
|
||||||
delete form_pointer.data();
|
delete form_pointer.data();
|
||||||
return false;
|
return false;
|
||||||
@ -75,7 +75,7 @@ QList<Message> TtRssFeed::obtainNewMessages(bool* error_during_obtaining) {
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
TtRssGetHeadlinesResponse headlines = serviceRoot()->network()->getHeadlines(customId().toInt(), limit, skip,
|
TtRssGetHeadlinesResponse headlines = serviceRoot()->network()->getHeadlines(customId().toInt(), limit, skip,
|
||||||
true, true, false);
|
true, true, false, true);
|
||||||
|
|
||||||
if (serviceRoot()->network()->lastError() != QNetworkReply::NoError) {
|
if (serviceRoot()->network()->lastError() != QNetworkReply::NoError) {
|
||||||
setStatus(Feed::NetworkError);
|
setStatus(Feed::NetworkError);
|
||||||
@ -85,6 +85,7 @@ QList<Message> TtRssFeed::obtainNewMessages(bool* error_during_obtaining) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QList<Message> new_messages = headlines.messages();
|
QList<Message> new_messages = headlines.messages();
|
||||||
|
|
||||||
messages.append(new_messages);
|
messages.append(new_messages);
|
||||||
newly_added_messages = new_messages.size();
|
newly_added_messages = new_messages.size();
|
||||||
skip += newly_added_messages;
|
skip += newly_added_messages;
|
||||||
|
@ -53,6 +53,7 @@ QString TtRssServiceRoot::code() const {
|
|||||||
|
|
||||||
bool TtRssServiceRoot::editViaGui() {
|
bool TtRssServiceRoot::editViaGui() {
|
||||||
QScopedPointer<FormEditTtRssAccount> form_pointer(new FormEditTtRssAccount(qApp->mainFormWidget()));
|
QScopedPointer<FormEditTtRssAccount> form_pointer(new FormEditTtRssAccount(qApp->mainFormWidget()));
|
||||||
|
|
||||||
form_pointer.data()->execForEdit(this);
|
form_pointer.data()->execForEdit(this);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -92,6 +93,7 @@ void TtRssServiceRoot::addNewFeed(const QString& url) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QScopedPointer<FormTtRssFeedDetails> form_pointer(new FormTtRssFeedDetails(this, qApp->mainFormWidget()));
|
QScopedPointer<FormTtRssFeedDetails> form_pointer(new FormTtRssFeedDetails(this, qApp->mainFormWidget()));
|
||||||
|
|
||||||
form_pointer.data()->addEditFeed(nullptr, this, url);
|
form_pointer.data()->addEditFeed(nullptr, this, url);
|
||||||
qApp->feedUpdateLock()->unlock();
|
qApp->feedUpdateLock()->unlock();
|
||||||
}
|
}
|
||||||
@ -132,7 +134,6 @@ void TtRssServiceRoot::saveAllCachedData(bool async) {
|
|||||||
while (j.hasNext()) {
|
while (j.hasNext()) {
|
||||||
j.next();
|
j.next();
|
||||||
auto key = j.key();
|
auto key = j.key();
|
||||||
|
|
||||||
QList<Message> messages = j.value();
|
QList<Message> messages = j.value();
|
||||||
|
|
||||||
if (!messages.isEmpty()) {
|
if (!messages.isEmpty()) {
|
||||||
@ -178,7 +179,8 @@ void TtRssServiceRoot::saveAccountDataToDatabase() {
|
|||||||
if (DatabaseQueries::overwriteTtRssAccount(database, m_network->username(), m_network->password(),
|
if (DatabaseQueries::overwriteTtRssAccount(database, m_network->username(), m_network->password(),
|
||||||
m_network->authIsUsed(), m_network->authUsername(),
|
m_network->authIsUsed(), m_network->authUsername(),
|
||||||
m_network->authPassword(), m_network->url(),
|
m_network->authPassword(), m_network->url(),
|
||||||
m_network->forceServerSideUpdate(), accountId())) {
|
m_network->forceServerSideUpdate(), m_network->downloadOnlyUnreadMessages(),
|
||||||
|
accountId())) {
|
||||||
updateTitle();
|
updateTitle();
|
||||||
itemChanged(QList<RootItem*>() << this);
|
itemChanged(QList<RootItem*>() << this);
|
||||||
}
|
}
|
||||||
@ -191,7 +193,8 @@ void TtRssServiceRoot::saveAccountDataToDatabase() {
|
|||||||
if (DatabaseQueries::createTtRssAccount(database, id_to_assign, m_network->username(),
|
if (DatabaseQueries::createTtRssAccount(database, id_to_assign, m_network->username(),
|
||||||
m_network->password(), m_network->authIsUsed(),
|
m_network->password(), m_network->authIsUsed(),
|
||||||
m_network->authUsername(), m_network->authPassword(),
|
m_network->authUsername(), m_network->authPassword(),
|
||||||
m_network->url(), m_network->forceServerSideUpdate())) {
|
m_network->url(), m_network->forceServerSideUpdate(),
|
||||||
|
m_network->downloadOnlyUnreadMessages())) {
|
||||||
setId(id_to_assign);
|
setId(id_to_assign);
|
||||||
setAccountId(id_to_assign);
|
setAccountId(id_to_assign);
|
||||||
updateTitle();
|
updateTitle();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user