summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Kurz <[email protected]>2017-07-27 21:02:43 +0200
committerDenis Kurz <[email protected]>2017-08-21 19:58:20 +0200
commit5684cff5b77aeddf1cbd93d8e878f709dceee886 (patch)
treedcb3e628cb40d2030534818ecd18e92d30d9a734
parentf96561fa1cca018fa88a52f93b53656d6b02ac2c (diff)
Remove raw pointer that was never read
In fact, mWin was used to invoke show() on it twice, and returned once, but only after setting it immediately before that.
-rw-r--r--src/kmkernel.cpp16
-rw-r--r--src/kmkernel.h2
2 files changed, 5 insertions, 13 deletions
diff --git a/src/kmkernel.cpp b/src/kmkernel.cpp
index 8d9b544..bffba38 100644
--- a/src/kmkernel.cpp
+++ b/src/kmkernel.cpp
@@ -148,7 +148,6 @@ KMKernel::KMKernel(QObject *parent)
the_undoStack = nullptr;
the_msgSender = nullptr;
mFilterEditDialog = nullptr;
- mWin = nullptr;
// make sure that we check for config updates before doing anything else
KMKernel::config();
// this shares the kmailrc parsing too (via KSharedConfig), and reads values from it
@@ -528,7 +527,6 @@ void KMKernel::checkAccount(const QString &account) //might create a new reade
void KMKernel::openReader(bool onlyCheck)
{
- mWin = nullptr;
KMainWindow *ktmw = nullptr;
foreach (KMainWindow *window, KMainWindow::memberList()) {
@@ -540,14 +538,14 @@ void KMKernel::openReader(bool onlyCheck)
bool activate;
if (ktmw) {
- mWin = static_cast<KMMainWin *>(ktmw);
+ KMMainWin *win = static_cast<KMMainWin *>(ktmw);
activate = !onlyCheck; // existing window: only activate if not --check
if (activate) {
- mWin->show();
+ win->show();
}
} else {
- mWin = new KMMainWin;
- mWin->show();
+ KMMainWin *win = new KMMainWin;
+ win->show();
activate = false; // new window: no explicit activation (#73591)
}
}
@@ -1128,9 +1126,6 @@ void KMKernel::cleanup(void)
the_undoStack = nullptr;
delete mConfigureDialog;
mConfigureDialog = nullptr;
- // do not delete, because mWin may point to an existing window
- // delete mWin;
- mWin = nullptr;
KSharedConfig::Ptr config = KMKernel::config();
if (RecentAddresses::exists()) {
@@ -1299,8 +1294,7 @@ KMainWindow *KMKernel::mainWin()
// This could happen if we want to pop up an error message
// while we are still doing the startup wizard and no other
// KMainWindow is running.
- mWin = new KMMainWin;
- return mWin;
+ return new KMMainWin;
}
KMKernel *KMKernel::self()
diff --git a/src/kmkernel.h b/src/kmkernel.h
index 149a4ce..6910862 100644
--- a/src/kmkernel.h
+++ b/src/kmkernel.h
@@ -519,8 +519,6 @@ private:
QTimer *mBackgroundTasksTimer;
MailCommon::JobScheduler *mJobScheduler;
- // temporary mainwin
- KMMainWin *mWin;
MailServiceImpl *mMailService;
bool mSystemNetworkStatus;