mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-05 11:35:26 +00:00
Monotone-Parent: daeccf44f2750bfeb36858cb6386c86f90cc252a
Monotone-Revision: 43d241658c366d49394b3972e7951947d8271398 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-08-13T19:39:47 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -242,22 +242,18 @@ Class SOGoMAPIDBObjectK = Nil;
|
||||
{
|
||||
record = [records objectAtIndex: count];
|
||||
path = [record objectForKey: @"c_path"];
|
||||
if ([path isEqualToString: oldPath]
|
||||
|| [path hasPrefix: oldPathAsPrefix])
|
||||
{
|
||||
sql = [NSMutableString stringWithFormat: @"UPDATE %@"
|
||||
@" SET c_path = '%@'",
|
||||
[self tableName],
|
||||
[path stringByReplacingPrefix: oldPath
|
||||
withPrefix: newPath]];
|
||||
parentPath = [record objectForKey: @"c_parent_path"];
|
||||
if ([parentPath isNotNull])
|
||||
[sql appendFormat: @", c_parent_path = '%@'",
|
||||
[parentPath stringByReplacingPrefix: oldPath
|
||||
withPrefix: newPath]];
|
||||
[sql appendFormat: @" WHERE c_path = '%@'", oldPath];
|
||||
[queries addObject: sql];
|
||||
}
|
||||
sql = [NSMutableString stringWithFormat: @"UPDATE %@"
|
||||
@" SET c_path = '%@'",
|
||||
[self tableName],
|
||||
[path stringByReplacingPrefix: oldPath
|
||||
withPrefix: newPath]];
|
||||
parentPath = [record objectForKey: @"c_parent_path"];
|
||||
if ([parentPath isNotNull])
|
||||
[sql appendFormat: @", c_parent_path = '%@'",
|
||||
[parentPath stringByReplacingPrefix: oldPath
|
||||
withPrefix: newPath]];
|
||||
[sql appendFormat: @" WHERE c_path = '%@'", path];
|
||||
[queries addObject: sql];
|
||||
}
|
||||
[self performBatchSQLQueries: queries];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user