save
This commit is contained in:
parent
580c067b02
commit
db98dc5beb
10 changed files with 20 additions and 29 deletions
|
@ -172,8 +172,8 @@
|
||||||
#define qInfoNN qInfo().noquote().nospace()
|
#define qInfoNN qInfo().noquote().nospace()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define QUOTE_W_SPACE_DOT(x) " '" << x << "'."
|
#define QUOTE_W_SPACE_DOT(x) " '" << (x) << "'."
|
||||||
#define QUOTE_W_SPACE(x) " '" << x << "' "
|
#define QUOTE_W_SPACE(x) " '" << (x) << "' "
|
||||||
|
|
||||||
#ifndef QSL
|
#ifndef QSL
|
||||||
|
|
||||||
|
|
|
@ -269,7 +269,6 @@ SOURCES += core/feeddownloader.cpp \
|
||||||
services/abstract/importantnode.cpp \
|
services/abstract/importantnode.cpp \
|
||||||
services/abstract/recyclebin.cpp \
|
services/abstract/recyclebin.cpp \
|
||||||
services/abstract/rootitem.cpp \
|
services/abstract/rootitem.cpp \
|
||||||
services/abstract/serviceentrypoint.cpp \
|
|
||||||
services/abstract/serviceroot.cpp \
|
services/abstract/serviceroot.cpp \
|
||||||
services/gmail/gmailentrypoint.cpp \
|
services/gmail/gmailentrypoint.cpp \
|
||||||
services/gmail/gmailfeed.cpp \
|
services/gmail/gmailfeed.cpp \
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
AccountCheckModel::AccountCheckModel(QObject* parent)
|
AccountCheckModel::AccountCheckModel(QObject* parent)
|
||||||
: QAbstractItemModel(parent), m_rootItem(nullptr), m_recursiveChange(false) {}
|
: QAbstractItemModel(parent), m_rootItem(nullptr), m_recursiveChange(false) {}
|
||||||
|
|
||||||
AccountCheckModel::~AccountCheckModel() = default;
|
|
||||||
|
|
||||||
RootItem* AccountCheckModel::itemForIndex(const QModelIndex& index) const {
|
RootItem* AccountCheckModel::itemForIndex(const QModelIndex& index) const {
|
||||||
if (index.isValid() && index.model() == this) {
|
if (index.isValid() && index.model() == this) {
|
||||||
return static_cast<RootItem*>(index.internalPointer());
|
return static_cast<RootItem*>(index.internalPointer());
|
||||||
|
|
|
@ -14,7 +14,7 @@ class AccountCheckModel : public QAbstractItemModel {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AccountCheckModel(QObject* parent = nullptr);
|
explicit AccountCheckModel(QObject* parent = nullptr);
|
||||||
virtual ~AccountCheckModel();
|
virtual ~AccountCheckModel() = default;
|
||||||
|
|
||||||
QModelIndex index(int row, int column, const QModelIndex& parent) const;
|
QModelIndex index(int row, int column, const QModelIndex& parent) const;
|
||||||
QModelIndex parent(const QModelIndex& child) const;
|
QModelIndex parent(const QModelIndex& child) const;
|
||||||
|
|
|
@ -39,7 +39,9 @@ Feed::Feed(const QSqlRecord& record) : Feed(nullptr) {
|
||||||
setAutoUpdateType(static_cast<Feed::AutoUpdateType>(record.value(FDS_DB_UPDATE_TYPE_INDEX).toInt()));
|
setAutoUpdateType(static_cast<Feed::AutoUpdateType>(record.value(FDS_DB_UPDATE_TYPE_INDEX).toInt()));
|
||||||
setAutoUpdateInitialInterval(record.value(FDS_DB_UPDATE_INTERVAL_INDEX).toInt());
|
setAutoUpdateInitialInterval(record.value(FDS_DB_UPDATE_INTERVAL_INDEX).toInt());
|
||||||
|
|
||||||
qDebug("Custom ID of feed when loading from DB is '%s'.", qPrintable(customId()));
|
qDebugNN << LOGSEC_CORE
|
||||||
|
<< "Custom ID of feed when loading from DB is"
|
||||||
|
<< QUOTE_W_SPACE_DOT(customId());
|
||||||
}
|
}
|
||||||
|
|
||||||
Feed::Feed(const Feed& other) : RootItem(other) {
|
Feed::Feed(const Feed& other) : RootItem(other) {
|
||||||
|
@ -188,13 +190,16 @@ int Feed::updateMessages(const QList<Message>& messages, bool error_during_obtai
|
||||||
if (!error_during_obtaining) {
|
if (!error_during_obtaining) {
|
||||||
bool is_main_thread = QThread::currentThread() == qApp->thread();
|
bool is_main_thread = QThread::currentThread() == qApp->thread();
|
||||||
|
|
||||||
qDebug("Updating messages in DB. Main thread: '%s'.", qPrintable(is_main_thread ? "true" : "false"));
|
qDebugNN << LOGSEC_CORE
|
||||||
|
<< "Updating messages in DB. Main thread:"
|
||||||
|
<< QUOTE_W_SPACE_DOT(is_main_thread ? "true" : "false");
|
||||||
|
|
||||||
bool anything_updated = false;
|
bool anything_updated = false;
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
|
|
||||||
if (!messages.isEmpty()) {
|
if (!messages.isEmpty()) {
|
||||||
qDebug("There are some messages to be updated/added to DB.");
|
qDebugNN << LOGSEC_CORE
|
||||||
|
<< "There are some messages to be updated/added to DB.";
|
||||||
|
|
||||||
QString custom_id = customId();
|
QString custom_id = customId();
|
||||||
int account_id = getParentServiceRoot()->accountId();
|
int account_id = getParentServiceRoot()->accountId();
|
||||||
|
@ -205,7 +210,8 @@ int Feed::updateMessages(const QList<Message>& messages, bool error_during_obtai
|
||||||
updated_messages = DatabaseQueries::updateMessages(database, messages, custom_id, account_id, url(), &anything_updated, &ok);
|
updated_messages = DatabaseQueries::updateMessages(database, messages, custom_id, account_id, url(), &anything_updated, &ok);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qWarning("There are no messages for update.");
|
qDebugNN << LOGSEC_CORE
|
||||||
|
<< "There are no messages for update.";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
|
@ -224,7 +230,8 @@ int Feed::updateMessages(const QList<Message>& messages, bool error_during_obtai
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qCritical("There is indication that there was error during messages obtaining.");
|
qCriticalNN << LOGSEC_CORE
|
||||||
|
<< "There is indication that there was error during messages obtaining.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some messages were really added to DB, reload feed in model.
|
// Some messages were really added to DB, reload feed in model.
|
||||||
|
|
|
@ -39,8 +39,6 @@ FormFeedDetails::FormFeedDetails(ServiceRoot* service_root, QWidget* parent)
|
||||||
onPasswordChanged(QString());
|
onPasswordChanged(QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
FormFeedDetails::~FormFeedDetails() = default;
|
|
||||||
|
|
||||||
int FormFeedDetails::addEditFeed(Feed* input_feed, RootItem* parent_to_select, const QString& url) {
|
int FormFeedDetails::addEditFeed(Feed* input_feed, RootItem* parent_to_select, const QString& url) {
|
||||||
// Load categories.
|
// Load categories.
|
||||||
loadCategories(m_serviceRoot->getSubTreeCategories(), m_serviceRoot);
|
loadCategories(m_serviceRoot->getSubTreeCategories(), m_serviceRoot);
|
||||||
|
@ -188,8 +186,6 @@ void FormFeedDetails::onUseDefaultIcon() {
|
||||||
m_ui->m_btnIcon->setIcon(QIcon());
|
m_ui->m_btnIcon->setIcon(QIcon());
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormFeedDetails::apply() {}
|
|
||||||
|
|
||||||
void FormFeedDetails::guessFeed() {
|
void FormFeedDetails::guessFeed() {
|
||||||
QPair<StandardFeed*, QNetworkReply::NetworkError> result = StandardFeed::guessFeed(m_ui->m_txtUrl->lineEdit()->text(),
|
QPair<StandardFeed*, QNetworkReply::NetworkError> result = StandardFeed::guessFeed(m_ui->m_txtUrl->lineEdit()->text(),
|
||||||
m_ui->m_txtUsername->lineEdit()->text(),
|
m_ui->m_txtUsername->lineEdit()->text(),
|
||||||
|
|
|
@ -20,10 +20,8 @@ class FormFeedDetails : public QDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors and destructors.
|
|
||||||
explicit FormFeedDetails(ServiceRoot* service_root, QWidget* parent = nullptr);
|
explicit FormFeedDetails(ServiceRoot* service_root, QWidget* parent = nullptr);
|
||||||
virtual ~FormFeedDetails();
|
virtual ~FormFeedDetails() = default;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
// For license of this file, see <project-root-folder>/LICENSE.md.
|
|
||||||
|
|
||||||
#include "services/abstract/serviceentrypoint.h"
|
|
||||||
|
|
||||||
ServiceEntryPoint::~ServiceEntryPoint() = default;
|
|
|
@ -13,7 +13,7 @@ class FeedsModel;
|
||||||
// TOP LEVEL class which provides basic information about the "service"
|
// TOP LEVEL class which provides basic information about the "service"
|
||||||
class ServiceEntryPoint {
|
class ServiceEntryPoint {
|
||||||
public:
|
public:
|
||||||
virtual ~ServiceEntryPoint();
|
virtual ~ServiceEntryPoint() = default;
|
||||||
|
|
||||||
// Creates new service root item, which is ready to be added
|
// Creates new service root item, which is ready to be added
|
||||||
// into the model. This method can for example display
|
// into the model. This method can for example display
|
||||||
|
|
|
@ -14,8 +14,8 @@ FormEditGmailAccount::FormEditGmailAccount(QWidget* parent)
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
|
|
||||||
GuiUtilities::applyDialogProperties(*this, qApp->icons()->miscIcon(QSL("gmail")));
|
GuiUtilities::applyDialogProperties(*this, qApp->icons()->miscIcon(QSL("gmail")));
|
||||||
|
|
||||||
GuiUtilities::setLabelAsNotice(*m_ui.m_lblInfo, true);
|
GuiUtilities::setLabelAsNotice(*m_ui.m_lblInfo, true);
|
||||||
|
|
||||||
m_ui.m_lblInfo->setText(tr("Specified redirect URL must start with \"http://localhost\" and "
|
m_ui.m_lblInfo->setText(tr("Specified redirect URL must start with \"http://localhost\" and "
|
||||||
"must be configured in your OAuth \"application\"."));
|
"must be configured in your OAuth \"application\"."));
|
||||||
|
|
||||||
|
@ -104,12 +104,10 @@ void FormEditGmailAccount::onClickedCancel() {
|
||||||
|
|
||||||
void FormEditGmailAccount::checkUsername(const QString& username) {
|
void FormEditGmailAccount::checkUsername(const QString& username) {
|
||||||
if (username.isEmpty()) {
|
if (username.isEmpty()) {
|
||||||
m_ui.m_txtUsername->setStatus(WidgetWithStatus::StatusType::Error, tr("No username entered. \
|
m_ui.m_txtUsername->setStatus(WidgetWithStatus::StatusType::Error, tr("No username entered."));
|
||||||
"));
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_ui.m_txtUsername->setStatus(WidgetWithStatus::StatusType::Ok, tr("Some username entered. \
|
m_ui.m_txtUsername->setStatus(WidgetWithStatus::StatusType::Ok, tr("Some username entered."));
|
||||||
"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue