iOS: move infoPlistValue to qiosglobal

Change-Id: If237f08683290105413dc47923e23a496765bb22
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
bb10
Richard Moe Gustavsen 2013-11-26 10:38:21 +01:00 committed by The Qt Project
parent 2e13285446
commit 6c5febd203
3 changed files with 8 additions and 7 deletions

View File

@ -206,13 +206,6 @@ namespace
bool debugStackUsage = false;
}
static int infoPlistValue(NSString* key, int defaultValue)
{
static NSBundle *bundle = [NSBundle mainBundle];
NSNumber* value = [bundle objectForInfoDictionaryKey:key];
return value ? [value intValue] : defaultValue;
}
extern "C" int __attribute__((weak)) main(int argc, char *argv[])
{
@autoreleasepool {

View File

@ -61,6 +61,7 @@ QPointF fromCGPoint(const CGPoint &point);
Qt::ScreenOrientation toQtScreenOrientation(UIDeviceOrientation uiDeviceOrientation);
UIDeviceOrientation fromQtScreenOrientation(Qt::ScreenOrientation qtOrientation);
QRect fromPortraitToPrimary(const QRect &rect, QPlatformScreen *screen);
int infoPlistValue(NSString* key, int defaultValue);
QT_END_NAMESPACE

View File

@ -134,5 +134,12 @@ QRect fromPortraitToPrimary(const QRect &rect, QPlatformScreen *screen)
: QRect(rect.y(), geometry.height() - rect.width() - rect.x(), rect.height(), rect.width());
}
int infoPlistValue(NSString* key, int defaultValue)
{
static NSBundle *bundle = [NSBundle mainBundle];
NSNumber* value = [bundle objectForInfoDictionaryKey:key];
return value ? [value intValue] : defaultValue;
}
QT_END_NAMESPACE