1 |
diff -ru desktop.orig/source/deployment/misc/dp_misc.cxx desktop/source/deployment/misc/dp_misc.cxx |
2 |
--- desktop.orig/source/deployment/misc/dp_misc.cxx 2010-07-20 08:31:24.000000000 +0100 |
3 |
+++ desktop/source/deployment/misc/dp_misc.cxx 2010-07-20 09:12:23.000000000 +0100 |
4 |
@@ -143,6 +143,23 @@ |
5 |
return pipe.is(); |
6 |
} |
7 |
|
8 |
+//get modification time |
9 |
+static bool getModifyTimeTargetFile(const OUString &rFileURL, TimeValue &rTime) |
10 |
+{ |
11 |
+ ::osl::DirectoryItem item; |
12 |
+ if (::osl::DirectoryItem::get(rFileURL, item) != ::osl::File::E_None) |
13 |
+ return false; |
14 |
+ |
15 |
+ ::osl::FileStatus stat(FileStatusMask_ModifyTime|FileStatusMask_Type|FileStatusMask_LinkTargetURL); |
16 |
+ if (item.getFileStatus(stat) != ::osl::File::E_None) |
17 |
+ return false; |
18 |
+ |
19 |
+ if( stat.getFileType() == ::osl::FileStatus::Link ) |
20 |
+ return getModifyTimeTargetFile(stat.getLinkTargetURL(), rTime); |
21 |
+ |
22 |
+ rTime = stat.getModifyTime(); |
23 |
+ return true; |
24 |
+} |
25 |
|
26 |
//Returns true if the Folder was more recently modified then |
27 |
//the lastsynchronized file. That is the repository needs to |
28 |
@@ -181,15 +198,12 @@ |
29 |
|
30 |
//compare the modification time of the extension folder and the last |
31 |
//modified file |
32 |
- ::osl::FileStatus statFolder(FileStatusMask_ModifyTime); |
33 |
- ::osl::FileStatus statFile(FileStatusMask_ModifyTime); |
34 |
- if (itemExtFolder.getFileStatus(statFolder) == ::osl::File::E_None) |
35 |
+ TimeValue timeFolder; |
36 |
+ if (getModifyTimeTargetFile(folderURL, timeFolder)) |
37 |
{ |
38 |
- if (itemFile.getFileStatus(statFile) == ::osl::File::E_None) |
39 |
+ TimeValue timeFile; |
40 |
+ if (getModifyTimeTargetFile(fileURL, timeFile)) |
41 |
{ |
42 |
- TimeValue timeFolder = statFolder.getModifyTime(); |
43 |
- TimeValue timeFile = statFile.getModifyTime(); |
44 |
- |
45 |
if (timeFile.Seconds < timeFolder.Seconds) |
46 |
bNeedsSync = true; |
47 |
} |
48 |
@@ -204,6 +218,7 @@ |
49 |
OSL_ASSERT(0); |
50 |
bNeedsSync = true; |
51 |
} |
52 |
+ |
53 |
return bNeedsSync; |
54 |
} |
55 |
|