tweaked clang format

This commit is contained in:
Martin Rotter 2024-03-19 10:31:49 +01:00 committed by martinrotter
parent 217374071d
commit a29d4b80bb
212 changed files with 612 additions and 617 deletions

View File

@ -92,11 +92,11 @@ IncludeCategories:
SortPriority: 0
CaseSensitive: false
- Regex: '^<[A-Z]'
Priority: 3
Priority: 4
SortPriority: 0
CaseSensitive: true
- Regex: '^<[a-z0-9]'
Priority: 4
Priority: 3
SortPriority: 0
CaseSensitive: true
IncludeIsMainRegex: '(Test)?$'

View File

@ -2,6 +2,16 @@
#include "src/gui/formdiscoverfeeds.h"
#include "src/definitions.h"
#include "src/gui/formstandardfeeddetails.h"
#include "src/parsers/atomparser.h"
#include "src/parsers/icalparser.h"
#include "src/parsers/jsonparser.h"
#include "src/parsers/rdfparser.h"
#include "src/parsers/rssparser.h"
#include "src/parsers/sitemapparser.h"
#include "src/standardfeed.h"
#include <librssguard/3rd-party/boolinq/boolinq.h>
#include <librssguard/database/databasequeries.h>
#include <librssguard/gui/guiutilities.h>
@ -10,16 +20,6 @@
#include <librssguard/miscellaneous/settings.h>
#include <librssguard/services/abstract/category.h>
#include <librssguard/services/abstract/serviceroot.h>
#include "src/definitions.h"
#include "src/gui/formstandardfeeddetails.h"
#include "src/standardfeed.h"
#include "src/parsers/atomparser.h"
#include "src/parsers/icalparser.h"
#include "src/parsers/jsonparser.h"
#include "src/parsers/rdfparser.h"
#include "src/parsers/rssparser.h"
#include "src/parsers/sitemapparser.h"
#include <QtConcurrentMap>

View File

@ -7,11 +7,11 @@
#include "ui_formdiscoverfeeds.h"
#include <librssguard/services/abstract/accountcheckmodel.h>
#include <QDialog>
#include <QFutureWatcher>
#include <librssguard/services/abstract/accountcheckmodel.h>
class ServiceRoot;
class RootItem;
class Category;

View File

@ -2,6 +2,9 @@
#include "src/gui/formstandardfeeddetails.h"
#include "src/gui/standardfeeddetails.h"
#include "src/standardfeed.h"
#include <librssguard/database/databasequeries.h>
#include <librssguard/exceptions/applicationexception.h>
#include <librssguard/miscellaneous/application.h>
@ -10,8 +13,6 @@
#include <librssguard/services/abstract/category.h>
#include <librssguard/services/abstract/gui/authenticationdetails.h>
#include <librssguard/services/abstract/serviceroot.h>
#include "src/gui/standardfeeddetails.h"
#include "src/standardfeed.h"
#include <QComboBox>
#include <QDialogButtonBox>

View File

@ -2,15 +2,15 @@
#include "src/gui/formstandardimportexport.h"
#include "src/standardfeedsimportexportmodel.h"
#include "src/standardserviceroot.h"
#include <librssguard/exceptions/ioexception.h>
#include <librssguard/gui/guiutilities.h>
#include <librssguard/miscellaneous/application.h>
#include <librssguard/miscellaneous/iconfactory.h>
#include <librssguard/services/abstract/category.h>
#include "src/standardfeedsimportexportmodel.h"
#include "src/standardserviceroot.h"
#include <QFileDialog>
#include <QTextStream>

View File

@ -2,9 +2,10 @@
#include "src/gui/standardaccountdetails.h"
#include "src/standardserviceentrypoint.h"
#include <librssguard/3rd-party/boolinq/boolinq.h>
#include <librssguard/miscellaneous/iconfactory.h>
#include "src/standardserviceentrypoint.h"
#include <QFileDialog>
#include <QImageReader>

View File

@ -2,6 +2,8 @@
#include "src/gui/standardfeeddetails.h"
#include "src/definitions.h"
#include <librssguard/3rd-party/boolinq/boolinq.h>
#include <librssguard/exceptions/applicationexception.h>
#include <librssguard/exceptions/networkexception.h>
@ -10,7 +12,6 @@
#include <librssguard/miscellaneous/textfactory.h>
#include <librssguard/network-web/networkfactory.h>
#include <librssguard/services/abstract/category.h>
#include "src/definitions.h"
#include <QFileDialog>
#include <QImageReader>

View File

@ -2,13 +2,14 @@
#include "src/parsers/atomparser.h"
#include "src/definitions.h"
#include "src/standardfeed.h"
#include <librssguard/definitions/definitions.h>
#include <librssguard/exceptions/applicationexception.h>
#include <librssguard/miscellaneous/application.h>
#include <librssguard/miscellaneous/settings.h>
#include <librssguard/miscellaneous/textfactory.h>
#include "src/definitions.h"
#include "src/standardfeed.h"
#include <QTextCodec>

View File

