summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <[email protected]>2017-09-04 17:41:40 +0200
committerDaniel Vrátil <[email protected]>2017-09-04 17:41:49 +0200
commit70856d7bc317a20d4f77141b9aec487870285fad (patch)
treee486e8a6466ef78de6183074bbbaa17c7b3d9d38
parent315f57ab5a165c6d7adc9faa49b73fec0dc90e19 (diff)
Add objectNames to Monitors to make them easier to identify
-rw-r--r--agents/archivemailagent/archivemailagent.cpp1
-rw-r--r--agents/mailfilteragent/mailfilteragent.cpp2
-rw-r--r--src/kmreaderthreadview.cpp25
-rw-r--r--src/tag/tagactionmanager.cpp1
-rw-r--r--src/widgets/splitter.cpp40
-rw-r--r--src/widgets/splitter.h16
6 files changed, 85 insertions, 0 deletions
diff --git a/agents/archivemailagent/archivemailagent.cpp b/agents/archivemailagent/archivemailagent.cpp
index c85a2a7..fd39662 100644
--- a/agents/archivemailagent/archivemailagent.cpp
+++ b/agents/archivemailagent/archivemailagent.cpp
@@ -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);
diff --git a/agents/mailfilteragent/mailfilteragent.cpp b/agents/mailfilteragent/mailfilteragent.cpp
index 2907977..6576bee 100644
--- a/agents/mailfilteragent/mailfilteragent.cpp
+++ b/agents/mailfilteragent/mailfilteragent.cpp
@@ -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);
diff --git a/src/kmreaderthreadview.cpp b/src/kmreaderthreadview.cpp
new file mode 100644
index 0000000..bceff84
--- /dev/null
+++ b/src/kmreaderthreadview.cpp
@@ -0,0 +1,25 @@
+/*
+ Copyright (c) 2017 Daniel Vrátil <[email protected]>
+
+ 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)
+{
+}
+
diff --git a/src/tag/tagactionmanager.cpp b/src/tag/tagactionmanager.cpp
index 9f1f0f5..e629f66 100644
--- a/src/tag/tagactionmanager.cpp
+++ b/src/tag/tagactionmanager.cpp
@@ -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);
diff --git a/src/widgets/splitter.cpp b/src/widgets/splitter.cpp
new file mode 100644
index 0000000..ec15c9e
--- /dev/null
+++ b/src/widgets/splitter.cpp
@@ -0,0 +1,40 @@
+#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"
diff --git a/src/widgets/splitter.h b/src/widgets/splitter.h
new file mode 100644
index 0000000..5addebe
--- /dev/null
+++ b/src/widgets/splitter.h
@@ -0,0 +1,16 @@
+#ifndef SPLITTER_H_
+#define SPLITTER_H_
+
+#include <QSplitter>
+
+class Splitter : public QSplitter
+{
+ Q_OBJECT
+public:
+ using QSplitter::QSplitter;
+
+protected:
+ QSplitterHandle * createHandle() override;
+};
+
+#endif