Commit 70856d7b authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Add objectNames to Monitors to make them easier to identify

parent 315f57ab
......@@ -50,6 +50,7 @@ ArchiveMailAgent::ArchiveMailAgent(const QString &id)
connect(mArchiveManager, &ArchiveMailManager::needUpdateConfigDialogBox, this, &ArchiveMailAgent::needUpdateConfigDialogBox);
Akonadi::Monitor *collectionMonitor = new Akonadi::Monitor(this);
collectionMonitor->setObjectName(QStringLiteral("ArchiveMailCollectionMonitor"));
collectionMonitor->fetchCollection(true);
collectionMonitor->ignoreSession(Akonadi::Session::defaultSession());
collectionMonitor->collectionFetchScope().setAncestorRetrieval(Akonadi::CollectionFetchScope::All);
......
......@@ -84,6 +84,7 @@ MailFilterAgent::MailFilterAgent(const QString &id)
connect(m_filterManager, &FilterManager::progressMessage, this, &MailFilterAgent::emitProgressMessage);
Akonadi::Monitor *collectionMonitor = new Akonadi::Monitor(this);
collectionMonitor->setObjectName(QStringLiteral("MailFilterCollectionMonitor"));
collectionMonitor->fetchCollection(true);
collectionMonitor->ignoreSession(Akonadi::Session::defaultSession());
collectionMonitor->collectionFetchScope().setAncestorRetrieval(Akonadi::CollectionFetchScope::All);
......@@ -133,6 +134,7 @@ MailFilterAgent::MailFilterAgent(const QString &id)
connect(mProgressTimer, SIGNAL(timeout()), this, SLOT(emitProgress()));
itemMonitor = new Akonadi::Monitor(this);
itemMonitor->setObjectName(QStringLiteral("MailFilterItemMonitor"));
itemMonitor->itemFetchScope().setFetchRemoteIdentification(true);
itemMonitor->itemFetchScope().setAncestorRetrieval(Akonadi::ItemFetchScope::Parent);
connect(itemMonitor, &Akonadi::Monitor::itemChanged, this, &MailFilterAgent::slotItemChanged);
......
/*
Copyright (c) 2017 Daniel Vrátil <dvratil@kde.org>
KMail is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
KMail is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "kmreaderthreadview.h"
#include "kmreadermainwin.h"
KMReaderThreadView::KMReaderThreadView(KMReaderMainWin *parent)
: MessageList::Core::View(parent)
{
}
......@@ -63,6 +63,7 @@ TagActionManager::TagActionManager(QObject *parent, KActionCollection *actionCol
{
mMessageActions->messageStatusMenu()->menu()->addSeparator();
mMonitor->setObjectName(QStringLiteral("TagActionManagerMonitor"));
mMonitor->setTypeMonitored(Akonadi::Monitor::Tags);
mMonitor->tagFetchScope().fetchAttribute<Akonadi::TagAttribute>();
connect(mMonitor, &Akonadi::Monitor::tagAdded, this, &TagActionManager::onTagAdded);
......
#include "splitter.h"
#include <QSplitterHandle>
#include <QPaintEvent>
#include <QPainter>
#include <QStyle>
#include <QPalette>
namespace {
class SplitterHandle : public QSplitterHandle
{
Q_OBJECT
public:
using QSplitterHandle::QSplitterHandle;
protected:
void paintEvent(QPaintEvent *event) override
{
const auto t = palette().text().color();
const auto w = palette().window().color();
const auto a = 0.7f;
const auto invA = 1.f - a;
QPainter painter(this);
painter.fillRect(event->rect(), QColor::fromRgbF(w.redF() * a + t.redF() * invA,
w.greenF() * a + t.greenF() * invA,
w.blueF() * a + t.blueF() * invA));
}
};
}
QSplitterHandle * Splitter::createHandle()
{
return new SplitterHandle(orientation(), this);
}
#include "splitter.moc"
#ifndef SPLITTER_H_
#define SPLITTER_H_
#include <QSplitter>
class Splitter : public QSplitter
{
Q_OBJECT
public:
using QSplitter::QSplitter;
protected:
QSplitterHandle * createHandle() override;
};
#endif
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