summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/CocoaApplicationActivateHelper.h6
-rw-r--r--Swift/QtUI/CocoaApplicationActivateHelper.mm6
2 files changed, 7 insertions, 5 deletions
diff --git a/Swift/QtUI/CocoaApplicationActivateHelper.h b/Swift/QtUI/CocoaApplicationActivateHelper.h
index c7aa5b3..83fa886 100644
--- a/Swift/QtUI/CocoaApplicationActivateHelper.h
+++ b/Swift/QtUI/CocoaApplicationActivateHelper.h
@@ -1,11 +1,13 @@
/*
- * Copyright (c) 2012 Isode Limited.
+ * Copyright (c) 2012-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <memory>
+
#include <QObject>
namespace Swift {
@@ -23,6 +25,6 @@ namespace Swift {
private:
struct Private;
- Private* p;
+ const std::unique_ptr<Private> p;
};
}
diff --git a/Swift/QtUI/CocoaApplicationActivateHelper.mm b/Swift/QtUI/CocoaApplicationActivateHelper.mm
index 4d4409d..2bd985a 100644
--- a/Swift/QtUI/CocoaApplicationActivateHelper.mm
+++ b/Swift/QtUI/CocoaApplicationActivateHelper.mm
@@ -6,6 +6,8 @@
#include <Swift/QtUI/CocoaApplicationActivateHelper.h>
+#include <memory>
+
#include <boost/function.hpp>
#include <QApplication>
@@ -31,8 +33,7 @@ struct CocoaApplicationActivateHelper::Private {
bool initialized;
};
-CocoaApplicationActivateHelper::CocoaApplicationActivateHelper() {
- p = new Private();
+CocoaApplicationActivateHelper::CocoaApplicationActivateHelper() : p(new Private()) {
p->delegate = [[CocoaApplicationActivateHelperDelegate alloc] init];
p->initialized = false;
qApp->installEventFilter(this);
@@ -41,7 +42,6 @@ CocoaApplicationActivateHelper::CocoaApplicationActivateHelper() {
CocoaApplicationActivateHelper::~CocoaApplicationActivateHelper() {
[[NSAppleEventManager sharedAppleEventManager] removeEventHandlerForEventClass:kCoreEventClass andEventID:kAEReopenApplication];
[p->delegate release];
- delete p;
}
bool CocoaApplicationActivateHelper::eventFilter(QObject* object, QEvent* event) {