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:
parent
02a2c91e24
commit
9f266a0210
@ -50,7 +50,3 @@
|
|||||||
@property (strong, nonatomic) QIOSViewController *qiosViewController;
|
@property (strong, nonatomic) QIOSViewController *qiosViewController;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface QIOSMainWrapperApplicationDelegate : QIOSApplicationDelegate
|
|
||||||
@end
|
|
||||||
|
|
||||||
|
@ -46,6 +46,8 @@
|
|||||||
|
|
||||||
#include <QtCore/QtCore>
|
#include <QtCore/QtCore>
|
||||||
|
|
||||||
|
extern int qt_user_main(int argc, char *argv[]);
|
||||||
|
|
||||||
@implementation QIOSApplicationDelegate
|
@implementation QIOSApplicationDelegate
|
||||||
|
|
||||||
@synthesize window;
|
@synthesize window;
|
||||||
@ -53,55 +55,9 @@
|
|||||||
|
|
||||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||||
{
|
{
|
||||||
Q_UNUSED(application)
|
Q_UNUSED(application);
|
||||||
Q_UNUSED(launchOptions)
|
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.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
|
||||||
self.qiosViewController = [[[QIOSViewController alloc] init] autorelease];
|
self.qiosViewController = [[[QIOSViewController alloc] init] autorelease];
|
||||||
self.window.rootViewController = self.qiosViewController;
|
self.window.rootViewController = self.qiosViewController;
|
||||||
@ -117,10 +73,7 @@ extern int qt_user_main(int argc, char *argv[]);
|
|||||||
[NSTimer scheduledTimerWithTimeInterval:.01f target:self
|
[NSTimer scheduledTimerWithTimeInterval:.01f target:self
|
||||||
selector:@selector(runUserMain) userInfo:nil repeats:NO];
|
selector:@selector(runUserMain) userInfo:nil repeats:NO];
|
||||||
|
|
||||||
if ([QIOSApplicationDelegate instancesRespondToSelector:_cmd])
|
return YES;
|
||||||
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
|
||||||
else
|
|
||||||
return YES;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)runUserMain
|
- (void)runUserMain
|
||||||
@ -138,5 +91,13 @@ extern int qt_user_main(int argc, char *argv[]);
|
|||||||
delete[] argv;
|
delete[] argv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (void)dealloc
|
||||||
|
{
|
||||||
|
[qiosViewController release];
|
||||||
|
[window release];
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -55,6 +55,6 @@
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([QIOSMainWrapperApplicationDelegate class]));
|
return UIApplicationMain(argc, argv, nil, NSStringFromClass([QIOSApplicationDelegate class]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user