This commit is contained in:
Martin Rotter 2020-08-17 15:26:47 +02:00
parent 580c067b02
commit db98dc5beb
10 changed files with 20 additions and 29 deletions

View File

@ -172,8 +172,8 @@
#define qInfoNN qInfo().noquote().nospace()
#endif
#define QUOTE_W_SPACE_DOT(x) " '" << x << "'."
#define QUOTE_W_SPACE(x) " '" << x << "' "
#define QUOTE_W_SPACE_DOT(x) " '" << (x) << "'."
#define QUOTE_W_SPACE(x) " '" << (x) << "' "
#ifndef QSL

View File

@ -269,7 +269,6 @@ SOURCES += core/feeddownloader.cpp \
services/abstract/importantnode.cpp \
services/abstract/recyclebin.cpp \
services/abstract/rootitem.cpp \
services/abstract/serviceentrypoint.cpp \
services/abstract/serviceroot.cpp \
services/gmail/gmailentrypoint.cpp \
services/gmail/gmailfeed.cpp \

View File

@ -9,8 +9,6 @@
AccountCheckModel::AccountCheckModel(QObject* parent)
: QAbstractItemModel(parent), m_rootItem(nullptr), m_recursiveChange(false) {}
AccountCheckModel::~AccountCheckModel() = default;
RootItem* AccountCheckModel::itemForIndex(const QModelIndex& index) const {
if (index.isValid() && index.model() == this) {
return static_cast<RootItem*>(index.internalPointer());

View File

@ -14,7 +14,7 @@ class AccountCheckModel : public QAbstractItemModel {
public:
explicit AccountCheckModel(QObject* parent = nullptr);
virtual ~AccountCheckModel();
virtual ~AccountCheckModel() = default;
QModelIndex index(int row, int column, const QModelIndex& parent) const;
QModelIndex parent(const QModelIndex& child) const;

View File

@ -39,7 +39,9 @@ Feed::Feed(const QSqlRecord& record) : Feed(nullptr) {
setAutoUpdateType(static_cast<Feed::AutoUpdateType>(record.value(FDS_DB_UPDATE_TYPE_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) {
@ -188,13 +190,16 @@ int Feed::updateMessages(const QList<Message>& messages, bool error_during_obtai
if (!error_during_obtaining) {
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 ok = true;
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();
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);
}
else {
qWarning("There are no messages for update.");
qDebugNN << LOGSEC_CORE
<< "There are no messages for update.";
}
if (ok) {
@ -224,7 +230,8 @@ int Feed::updateMessages(const QList<Message>& messages, bool error_during_obtai
}
}
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.

View File

@ -39,8 +39,6 @@ FormFeedDetails::FormFeedDetails(ServiceRoot* service_root, QWidget* parent)
onPasswordChanged(QString());
}
FormFeedDetails::~FormFeedDetails() = default;
int FormFeedDetails::addEditFeed(Feed* input_feed, RootItem* parent_to_select, const QString& url) {
// Load categories.
loadCategories(m_serviceRoot->getSubTreeCategories(), m_serviceRoot);
@ -188,8 +186,6 @@ void FormFeedDetails::onUseDefaultIcon() {
m_ui->m_btnIcon->setIcon(QIcon());
}
void FormFeedDetails::apply() {}
void FormFeedDetails::guessFeed() {
QPair<StandardFeed*, QNetworkReply::NetworkError> result = StandardFeed::guessFeed(m_ui->m_txtUrl->lineEdit()->text(),
m_ui->m_txtUsername->lineEdit()->text(),

View File

@ -20,10 +20,8 @@ class FormFeedDetails : public QDialog {
Q_OBJECT
public:
// Constructors and destructors.
explicit FormFeedDetails(ServiceRoot* service_root, QWidget* parent = nullptr);
virtual ~FormFeedDetails();
virtual ~FormFeedDetails() = default;
public slots:

View File

@ -1,5 +0,0 @@
// For license of this file, see <project-root-folder>/LICENSE.md.
#include "services/abstract/serviceentrypoint.h"
ServiceEntryPoint::~ServiceEntryPoint() = default;

View File

@ -13,7 +13,7 @@ class FeedsModel;
// TOP LEVEL class which provides basic information about the "service"
class ServiceEntryPoint {
public:
virtual ~ServiceEntryPoint();
virtual ~ServiceEntryPoint() = default;
// Creates new service root item, which is ready to be added
// into the model. This method can for example display

View File

@ -14,8 +14,8 @@ FormEditGmailAccount::FormEditGmailAccount(QWidget* parent)
m_ui.setupUi(this);
GuiUtilities::applyDialogProperties(*this, qApp->icons()->miscIcon(QSL("gmail")));
GuiUtilities::setLabelAsNotice(*m_ui.m_lblInfo, true);
m_ui.m_lblInfo->setText(tr("Specified redirect URL must start with \"http://localhost\" and "
"must be configured in your OAuth \"application\"."));
@ -104,12 +104,10 @@ void FormEditGmailAccount::onClickedCancel() {
void FormEditGmailAccount::checkUsername(const QString& username) {
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 {
m_ui.m_txtUsername->setStatus(WidgetWithStatus::StatusType::Ok, tr("Some username entered. \
"));
m_ui.m_txtUsername->setStatus(WidgetWithStatus::StatusType::Ok, tr("Some username entered."));
}
}