summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-06-10 15:11:46 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-15 12:40:04 +0200
commit9f266a0210ff680fb85e6b6b3bd9eec7f3fe2b2e (patch)
treea3a3073d90f0e1c8da1b63c10b6497ab95683629 /src/plugins/platforms
parent02a2c91e24462df6cf6a8521c9af77421544d7b6 (diff)
iOS: Get rid of QIOSMainWrapperApplicationDelegate
We only control the application delegate in the wrapped case anyways, so QIOSApplicationDelegate is good enough for our use. Change-Id: Ib738592dc306c5b6652632b9ae4dab431639a89a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/ios/qiosapplicationdelegate.h4
-rw-r--r--src/plugins/platforms/ios/qiosapplicationdelegate.mm65
-rw-r--r--src/plugins/platforms/ios/qiosmain_wrapper.mm2
3 files changed, 14 insertions, 57 deletions
diff --git a/src/plugins/platforms/ios/qiosapplicationdelegate.h b/src/plugins/platforms/ios/qiosapplicationdelegate.h
index 3d3ba58049..bfe31af198 100644
--- a/src/plugins/platforms/ios/qiosapplicationdelegate.h
+++ b/src/plugins/platforms/ios/qiosapplicationdelegate.h
@@ -50,7 +50,3 @@
@property (strong, nonatomic) QIOSViewController *qiosViewController;
@end
-
-@interface QIOSMainWrapperApplicationDelegate : QIOSApplicationDelegate
-@end
-
diff --git a/src/plugins/platforms/ios/qiosapplicationdelegate.mm b/src/plugins/platforms/ios/qiosapplicationdelegate.mm
index 571de9ffda..52d94f38fb 100644
--- a/src/plugins/platforms/ios/qiosapplicationdelegate.mm
+++ b/src/plugins/platforms/ios/qiosapplicationdelegate.mm
@@ -46,6 +46,8 @@
#include <QtCore/QtCore>
+extern int qt_user_main(int argc, char *argv[]);
+
@implementation QIOSApplicationDelegate
@synthesize window;
@@ -53,55 +55,9 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
- Q_UNUSED(application)
- Q_UNUSED(launchOptions)
-
- return YES;
-}
-
-- (void)applicationWillResignActive:(UIApplication *)application
-{
- Q_UNUSED(application)
-}
-
-- (void)applicationDidEnterBackground:(UIApplication *)application
-{
- Q_UNUSED(application)
-}
-
-- (void)applicationWillEnterForeground:(UIApplication *)application
-{
- Q_UNUSED(application)
- // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
-}
-
-- (void)applicationDidBecomeActive:(UIApplication *)application
-{
- Q_UNUSED(application)
- // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
-}
+ Q_UNUSED(application);
+ Q_UNUSED(launchOptions);
-- (void)applicationWillTerminate:(UIApplication *)application
-{
- Q_UNUSED(application)
- // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
-}
-
-- (void)dealloc
-{
- [qiosViewController release];
- [window release];
- [super dealloc];
-}
-
-@end
-
-extern int qt_user_main(int argc, char *argv[]);
-
-@implementation QIOSMainWrapperApplicationDelegate
-
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
-{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.qiosViewController = [[[QIOSViewController alloc] init] autorelease];
self.window.rootViewController = self.qiosViewController;
@@ -117,10 +73,7 @@ extern int qt_user_main(int argc, char *argv[]);
[NSTimer scheduledTimerWithTimeInterval:.01f target:self
selector:@selector(runUserMain) userInfo:nil repeats:NO];
- if ([QIOSApplicationDelegate instancesRespondToSelector:_cmd])
- return [super application:application didFinishLaunchingWithOptions:launchOptions];
- else
- return YES;
+ return YES;
}
- (void)runUserMain
@@ -138,5 +91,13 @@ extern int qt_user_main(int argc, char *argv[]);
delete[] argv;
}
+
+- (void)dealloc
+{
+ [qiosViewController release];
+ [window release];
+ [super dealloc];
+}
+
@end
diff --git a/src/plugins/platforms/ios/qiosmain_wrapper.mm b/src/plugins/platforms/ios/qiosmain_wrapper.mm
index 4533add424..d9b8c7311e 100644
--- a/src/plugins/platforms/ios/qiosmain_wrapper.mm
+++ b/src/plugins/platforms/ios/qiosmain_wrapper.mm
@@ -55,6 +55,6 @@
int main(int argc, char *argv[])
{
@autoreleasepool {
- return UIApplicationMain(argc, argv, nil, NSStringFromClass([QIOSMainWrapperApplicationDelegate class]));
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([QIOSApplicationDelegate class]));
}
}