From b05c20b4f33b35c8b3428caf2ee59675d858d5ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 25 Dec 2012 21:44:13 +0100 Subject: iOS: Don't check for existing window in QIOSMainWrapperApplicationDelegate The delegate is only used when we control the application, so we know that there isn't any window yet. Change-Id: Ibd774cb4fd8ceaab6a181769d2792b569f490495 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qtmain.mm | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/ios/qtmain.mm b/src/plugins/platforms/ios/qtmain.mm index 61756edc93..7cc96f54b1 100644 --- a/src/plugins/platforms/ios/qtmain.mm +++ b/src/plugins/platforms/ios/qtmain.mm @@ -55,20 +55,16 @@ extern int qt_main(int argc, char *argv[]); - (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // We may have a window already from a NIB or storyboard - if (!self.window) { - // If not, we create one ourselves - self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - QIOSViewController *controller = [[QIOSViewController alloc] init]; - self.window.rootViewController = controller; - controller.view = [[UIView alloc] init]; + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + QIOSViewController *controller = [[QIOSViewController alloc] init]; + self.window.rootViewController = controller; + controller.view = [[UIView alloc] init]; - // Aid debugging during development - self.window.backgroundColor = [UIColor cyanColor]; - self.window.rootViewController.view.backgroundColor = [UIColor magentaColor]; + // Aid debugging during development + self.window.backgroundColor = [UIColor cyanColor]; + self.window.rootViewController.view.backgroundColor = [UIColor magentaColor]; - [self.window makeKeyAndVisible]; - } + [self.window makeKeyAndVisible]; // We schedule the main-redirection for the next eventloop pass so that we // can return from this function and let UIApplicationMain finish its job. -- cgit v1.2.3