From f7e54fe0cb50e5a43254bba13debe0432c5c00e8 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Wed, 20 Sep 2017 07:38:13 +0200 Subject: [PATCH] Clean up code --- src/kmstartup.cpp | 4 ++-- src/kmsystemtray.cpp | 5 ----- src/kmsystemtray.h | 11 ++++------- src/mailserviceimpl.cpp | 3 +-- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/kmstartup.cpp b/src/kmstartup.cpp index 92e0e4c14..721049baf 100644 --- a/src/kmstartup.cpp +++ b/src/kmstartup.cpp @@ -20,7 +20,7 @@ #include -namespace KMail { +using namespace KMail; void insertLibraryIcons() { static const char *const iconPath[] = { @@ -36,4 +36,4 @@ void insertLibraryIcons() il->addAppDir(QLatin1String(iconPath[i])); } } -} + diff --git a/src/kmsystemtray.cpp b/src/kmsystemtray.cpp index ca7ba5be6..548d179d1 100644 --- a/src/kmsystemtray.cpp +++ b/src/kmsystemtray.cpp @@ -56,11 +56,6 @@ using namespace KMail; KMSystemTray::KMSystemTray(QObject *parent) : KStatusNotifierItem(parent) , mIcon(QIcon::fromTheme(QStringLiteral("mail-mark-unread-new"))) - , mDesktopOfMainWin(0) - , mCount(0) - , mIconNotificationsEnabled(true) - , mNewMessagesPopup(nullptr) - , mSendQueued(nullptr) { qCDebug(KMAIL_LOG) << "Initting systray"; setToolTipTitle(i18n("KMail")); diff --git a/src/kmsystemtray.h b/src/kmsystemtray.h index adbebb0ad..cbbf2994b 100644 --- a/src/kmsystemtray.h +++ b/src/kmsystemtray.h @@ -53,7 +53,7 @@ public: void updateSystemTray(); -private Q_SLOTS: +private: void slotActivated(); void slotContextMenuAboutToShow(); void slotSelectCollection(QAction *act); @@ -61,7 +61,6 @@ private Q_SLOTS: void slotCollectionStatisticsChanged(Akonadi::Collection::Id, const Akonadi::CollectionStatistics &); void slotGeneralFontChanged(); -private: bool mainWindowIsOnCurrentDesktop(); bool buildPopupMenu(); void updateCount(); @@ -69,14 +68,12 @@ private: void unreadMail(const QAbstractItemModel *model, const QModelIndex &parentIndex = QModelIndex()); bool excludeFolder(const Akonadi::Collection &collection) const; bool ignoreNewMailInFolder(const Akonadi::Collection &collection); - -private: QIcon mIcon; - int mDesktopOfMainWin; + int mDesktopOfMainWin = 0; - int mCount; + int mCount = 0; - bool mIconNotificationsEnabled; + bool mIconNotificationsEnabled =true; QMenu *mNewMessagesPopup = nullptr; QAction *mSendQueued = nullptr; diff --git a/src/mailserviceimpl.cpp b/src/mailserviceimpl.cpp index ed06278b8..cc8fe740d 100644 --- a/src/mailserviceimpl.cpp +++ b/src/mailserviceimpl.cpp @@ -41,7 +41,7 @@ #include -namespace KMail { +using namespace KMail; MailServiceImpl::MailServiceImpl() { new ServiceAdaptor(this); @@ -129,4 +129,3 @@ bool MailServiceImpl::sendMessage(const QString &from, const QString &to, const KMail::makeComposer(msg, false, false); return true; } -}//end namespace KMail