Skip to content
Snippets Groups Projects
Commit 36222cfa authored by Oz Linden's avatar Oz Linden
Browse files

merge changes for DRTVWR-244

parents 07dd6cf6 7a6b073d
No related branches found
No related tags found
No related merge requests found
...@@ -325,6 +325,7 @@ b61afe175b829c149d369524a4e974dfda99facf DRTVWR-219 ...@@ -325,6 +325,7 @@ b61afe175b829c149d369524a4e974dfda99facf DRTVWR-219
e6e553761829dc0270eaaa712b7cb0622535b076 3.4.1-beta3 e6e553761829dc0270eaaa712b7cb0622535b076 3.4.1-beta3
f00068a66a2e2f72acbe3f690b98b323e740b289 DRTVWR-222 f00068a66a2e2f72acbe3f690b98b323e740b289 DRTVWR-222
305950187c628a5d6743ee9ea711cc5b9177a18e 3.4.1-beta4 305950187c628a5d6743ee9ea711cc5b9177a18e 3.4.1-beta4
dd23d4da3bcb2ffda58569e759feb7c119982973 DRTVWR-224
0bd3744ff060452aa13ff4992eafb381df7b1012 3.4.1-beta5 0bd3744ff060452aa13ff4992eafb381df7b1012 3.4.1-beta5
29075f8c1abed53dcf195a59f61744e27a91108f DRTVWR-226 29075f8c1abed53dcf195a59f61744e27a91108f DRTVWR-226
fba99f381b8d4ad1b7b42fa4993b29998d95be18 DRTVWR-179 fba99f381b8d4ad1b7b42fa4993b29998d95be18 DRTVWR-179
...@@ -382,5 +383,4 @@ daca610d840625b5bebb966a57cb49581852c417 DRTVWR-265 ...@@ -382,5 +383,4 @@ daca610d840625b5bebb966a57cb49581852c417 DRTVWR-265
9afbdc4e24cc04feacfb2b7a10b78a64f780901a DRTVWR-266 9afbdc4e24cc04feacfb2b7a10b78a64f780901a DRTVWR-266
73280db02501f5ad041fc18b1eba68e73a81996c DRTVWR-267 73280db02501f5ad041fc18b1eba68e73a81996c DRTVWR-267
870e2d79e0063fda87187f17bbc2747766733194 3.4.3-beta3 870e2d79e0063fda87187f17bbc2747766733194 3.4.3-beta3
18c5f76ac07937e0b64bb874edba0d60a28cec56 DRTVWR-244 84fbaf2d4141bd161731430e760949dc787ca206 DRTVWR-244
12655fb818f3b0b08a4638d0cda1ad1f01e5f52f DRTVWR-224
...@@ -32,16 +32,22 @@ ...@@ -32,16 +32,22 @@
std::string* getSystemTempFolder() std::string* getSystemTempFolder()
{ {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString * tempDir = NSTemporaryDirectory(); NSString * tempDir = NSTemporaryDirectory();
if (tempDir == nil) if (tempDir == nil)
tempDir = @"/tmp"; tempDir = @"/tmp";
return ( new std::string([tempDir UTF8String]) ); std::string *result = ( new std::string([tempDir UTF8String]) );
[pool release];
return result;
} }
//findSystemDirectory scoped exclusively to this file. //findSystemDirectory scoped exclusively to this file.
std::string* findSystemDirectory(NSSearchPathDirectory searchPathDirectory, std::string* findSystemDirectory(NSSearchPathDirectory searchPathDirectory,
NSSearchPathDomainMask domainMask) NSSearchPathDomainMask domainMask)
{ {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
std::string *result; std::string *result;
NSString *path = nil; NSString *path = nil;
...@@ -60,19 +66,30 @@ std::string* findSystemDirectory(NSSearchPathDirectory searchPathDirectory, ...@@ -60,19 +66,30 @@ std::string* findSystemDirectory(NSSearchPathDirectory searchPathDirectory,
result = new std::string([path UTF8String]); result = new std::string([path UTF8String]);
} }
[pool release];
return result; return result;
} }
std::string* getSystemExecutableFolder() std::string* getSystemExecutableFolder()
{ {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *bundlePath = [[NSBundle mainBundle] executablePath]; NSString *bundlePath = [[NSBundle mainBundle] executablePath];
return (new std::string([bundlePath UTF8String])); std::string *result = (new std::string([bundlePath UTF8String]));
[pool release];
return result;
} }
std::string* getSystemResourceFolder() std::string* getSystemResourceFolder()
{ {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *bundlePath = [[NSBundle mainBundle] resourcePath]; NSString *bundlePath = [[NSBundle mainBundle] resourcePath];
return (new std::string([bundlePath UTF8String])); std::string *result = (new std::string([bundlePath UTF8String]));
[pool release];
return result;
} }
std::string* getSystemCacheFolder() std::string* getSystemCacheFolder()
......
...@@ -134,7 +134,7 @@ struct LLDir_Dummy: public LLDir ...@@ -134,7 +134,7 @@ struct LLDir_Dummy: public LLDir
return 0; return 0;
} }
virtual BOOL fileExists(const std::string& pathname) const virtual bool fileExists(const std::string& pathname) const
{ {
// Record fileExists() calls so we can check whether caching is // Record fileExists() calls so we can check whether caching is
// working right. Certain LLDir calls should be able to make decisions // working right. Certain LLDir calls should be able to make decisions
......
...@@ -126,6 +126,8 @@ void sendProgress(int cur, int max, const std::string str) ...@@ -126,6 +126,8 @@ void sendProgress(int cur, int max, const std::string str)
bool copyDir(const std::string& src_dir, const std::string& dest_dir) bool copyDir(const std::string& src_dir, const std::string& dest_dir)
{ {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString* file = [NSString stringWithCString:src_dir.c_str() NSString* file = [NSString stringWithCString:src_dir.c_str()
encoding:[NSString defaultCStringEncoding]]; encoding:[NSString defaultCStringEncoding]];
NSString* toParent = [NSString stringWithCString:dest_dir.c_str() NSString* toParent = [NSString stringWithCString:dest_dir.c_str()
...@@ -137,6 +139,8 @@ bool copyDir(const std::string& src_dir, const std::string& dest_dir) ...@@ -137,6 +139,8 @@ bool copyDir(const std::string& src_dir, const std::string& dest_dir)
if (!result) { if (!result) {
NSLog(@"Error during copy: %@", [error localizedDescription]); NSLog(@"Error during copy: %@", [error localizedDescription]);
} }
[pool release];
return result; return result;
} }
...@@ -178,26 +182,38 @@ bool copyDir(const std::string& src_dir, const std::string& dest_dir) ...@@ -178,26 +182,38 @@ bool copyDir(const std::string& src_dir, const std::string& dest_dir)
bool isDirWritable(const std::string& dir_name) bool isDirWritable(const std::string& dir_name)
{ {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *fullPath = [NSString stringWithCString:dir_name.c_str() NSString *fullPath = [NSString stringWithCString:dir_name.c_str()
encoding:[NSString defaultCStringEncoding]]; encoding:[NSString defaultCStringEncoding]];
NSFileManager *fm = [NSFileManager defaultManager]; NSFileManager *fm = [NSFileManager defaultManager];
bool result = [fm isWritableFileAtPath:fullPath]; bool result = [fm isWritableFileAtPath:fullPath];
[pool release];
return result; return result;
} }
std::string* getUserTrashFolder() std::string* getUserTrashFolder()
{ {
std::string *result;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *trash_str=[NSHomeDirectory() stringByAppendingPathComponent:@".Trash"]; NSString *trash_str=[NSHomeDirectory() stringByAppendingPathComponent:@".Trash"];
return NSToString( trash_str );
result = NSToString( trash_str );
[pool release];
return result;
} }
bool isFSRefViewerBundle(const std::string& targetURL) bool isFSRefViewerBundle(const std::string& targetURL)
{ {
bool result = false; bool result = false;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *fullPath = [NSString stringWithCString:targetURL.c_str() NSString *fullPath = [NSString stringWithCString:targetURL.c_str()
encoding:[NSString defaultCStringEncoding]]; encoding:[NSString defaultCStringEncoding]];
NSBundle *targetBundle = [NSBundle bundleWithPath:fullPath]; NSBundle *targetBundle = [NSBundle bundleWithPath:fullPath];
...@@ -212,6 +228,8 @@ bool isFSRefViewerBundle(const std::string& targetURL) ...@@ -212,6 +228,8 @@ bool isFSRefViewerBundle(const std::string& targetURL)
std::cout << "Target bundle ID mismatch." << std::endl; std::cout << "Target bundle ID mismatch." << std::endl;
} }
[pool release];
return result; return result;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment