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>
This commit is contained in:
Tor Arne Vestbø 2013-06-10 15:11:46 +02:00 committed by The Qt Project
parent 02a2c91e24
commit 9f266a0210
3 changed files with 14 additions and 57 deletions

View File

@ -50,7 +50,3 @@
@property (strong, nonatomic) QIOSViewController *qiosViewController;
@end
@interface QIOSMainWrapperApplicationDelegate : QIOSApplicationDelegate
@end

View File

@ -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)
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.
}
- (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

View File

@ -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]));
}
}