This commit is contained in:
Martin Rotter 2020-11-23 12:59:59 +01:00
parent 12104c70a4
commit b90402eced
17 changed files with 43 additions and 12 deletions

View file

@ -4,6 +4,10 @@ DEFINES *= QT_USE_QSTRINGBUILDER QT_USE_FAST_CONCATENATION QT_USE_FAST_OPERATOR_
VERSION = $$APP_VERSION VERSION = $$APP_VERSION
QT *= core gui widgets sql network xml qml QT *= core gui widgets sql network xml qml
greaterThan(QT_MAJOR_VERSION, 5) {
QT*= core5compat
}
equals(USE_WEBENGINE, true) { equals(USE_WEBENGINE, true) {
message($$MSG_PREFIX: Application will be compiled WITH QtWebEngine module.) message($$MSG_PREFIX: Application will be compiled WITH QtWebEngine module.)
QT *= webenginewidgets QT *= webenginewidgets

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2017-2019 Martin Rotter <rotter.martinos@gmail.com> --> <!-- Copyright 2017-2020 Martin Rotter <rotter.martinos@gmail.com> -->
<component type="desktop-application"> <component type="desktop-application">
<id>com.github.rssguard.desktop</id> <id>com.github.rssguard.desktop</id>
<metadata_license>CC0-1.0</metadata_license> <metadata_license>CC0-1.0</metadata_license>

View file

@ -352,7 +352,7 @@ namespace Mimesis {
return unquote(str.substr(start, end - start)); return unquote(str.substr(start, end - start));
} }
static const string ending[2] = {"\n", "\r\n"}; static const string ending[2] = { "\n", "\r\n" };
Part::Part() : Part::Part() :
headers(), headers(),
@ -805,7 +805,7 @@ namespace Mimesis {
QLocale loc("C"); QLocale loc("C");
QDateTime dat; QDateTime dat;
dat.fromTime_t(date.time_since_epoch().count()); dat.setSecsSinceEpoch(date.time_since_epoch().count());
return loc.toString(dat, "ddd, MM MMM yyyy HH:mm:ss t").toStdString(); return loc.toString(dat, "ddd, MM MMM yyyy HH:mm:ss t").toStdString();

View file

@ -12,7 +12,11 @@
DynamicShortcutsWidget::DynamicShortcutsWidget(QWidget* parent) : QWidget(parent) { DynamicShortcutsWidget::DynamicShortcutsWidget(QWidget* parent) : QWidget(parent) {
// Create layout for this control and set is as active. // Create layout for this control and set is as active.
m_layout = new QGridLayout(this); m_layout = new QGridLayout(this);
#if QT_VERSION_MAJOR <= 5
m_layout->setMargin(0); m_layout->setMargin(0);
#endif
setLayout(m_layout); setLayout(m_layout);
} }

View file

@ -12,7 +12,11 @@ ShortcutCatcher::ShortcutCatcher(QWidget* parent)
: QWidget(parent), m_isRecording(false), m_numKey(0), m_modifierKeys(0U) { : QWidget(parent), m_isRecording(false), m_numKey(0), m_modifierKeys(0U) {
// Setup layout of the control // Setup layout of the control
m_layout = new QHBoxLayout(this); m_layout = new QHBoxLayout(this);
#if QT_VERSION_MAJOR <= 5
m_layout->setMargin(0); m_layout->setMargin(0);
#endif
m_layout->setSpacing(1); m_layout->setSpacing(1);
// Create reset button. // Create reset button.

View file

@ -8,7 +8,6 @@
#include "miscellaneous/iconfactory.h" #include "miscellaneous/iconfactory.h"
#include "services/standard/standardserviceentrypoint.h" #include "services/standard/standardserviceentrypoint.h"
#include <QDesktopWidget>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QListWidget> #include <QListWidget>
#include <QSize> #include <QSize>

View file

@ -39,7 +39,6 @@
#endif #endif
#include <QCloseEvent> #include <QCloseEvent>
#include <QDesktopWidget>
#include <QFileDialog> #include <QFileDialog>
#include <QRect> #include <QRect>
#include <QScopedPointer> #include <QScopedPointer>

View file

@ -259,11 +259,14 @@ void FeedMessageViewer::initializeViews() {
auto* message_layout = new QVBoxLayout(m_messagesWidget); auto* message_layout = new QVBoxLayout(m_messagesWidget);
// Set layout properties. // Set layout properties.
#if QT_VERSION_MAJOR <= 5
central_layout->setMargin(0); central_layout->setMargin(0);
central_layout->setSpacing(0);
feed_layout->setMargin(0); feed_layout->setMargin(0);
feed_layout->setSpacing(0);
message_layout->setMargin(0); message_layout->setMargin(0);
#endif
central_layout->setSpacing(0);
feed_layout->setSpacing(0);
message_layout->setSpacing(0); message_layout->setSpacing(0);
// Set views. // Set views.

View file

@ -568,7 +568,11 @@ void MessagesView::selectNextUnreadItem() {
} }
void MessagesView::searchMessages(const QString& pattern) { void MessagesView::searchMessages(const QString& pattern) {
#if QT_VERSION_MAJOR <= 5
m_proxyModel->setFilterRegExp(pattern); m_proxyModel->setFilterRegExp(pattern);
#else
m_proxyModel->setFilterRegularExpression(pattern);
#endif
if (selectionModel()->selectedRows().isEmpty()) { if (selectionModel()->selectedRows().isEmpty()) {
emit currentMessageRemoved(); emit currentMessageRemoved();

View file

@ -4,7 +4,12 @@
#define STYLEDITEMDELEGATEWITHOUTFOCUS_H #define STYLEDITEMDELEGATEWITHOUTFOCUS_H
#include <QStyledItemDelegate> #include <QStyledItemDelegate>
#if QT_VERSION_MAJOR <= 5
#include <QStyleOptionViewItemV4> #include <QStyleOptionViewItemV4>
#else
#include <QStyleOptionViewItem>
#endif
class StyledItemDelegateWithoutFocus : public QStyledItemDelegate { class StyledItemDelegateWithoutFocus : public QStyledItemDelegate {
Q_OBJECT Q_OBJECT

View file

@ -19,7 +19,10 @@ WidgetWithStatus::WidgetWithStatus(QWidget* parent)
m_iconOk = qApp->icons()->fromTheme(QSL("dialog-yes")); m_iconOk = qApp->icons()->fromTheme(QSL("dialog-yes"));
// Set layout properties. // Set layout properties.
#if QT_VERSION_MAJOR <= 5
m_layout->setMargin(0); m_layout->setMargin(0);
#endif
setLayout(m_layout); setLayout(m_layout);
setStatus(StatusType::Information, QString()); setStatus(StatusType::Information, QString());
} }

View file

@ -4,7 +4,7 @@
#include "definitions/definitions.h" #include "definitions/definitions.h"
Mutex::Mutex(QMutex::RecursionMode mode, QObject* parent) : QObject(parent), m_mutex(new QMutex(mode)), m_isLocked(false) {} Mutex::Mutex(QObject* parent) : QObject(parent), m_mutex(new QMutex()), m_isLocked(false) {}
Mutex::~Mutex() { Mutex::~Mutex() {
qDebugNN << LOGSEC_CORE << ("Destroying Mutex instance."); qDebugNN << LOGSEC_CORE << ("Destroying Mutex instance.");

View file

@ -10,9 +10,7 @@ class Mutex : public QObject {
Q_OBJECT Q_OBJECT
public: public:
explicit Mutex(QObject* parent = nullptr);
// Constructors.
explicit Mutex(QMutex::RecursionMode mode = QMutex::NonRecursive, QObject* parent = 0);
virtual ~Mutex(); virtual ~Mutex();
// Main methods. // Main methods.

View file

@ -31,6 +31,7 @@
#include <QCryptographicHash> #include <QCryptographicHash>
#include <QDataStream> #include <QDataStream>
#include <QDateTime> #include <QDateTime>
#include <QIODevice>
#include <QRandomGenerator> #include <QRandomGenerator>
#include <QtDebug> #include <QtDebug>
#include <QtGlobal> #include <QtGlobal>

View file

@ -10,7 +10,7 @@
#include <QDir> #include <QDir>
#include <QSet> #include <QSet>
CacheForServiceRoot::CacheForServiceRoot() : m_cacheSaveMutex(new QMutex(QMutex::NonRecursive)) {} CacheForServiceRoot::CacheForServiceRoot() : m_cacheSaveMutex(new QMutex()) {}
void CacheForServiceRoot::addLabelsAssignmentsToCache(const QList<Message>& ids_of_messages, Label* lbl, bool assign) { void CacheForServiceRoot::addLabelsAssignmentsToCache(const QList<Message>& ids_of_messages, Label* lbl, bool assign) {
auto custom_ids = lbl->getParentServiceRoot()->customIDsOfMessages(ids_of_messages); auto custom_ids = lbl->getParentServiceRoot()->customIDsOfMessages(ids_of_messages);

View file

@ -18,7 +18,11 @@ EmailRecipientControl::EmailRecipientControl(const QString& recipient, QWidget*
lay->addWidget(m_cmbRecipientType = new QComboBox(this)); lay->addWidget(m_cmbRecipientType = new QComboBox(this));
lay->addWidget(m_txtRecipient = new QLineEdit(this), 1); lay->addWidget(m_txtRecipient = new QLineEdit(this), 1);
lay->addWidget(m_btnCloseMe = new PlainToolButton(this)); lay->addWidget(m_btnCloseMe = new PlainToolButton(this));
#if QT_VERSION_MAJOR <= 5
lay->setMargin(0); lay->setMargin(0);
#endif
lay->setContentsMargins(0, 0, 0, 0); lay->setContentsMargins(0, 0, 0, 0);
m_cmbRecipientType->setFocusPolicy(Qt::FocusPolicy::NoFocus); m_cmbRecipientType->setFocusPolicy(Qt::FocusPolicy::NoFocus);

View file

@ -23,7 +23,10 @@ FormAddEditEmail::FormAddEditEmail(GmailServiceRoot* root, QWidget* parent)
GuiUtilities::applyDialogProperties(*this, qApp->icons()->fromTheme(QSL("mail-message-new"))); GuiUtilities::applyDialogProperties(*this, qApp->icons()->fromTheme(QSL("mail-message-new")));
#if QT_VERSION_MAJOR <= 5
m_ui.m_layoutAdder->setMargin(0); m_ui.m_layoutAdder->setMargin(0);
#endif
m_ui.m_layoutAdder->setContentsMargins(0, 0, 0, 0); m_ui.m_layoutAdder->setContentsMargins(0, 0, 0, 0);
m_ui.m_btnAdder->setIcon(qApp->icons()->fromTheme(QSL("list-add"))); m_ui.m_btnAdder->setIcon(qApp->icons()->fromTheme(QSL("list-add")));