Commit cc7f7894 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

run git clang-format

parent 7daff0df
......@@ -11,8 +11,8 @@
#include "settings_advanced.h"
#include <KAboutData>
#include <KPluginFactory>
#include <KLocalizedString>
#include <KPluginFactory>
#include <QVBoxLayout>
......@@ -28,7 +28,9 @@ KCMAkregatorAdvancedConfig::KCMAkregatorAdvancedConfig(QWidget *parent, const QV
layout->addWidget(m_widget);
KAboutData *about = new KAboutData(QStringLiteral("kcmakradvancedconfig"),
i18n("Advanced Feed Reader Settings"),
QString(), QString(), KAboutLicense::GPL,
QString(),
QString(),
KAboutLicense::GPL,
i18n("(c), 2004 - 2008 Frank Osterfeld"));
about->addAuthor(i18n("Frank Osterfeld"), QString(), QStringLiteral("osterfeld@kde.org"));
......
......@@ -12,7 +12,8 @@
#include <QVariant>
namespace Akregator {
namespace Akregator
{
class SettingsAdvanced;
}
......
......@@ -9,8 +9,8 @@
#include "akregatorconfig.h"
#include <KAboutData>
#include <KPluginFactory>
#include <KLocalizedString>
#include <KPluginFactory>
#include <QAbstractSlider>
#include <QVBoxLayout>
......@@ -43,7 +43,9 @@ KCMAkregatorAppearanceConfig::KCMAkregatorAppearanceConfig(QWidget *parent, cons
connect(m_ui.kcfg_MediumFontSize, qOverload<int>(&KPluralHandlingSpinBox::valueChanged), m_ui.slider_mediumFontSize, &QSlider::setValue);
KAboutData *about = new KAboutData(QStringLiteral("kcmakrappearanceconfig"),
i18n("Configure Feed Reader Appearance"),
QString(), QString(), KAboutLicense::GPL,
QString(),
QString(),
KAboutLicense::GPL,
i18n("(c), 2004 - 2008 Frank Osterfeld"));
about->addAuthor(i18n("Frank Osterfeld"), QString(), QStringLiteral("osterfeld@kde.org"));
......
......@@ -8,16 +8,15 @@
#include "akregator_config_archive.h"
#include "ui_settings_archive.h"
#include <KAboutData>
#include <KPluginFactory>
#include <KLocalizedString>
#include <KPluginFactory>
#include <QButtonGroup>
#include <QVBoxLayout>
using namespace Akregator;
K_PLUGIN_FACTORY(KCMAkregatorArchiveConfigFactory, registerPlugin<KCMAkregatorArchiveConfig>();
)
K_PLUGIN_FACTORY(KCMAkregatorArchiveConfigFactory, registerPlugin<KCMAkregatorArchiveConfig>();)
KCMAkregatorArchiveConfig::KCMAkregatorArchiveConfig(QWidget *parent, const QVariantList &args)
: KCModule(parent, args)
......@@ -28,10 +27,8 @@ KCMAkregatorArchiveConfig::KCMAkregatorArchiveConfig(QWidget *parent, const QVar
auto *layout = new QVBoxLayout(this);
layout->addWidget(m_widget);
connect(m_ui.rb_LimitArticleNumber, &QAbstractButton::toggled,
m_ui.kcfg_MaxArticleNumber, &QWidget::setEnabled);
connect(m_ui.rb_LimitArticleAge, &QAbstractButton::toggled,
m_ui.kcfg_MaxArticleAge, &QWidget::setEnabled);
connect(m_ui.rb_LimitArticleNumber, &QAbstractButton::toggled, m_ui.kcfg_MaxArticleNumber, &QWidget::setEnabled);
connect(m_ui.rb_LimitArticleAge, &QAbstractButton::toggled, m_ui.kcfg_MaxArticleAge, &QWidget::setEnabled);
m_ui.kcfg_MaxArticleNumber->setSuffix(ki18ncp("Limit feed archive size to:", " article", " articles"));
m_ui.kcfg_MaxArticleAge->setSuffix(ki18ncp("Delete articles older than:", " day", " days"));
......@@ -44,7 +41,9 @@ KCMAkregatorArchiveConfig::KCMAkregatorArchiveConfig(QWidget *parent, const QVar
KAboutData *about = new KAboutData(QStringLiteral("kcmakrarchiveconfig"),
i18n("Configure Feed Reader Archive"),
QString(), QString(), KAboutLicense::GPL,
QString(),
QString(),
KAboutLicense::GPL,
i18n("(c), 2004 - 2008 Frank Osterfeld"));
about->addAuthor(i18n("Frank Osterfeld"), QString(), QStringLiteral("osterfeld@kde.org"));
......
......@@ -11,8 +11,8 @@
#include "ui_settings_browser.h"
#include <KAboutData>
#include <KPluginFactory>
#include <KLocalizedString>
#include <KPluginFactory>
#include <QVBoxLayout>
......@@ -30,11 +30,12 @@ KCMAkregatorBrowserConfig::KCMAkregatorBrowserConfig(QWidget *parent, const QVar
auto *layout = new QVBoxLayout(this);
layout->addWidget(m_widget);
connect(ui.kcfg_ExternalBrowserUseCustomCommand, &QAbstractButton::toggled,
ui.kcfg_ExternalBrowserCustomCommand, &QWidget::setEnabled);
connect(ui.kcfg_ExternalBrowserUseCustomCommand, &QAbstractButton::toggled, ui.kcfg_ExternalBrowserCustomCommand, &QWidget::setEnabled);
KAboutData *about = new KAboutData(QStringLiteral("kcmakrbrowserconfig"),
i18n("Configure Feed Reader Browser"),
QString(), QString(), KAboutLicense::GPL,
QString(),
QString(),
KAboutLicense::GPL,
i18n("(c), 2004 - 2008 Frank Osterfeld"));
about->addAuthor(i18n("Frank Osterfeld"), QString(), QStringLiteral("osterfeld@kde.org"));
......
......@@ -11,15 +11,14 @@
#include "ui_settings_general.h"
#include <KAboutData>
#include <KPluginFactory>
#include <KLocalizedString>
#include <KPluginFactory>
#include <QVBoxLayout>
using namespace Akregator;
K_PLUGIN_FACTORY(KCMAkregatorGeneralConfigFactory, registerPlugin<KCMAkregatorGeneralConfig>();
)
K_PLUGIN_FACTORY(KCMAkregatorGeneralConfigFactory, registerPlugin<KCMAkregatorGeneralConfig>();)
KCMAkregatorGeneralConfig::KCMAkregatorGeneralConfig(QWidget *parent, const QVariantList &args)
: KCModule(parent, args)
......@@ -37,7 +36,9 @@ KCMAkregatorGeneralConfig::KCMAkregatorGeneralConfig(QWidget *parent, const QVar
connect(ui.kcfg_UseIntervalFetch, &QAbstractButton::toggled, ui.autoFetchIntervalLabel, &QWidget::setEnabled);
KAboutData *about = new KAboutData(QStringLiteral("kcmakrgeneralconfig"),
i18n("Configure Feeds"),
QString(), QString(), KAboutLicense::GPL,
QString(),
QString(),
KAboutLicense::GPL,
i18n("(c), 2004 - 2008 Frank Osterfeld"));
about->addAuthor(i18n("Frank Osterfeld"), QString(), QStringLiteral("osterfeld@kde.org"));
......
......@@ -8,15 +8,14 @@
#include "akregatorconfig.h"
#include "akregatorconfigurepluginlistwidget.h"
#include <KAboutData>
#include <KPluginFactory>
#include <KLocalizedString>
#include <PimCommon/ConfigurePluginsWidget>
#include <KPluginFactory>
#include <PimCommon/ConfigurePluginsListWidget>
#include <PimCommon/ConfigurePluginsWidget>
#include <QHBoxLayout>
using namespace Akregator;
K_PLUGIN_FACTORY(KCMAkregatorPluginsConfigFactory, registerPlugin<KCMAkregatorPluginsConfig>();
)
K_PLUGIN_FACTORY(KCMAkregatorPluginsConfigFactory, registerPlugin<KCMAkregatorPluginsConfig>();)
KCMAkregatorPluginsConfig::KCMAkregatorPluginsConfig(QWidget *parent, const QVariantList &args)
: KCModule(parent, args)
......@@ -26,7 +25,9 @@ KCMAkregatorPluginsConfig::KCMAkregatorPluginsConfig(QWidget *parent, const QVar
KAboutData *about = new KAboutData(QStringLiteral("kcmakrpluginsconfig"),
i18n("Configure Plugins"),
QString(), QString(), KAboutLicense::GPL,
QString(),
QString(),
KAboutLicense::GPL,
i18n("(c), 2016-2020 Laurent Montel"));
about->addAuthor(i18n("Laurent Montel"), QString(), QStringLiteral("montel@kde.org"));
......
......@@ -9,11 +9,13 @@
#include <KCModule>
#include <QVariant>
namespace PimCommon {
namespace PimCommon
{
class ConfigurePluginsWidget;
}
namespace Akregator {
namespace Akregator
{
class KCMAkregatorPluginsConfig : public KCModule
{
Q_OBJECT
......@@ -24,6 +26,7 @@ public:
void defaults() override;
private Q_SLOTS:
void slotConfigChanged();
private:
PimCommon::ConfigurePluginsWidget *mConfigurePluginWidget = nullptr;
};
......
......@@ -6,18 +6,17 @@
#include "akregator_config_userfeedback.h"
#include <KAboutData>
#include <KPluginFactory>
#include <KLocalizedString>
#include <KPluginFactory>
#include <QHBoxLayout>
#ifdef WITH_KUSERFEEDBACK
#include <KUserFeedback/FeedbackConfigWidget>
#include "userfeedback/userfeedbackmanager.h"
#include <KUserFeedback/FeedbackConfigWidget>
#endif
using namespace Akregator;
K_PLUGIN_FACTORY(KCMAkregatorUserFeedBackConfigFactory, registerPlugin<KCMAkregatorUserFeedBackConfig>();
)
K_PLUGIN_FACTORY(KCMAkregatorUserFeedBackConfigFactory, registerPlugin<KCMAkregatorUserFeedBackConfig>();)
KCMAkregatorUserFeedBackConfig::KCMAkregatorUserFeedBackConfig(QWidget *parent, const QVariantList &args)
: KCModule(parent, args)
......@@ -27,7 +26,9 @@ KCMAkregatorUserFeedBackConfig::KCMAkregatorUserFeedBackConfig(QWidget *parent,
KAboutData *about = new KAboutData(QStringLiteral("kcmaddressbookuserfeedbackconfig"),
i18n("Configure User Feedback"),
QString(), QString(), KAboutLicense::GPL,
QString(),
QString(),
KAboutLicense::GPL,
i18n("(c), 2020 Laurent Montel"));
about->addAuthor(i18n("Laurent Montel"), QString(), QStringLiteral("montel@kde.org"));
......@@ -53,7 +54,7 @@ void KCMAkregatorUserFeedBackConfig::load()
void KCMAkregatorUserFeedBackConfig::defaults()
{
//TODO fixme default values
// TODO fixme default values
mUserFeedbackWidget->setFeedbackProvider(Akregator::UserFeedBackManager::self()->userFeedbackProvider());
}
......
......@@ -10,11 +10,13 @@
#include <KCModule>
#include <QVariant>
namespace KUserFeedback {
namespace KUserFeedback
{
class FeedbackConfigWidget;
}
namespace Akregator {
namespace Akregator
{
class KCMAkregatorUserFeedBackConfig : public KCModule
{
Q_OBJECT
......@@ -23,6 +25,7 @@ public:
void load() override;
void save() override;
void defaults() override;
private:
KUserFeedback::FeedbackConfigWidget *mUserFeedbackWidget = nullptr;
};
......
......@@ -5,11 +5,12 @@
*/
#include "akregatorconfigurepluginlistwidget.h"
#include <WebEngineViewer/NetworkUrlInterceptorPluginManager>
#include <WebEngineViewer/NetworkPluginUrlInterceptor>
#include "kcm_config_plugins_debug.h"
#include <KLocalizedString>
namespace {
#include <WebEngineViewer/NetworkPluginUrlInterceptor>
#include <WebEngineViewer/NetworkUrlInterceptorPluginManager>
namespace
{
QString networkUrlInterceptorGroupName()
{
return QStringLiteral("networkurlinterceptorgroupname");
......@@ -47,7 +48,7 @@ void AkregatorConfigurePluginListWidget::doResetToDefaultsOther()
void AkregatorConfigurePluginListWidget::initialize()
{
mListWidget->clear();
//Load webengineplugin
// Load webengineplugin
PimCommon::ConfigurePluginsListWidget::fillTopItems(WebEngineViewer::NetworkUrlInterceptorPluginManager::self()->pluginsDataList(),
i18n("Webengine Plugins"),
WebEngineViewer::NetworkUrlInterceptorPluginManager::self()->configGroupName(),
......@@ -61,7 +62,8 @@ void AkregatorConfigurePluginListWidget::slotConfigureClicked(const QString &con
{
if (!configureGroupName.isEmpty() && !identifier.isEmpty()) {
if (configureGroupName == networkUrlInterceptorGroupName()) {
WebEngineViewer::NetworkPluginUrlInterceptor *plugin = WebEngineViewer::NetworkUrlInterceptorPluginManager::self()->pluginFromIdentifier(identifier);
WebEngineViewer::NetworkPluginUrlInterceptor *plugin =
WebEngineViewer::NetworkUrlInterceptorPluginManager::self()->pluginFromIdentifier(identifier);
plugin->showConfigureDialog(this);
} else {
qCWarning(AKREGATOR_CONFIG_PLUGIN_LOG) << "Unknown configureGroupName" << configureGroupName;
......
......@@ -20,6 +20,7 @@ public:
void doLoadFromGlobalSettings() override;
void doResetToDefaultsOther() override;
void initialize() override;
private:
void slotConfigureClicked(const QString &configureGroupName, const QString &identifier);
QVector<PluginItem *> mPluginWebEngineItems;
......
......@@ -20,7 +20,8 @@
#include <cassert>
using namespace Akregator;
SettingsAdvanced::SettingsAdvanced(QWidget *parent) : QWidget(parent)
SettingsAdvanced::SettingsAdvanced(QWidget *parent)
: QWidget(parent)
{
setupUi(this);
......
......@@ -16,8 +16,10 @@
class QString;
class QWidget;
namespace Akregator {
namespace Backend {
namespace Akregator
{
namespace Backend
{
class StorageFactory;
}
......@@ -43,4 +45,4 @@ private:
};
} // namespace Akregator
#endif //AKREGATOR_SETTINGS_ADVANCED_H
#endif // AKREGATOR_SETTINGS_ADVANCED_H
......@@ -7,27 +7,27 @@
*
*/
#include "feedstorage.h"
#include "plugin.h"
#include "storage.h"
#include "storagefactory.h"
#include "storagefactoryregistry.h"
#include "plugin.h"
#include <KLocalizedString>
#include <Syndication/Constants>
#include <Syndication/Atom/Atom>
#include <Syndication/Constants>
#include <QDateTime>
#include <QFile>
#include <QIODevice>
#include <QStringList>
#include <QXmlStreamWriter>
#include <QVariant>
#include <QXmlStreamWriter>
#include <KPluginLoader>
#include <KService>
#include <KServiceTypeTrader>
#include <QUrl>
#include <QDebug>
#include <QUrl>
#include <iostream>
......@@ -36,24 +36,16 @@
using namespace Akregator;
using namespace Akregator::Backend;
namespace {
namespace
{
static QString akregatorNamespace()
{
return QStringLiteral("http://akregator.kde.org/StorageExporter#");
}
enum TextMode {
PlainText,
Html
};
enum TextMode { PlainText, Html };
enum Status {
Deleted = 0x01,
Trash = 0x02,
New = 0x04,
Read = 0x08,
Keep = 0x10
};
enum Status { Deleted = 0x01, Trash = 0x02, New = 0x04, Read = 0x08, Keep = 0x10 };
class Element
{
......@@ -101,7 +93,8 @@ public:
};
struct Elements {
Elements() : atomNS(Syndication::Atom::atom1Namespace())
Elements()
: atomNS(Syndication::Atom::atom1Namespace())
, akregatorNS(akregatorNamespace())
, commentNS(Syndication::commentApiNamespace())
, title(atomNS, QStringLiteral("title"))
......@@ -252,10 +245,7 @@ static void writeItem(FeedStorage *storage, const QString &guid, QXmlStreamWrite
Elements::instance.summary.write(storage->description(guid), writer, Html);
Elements::instance.content.write(storage->content(guid), writer, Html);
writeAuthor(storage->authorName(guid),
storage->authorUri(guid),
storage->authorEMail(guid),
writer);
writeAuthor(storage->authorName(guid), storage->authorUri(guid), storage->authorEMail(guid), writer);
bool hasEnc = false;
QString encUrl, encType;
......@@ -300,10 +290,10 @@ static void serialize(Storage *storage, const QString &url, QIODevice *device)
static KService::List queryStoragePlugins()
{
return KServiceTypeTrader::self()->query(QStringLiteral("Akregator/Plugin"),
QStringLiteral("[X-KDE-akregator-framework-version] == %1 and [X-KDE-akregator-plugintype] == 'storage' and [X-KDE-akregator-rank] > 0").arg(QString::
number(
AKREGATOR_PLUGIN_INTERFACE_VERSION)));
return KServiceTypeTrader::self()->query(
QStringLiteral("Akregator/Plugin"),
QStringLiteral("[X-KDE-akregator-framework-version] == %1 and [X-KDE-akregator-plugintype] == 'storage' and [X-KDE-akregator-rank] > 0")
.arg(QString::number(AKREGATOR_PLUGIN_INTERFACE_VERSION)));
}
static Plugin *createFromService(const KService::Ptr &service)
......@@ -311,8 +301,10 @@ static Plugin *createFromService(const KService::Ptr &service)
KPluginLoader loader(*service);
KPluginFactory *factory = loader.factory();
if (!factory) {
qCritical() << QStringLiteral(" Could not create plugin factory for: %1\n"
" Error message: %2").arg(service->library(), loader.errorString());
qCritical() << QStringLiteral(
" Could not create plugin factory for: %1\n"
" Error message: %2")
.arg(service->library(), loader.errorString());
return nullptr;
}
return factory->create<Akregator::Plugin>();
......
......@@ -13,8 +13,8 @@
#include "akregator_export.h"
#include "types.h"
#include <Syndication/Person>
#include <QSharedPointer>
#include <Syndication/Person>
class QDateTime;
class QString;
......@@ -25,14 +25,17 @@ typedef unsigned int uint;
class QUrl;
namespace Syndication {
namespace Syndication
{
class Enclosure;
class Item;
typedef QSharedPointer<Item> ItemPtr;
}
namespace Akregator {
namespace Backend {
namespace Akregator
{
namespace Backend
{
class FeedStorage;
}
......@@ -123,7 +126,7 @@ public:
bool operator>(const Article &other) const;
bool operator>=(const Article &other) const;
private: //only for our friends
private: // only for our friends
void setStatus(int s);
void setDeleted();
void setKeep(bool keep);
......
......@@ -21,11 +21,13 @@ public:
QPointer<QWidget> parentWidget;
};
Command::Private::Private() : parentWidget()
Command::Private::Private()
: parentWidget()
{
}
Command::Command(QObject *parent) : QObject(parent)
Command::Command(QObject *parent)
: QObject(parent)
, d(new Private)
{
}
......
......@@ -15,7 +15,8 @@
class QWidget;
namespace Akregator {
namespace Akregator
{
class AKREGATORINTERFACES_EXPORT Command : public QObject
{
Q_OBJECT
......
......@@ -14,7 +14,8 @@
class QString;
#include <QStringList>
namespace Akregator {
namespace Akregator
{
class AKREGATORINTERFACES_EXPORT FeedListManagementInterface
{
public:
......
......@@ -13,14 +13,15 @@ class QString;
#include <QStringList>
class QDateTime;
namespace Akregator {
namespace Backend {
namespace Akregator
{
namespace Backend
{
class Storage;
class FeedStorage : public QObject //krazy:exclude=qobject
class FeedStorage : public QObject // krazy:exclude=qobject
{
public:
virtual int unread() const = 0;
virtual void setUnread(int unread) = 0;
virtual int totalCount() const = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment