Revision 3a8071d4 Classes/OpenStackAppDelegate.m

b/Classes/OpenStackAppDelegate.m
251 251
}
252 252

  
253 253
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
254
    if (!url)
254
    if (!url) 
255 255
        return NO;
256 256

  
257 257
    NSString *host = [url host];
......
291 291
                         stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
292 292
        }
293 293
        
294
        if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
295
            if (authToken)
296
                [masterNavigationController.visibleViewController setValue:authToken forKey:@"apiKey"];
297
            if (authUser)
298
                [masterNavigationController.visibleViewController setValue:authUser forKey:@"userName"];
299
            [((UITableViewController *)masterNavigationController.visibleViewController).tableView reloadData];        
300
        } else {
301
            if (authToken)
302
                [navigationController.visibleViewController setValue:authToken forKey:@"apiKey"];
303
            if (authUser)
304
                [navigationController.visibleViewController setValue:authUser forKey:@"userName"];
305
            [((UITableViewController *)navigationController.visibleViewController).tableView reloadData];        
294
        if (authToken || authUser) {
295
            UIViewController *vc = nil;
296
            if (([navigationController.visibleViewController class] == [AccountDetailsViewController class]) || 
297
                ([navigationController.visibleViewController class] == [AccountSettingsViewController class]))
298
                vc = navigationController.visibleViewController;
299
            else if (([masterNavigationController.visibleViewController class] == [AccountDetailsViewController class]) || 
300
                     ([masterNavigationController.visibleViewController class] == [AccountSettingsViewController class]))
301
                vc = masterNavigationController.visibleViewController;
302
            if (vc) {
303
                if (authToken)
304
                    [vc setValue:authToken forKey:@"apiKey"];
305
                if (authUser)
306
                    [vc setValue:authUser forKey:@"userName"];
307
                [((UITableViewController *)vc).tableView reloadData];
308
            }
306 309
        }
307 310
    }
308 311
    // XXX else maybe show an error message?
309
    
310 312
    return YES;
311 313
}
312 314

  

Also available in: Unified diff