@ -5,11 +5,11 @@
#include "src/parsers/feedparser.h"
#include <librssguard/core/message.h>
#include <QDomDocument>
#include <QList>
#include <librssguard/core/message.h>
class AtomParser : public FeedParser {
public:
explicit AtomParser(const QString& data);

View File

@ -9,13 +9,12 @@
#include <librssguard/exceptions/feedfetchexception.h>
#include <librssguard/miscellaneous/iofactory.h>
#include <librssguard/network-web/webfactory.h>
#include <utility>
#include <QDebug>
#include <QFile>
#include <QRegularExpression>
#include <utility>
FeedParser::FeedParser(QString data, DataType is_xml)
: m_dataType(is_xml), m_data(std::move(data)), m_mrssNamespace(QSL("http://search.yahoo.com/mrss/")) {
if (m_data.isEmpty()) {

View File

@ -5,15 +5,15 @@
#include "src/standardfeed.h"
#include <librssguard/core/message.h>
#include <librssguard/definitions/typedefs.h>
#include <QDomDocument>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QString>
#include <librssguard/core/message.h>
#include <librssguard/definitions/typedefs.h>
// Base class for all XML-based feed parsers.
class FeedParser {
public:

View File

@ -2,6 +2,8 @@
#include "src/parsers/icalparser.h"
#include "src/definitions.h"
#include <librssguard/3rd-party/boolinq/boolinq.h>
#include <librssguard/definitions/definitions.h>
#include <librssguard/exceptions/applicationexception.h>
@ -9,7 +11,6 @@
#include <librssguard/miscellaneous/application.h>
#include <librssguard/miscellaneous/settings.h>
#include <librssguard/miscellaneous/textfactory.h>
#include "src/definitions.h"
IcalParser::IcalParser(const QString& data)
: FeedParser(data, DataType::Other), m_iCalendar(Icalendar(m_data.toUtf8())) {}

View File

@ -2,14 +2,15 @@
#include "src/parsers/jsonparser.h"
#include "src/definitions.h"
#include "src/standardfeed.h"
#include <librssguard/definitions/definitions.h>
#include <librssguard/definitions/typedefs.h>
#include <librssguard/exceptions/applicationexception.h>
#include <librssguard/exceptions/feedrecognizedbutfailedexception.h>
#include <librssguard/miscellaneous/settings.h>
#include <librssguard/miscellaneous/textfactory.h>
#include "src/definitions.h"
#include "src/standardfeed.h"
#include <QJsonArray>
#include <QJsonDocument>

View File

@ -2,11 +2,12 @@
#include "src/parsers/rdfparser.h"
#include "src/definitions.h"
#include "src/standardfeed.h"
#include <librssguard/exceptions/applicationexception.h>
#include <librssguard/miscellaneous/settings.h>
#include <librssguard/miscellaneous/textfactory.h>
#include "src/definitions.h"
#include "src/standardfeed.h"
#include <QDomDocument>
#include <QTextCodec>

View File

@ -2,13 +2,14 @@
#include "src/parsers/rssparser.h"
#include "src/definitions.h"
#include "src/standardfeed.h"
#include <librssguard/exceptions/applicationexception.h>
#include <librssguard/miscellaneous/application.h>
#include <librssguard/miscellaneous/settings.h>
#include <librssguard/miscellaneous/textfactory.h>
#include <librssguard/network-web/networkfactory.h>
#include "src/definitions.h"
#include "src/standardfeed.h"
#include <QDomDocument>
#include <QTextCodec>

View File

@ -7,6 +7,7 @@
#endif
#include "src/definitions.h"
#include <librssguard/definitions/definitions.h>
#include <librssguard/exceptions/applicationexception.h>
#include <librssguard/exceptions/feedrecognizedbutfailedexception.h>

View File

@ -4,7 +4,6 @@
#define SITEMAPPARSER_H
#include "src/parsers/feedparser.h"
#include "src/standardfeed.h"
class SitemapParser : public FeedParser {

View File

@ -4,6 +4,7 @@
#include "src/gui/formstandardfeeddetails.h"
#include "src/standardserviceroot.h"
#include <librssguard/database/databasequeries.h>
#include <librssguard/definitions/definitions.h>
#include <librssguard/exceptions/applicationexception.h>

View File

@ -3,9 +3,8 @@
#ifndef FEEDSMODELFEED_H
#define FEEDSMODELFEED_H
#include <librssguard/services/abstract/feed.h>
#include <librssguard/network-web/networkfactory.h>
#include <librssguard/services/abstract/feed.h>
#include <QCoreApplication>
#include <QDateTime>

View File

@ -2,15 +2,16 @@
#include "src/standardfeedsimportexportmodel.h"
#include "src/definitions.h"
#include "src/standardcategory.h"
#include "src/standardfeed.h"
#include "src/standardserviceroot.h"
#include <librssguard/3rd-party/boolinq/boolinq.h>
#include <librssguard/definitions/definitions.h>
#include <librssguard/exceptions/applicationexception.h>
#include <librssguard/miscellaneous/application.h>
#include <librssguard/miscellaneous/iconfactory.h>
#include "src/definitions.h"
#include "src/standardcategory.h"
#include "src/standardfeed.h"
#include "src/standardserviceroot.h"
#include <QDomAttr>
#include <QDomDocument>

View File

@ -4,6 +4,7 @@
#include "src/gui/formeditstandardaccount.h"
#include "src/standardserviceroot.h"
#include <librssguard/database/databasequeries.h>
#include <librssguard/definitions/definitions.h>
#include <librssguard/miscellaneous/application.h>

View File

@ -2,19 +2,6 @@
#include "src/standardserviceroot.h"
#include <librssguard/database/databasequeries.h>
#include <librssguard/definitions/definitions.h>
#include <librssguard/exceptions/applicationexception.h>
#include <librssguard/exceptions/feedfetchexception.h>
#include <librssguard/exceptions/scriptexception.h>
#include <librssguard/gui/messagebox.h>
#include <librssguard/miscellaneous/application.h>
#include <librssguard/miscellaneous/iconfactory.h>
#include <librssguard/miscellaneous/mutex.h>
#include <librssguard/miscellaneous/settings.h>
#include <librssguard/network-web/networkfactory.h>
#include <librssguard/services/abstract/gui/formcategorydetails.h>
#include "src/definitions.h"
#include "src/gui/formdiscoverfeeds.h"
#include "src/gui/formeditstandardaccount.h"
@ -31,6 +18,19 @@
#include "src/standardfeedsimportexportmodel.h"
#include "src/standardserviceentrypoint.h"
#include <librssguard/database/databasequeries.h>
#include <librssguard/definitions/definitions.h>
#include <librssguard/exceptions/applicationexception.h>
#include <librssguard/exceptions/feedfetchexception.h>
#include <librssguard/exceptions/scriptexception.h>
#include <librssguard/gui/messagebox.h>
#include <librssguard/miscellaneous/application.h>
#include <librssguard/miscellaneous/iconfactory.h>
#include <librssguard/miscellaneous/mutex.h>
#include <librssguard/miscellaneous/settings.h>
#include <librssguard/network-web/networkfactory.h>
#include <librssguard/services/abstract/gui/formcategorydetails.h>
#if defined(NO_LITE)
#include <librssguard/gui/webviewers/webengine/webengineviewer.h>
#include <librssguard/network-web/webengine/webenginepage.h>

View File

@ -3,10 +3,10 @@
#ifndef STANDARDSERVICEROOT_H
#define STANDARDSERVICEROOT_H
#include <librssguard/services/abstract/serviceroot.h>
#include "src/standardfeed.h"
#include <librssguard/services/abstract/serviceroot.h>
#include <QCoreApplication>
#include <QPair>

View File

@ -3,10 +3,10 @@
#ifndef ARTICLELISTNOTIFICATIONMODEL_H
#define ARTICLELISTNOTIFICATIONMODEL_H
#include <QAbstractListModel>
#include "core/message.h"
#include <QAbstractListModel>
class ArticleListNotificationModel : public QAbstractListModel {
Q_OBJECT

View File

@ -3,8 +3,6 @@
#ifndef FEEDDOWNLOADER_H
#define FEEDDOWNLOADER_H
#include <QObject>
#include "core/message.h"
#include "exceptions/applicationexception.h"
#include "services/abstract/cacheforserviceroot.h"
@ -12,6 +10,7 @@
#include <QFutureWatcher>
#include <QHash>
#include <QObject>
#include <QPair>
class MessageFilter;

View File

@ -3,10 +3,10 @@
#ifndef FEEDSMODEL_H
#define FEEDSMODEL_H
#include <QAbstractItemModel>
#include "services/abstract/rootitem.h"
#include <QAbstractItemModel>
class Category;
class Feed;
class ServiceRoot;

View File

@ -3,10 +3,10 @@
#ifndef FEEDSPROXYMODEL_H
#define FEEDSPROXYMODEL_H
#include <QSortFilterProxyModel>
#include "services/abstract/rootitem.h"
#include <QSortFilterProxyModel>
class FeedsModel;
class FeedsView;

View File

@ -3,12 +3,11 @@
#ifndef MESSAGEFILTER_H
#define MESSAGEFILTER_H
#include <QObject>
#include "core/message.h"
#include "core/messageobject.h"
#include <QJSEngine>
#include <QObject>
// Class which represents one message filter.
class RSSGUARD_DLLSPEC MessageFilter : public QObject {

View File

@ -3,10 +3,10 @@
#ifndef MESSAGEOBJECT_H
#define MESSAGEOBJECT_H
#include <QObject>
#include "services/abstract/label.h"
#include <QObject>
class MessageObject : public QObject {
Q_OBJECT

View File

@ -3,16 +3,15 @@
#ifndef MESSAGESFORFILTERSMODEL_H
#define MESSAGESFORFILTERSMODEL_H
#include <QAbstractTableModel>
#include "core/messageobject.h"
#include <QAbstractTableModel>
#include <QJSEngine>
class MessageFilter;
class MessagesForFiltersModel : public QAbstractTableModel {
Q_OBJECT
Q_OBJECT
public:
explicit MessagesForFiltersModel(QObject* parent = nullptr);

View File

@ -17,13 +17,13 @@
#include "services/abstract/recyclebin.h"
#include "services/abstract/serviceroot.h"
#include <cmath>
#include <QPainter>
#include <QPainterPath>
#include <QSqlError>
#include <QSqlField>
#include <cmath>
MessagesModel::MessagesModel(QObject* parent)
: QSqlQueryModel(parent), m_view(nullptr), m_cache(new MessagesModelCache(this)),
m_messageHighlighter(MessageHighlighter::NoHighlighting), m_customDateFormat(QString()),

View File

@ -3,15 +3,14 @@
#ifndef MESSAGESMODEL_H
#define MESSAGESMODEL_H
#include "core/messagesmodelsqllayer.h"
#include <QSqlQueryModel>
#include "core/message.h"
#include "core/messagesmodelsqllayer.h"
#include "definitions/definitions.h"
#include "services/abstract/rootitem.h"
#include <QFont>
#include <QIcon>
#include <QSqlQueryModel>
class MessagesView;
class MessagesModelCache;

View File

@ -3,15 +3,14 @@
#ifndef MESSAGESMODELCACHE_H
#define MESSAGESMODELCACHE_H
#include <QObject>
#include "core/message.h"
#include <QModelIndex>
#include <QObject>
#include <QVariant>
class MessagesModelCache : public QObject {
Q_OBJECT
Q_OBJECT
public:
explicit MessagesModelCache(QObject* parent = nullptr);

View File

@ -3,11 +3,10 @@
#ifndef MESSAGESMODELSQLLAYER_H
#define MESSAGESMODELSQLLAYER_H
#include <QSqlDatabase>
#include <QList>
#include <QMap>
#include <QPair>
#include <QSqlDatabase>
struct SortColumnsAndOrders {
QList<int> m_columns;

View File

@ -4,20 +4,19 @@
#define DATABASECLEANER_H
#include <QObject>
#include <QSqlDatabase>
struct CleanerOrders {
bool m_removeReadMessages;
bool m_shrinkDatabase;
bool m_removeOldMessages;
bool m_removeRecycleBin;
bool m_removeStarredMessages;
int m_barrierForRemovingOldMessagesInDays;
bool m_removeReadMessages;
bool m_shrinkDatabase;
bool m_removeOldMessages;
bool m_removeRecycleBin;
bool m_removeStarredMessages;
int m_barrierForRemovingOldMessagesInDays;
};
class DatabaseCleaner : public QObject {
Q_OBJECT
Q_OBJECT
public:
explicit DatabaseCleaner(QObject* parent = nullptr);

View File

@ -4,7 +4,6 @@
#define DATABASEDRIVER_H
#include <QObject>
#include <QSqlDatabase>
#include <QSqlQuery>

View File

@ -3,10 +3,9 @@
#ifndef DATABASEFACTORY_H
#define DATABASEFACTORY_H
#include <QObject>
#include "database/databasedriver.h"
#include <QObject>
#include <QSqlDatabase>
class RSSGUARD_DLLSPEC DatabaseFactory : public QObject {

View File

@ -3,8 +3,6 @@
#ifndef DATABASEQUERIES_H
#define DATABASEQUERIES_H
#include "services/abstract/rootitem.h"
#include "core/messagefilter.h"
#include "definitions/typedefs.h"
#include "miscellaneous/application.h"
@ -12,6 +10,7 @@
#include "miscellaneous/textfactory.h"
#include "services/abstract/category.h"
#include "services/abstract/label.h"
#include "services/abstract/rootitem.h"
#include "services/abstract/search.h"
#include "services/abstract/serviceroot.h"

View File

@ -6,7 +6,7 @@
#include "database/databasedriver.h"
class MariaDbDriver : public DatabaseDriver {
Q_OBJECT
Q_OBJECT
public:
enum class MariaDbError {
@ -21,8 +21,11 @@ class MariaDbDriver : public DatabaseDriver {
explicit MariaDbDriver(QObject* parent = nullptr);
MariaDbError testConnection(const QString& hostname, int port, const QString& w_database,
const QString& username, const QString& password);
MariaDbError testConnection(const QString& hostname,
int port,
const QString& w_database,
const QString& username,
const QString& password);
virtual QString location() const;
virtual QString humanDriverType() const;
@ -36,7 +39,8 @@ class MariaDbDriver : public DatabaseDriver {
virtual bool finishRestoration();
virtual qint64 databaseDataSize();
virtual QSqlDatabase connection(const QString& connection_name,
DatabaseDriver::DesiredStorageType desired_type = DatabaseDriver::DesiredStorageType::FromSettings);
DatabaseDriver::DesiredStorageType desired_type =
DatabaseDriver::DesiredStorageType::FromSettings);
virtual QString autoIncrementPrimaryKey() const;
virtual QString blob() const;

View File

@ -3,12 +3,12 @@
#ifndef TYPEDEFS_H
#define TYPEDEFS_H
#include <QList>
#include <QPair>
#include "core/message.h"
#include "services/abstract/rootitem.h"
#include <QList>
#include <QPair>
// First item here represents ID (int, primary key) of the item.
typedef QList<QPair<int, RootItem*>> Assignment;
typedef QPair<int, RootItem*> AssignmentItem;

View File

@ -9,7 +9,6 @@ class QAction;
class DynamicShortcuts {
public:
// Checks the application settings and then initializes shortcut of
// each action from actions from the settings.
static void load(const QList<QAction*>& actions);
@ -19,7 +18,6 @@ class DynamicShortcuts {
static void save(const QList<QAction*>& actions);
private:
// Constructor.
explicit DynamicShortcuts() = default;
};

View File

@ -49,7 +49,8 @@ void DynamicShortcutsWidget::updateShortcuts() {
void DynamicShortcutsWidget::populate(QList<QAction*> actions) {
m_actionBindings.clear();
std::sort(actions.begin(), actions.end(), [](QAction* lhs, QAction* rhs) {
return QString::localeAwareCompare(lhs->text().replace(QL1S("&"), QString()), rhs->text().replace(QL1S("&"), QString())) < 0;
return QString::localeAwareCompare(lhs->text().replace(QL1S("&"), QString()),
rhs->text().replace(QL1S("&"), QString())) < 0;
});
int row_id = 0;
@ -82,7 +83,7 @@ void DynamicShortcutsWidget::populate(QList<QAction*> actions) {
action_label->setToolTip(action->toolTip());
action_label->setWordWrap(true);
//action_label->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
// action_label->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
auto* action_icon = new QLabel(this);

View File

@ -11,7 +11,7 @@ class ShortcutCatcher;
typedef QPair<QAction*, ShortcutCatcher*> ActionBinding;
class DynamicShortcutsWidget : public QWidget {
Q_OBJECT
Q_OBJECT
public:
explicit DynamicShortcutsWidget(QWidget* parent = nullptr);

View File

@ -10,7 +10,7 @@ class QHBoxLayout;
class QKeySequenceEdit;
class ShortcutCatcher : public QWidget {
Q_OBJECT
Q_OBJECT
public:
explicit ShortcutCatcher(QWidget* parent = nullptr);

View File

@ -5,9 +5,8 @@
#include "network-web/networkfactory.h"
NetworkException::NetworkException(QNetworkReply::NetworkError error, const QString& message)
: ApplicationException(message.simplified().isEmpty()
? NetworkFactory::networkErrorText(error)
: message), m_networkError(error) {}
: ApplicationException(message.simplified().isEmpty() ? NetworkFactory::networkErrorText(error) : message),
m_networkError(error) {}
QNetworkReply::NetworkError NetworkException::networkError() const {
return m_networkError;

View File

@ -2,8 +2,10 @@
#include "exceptions/processexception.h"
ProcessException::ProcessException(int exit_code, QProcess::ExitStatus exit_status,
QProcess::ProcessError error, const QString& message)
ProcessException::ProcessException(int exit_code,
QProcess::ExitStatus exit_status,
QProcess::ProcessError error,
const QString& message)
: ApplicationException(message), m_error(error), m_exitStatus(exit_status), m_exitCode(exit_code) {}
QProcess::ExitStatus ProcessException::exitStatus() const {

View File

@ -3,10 +3,10 @@
#ifndef FORMABOUT_H
#define FORMABOUT_H
#include <QDialog>
#include "ui_formabout.h"
#include <QDialog>
class RSSGUARD_DLLSPEC FormAbout : public QDialog {
Q_OBJECT

View File

@ -3,18 +3,20 @@
#ifndef FORMADDACCOUNT_H
#define FORMADDACCOUNT_H
#include <QDialog>
#include "ui_formaddaccount.h"
#include <QDialog>
class ServiceEntryPoint;
class FeedsModel;
class FormAddAccount : public QDialog {
Q_OBJECT
Q_OBJECT
public:
explicit FormAddAccount(const QList<ServiceEntryPoint*>& entry_points, FeedsModel* model, QWidget* parent = nullptr);
explicit FormAddAccount(const QList<ServiceEntryPoint*>& entry_points,
FeedsModel* model,
QWidget* parent = nullptr);
virtual ~FormAddAccount();
private slots:

View File

@ -3,12 +3,12 @@
#ifndef FORMBACKUPDATABASECONFIG_H
#define FORMBACKUPDATABASECONFIG_H
#include <QDialog>
#include "ui_formbackupdatabasesettings.h"
#include <QDialog>
class FormBackupDatabaseSettings : public QDialog {
Q_OBJECT
Q_OBJECT
public:
explicit FormBackupDatabaseSettings(QWidget* parent = nullptr);

View File

@ -3,14 +3,14 @@
#ifndef FORMDATABASECLEANUP_H
#define FORMDATABASECLEANUP_H
#include <QDialog>
#include "database/databasecleaner.h"
#include "ui_formdatabasecleanup.h"
#include "database/databasecleaner.h"
#include <QDialog>
class FormDatabaseCleanup : public QDialog {
Q_OBJECT
Q_OBJECT
public:
explicit FormDatabaseCleanup(QWidget* parent = nullptr);

View File

@ -3,10 +3,10 @@
#ifndef FORMLOG_H
#define FORMLOG_H
#include <QDialog>
#include "ui_formlog.h"
#include <QDialog>
class FormLog : public QDialog {
Q_OBJECT

View File

@ -3,10 +3,10 @@
#ifndef FORMMAIN_H
#define FORMMAIN_H
#include <QMainWindow>
#include "ui_formmain.h"
#include <QMainWindow>
class StatusBar;
class QWidgetAction;

View File

@ -3,12 +3,12 @@
#ifndef FORMMESSAGEFILTERSMANAGER_H
#define FORMMESSAGEFILTERSMANAGER_H
#include <QDialog>
#include "services/abstract/serviceroot.h"
#include "ui_formmessagefiltersmanager.h"
#include <QDialog>
class AccountCheckSortedModel;
class MessageFilter;
class FeedReader;

View File

@ -3,15 +3,14 @@
#ifndef FORMRESTOREDATABASESETTINGS_H
#define FORMRESTOREDATABASESETTINGS_H
#include <QDialog>
#include "ui_formrestoredatabasesettings.h"
#include <QDialog>
class FormRestoreDatabaseSettings : public QDialog {
Q_OBJECT
Q_OBJECT
public:
// Constructors and destructors.
explicit FormRestoreDatabaseSettings(QWidget& parent);
virtual ~FormRestoreDatabaseSettings();

View File

@ -3,12 +3,8 @@
#include "gui/dialogs/formsettings.h"
#include "definitions/definitions.h"
#include "gui/messagebox.h"
#include "miscellaneous/application.h"
#include "miscellaneous/iconfactory.h"
#include "miscellaneous/settings.h"
#include "gui/guiutilities.h"
#include "gui/messagebox.h"
#include "gui/settings/settingsbrowsermail.h"
#include "gui/settings/settingsdatabase.h"
#include "gui/settings/settingsdownloads.h"
@ -20,6 +16,9 @@
#include "gui/settings/settingsnodejs.h"
#include "gui/settings/settingsnotifications.h"
#include "gui/settings/settingsshortcuts.h"
#include "miscellaneous/application.h"
#include "miscellaneous/iconfactory.h"
#include "miscellaneous/settings.h"
#include <QPainter>
#include <QScrollArea>

View File

@ -3,10 +3,10 @@
#ifndef FORMSETTINGS_H
#define FORMSETTINGS_H
#include <QDialog>
#include "ui_formsettings.h"
#include <QDialog>
class Settings;
class SettingsPanel;

View File

@ -3,13 +3,12 @@
#ifndef FORMUPDATE_H
#define FORMUPDATE_H
#include <QDialog>
#include "ui_formupdate.h"
#include "miscellaneous/systemfactory.h"
#include "network-web/downloader.h"
#include "ui_formupdate.h"
#include <QDialog>
#include <QNetworkReply>
#include <QPushButton>

View File

@ -3,10 +3,9 @@
#ifndef FEEDMESSAGEVIEWER_H
#define FEEDMESSAGEVIEWER_H
#include "gui/tabcontent.h"
#include "core/messagesmodel.h"
#include "core/messagesproxymodel.h"
#include "gui/tabcontent.h"
class WebBrowser;
class MessagePreviewer;

View File

@ -18,6 +18,8 @@
#include "services/abstract/rootitem.h"
#include "services/abstract/serviceroot.h"
#include <algorithm>
#include <QClipboard>
#include <QContextMenuEvent>
#include <QHeaderView>
@ -26,8 +28,6 @@
#include <QPointer>
#include <QTimer>
#include <algorithm>
FeedsView::FeedsView(QWidget* parent)
: BaseTreeView(parent), m_contextMenuService(nullptr), m_contextMenuBin(nullptr), m_contextMenuCategories(nullptr),
m_contextMenuFeeds(nullptr), m_contextMenuImportant(nullptr), m_contextMenuEmptySpace(nullptr),

View File

@ -3,9 +3,8 @@
#ifndef FEEDSVIEW_H
#define FEEDSVIEW_H
#include "gui/reusable/basetreeview.h"
#include "core/feedsmodel.h"
#include "gui/reusable/basetreeview.h"
#include "gui/toolbars/feedstoolbar.h"
#include <QStyledItemDelegate>

View File

@ -3,7 +3,6 @@
#include "gui/guiutilities.h"
#include "definitions/definitions.h"
#include "miscellaneous/application.h"
#include "miscellaneous/settings.h"

View File

@ -3,10 +3,10 @@
#ifndef ITEMDETAILS_H
#define ITEMDETAILS_H
#include <QWidget>
#include "ui_itemdetails.h"
#include <QWidget>
class RootItem;
class ItemDetails : public QWidget {

View File

@ -4,10 +4,10 @@
#define LIBMPVWIDGET_H
#if defined(MEDIAPLAYER_LIBMPV_OPENGL)
#include <QOpenGLWidget>
#include <mpv/render_gl.h>
#include <QOpenGLWidget>
#define BASE_WIDGET QOpenGLWidget
#else
#include <QWidget>

View File

@ -3,9 +3,8 @@
#ifndef LIBMPV_QTHELPER_H_
#define LIBMPV_QTHELPER_H_
#include <mpv/client.h>
#include <cstring>
#include <mpv/client.h>
#include <QHash>
#include <QList>

View File

@ -3,9 +3,8 @@
#ifndef MEDIAPLAYER_H
#define MEDIAPLAYER_H
#include "gui/tabcontent.h"
#include "gui/mediaplayer/playerbackend.h"
#include "gui/tabcontent.h"
#include "ui_mediaplayer.h"

View File

@ -3,9 +3,8 @@
#ifndef PLAYERBACKEND_H
#define PLAYERBACKEND_H
#include <QWidget>
#include <QUrl>
#include <QWidget>
class QVBoxLayout;
class Application;

View File

@ -5,9 +5,8 @@
#include "gui/mediaplayer/playerbackend.h"
#include <QObject>
#include <QMediaPlayer>
#include <QObject>
#if QT_VERSION_MAJOR == 6
#define PLAYBACK_STATE PlaybackState

View File

@ -3,11 +3,11 @@
#ifndef MESSAGEBOX_H
#define MESSAGEBOX_H
#include <functional>
#include <QDialogButtonBox>
#include <QMessageBox>
#include <functional>
class RSSGUARD_DLLSPEC MsgBox : public QMessageBox {
Q_OBJECT

View File

@ -18,7 +18,7 @@
MessageBrowser::MessageBrowser(bool should_resize_to_fit, QWidget* parent)
: QWidget(parent), m_txtBrowser(new MessageTextBrowser(this)), m_searchWidget(new SearchTextWidget(this)),
m_layout(new QVBoxLayout(this)) {
m_layout(new QVBoxLayout(this)) {
m_layout->setContentsMargins(3, 3, 3, 3);
m_layout->addWidget(m_txtBrowser, 1);
m_layout->addWidget(m_searchWidget);
@ -41,9 +41,7 @@ MessageBrowser::MessageBrowser(bool should_resize_to_fit, QWidget* parent)
});
connect(m_txtBrowser, &QTextBrowser::anchorClicked, this, &MessageBrowser::onAnchorClicked);
connect(m_txtBrowser,
QOverload<const QUrl&>::of(&QTextBrowser::highlighted),
[=](const QUrl& url) {
connect(m_txtBrowser, QOverload<const QUrl&>::of(&QTextBrowser::highlighted), [=](const QUrl& url) {
Q_UNUSED(url)
QToolTip::showText(QCursor::pos(), tr("Click this link to download it or open it with external browser."), this);
});
@ -86,7 +84,7 @@ QString MessageBrowser::prepareHtmlForMessage(const Message& message) {
QRegularExpression imgTagRegex("\\<img[^\\>]*src\\s*=\\s*[\"\']([^\"\']*)[\"\'][^\\>]*\\>",
QRegularExpression::PatternOption::CaseInsensitiveOption |
QRegularExpression::PatternOption::InvertedGreedinessOption);
QRegularExpression::PatternOption::InvertedGreedinessOption);
QRegularExpressionMatchIterator i = imgTagRegex.globalMatch(message.m_contents);
QString pictures_html;
@ -120,10 +118,9 @@ QString MessageBrowser::prepareHtmlForMessage(const Message& message) {
"a { color: %2; }"
"</style></head>"
"<body>%1</body>"
"</html>").arg(html,
qApp->skins()->currentSkin()
.colorForModel(SkinEnums::PaletteColors::FgInteresting)
.value<QColor>().name());
"</html>")
.arg(html,
qApp->skins()->currentSkin().colorForModel(SkinEnums::PaletteColors::FgInteresting).value<QColor>().name());
}
bool MessageBrowser::eventFilter(QObject* watched, QEvent* event) {
@ -149,15 +146,14 @@ bool MessageBrowser::eventFilter(QObject* watched, QEvent* event) {
}
void MessageBrowser::onAnchorClicked(const QUrl& url) {
if (url.toString().startsWith(INTERNAL_URL_PASSATTACHMENT) &&
m_root != nullptr &&
if (url.toString().startsWith(INTERNAL_URL_PASSATTACHMENT) && m_root != nullptr &&
m_root->getParentServiceRoot()->downloadAttachmentOnMyOwn(url)) {
return;
}
if (!url.isEmpty()) {
bool open_externally_now = qApp->settings()->value(GROUP(Browser),
SETTING(Browser::OpenLinksInExternalBrowserRightAway)).toBool();
bool open_externally_now =
qApp->settings()->value(GROUP(Browser), SETTING(Browser::OpenLinksInExternalBrowserRightAway)).toBool();
if (open_externally_now) {
qApp->web()->openUrlInExternalBrowser(url.toString());
@ -198,7 +194,10 @@ void MessageBrowser::onAnchorClicked(const QUrl& url) {
}
}
else {
MsgBox::show(qApp->mainFormWidget(), QMessageBox::Warning, tr("Incorrect link"), tr("Selected hyperlink is invalid."));
MsgBox::show(qApp->mainFormWidget(),
QMessageBox::Warning,
tr("Incorrect link"),
tr("Selected hyperlink is invalid."));
}
}

View File

@ -3,13 +3,11 @@
#ifndef MESSAGEBROWSER_H
#define MESSAGEBROWSER_H
#include <QWidget>
#include "core/message.h"
#include "services/abstract/rootitem.h"
#include <QPointer>
#include <QWidget>
class RootItem;
class QVBoxLayout;
@ -17,7 +15,7 @@ class MessageTextBrowser;
class SearchTextWidget;
class MessageBrowser : public QWidget {
Q_OBJECT
Q_OBJECT
public:
explicit MessageBrowser(bool should_resize_to_fit, QWidget* parent = nullptr);

View File

@ -3,9 +3,8 @@
#ifndef MESSAGEPREVIEWER_H
#define MESSAGEPREVIEWER_H
#include "gui/tabcontent.h"
#include "core/message.h"
#include "gui/tabcontent.h"
#include "services/abstract/label.h"
#include "services/abstract/rootitem.h"

View File

@ -3,10 +3,9 @@
#ifndef MESSAGESVIEW_H
#define MESSAGESVIEW_H
#include "gui/reusable/basetreeview.h"
#include "core/messagesmodel.h"
#include "core/messagesproxymodel.h"
#include "gui/reusable/basetreeview.h"
#include "gui/reusable/searchlineedit.h"
#include "services/abstract/rootitem.h"

View File

@ -26,8 +26,9 @@ QVariant MessageTextBrowser::loadResource(int type, const QUrl& name) {
case QTextDocument::ResourceType::ImageResource: {
if (qApp->settings()->value(GROUP(Messages), SETTING(Messages::DisplayImagePlaceholders)).toBool()) {
if (m_imagePlaceholder.isNull()) {
m_imagePlaceholder = qApp->icons()->miscPixmap(QSL("image-placeholder")).scaledToWidth(20,
Qt::TransformationMode::FastTransformation);
m_imagePlaceholder = qApp->icons()
->miscPixmap(QSL("image-placeholder"))
.scaledToWidth(20, Qt::TransformationMode::FastTransformation);
}
return m_imagePlaceholder;

View File

@ -3,12 +3,12 @@
#ifndef MESSAGETEXTBROWSER_H
#define MESSAGETEXTBROWSER_H
#include <QTextBrowser>
#include "core/message.h"
#include <QTextBrowser>
class MessageTextBrowser : public QTextBrowser {
Q_OBJECT
Q_OBJECT
public:
explicit MessageTextBrowser(QWidget* parent = nullptr);
@ -20,7 +20,7 @@ class MessageTextBrowser : public QTextBrowser {
protected:
virtual void contextMenuEvent(QContextMenuEvent* event);
virtual void wheelEvent(QWheelEvent* event);
virtual void resizeEvent (QResizeEvent* event);
virtual void resizeEvent(QResizeEvent* event);
private:
QPixmap m_imagePlaceholder;

View File

@ -3,9 +3,8 @@
#ifndef ARTICLELISTNOTIFICATION_H
#define ARTICLELISTNOTIFICATION_H
#include "gui/notifications/basetoastnotification.h"
#include "core/message.h"
#include "gui/notifications/basetoastnotification.h"
#include "ui_articlelistnotification.h"

View File

@ -5,13 +5,13 @@
#include "miscellaneous/iconfactory.h"
#include "miscellaneous/settings.h"
#include <chrono>
#include <QAbstractButton>
#include <QCloseEvent>
#include <QLabel>
#include <QTimerEvent>
#include <chrono>
using namespace std::chrono_literals;
BaseToastNotification::BaseToastNotification(QWidget* parent) : QDialog(parent), m_timerId(-1) {

View File

@ -4,7 +4,6 @@
#define BASETOASTNOTIFICATION_H
#include <QDialog>
#include <QTimer>
class QAbstractButton;

View File

@ -19,20 +19,27 @@ void NotificationsEditor::loadNotifications(const QList<Notification>& notificat
for (auto ev : all_events) {
if (notif.any([ev](auto n) {
return n.event() == ev;
})) {
return n.event() == ev;
})) {
auto* notif_editor = new SingleNotificationEditor(notif.first([ev](auto n) {
return n.event() == ev;
}), this);
}),
this);
connect(notif_editor, &SingleNotificationEditor::notificationChanged, this, &NotificationsEditor::someNotificationChanged);
connect(notif_editor,
&SingleNotificationEditor::notificationChanged,
this,
&NotificationsEditor::someNotificationChanged);
m_layout->addWidget(notif_editor);
}
else {
auto* notif_editor = new SingleNotificationEditor(Notification(ev), this);
connect(notif_editor, &SingleNotificationEditor::notificationChanged, this, &NotificationsEditor::someNotificationChanged);
connect(notif_editor,
&SingleNotificationEditor::notificationChanged,
this,
&NotificationsEditor::someNotificationChanged);
m_layout->addWidget(notif_editor);
}
@ -42,9 +49,11 @@ void NotificationsEditor::loadNotifications(const QList<Notification>& notificat
}
QList<Notification> NotificationsEditor::allNotifications() const {
auto lst = boolinq::from(findChildren<SingleNotificationEditor*>()).select([](const SingleNotificationEditor* ed) {
return ed->notification();
}).toStdList();
auto lst = boolinq::from(findChildren<SingleNotificationEditor*>())
.select([](const SingleNotificationEditor* ed) {
return ed->notification();
})
.toStdList();
return FROM_STD_LIST(QList<Notification>, lst);
}

View File

@ -3,16 +3,16 @@
#ifndef NOTIFICATIONSEDITOR_H
#define NOTIFICATIONSEDITOR_H
#include <QWidget>
#include "miscellaneous/notification.h"
#include "ui_notificationseditor.h"
#include "miscellaneous/notification.h"
#include <QWidget>
class QVBoxLayout;
class NotificationsEditor : public QWidget {
Q_OBJECT
Q_OBJECT
public:
explicit NotificationsEditor(QWidget* parent = nullptr);

View File

@ -3,14 +3,14 @@
#ifndef SINGLENOTIFICATIONEDITOR_H
#define SINGLENOTIFICATIONEDITOR_H
#include <QGroupBox>
#include "miscellaneous/notification.h"
#include "ui_singlenotificationeditor.h"
#include "miscellaneous/notification.h"
#include <QGroupBox>
class SingleNotificationEditor : public QGroupBox {
Q_OBJECT
Q_OBJECT
public:
explicit SingleNotificationEditor(const Notification& notification, QWidget* parent = nullptr);

View File

@ -4,7 +4,6 @@
#define TOASTNOTIFICATION_H
#include "gui/notifications/basetoastnotification.h"
#include "miscellaneous/application.h"
#include "ui_toastnotification.h"

View File

@ -3,10 +3,10 @@
#ifndef TOASTNOTIFICATIONSMANAGER_H
#define TOASTNOTIFICATIONSMANAGER_H
#include <QObject>
#include "miscellaneous/application.h"
#include <QObject>
class BaseToastNotification;
class ToastNotification;
class ArticleListNotification;

View File

@ -3,11 +3,11 @@
#ifndef ARTICLEAMOUNTCONTROL_H
#define ARTICLEAMOUNTCONTROL_H
#include <QWidget>
#include "services/abstract/feed.h"
#include "ui_articleamountcontrol.h"
#include "services/abstract/feed.h"
#include <QWidget>
class ArticleAmountControl : public QWidget {
Q_OBJECT

View File

@ -6,7 +6,7 @@
#include <QLineEdit>
class BaseLineEdit : public QLineEdit {
Q_OBJECT
Q_OBJECT
public:
explicit BaseLineEdit(QWidget* parent = nullptr);

View File

@ -6,8 +6,7 @@
#include <QHBoxLayout>
ComboBoxWithStatus::ComboBoxWithStatus(QWidget* parent)
: WidgetWithStatus(parent) {
ComboBoxWithStatus::ComboBoxWithStatus(QWidget* parent) : WidgetWithStatus(parent) {
m_wdgInput = new QComboBox(this);
// Set correct size for the tool button.

View File

@ -8,10 +8,9 @@
#include <QComboBox>
class ComboBoxWithStatus : public WidgetWithStatus {
Q_OBJECT
Q_OBJECT
public:
// Constructors and destructors.
explicit ComboBoxWithStatus(QWidget* parent = nullptr);
virtual ~ComboBoxWithStatus() = default;
@ -19,7 +18,6 @@ class ComboBoxWithStatus : public WidgetWithStatus {
inline QComboBox* comboBox() const {
return static_cast<QComboBox*>(m_wdgInput);
}
};
#endif // COMBOBOXWITHSTATUS_H

View File

@ -6,7 +6,7 @@
#include <QTableView>
class EditTableView : public QTableView {
Q_OBJECT
Q_OBJECT
public:
explicit EditTableView(QWidget* parent = nullptr);

View File

@ -3,9 +3,8 @@
#ifndef JSSYNTAXHIGHLIGHTER_H
#define JSSYNTAXHIGHLIGHTER_H
#include <QSyntaxHighlighter>
#include <QRegularExpression>
#include <QSyntaxHighlighter>
class JsSyntaxHighlighter : public QSyntaxHighlighter {
Q_OBJECT

View File

@ -4,11 +4,10 @@
#define LABELSMENU_H
#include "gui/reusable/nonclosablemenu.h"
#include "services/abstract/label.h"
class LabelsMenu : public NonClosableMenu {
Q_OBJECT
Q_OBJECT
public:
explicit LabelsMenu(const QList<Message>& messages, const QList<Label*>& labels, QWidget* parent = nullptr);
@ -31,7 +30,7 @@ class LabelsMenu : public NonClosableMenu {
};
class LabelAction : public QAction {
Q_OBJECT
Q_OBJECT
public:
explicit LabelAction(Label* label, QWidget* parent_widget, QObject* parent);

View File

@ -6,8 +6,7 @@
#include <QHBoxLayout>
LabelWithStatus::LabelWithStatus(QWidget* parent)
: WidgetWithStatus(parent) {
LabelWithStatus::LabelWithStatus(QWidget* parent) : WidgetWithStatus(parent) {
m_wdgInput = new QLabel(this);
// Set correct size for the tool button.

View File

@ -7,8 +7,7 @@
#include <QHBoxLayout>
LineEditWithStatus::LineEditWithStatus(QWidget* parent)
: WidgetWithStatus(parent) {
LineEditWithStatus::LineEditWithStatus(QWidget* parent) : WidgetWithStatus(parent) {
m_wdgInput = new BaseLineEdit(this);
setFocusProxy(m_wdgInput);
@ -22,8 +21,7 @@ LineEditWithStatus::LineEditWithStatus(QWidget* parent)
m_layout->addWidget(m_btnStatus);
}
TextEditWithStatus::TextEditWithStatus(QWidget* parent)
: WidgetWithStatus(parent) {
TextEditWithStatus::TextEditWithStatus(QWidget* parent) : WidgetWithStatus(parent) {
m_wdgInput = new QPlainTextEdit(this);
setFocusProxy(m_wdgInput);

View File

@ -3,9 +3,8 @@
#ifndef LINEEDITWITHSTATUS_H
#define LINEEDITWITHSTATUS_H
#include "gui/reusable/widgetwithstatus.h"
#include "gui/reusable/baselineedit.h"
#include "gui/reusable/widgetwithstatus.h"
#include <QPlainTextEdit>

View File

@ -9,7 +9,7 @@ class WebBrowser;
class GoogleSuggest;
class LocationLineEdit : public BaseLineEdit {
Q_OBJECT
Q_OBJECT
public:
explicit LocationLineEdit(QWidget* parent = nullptr);

View File

@ -6,7 +6,7 @@
#include <QSpinBox>
class MessageCountSpinBox : public QSpinBox {
Q_OBJECT
Q_OBJECT
public:
explicit MessageCountSpinBox(QWidget* parent = nullptr);

View File

@ -2,10 +2,10 @@
#include "gui/reusable/networkproxydetails.h"
#include "ui_networkproxydetails.h"
#include "definitions/definitions.h"
#include "ui_networkproxydetails.h"
#include <QNetworkProxy>
NetworkProxyDetails::NetworkProxyDetails(QWidget* parent) : QWidget(parent), m_ui(new Ui::NetworkProxyDetails()) {

View File

@ -3,9 +3,8 @@
#ifndef NETWORKPROXYDETAILS_H
#define NETWORKPROXYDETAILS_H
#include <QWidget>
#include <QNetworkProxy>
#include <QWidget>
namespace Ui {
class NetworkProxyDetails;

View File

@ -6,7 +6,7 @@
#include <QToolButton>
class PlainToolButton : public QToolButton {
Q_OBJECT
Q_OBJECT
public:
explicit PlainToolButton(QWidget* parent = nullptr);

View File

@ -19,7 +19,11 @@ class SearchLineEdit : public BaseLineEdit {
int m_data;
};
enum class SearchMode { FixedString = 1, Wildcard = 2, RegularExpression = 4 };
enum class SearchMode {
FixedString = 1,
Wildcard = 2,
RegularExpression = 4
};
explicit SearchLineEdit(const QList<CustomSearchChoice>& choices, QWidget* parent = nullptr);

View File

@ -3,16 +3,16 @@
#ifndef SEARCHTEXTWIDGET_H
#define SEARCHTEXTWIDGET_H
#include <QWidget>
#include "ui_searchtextwidget.h"
#include <QWidget>
namespace Ui {
class SearchTextWidget;
}
class SearchTextWidget : public QWidget {
Q_OBJECT
Q_OBJECT
public:
explicit SearchTextWidget(QWidget* parent = nullptr);

View File

@ -6,7 +6,7 @@
#include <QLabel>
class SqueezeLabel : public QLabel {
Q_OBJECT
Q_OBJECT
public:
explicit SqueezeLabel(QWidget* parent = nullptr);

Some files were not shown because too many files have changed in this diff Show More