mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-29 10:39:47 +01:00
Move ScopedNSAutoreleasePool to ext
This commit is contained in:
parent
7823d95a07
commit
705cdf11fc
2
debian/copyright
vendored
2
debian/copyright
vendored
@ -46,9 +46,9 @@ Copyright: 2004, Melchior FRANZ <mfranz@kde.org>
|
|||||||
License: GPL-2+
|
License: GPL-2+
|
||||||
|
|
||||||
Files: ext/libclementine-common/core/arraysize.h
|
Files: ext/libclementine-common/core/arraysize.h
|
||||||
|
ext/libclementine-common/core/scoped_nsautorelease_pool.*
|
||||||
src/core/scoped_nsobject.h
|
src/core/scoped_nsobject.h
|
||||||
src/core/scoped_cftyperef.h
|
src/core/scoped_cftyperef.h
|
||||||
src/core/scoped_nsautorelease_pool.*
|
|
||||||
Copyright: 2011, The Chromium Authors
|
Copyright: 2011, The Chromium Authors
|
||||||
License: BSD-Google
|
License: BSD-Google
|
||||||
|
|
||||||
|
@ -4,11 +4,12 @@
|
|||||||
#import <Foundation/NSFileManager.h>
|
#import <Foundation/NSFileManager.h>
|
||||||
#import <Foundation/NSPathUtilities.h>
|
#import <Foundation/NSPathUtilities.h>
|
||||||
|
|
||||||
|
#import "core/scoped_nsautorelease_pool.h"
|
||||||
|
|
||||||
namespace utilities {
|
namespace utilities {
|
||||||
|
|
||||||
QString GetUserDataDirectory() {
|
QString GetUserDataDirectory() {
|
||||||
NSAutoreleasePool* pool = [NSAutoreleasePool alloc];
|
ScopedNSAutoreleasePool pool;
|
||||||
[pool init];
|
|
||||||
|
|
||||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory,
|
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory,
|
||||||
NSUserDomainMask, YES);
|
NSUserDomainMask, YES);
|
||||||
@ -19,12 +20,11 @@ QString GetUserDataDirectory() {
|
|||||||
} else {
|
} else {
|
||||||
ret = "~/Library/Caches";
|
ret = "~/Library/Caches";
|
||||||
}
|
}
|
||||||
[pool drain];
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString GetSettingsDirectory() {
|
QString GetSettingsDirectory() {
|
||||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
ScopedNSAutoreleasePool pool;
|
||||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(
|
NSArray* paths = NSSearchPathForDirectoriesInDomains(
|
||||||
NSApplicationSupportDirectory, NSUserDomainMask, YES);
|
NSApplicationSupportDirectory, NSUserDomainMask, YES);
|
||||||
NSString* ret;
|
NSString* ret;
|
||||||
@ -42,7 +42,7 @@ QString GetSettingsDirectory() {
|
|||||||
error:nil];
|
error:nil];
|
||||||
|
|
||||||
QString path = QString::fromUtf8([ret UTF8String]);
|
QString path = QString::fromUtf8([ret UTF8String]);
|
||||||
[pool drain];
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
} // namespace utilities
|
||||||
|
@ -21,6 +21,10 @@ set(HEADERS
|
|||||||
core/workerpool.h
|
core/workerpool.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
list(APPEND SOURCES core/scoped_nsautorelease_pool.mm)
|
||||||
|
endif(APPLE)
|
||||||
|
|
||||||
qt4_wrap_cpp(MOC ${HEADERS})
|
qt4_wrap_cpp(MOC ${HEADERS})
|
||||||
|
|
||||||
add_library(libclementine-common STATIC
|
add_library(libclementine-common STATIC
|
||||||
|
@ -864,7 +864,6 @@ optional_source(APPLE
|
|||||||
core/macfslistener.mm
|
core/macfslistener.mm
|
||||||
core/macglobalshortcutbackend.mm
|
core/macglobalshortcutbackend.mm
|
||||||
core/mac_startup.mm
|
core/mac_startup.mm
|
||||||
core/scoped_nsautorelease_pool.mm
|
|
||||||
devices/macdevicelister.mm
|
devices/macdevicelister.mm
|
||||||
engines/osxdevicefinder.cpp
|
engines/osxdevicefinder.cpp
|
||||||
networkremote/bonjour.mm
|
networkremote/bonjour.mm
|
||||||
|
Loading…
x
Reference in New Issue
Block a user