projects
/
pithos-macos
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
145a4c7
)
Using caches directory for sync archive and temporary files.
author
Miltiadis Vasilakis
<mvasilak@gmail.com>
Thu, 1 Dec 2011 13:26:11 +0000
(15:26 +0200)
committer
Miltiadis Vasilakis
<mvasilak@gmail.com>
Thu, 1 Dec 2011 13:26:11 +0000
(15:26 +0200)
pithos-macos/PithosSyncDaemon.m
patch
|
blob
|
history
diff --git
a/pithos-macos/PithosSyncDaemon.m
b/pithos-macos/PithosSyncDaemon.m
index
cd6f498
..
5bcd3fa
100644
(file)
--- a/
pithos-macos/PithosSyncDaemon.m
+++ b/
pithos-macos/PithosSyncDaemon.m
@@
-290,7
+290,9
@@
- (NSString *)pithosStateFilePath {
if (!pithosStateFilePath)
- (NSString *)pithosStateFilePath {
if (!pithosStateFilePath)
- pithosStateFilePath = [[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"PithosLocalObjectStates.archive"] retain];
+ pithosStateFilePath = [[[[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0]
+ stringByAppendingPathComponent:[[NSBundle mainBundle] bundleIdentifier]]
+ stringByAppendingPathComponent:@"PithosLocalObjectStates.archive"] retain];
return [[pithosStateFilePath copy] autorelease];
}
return [[pithosStateFilePath copy] autorelease];
}
@@
-311,9
+313,11
@@
[fileManager createDirectoryAtPath:tempDownloadsDirPath withIntermediateDirectories:YES attributes:nil error:&error];
if (error)
tempDownloadsDirPath = nil;
[fileManager createDirectoryAtPath:tempDownloadsDirPath withIntermediateDirectories:YES attributes:nil error:&error];
if (error)
tempDownloadsDirPath = nil;
- }
+ }
if (!tempDownloadsDirPath) {
if (!tempDownloadsDirPath) {
- NSString *tempDirTemplate = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Temp Downloads XXXXXX"];
+ NSString *tempDirTemplate = [[[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0]
+ stringByAppendingPathComponent:[[NSBundle mainBundle] bundleIdentifier]]
+ stringByAppendingPathComponent:@"Temp Downloads XXXXXX"];
const char *tempDirTemplateCString = [tempDirTemplate fileSystemRepresentation];
char *tempDirNameCString = (char *)malloc(strlen(tempDirTemplateCString) + 1);
strcpy(tempDirNameCString, tempDirTemplateCString);
const char *tempDirTemplateCString = [tempDirTemplate fileSystemRepresentation];
char *tempDirNameCString = (char *)malloc(strlen(tempDirTemplateCString) + 1);
strcpy(tempDirNameCString, tempDirTemplateCString);
@@
-348,7
+352,9
@@
tempTrashDirPath = nil;
}
if (!tempTrashDirPath) {
tempTrashDirPath = nil;
}
if (!tempTrashDirPath) {
- NSString *tempDirTemplate = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Temp Trash XXXXXX"];
+ NSString *tempDirTemplate = [[[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0]
+ stringByAppendingPathComponent:[[NSBundle mainBundle] bundleIdentifier]]
+ stringByAppendingPathComponent:@"Temp Trash XXXXXX"];
const char *tempDirTemplateCString = [tempDirTemplate fileSystemRepresentation];
char *tempDirNameCString = (char *)malloc(strlen(tempDirTemplateCString) + 1);
strcpy(tempDirNameCString, tempDirTemplateCString);
const char *tempDirTemplateCString = [tempDirTemplate fileSystemRepresentation];
char *tempDirNameCString = (char *)malloc(strlen(tempDirTemplateCString) + 1);
strcpy(tempDirNameCString, tempDirTemplateCString);