mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-17 03:57:06 +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+
|
||||
|
||||
Files: ext/libclementine-common/core/arraysize.h
|
||||
ext/libclementine-common/core/scoped_nsautorelease_pool.*
|
||||
src/core/scoped_nsobject.h
|
||||
src/core/scoped_cftyperef.h
|
||||
src/core/scoped_nsautorelease_pool.*
|
||||
Copyright: 2011, The Chromium Authors
|
||||
License: BSD-Google
|
||||
|
||||
|
@ -4,11 +4,12 @@
|
||||
#import <Foundation/NSFileManager.h>
|
||||
#import <Foundation/NSPathUtilities.h>
|
||||
|
||||
#import "core/scoped_nsautorelease_pool.h"
|
||||
|
||||
namespace utilities {
|
||||
|
||||
QString GetUserDataDirectory() {
|
||||
NSAutoreleasePool* pool = [NSAutoreleasePool alloc];
|
||||
[pool init];
|
||||
ScopedNSAutoreleasePool pool;
|
||||
|
||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory,
|
||||
NSUserDomainMask, YES);
|
||||
@ -19,12 +20,11 @@ QString GetUserDataDirectory() {
|
||||
} else {
|
||||
ret = "~/Library/Caches";
|
||||
}
|
||||
[pool drain];
|
||||
return ret;
|
||||
}
|
||||
|
||||
QString GetSettingsDirectory() {
|
||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
||||
ScopedNSAutoreleasePool pool;
|
||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(
|
||||
NSApplicationSupportDirectory, NSUserDomainMask, YES);
|
||||
NSString* ret;
|
||||
@ -42,7 +42,7 @@ QString GetSettingsDirectory() {
|
||||
error:nil];
|
||||
|
||||
QString path = QString::fromUtf8([ret UTF8String]);
|
||||
[pool drain];
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace utilities
|
||||
|
@ -21,6 +21,10 @@ set(HEADERS
|
||||
core/workerpool.h
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
list(APPEND SOURCES core/scoped_nsautorelease_pool.mm)
|
||||
endif(APPLE)
|
||||
|
||||
qt4_wrap_cpp(MOC ${HEADERS})
|
||||
|
||||
add_library(libclementine-common STATIC
|
||||
|
@ -864,7 +864,6 @@ optional_source(APPLE
|
||||
core/macfslistener.mm
|
||||
core/macglobalshortcutbackend.mm
|
||||
core/mac_startup.mm
|
||||
core/scoped_nsautorelease_pool.mm
|
||||
devices/macdevicelister.mm
|
||||
engines/osxdevicefinder.cpp
|
||||
networkremote/bonjour.mm
|
||||
|
Loading…
Reference in New Issue
Block a user