Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit ef009f5f authored by Laurent Montel's avatar Laurent Montel 😁

Fix warning

parent 920bc5d6
......@@ -25,7 +25,7 @@
#include "actionmanager.h"
using namespace Akregator;
ActionManager *ActionManager::m_self = 0;
ActionManager *ActionManager::m_self = nullptr;
ActionManager *ActionManager::getInstance()
{
......
......@@ -143,7 +143,7 @@ void ActionManagerImpl::slotSettingsChanged()
void ActionManagerImpl::slotNodeSelected(TreeNode *node)
{
if (node != 0) {
if (node) {
d->nodeSelectVisitor->visit(node);
}
}
......@@ -154,12 +154,12 @@ ActionManagerImpl::ActionManagerImpl(Part *part, QObject *parent)
{
d->nodeSelectVisitor = new NodeSelectVisitor(this);
d->part = part;
d->subscriptionListView = 0;
d->articleList = 0;
d->trayIcon = 0;
d->mainWidget = 0;
d->tabWidget = 0;
d->tagMenu = 0;
d->subscriptionListView = nullptr;
d->articleList = nullptr;
d->trayIcon = nullptr;
d->mainWidget = nullptr;
d->tabWidget = nullptr;
d->tagMenu = nullptr;
d->actionCollection = part->actionCollection();
d->shareServiceManager = new PimCommon::ShareServiceUrlManager(this);
initPart();
......@@ -169,13 +169,13 @@ ActionManagerImpl::~ActionManagerImpl()
{
delete d->nodeSelectVisitor;
delete d;
d = 0;
d = nullptr;
}
void ActionManagerImpl::setTrayIcon(TrayIcon *trayIcon)
{
if (trayIcon == 0) {
d->trayIcon = 0;
if (trayIcon == nullptr) {
d->trayIcon = nullptr;
return;
}
if (d->trayIcon) {
......
......@@ -64,7 +64,7 @@ Feed *AddFeedDialog::feed() const
AddFeedDialog::AddFeedDialog(QWidget *parent, const QString &name)
: QDialog(parent)
, m_feed(0)
, m_feed(nullptr)
{
setObjectName(name);
setWindowTitle(i18n("Add Feed"));
......
......@@ -47,7 +47,7 @@ class AddFeedDialog : public QDialog
Q_OBJECT
public:
explicit AddFeedDialog(QWidget *parent = nullptr, const QString &name = QString());
~AddFeedDialog();
~AddFeedDialog() override;
QSize sizeHint() const override;
......
......@@ -81,7 +81,7 @@ public:
Part(QWidget *parentWidget, QObject *parent, const QVariantList &);
/** Destructor. */
~Part();
~Part() override;
/**
Opens feedlist
......
......@@ -156,8 +156,8 @@ private:
}
Article::Private::Private()
: feed(0)
, archive(0)
: feed(nullptr)
, archive(nullptr)
, status(0)
, hash(0)
, pubDate(QDateTime::fromTime_t(1))
......@@ -265,13 +265,13 @@ Article::Article(const ItemPtr &article, Feed *feed) : d(new Private(article, fe
{
}
Article::Article(const ItemPtr &article, Backend::FeedStorage *archive) : d(new Private(article, 0, archive))
Article::Article(const ItemPtr &article, Backend::FeedStorage *archive) : d(new Private(article, nullptr, archive))
{
}
bool Article::isNull() const
{
return d->archive == 0; // TODO: use proper null state
return d->archive == nullptr; // TODO: use proper null state
}
void Article::offsetPubDate(int secs)
......@@ -310,7 +310,7 @@ Article::~Article()
{
if (d->deref()) {
delete d;
d = 0;
d = nullptr;
}
}
......
......@@ -83,7 +83,7 @@ class AKREGATORPART_EXPORT ArticleListView : public QTreeView, public ArticleLis
public:
explicit ArticleListView(QWidget *parent = nullptr);
~ArticleListView();
~ArticleListView() override;
//impl ArticleLister
void setArticleModel(Akregator::ArticleModel *model) override;
......
......@@ -79,7 +79,7 @@ public:
ArticleMatcher();
ArticleMatcher(const QVector<Criterion> &criteria, Association assoc);
~ArticleMatcher();
~ArticleMatcher() override;
bool matches(const Article &article) const override;
bool operator==(const AbstractMatcher &other) const override;
......
......@@ -67,7 +67,7 @@ public:
};
explicit ArticleModel(const QVector<Article> &articles, QObject *parent = nullptr);
~ArticleModel();
~ArticleModel() override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
......
......@@ -27,7 +27,7 @@ class ArticleViewerWebEnginePage : public WebEngineViewer::WebEnginePage
Q_OBJECT
public:
explicit ArticleViewerWebEnginePage(QWebEngineProfile *profile, QObject *parent = nullptr);
~ArticleViewerWebEnginePage();
~ArticleViewerWebEnginePage() override;
Q_SIGNALS:
void urlClicked(const QUrl &url);
......
......@@ -197,7 +197,7 @@ void ArticleViewerWidget::showArticle(const Akregator::Article &article)
m_viewMode = NormalView;
disconnectFromNode(m_node);
m_article = article;
m_node = 0;
m_node = nullptr;
m_link = article.link();
if (article.feed()->loadLinkedWebsite()) {
openUrl(article.link());
......@@ -301,7 +301,7 @@ void ArticleViewerWidget::slotArticlesRemoved(TreeNode * /*node*/, const QVector
void ArticleViewerWidget::slotClear()
{
disconnectFromNode(m_node);
m_node = 0;
m_node = nullptr;
m_article = Article();
m_articles.clear();
......
......@@ -55,7 +55,7 @@ class AKREGATOR_EXPORT ArticleViewerWidget : public QWidget
Q_OBJECT
public:
explicit ArticleViewerWidget(const QString &grantleeDirectory, KActionCollection *ac, QWidget *parent);
~ArticleViewerWidget();
~ArticleViewerWidget() override;
/** Repaints the view. */
void reload();
......
......@@ -61,10 +61,10 @@ public:
CreateFeedCommand::Private::Private(CreateFeedCommand *qq)
: q(qq)
, m_rootFolder(0)
, m_subscriptionListView(0)
, m_parentFolder(0)
, m_after(0)
, m_rootFolder(nullptr)
, m_subscriptionListView(nullptr)
, m_parentFolder(nullptr)
, m_after(nullptr)
, m_autoexec(false)
{
}
......
......@@ -38,7 +38,7 @@ class CreateFeedCommand : public Command
Q_OBJECT
public:
explicit CreateFeedCommand(MainWidget *parent = nullptr);
~CreateFeedCommand();
~CreateFeedCommand() override;
void setSubscriptionListView(SubscriptionListView *view);
void setRootFolder(Folder *rootFolder);
......
......@@ -51,9 +51,6 @@ public:
CreateFolderCommand::Private::Private(CreateFolderCommand *qq)
: q(qq)
, m_selectedSubscription(0)
, m_rootFolder(0)
, m_subscriptionListView(0)
{
}
......
......@@ -37,7 +37,7 @@ class CreateFolderCommand : public Command
Q_OBJECT
public:
explicit CreateFolderCommand(QObject *parent = nullptr);
~CreateFolderCommand();
~CreateFolderCommand() override;
void setSubscriptionListView(SubscriptionListView *view);
void setSelectedSubscription(TreeNode *selected);
......
......@@ -43,7 +43,7 @@ class DeleteNodeVisitor : public TreeNodeVisitor
{
public:
explicit DeleteNodeVisitor(QWidget *parent) : m_widget(parent)
, m_job(0)
, m_job(nullptr)
{
}
......@@ -92,7 +92,7 @@ public:
DeleteSubscriptionJob *createJob(TreeNode *node)
{
m_job = 0;
m_job = nullptr;
if (node) {
visit(node);
}
......
......@@ -37,7 +37,7 @@ class DeleteSubscriptionCommand : public Command
Q_OBJECT
public:
explicit DeleteSubscriptionCommand(QObject *parent = nullptr);
~DeleteSubscriptionCommand();
~DeleteSubscriptionCommand() override;
void setSubscription(const QWeakPointer<FeedList> &feedList, int subId);
......
......@@ -91,7 +91,7 @@ public:
EditSubscriptionCommand::Private::Private(EditSubscriptionCommand *qq) : q(qq)
, m_list()
, m_subscriptionId(-1)
, m_subscriptionListView(0)
, m_subscriptionListView(nullptr)
{
}
......
......@@ -38,7 +38,7 @@ class EditSubscriptionCommand : public Command
Q_OBJECT
public:
explicit EditSubscriptionCommand(QObject *parent = nullptr);
~EditSubscriptionCommand();
~EditSubscriptionCommand() override;
void setSubscription(const QSharedPointer<FeedList> &feedList, int subId);
int subscriptionId() const;
......
......@@ -39,7 +39,7 @@ class ExpireItemsCommand : public Command
Q_OBJECT
public:
explicit ExpireItemsCommand(QObject *parent = nullptr);
~ExpireItemsCommand();
~ExpireItemsCommand() override;
void setFeedList(const QWeakPointer<FeedList> &feedList);
QWeakPointer<FeedList> feedList() const;
......
......@@ -39,7 +39,7 @@ class ImportFeedListCommand : public Command
Q_OBJECT
public:
explicit ImportFeedListCommand(QObject *parent = nullptr);
~ImportFeedListCommand();
~ImportFeedListCommand() override;
void setTargetList(const QWeakPointer<FeedList> &feedList);
......
......@@ -43,7 +43,7 @@ class LoadFeedListCommand : public Command
Q_OBJECT
public:
explicit LoadFeedListCommand(QObject *parent = nullptr);
~LoadFeedListCommand();
~LoadFeedListCommand() override;
void setFileName(const QString &fileName);
void setDefaultFeedList(const QDomDocument &doc);
......
......@@ -48,7 +48,7 @@ public:
entry.unread = unread;
entry.totalCount = totalCount;
entry.lastFetch = lastFetch;
entry.feedStorage = 0;
entry.feedStorage = nullptr;
feeds[url] = entry;
}
......@@ -64,7 +64,7 @@ StorageDummyImpl::StorageDummyImpl() : d(new StorageDummyImplPrivate)
StorageDummyImpl::~StorageDummyImpl()
{
delete d;
d = 0;
d = nullptr;
}
void StorageDummyImpl::initialize(const QStringList &)
......
......@@ -314,9 +314,9 @@ Akregator::Feed::Private::Private(Backend::Storage *storage_, Akregator::Feed *q
, fetchErrorCode(Syndication::Success)
, fetchTries(0)
, followDiscovery(false)
, loader(0)
, loader(nullptr)
, articlesLoaded(false)
, archive(0)
, archive(nullptr)
, totalCount(-1)
{
Q_ASSERT(q);
......@@ -333,7 +333,7 @@ Akregator::Feed::~Feed()
slotAbortFetch();
emitSignalDestroyed();
delete d;
d = 0;
d = nullptr;
}
void Akregator::Feed::loadFavicon(const QUrl &url)
......@@ -393,7 +393,7 @@ bool Akregator::Feed::markImmediatelyAsRead() const
bool Akregator::Feed::isFetching() const
{
return d->loader != 0;
return d->loader != nullptr;
}
void Akregator::Feed::setMarkImmediatelyAsRead(bool enabled)
......@@ -692,7 +692,7 @@ void Akregator::Feed::slotImageFetched(const QPixmap &image)
void Akregator::Feed::fetchCompleted(Syndication::Loader *l, Syndication::FeedPtr doc, Syndication::ErrorCode status)
{
// Note that loader instances delete themselves
d->loader = 0;
d->loader = nullptr;
// fetching wasn't successful:
if (status != Syndication::Success) {
......
......@@ -166,7 +166,7 @@ private:
FeedList::Private::Private(Backend::Storage *st, FeedList *qq)
: q(qq)
, storage(st)
, rootNode(0)
, rootNode(nullptr)
, addNodeVisitor(new AddNodeVisitor(q))
, removeNodeVisitor(new RemoveNodeVisitor(q))
, unreadCache(-1)
......@@ -175,7 +175,7 @@ FeedList::Private::Private(Backend::Storage *st, FeedList *qq)
}
FeedList::FeedList(Backend::Storage *storage)
: QObject(0)
: QObject(nullptr)
, d(new Private(storage, this))
{
Folder *rootNode = new Folder(i18n("All Feeds"));
......@@ -310,7 +310,7 @@ bool FeedList::readFromOpml(const QDomDocument &doc)
FeedList::~FeedList()
{
Q_EMIT signalDestroyed(this);
setRootNode(0);
setRootNode(nullptr);
delete d->addNodeVisitor;
delete d->removeNodeVisitor;
delete d;
......@@ -322,7 +322,7 @@ const Feed *FeedList::findByURL(const QString &feedURL) const
return nullptr;
}
const QList<Feed *> &v = d->urlMap[feedURL];
return !v.isEmpty() ? v.front() : 0;
return !v.isEmpty() ? v.front() : nullptr;
}
Feed *FeedList::findByURL(const QString &feedURL)
......@@ -331,7 +331,7 @@ Feed *FeedList::findByURL(const QString &feedURL)
return nullptr;
}
const QList<Feed *> &v = d->urlMap[feedURL];
return !v.isEmpty() ? v.front() : 0;
return !v.isEmpty() ? v.front() : nullptr;
}
const Article FeedList::findArticle(const QString &feedURL, const QString &guid) const
......@@ -417,7 +417,7 @@ Folder *FeedList::allFeedsFolder()
bool FeedList::isEmpty() const
{
return d->rootNode->firstChild() == 0;
return d->rootNode->firstChild() == nullptr;
}
void FeedList::rootNodeChanged()
......@@ -504,7 +504,7 @@ void FeedList::addToFetchQueue(FetchQueue *qu, bool intervalOnly)
KJob *FeedList::createMarkAsReadJob()
{
return d->rootNode ? d->rootNode->createMarkAsReadJob() : 0;
return d->rootNode ? d->rootNode->createMarkAsReadJob() : nullptr;
}
FeedListManagementImpl::FeedListManagementImpl(const QSharedPointer<FeedList> &list) : m_feedList(list)
......
......@@ -58,7 +58,7 @@ class FeedPropertiesDialog : public QDialog
Q_OBJECT
public:
explicit FeedPropertiesDialog(QWidget *parent = nullptr, const QString &name = QString());
~FeedPropertiesDialog();
~FeedPropertiesDialog() override;
void setFeed(Feed *feed);
......
......@@ -51,7 +51,7 @@ FetchQueue::~FetchQueue()
{
slotAbort();
delete d;
d = 0;
d = nullptr;
}
void FetchQueue::slotAbort()
......
......@@ -114,7 +114,7 @@ Folder::Folder(const QString &title) : TreeNode()
Folder::~Folder()
{
delete d;
d = 0;
d = nullptr;
}
QVector<Article> Folder::articles()
......@@ -284,7 +284,7 @@ void Folder::removeChild(TreeNode *node)
}
Q_EMIT signalAboutToRemoveChild(node);
node->setParent(0);
node->setParent(nullptr);
d->children.removeOne(node);
disconnectFromNode(node);
updateUnreadCount();
......@@ -296,22 +296,22 @@ void Folder::removeChild(TreeNode *node)
TreeNode *Folder::firstChild()
{
return d->children.isEmpty() ? 0 : children().first();
return d->children.isEmpty() ? nullptr : children().first();
}
const TreeNode *Folder::firstChild() const
{
return d->children.isEmpty() ? 0 : children().first();
return d->children.isEmpty() ? nullptr : children().first();
}
TreeNode *Folder::lastChild()
{
return d->children.isEmpty() ? 0 : children().last();
return d->children.isEmpty() ? nullptr : children().last();
}
const TreeNode *Folder::lastChild() const
{
return d->children.isEmpty() ? 0 : children().last();
return d->children.isEmpty() ? nullptr : children().last();
}
bool Folder::isOpen() const
......
......@@ -55,7 +55,7 @@ public:
*/
explicit Folder(const QString &title = QString());
~Folder();
~Folder() override;
bool accept(TreeNodeVisitor *visitor) override;
......
......@@ -29,7 +29,7 @@ class AKREGATOR_EXPORT DefaultCombinedViewFormatter : public ArticleFormatter
{
public:
explicit DefaultCombinedViewFormatter(const QString &grantleeDirectory, const QUrl &imageDir, QPaintDevice *device = nullptr);
~DefaultCombinedViewFormatter();
~DefaultCombinedViewFormatter() override;
QString formatArticles(const QVector<Article> &articles, IconOption option) const override;
......
......@@ -31,7 +31,7 @@ class AKREGATOR_EXPORT DefaultNormalViewFormatter : public ArticleFormatter
public:
explicit DefaultNormalViewFormatter(const QString &grantleeDirectory, const QUrl &imageDir, QPaintDevice *device = nullptr);
~DefaultNormalViewFormatter();
~DefaultNormalViewFormatter() override;
QString formatArticles(const QVector<Article> &article, IconOption option) const override;
......
......@@ -38,7 +38,7 @@ Frame::Frame(QWidget *parent)
m_title = i18n("Untitled");
m_state = Idle;
m_progress = -1;
m_progressItem = 0;
m_progressItem = nullptr;
m_isRemovable = true;
m_loading = false;
m_id = m_idCounter++;
......@@ -76,7 +76,7 @@ void Frame::slotSetStatusText(const QString &s)
void Frame::slotSetProgress(int a)
{
if (m_progressItem) {
m_progressItem->setProgress((int)a);
m_progressItem->setProgress(static_cast<int>(a));
}
m_progress = a;
Q_EMIT signalLoadingProgress(this, a);
......@@ -179,7 +179,7 @@ void Frame::slotSetCanceled(const QString &s)
if (m_progressItem) {
m_progressItem->setStatus(i18n("Loading canceled"));
m_progressItem->setComplete();
m_progressItem = 0;
m_progressItem = nullptr;
}
m_state = Canceled;
Q_EMIT signalCanceled(this, s);
......@@ -191,7 +191,7 @@ void Frame::slotSetCompleted()
if (m_progressItem) {
m_progressItem->setStatus(i18n("Loading completed"));
m_progressItem->setComplete();
m_progressItem = 0;
m_progressItem = nullptr;
}
m_state = Completed;
Q_EMIT signalCompleted(this);
......
......@@ -31,7 +31,7 @@ class AKREGATOR_EXPORT MainFrame : public Frame
public:
explicit MainFrame(QWidget *parent, QWidget *widget);
virtual ~MainFrame();
~MainFrame() override;
QUrl url() const override;
......
......@@ -29,7 +29,7 @@ class AkrWebEngineViewer : public ArticleViewerWebEngine
Q_OBJECT
public:
explicit AkrWebEngineViewer(KActionCollection *ac, QWidget *parent = nullptr);
~AkrWebEngineViewer();
~AkrWebEngineViewer() override;
protected:
void displayContextMenu(const QPoint &pos) override;
......
......@@ -30,7 +30,7 @@ class AKREGATORPART_EXPORT WebEngineFrame : public Frame
Q_OBJECT
public:
explicit WebEngineFrame(KActionCollection *ac, QWidget *parent = nullptr);
~WebEngineFrame();
~WebEngineFrame() override;
QUrl url() const override;
bool openUrl(const OpenUrlRequest &request) override;
......
......@@ -33,7 +33,7 @@ DownloadArticleJob::~DownloadArticleJob()
{
if (mAttachmentTemporaryFile) {
mAttachmentTemporaryFile->removeTempFiles();
mAttachmentTemporaryFile = 0;
mAttachmentTemporaryFile = nullptr;
}
}
......@@ -42,7 +42,7 @@ void DownloadArticleJob::forceCleanupTemporaryFile()
if (mAttachmentTemporaryFile) {
mAttachmentTemporaryFile->forceCleanTempFiles();
delete mAttachmentTemporaryFile;
mAttachmentTemporaryFile = 0;
mAttachmentTemporaryFile = nullptr;
}
}
......
......@@ -30,7 +30,7 @@
using namespace Akregator;
Kernel *Kernel::m_self = 0;
Kernel *Kernel::m_self = nullptr;
Kernel *Kernel::self()
{
......@@ -55,7 +55,7 @@ Kernel::Kernel() : d(new KernelPrivate)
{
d->fetchQueue = new FetchQueue();
d->frameManager = new FrameManager();
d->storage = 0;
d->storage = nullptr;
}
Kernel::~Kernel()
......@@ -63,7 +63,7 @@ Kernel::~Kernel()
delete d->fetchQueue;
delete d->frameManager;
delete d;
d = 0;
d = nullptr;
}
Backend::Storage *Kernel::storage()
......
......@@ -40,11 +40,11 @@ class Application : public KontactInterface::PimUniqueApplication
public:
Application(int &argc, char **argv[])
: KontactInterface::PimUniqueApplication(argc, argv)
, mMainWindow(0)
, mMainWindow(nullptr)
{
}
~Application()
~Application() override
{
}
......
......@@ -60,7 +60,7 @@ class MainWindow : public KParts::MainWindow
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
~MainWindow() override;
/**
* Creates the progress widget in the status bar and the ProgressDialog
......
......@@ -39,12 +39,12 @@ NotificationManager::NotificationManager() : QObject()
m_running = false;
m_addedInLastInterval = false;
m_maxArticles = 20;
m_widget = NULL;
m_widget = nullptr;
}
NotificationManager::~NotificationManager()
{
m_self = 0;
m_self = nullptr;
}
void NotificationManager::setWidget(QWidget *widget, const QString &componentName)
......@@ -133,7 +133,7 @@ void NotificationManager::slotIntervalCheck()
}
}
NotificationManager *NotificationManager::m_self = 0;
NotificationManager *NotificationManager::m_self = nullptr;
NotificationManager *NotificationManager::self()
{
......