QTfrontend/CocoaInitializer.mm
author nemo
Sun, 02 Aug 2009 17:37:45 +0000
changeset 2294 2e6ffb3ef304
parent 2261 57e99c908e7c
child 2400 2422ea85d100
permissions -rw-r--r--
For people's consideration. Restore the .11 behaviour of not initialising sound if music is turned off. Reason. I still get 100% CPU useage in frontend due to sucky sound daemon setups *cough*pulseaudio*cough* so this offers an easy workaround for people (turn off music). Disadvantage, this removes Smaxx' code to disable sound-related buttons on failure to init sound.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2261
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     1
/*
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     2
 * Copyright (C) 2008 Remko Troncon
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     3
 */
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     4
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     5
#include "CocoaInitializer.h"
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     6
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     7
#include <AppKit/AppKit.h>
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     8
#include <Cocoa/Cocoa.h>
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     9
#include <QtDebug>
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    10
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    11
class CocoaInitializer::Private 
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    12
{
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    13
	public:
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    14
		NSAutoreleasePool* autoReleasePool_;
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    15
};
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    16
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    17
CocoaInitializer::CocoaInitializer()
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    18
{
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    19
	d = new CocoaInitializer::Private();
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    20
	NSApplicationLoad();
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    21
	d->autoReleasePool_ = [[NSAutoreleasePool alloc] init];
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    22
}
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    23
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    24
CocoaInitializer::~CocoaInitializer()
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    25
{
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    26
	[d->autoReleasePool_ release];
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    27
	delete d;
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    28
}