Fix #259.
This commit is contained in:
parent
ed1ee0b362
commit
2618791143
|
@ -138,14 +138,15 @@ void FeedDownloader::updateOneFeed(Feed* feed) {
|
||||||
|
|
||||||
for (int i = 0; i < msgs.size(); i++) {
|
for (int i = 0; i < msgs.size(); i++) {
|
||||||
Message msg_backup(msgs[i]);
|
Message msg_backup(msgs[i]);
|
||||||
|
Message* msg_orig = &msgs[i];
|
||||||
|
|
||||||
// Attach live message object to wrapper.
|
// Attach live message object to wrapper.
|
||||||
tmr.restart();
|
tmr.restart();
|
||||||
msg_obj.setMessage(&msgs[i]);
|
msg_obj.setMessage(msg_orig);
|
||||||
qDebugNN << LOGSEC_FEEDDOWNLOADER << "Hooking message took " << tmr.nsecsElapsed() / 1000 << " microseconds.";
|
qDebugNN << LOGSEC_FEEDDOWNLOADER << "Hooking message took " << tmr.nsecsElapsed() / 1000 << " microseconds.";
|
||||||
|
|
||||||
auto feed_filters = feed->messageFilters();
|
auto feed_filters = feed->messageFilters();
|
||||||
bool msg_ignored = false;
|
bool remove_msg = false;
|
||||||
|
|
||||||
for (int j = 0; j < feed_filters.size(); j++) {
|
for (int j = 0; j < feed_filters.size(); j++) {
|
||||||
QPointer<MessageFilter> filter = feed_filters.at(j);
|
QPointer<MessageFilter> filter = feed_filters.at(j);
|
||||||
|
@ -176,8 +177,7 @@ void FeedDownloader::updateOneFeed(Feed* feed) {
|
||||||
case FilteringAction::Ignore:
|
case FilteringAction::Ignore:
|
||||||
|
|
||||||
// Remove the message, we do not want it.
|
// Remove the message, we do not want it.
|
||||||
msgs.removeAt(i--);
|
remove_msg = true;
|
||||||
msg_ignored = true;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -194,18 +194,20 @@ void FeedDownloader::updateOneFeed(Feed* feed) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!msg_ignored) {
|
if (!msg_backup.m_isRead && msg_orig->m_isRead) {
|
||||||
if (!msg_backup.m_isRead && msgs[i].m_isRead) {
|
|
||||||
qDebugNN << LOGSEC_FEEDDOWNLOADER << "Message with custom ID: '" << msg_backup.m_customId << "' was marked as read by message scripts.";
|
qDebugNN << LOGSEC_FEEDDOWNLOADER << "Message with custom ID: '" << msg_backup.m_customId << "' was marked as read by message scripts.";
|
||||||
|
|
||||||
read_msgs << msgs[i];
|
read_msgs << *msg_orig;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!msg_backup.m_isImportant && msgs[i].m_isImportant) {
|
if (!msg_backup.m_isImportant && msg_orig->m_isImportant) {
|
||||||
qDebugNN << LOGSEC_FEEDDOWNLOADER << "Message with custom ID: '" << msg_backup.m_customId << "' was marked as important by message scripts.";
|
qDebugNN << LOGSEC_FEEDDOWNLOADER << "Message with custom ID: '" << msg_backup.m_customId << "' was marked as important by message scripts.";
|
||||||
|
|
||||||
important_msgs << msgs[i];
|
important_msgs << *msg_orig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (remove_msg) {
|
||||||
|
msgs.removeAt(i--);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,8 @@
|
||||||
#define LOGSEC_FEEDMODEL "feed-model: "
|
#define LOGSEC_FEEDMODEL "feed-model: "
|
||||||
#define LOGSEC_FEEDDOWNLOADER "feed-downloader: "
|
#define LOGSEC_FEEDDOWNLOADER "feed-downloader: "
|
||||||
#define LOGSEC_MESSAGEMODEL "message-model: "
|
#define LOGSEC_MESSAGEMODEL "message-model: "
|
||||||
|
#define LOGSEC_GUI "gui: "
|
||||||
|
#define LOGSEC_CORE "core: "
|
||||||
|
|
||||||
#define MAX_ZOOM_FACTOR 5.0f
|
#define MAX_ZOOM_FACTOR 5.0f
|
||||||
#define MIN_ZOOM_FACTOR 0.25f
|
#define MIN_ZOOM_FACTOR 0.25f
|
||||||
|
|
|
@ -33,7 +33,7 @@ ShortcutCatcher::ShortcutCatcher(QWidget* parent)
|
||||||
m_shortcutBox->setMinimumWidth(170);
|
m_shortcutBox->setMinimumWidth(170);
|
||||||
m_shortcutBox->setToolTip(tr("Click and hit new shortcut."));
|
m_shortcutBox->setToolTip(tr("Click and hit new shortcut."));
|
||||||
|
|
||||||
// Add both buttons to the layout.
|
// Add all buttons to the layout.
|
||||||
m_layout->addWidget(m_shortcutBox);
|
m_layout->addWidget(m_shortcutBox);
|
||||||
m_layout->addWidget(m_btnReset);
|
m_layout->addWidget(m_btnReset);
|
||||||
m_layout->addWidget(m_btnClear);
|
m_layout->addWidget(m_btnClear);
|
||||||
|
|
|
@ -20,9 +20,7 @@ FormAbout::FormAbout(QWidget* parent) : QDialog(parent) {
|
||||||
loadSettingsAndPaths();
|
loadSettingsAndPaths();
|
||||||
}
|
}
|
||||||
|
|
||||||
FormAbout::~FormAbout() {
|
FormAbout::~FormAbout() {}
|
||||||
qDebug() << QSslSocket::sslLibraryVersionString();
|
|
||||||
}
|
|
||||||
|
|
||||||
void FormAbout::loadSettingsAndPaths() {
|
void FormAbout::loadSettingsAndPaths() {
|
||||||
if (qApp->settings()->type() == SettingsProperties::SettingsType::Portable) {
|
if (qApp->settings()->type() == SettingsProperties::SettingsType::Portable) {
|
||||||
|
|
|
@ -29,7 +29,7 @@ FormAddAccount::FormAddAccount(const QList<ServiceEntryPoint*>& entry_points, Fe
|
||||||
}
|
}
|
||||||
|
|
||||||
FormAddAccount::~FormAddAccount() {
|
FormAddAccount::~FormAddAccount() {
|
||||||
qDebug("Destroying FormAddAccount instance.");
|
qDebugNN << LOGSEC_GUI << "Destroying FormAddAccount instance.";
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormAddAccount::addSelectedAccount() {
|
void FormAddAccount::addSelectedAccount() {
|
||||||
|
@ -41,7 +41,7 @@ void FormAddAccount::addSelectedAccount() {
|
||||||
m_model->addServiceAccount(new_root, true);
|
m_model->addServiceAccount(new_root, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qWarning("Cannot create new account.");
|
qDebugNN << LOGSEC_CORE << "Cannot create new account.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ void FormAddAccount::loadEntryPoints() {
|
||||||
|
|
||||||
if (entry_point->isSingleInstanceService() && m_model->containsServiceRootFromEntryPoint(entry_point)) {
|
if (entry_point->isSingleInstanceService() && m_model->containsServiceRootFromEntryPoint(entry_point)) {
|
||||||
// Oops, this item cannot be added, it is single instance and is already added.
|
// Oops, this item cannot be added, it is single instance and is already added.
|
||||||
item->setFlags(Qt::NoItemFlags);
|
item->setFlags(Qt::ItemFlag::NoItemFlags);
|
||||||
item->setToolTip(tr("This account can be added only once."));
|
item->setToolTip(tr("This account can be added only once."));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -35,7 +35,7 @@ FormBackupDatabaseSettings::FormBackupDatabaseSettings(QWidget* parent) : QDialo
|
||||||
}
|
}
|
||||||
|
|
||||||
FormBackupDatabaseSettings::~FormBackupDatabaseSettings() {
|
FormBackupDatabaseSettings::~FormBackupDatabaseSettings() {
|
||||||
qDebug("Destroying FormBackupDatabaseSettings instance.");
|
qDebugNN << LOGSEC_GUI << "Destroying FormBackupDatabaseSettings instance.";
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormBackupDatabaseSettings::performBackup() {
|
void FormBackupDatabaseSettings::performBackup() {
|
||||||
|
|
|
@ -33,6 +33,11 @@
|
||||||
#include "services/owncloud/network/owncloudnetworkfactory.h"
|
#include "services/owncloud/network/owncloudnetworkfactory.h"
|
||||||
#include "services/standard/gui/formstandardimportexport.h"
|
#include "services/standard/gui/formstandardimportexport.h"
|
||||||
|
|
||||||
|
#if defined (USE_WEBENGINE)
|
||||||
|
#include "network-web/adblock/adblockicon.h"
|
||||||
|
#include "network-web/adblock/adblockmanager.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
@ -45,14 +50,9 @@
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
|
||||||
#include "network-web/adblock/adblockicon.h"
|
|
||||||
#include "network-web/adblock/adblockmanager.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
FormMain::FormMain(QWidget* parent, Qt::WindowFlags f)
|
FormMain::FormMain(QWidget* parent, Qt::WindowFlags f)
|
||||||
: QMainWindow(parent, f), m_ui(new Ui::FormMain), m_trayMenu(nullptr), m_statusBar(nullptr) {
|
: QMainWindow(parent, f), m_ui(new Ui::FormMain), m_trayMenu(nullptr), m_statusBar(nullptr) {
|
||||||
qDebug().nospace() << "Creating main application form in thread: \'" << QThread::currentThreadId() << "\'.";
|
qDebugNN << LOGSEC_GUI << "Creating main application form in thread: '" << QThread::currentThreadId() << "'.";
|
||||||
|
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
qApp->setMainForm(this);
|
qApp->setMainForm(this);
|
||||||
|
@ -89,7 +89,7 @@ FormMain::FormMain(QWidget* parent, Qt::WindowFlags f)
|
||||||
}
|
}
|
||||||
|
|
||||||
FormMain::~FormMain() {
|
FormMain::~FormMain() {
|
||||||
qDebug("Destroying FormMain instance.");
|
qDebugNN << LOGSEC_GUI << "Destroying FormMain instance.";
|
||||||
}
|
}
|
||||||
|
|
||||||
QMenu* FormMain::trayMenu() const {
|
QMenu* FormMain::trayMenu() const {
|
||||||
|
@ -135,16 +135,13 @@ QList<QAction*> FormMain::allActions() const {
|
||||||
|
|
||||||
#if !defined(Q_OS_MACOS)
|
#if !defined(Q_OS_MACOS)
|
||||||
actions << m_ui->m_actionFullscreen;
|
actions << m_ui->m_actionFullscreen;
|
||||||
|
actions << m_ui->m_actionSwitchMainMenu;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
actions << m_ui->m_actionAboutGuard;
|
actions << m_ui->m_actionAboutGuard;
|
||||||
actions << m_ui->m_actionSwitchFeedsList;
|
actions << m_ui->m_actionSwitchFeedsList;
|
||||||
actions << m_ui->m_actionSwitchMainWindow;
|
actions << m_ui->m_actionSwitchMainWindow;
|
||||||
|
|
||||||
#if !defined(Q_OS_MACOS)
|
|
||||||
actions << m_ui->m_actionSwitchMainMenu;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
actions << m_ui->m_actionSwitchToolBars;
|
actions << m_ui->m_actionSwitchToolBars;
|
||||||
actions << m_ui->m_actionSwitchListHeaders;
|
actions << m_ui->m_actionSwitchListHeaders;
|
||||||
actions << m_ui->m_actionSwitchStatusBar;
|
actions << m_ui->m_actionSwitchStatusBar;
|
||||||
|
@ -193,6 +190,7 @@ QList<QAction*> FormMain::allActions() const {
|
||||||
|
|
||||||
actions << m_ui->m_actionTabsCloseAll;
|
actions << m_ui->m_actionTabsCloseAll;
|
||||||
actions << m_ui->m_actionTabsCloseAllExceptCurrent;
|
actions << m_ui->m_actionTabsCloseAllExceptCurrent;
|
||||||
|
|
||||||
return actions;
|
return actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +211,8 @@ void FormMain::prepareMenus() {
|
||||||
m_trayMenu->addSeparator();
|
m_trayMenu->addSeparator();
|
||||||
m_trayMenu->addAction(m_ui->m_actionSettings);
|
m_trayMenu->addAction(m_ui->m_actionSettings);
|
||||||
m_trayMenu->addAction(m_ui->m_actionQuit);
|
m_trayMenu->addAction(m_ui->m_actionQuit);
|
||||||
qDebug("Creating tray icon menu.");
|
|
||||||
|
qDebugNN << LOGSEC_MESSAGEMODEL << "Creating tray icon menu.";
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(USE_WEBENGINE)
|
#if !defined(USE_WEBENGINE)
|
||||||
|
@ -545,7 +544,7 @@ void FormMain::loadSize() {
|
||||||
QScreen* scr = screen();
|
QScreen* scr = screen();
|
||||||
|
|
||||||
if (scr == nullptr) {
|
if (scr == nullptr) {
|
||||||
qWarning("Cannot load dialog size, because no screens are detected.");
|
qWarningNN << LOGSEC_MESSAGEMODEL << "Cannot load dialog size, because no screens are detected.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue