From 9f266a0210ff680fb85e6b6b3bd9eec7f3fe2b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 10 Jun 2013 15:11:46 +0200 Subject: 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 --- .../platforms/ios/qiosapplicationdelegate.h | 4 -- .../platforms/ios/qiosapplicationdelegate.mm | 65 +++++----------------- src/plugins/platforms/ios/qiosmain_wrapper.mm | 2 +- 3 files changed, 14 insertions(+), 57 deletions(-) (limited to 'src/plugins/platforms/ios') 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 +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])); } } -- cgit v1.2.3