Lines 145-150
Link Here
|
145 |
return pipe.is(); |
145 |
return pipe.is(); |
146 |
} |
146 |
} |
147 |
|
147 |
|
|
|
148 |
//get modification time |
149 |
static bool getModifyTimeTargetFile(const OUString &rFileURL, TimeValue &rTime) |
150 |
{ |
151 |
::osl::DirectoryItem item; |
152 |
if (::osl::DirectoryItem::get(rFileURL, item) != ::osl::File::E_None) |
153 |
return false; |
154 |
|
155 |
::osl::FileStatus stat(FileStatusMask_ModifyTime|FileStatusMask_Type|FileStatusMask_LinkTargetURL); |
156 |
if (item.getFileStatus(stat) != ::osl::File::E_None) |
157 |
return false; |
158 |
|
159 |
if( stat.getFileType() == ::osl::FileStatus::Link ) |
160 |
return getModifyTimeTargetFile(stat.getLinkTargetURL(), rTime); |
161 |
|
162 |
rTime = stat.getModifyTime(); |
163 |
return true; |
164 |
} |
148 |
|
165 |
|
149 |
//Returns true if the Folder was more recently modified then |
166 |
//Returns true if the Folder was more recently modified then |
150 |
//the lastsynchronized file. That is the repository needs to |
167 |
//the lastsynchronized file. That is the repository needs to |
Lines 183-210
Link Here
|
183 |
|
200 |
|
184 |
//compare the modification time of the extension folder and the last |
201 |
//compare the modification time of the extension folder and the last |
185 |
//modified file |
202 |
//modified file |
186 |
::osl::FileStatus statFolder(FileStatusMask_ModifyTime); |
203 |
TimeValue timeFolder; |
187 |
::osl::FileStatus statFile(FileStatusMask_ModifyTime); |
204 |
if (getModifyTimeTargetFile(folderURL, timeFolder)) |
188 |
if (itemExtFolder.getFileStatus(statFolder) == ::osl::File::E_None) |
|
|
189 |
{ |
205 |
{ |
190 |
if (itemFile.getFileStatus(statFile) == ::osl::File::E_None) |
206 |
TimeValue timeFile; |
|
|
207 |
if (getModifyTimeTargetFile(fileURL, timeFile)) |
191 |
{ |
208 |
{ |
192 |
TimeValue timeFolder = statFolder.getModifyTime(); |
209 |
if (timeFile.Seconds < timeFolder.Seconds) |
193 |
TimeValue timeFile = statFile.getModifyTime(); |
|
|
194 |
|
195 |
fprintf(stderr, "compare extension %s to %s\n", |
196 |
rtl::OUStringToOString(folderURL, RTL_TEXTENCODING_UTF8).getStr(), |
197 |
rtl::OUStringToOString(fileURL, RTL_TEXTENCODING_UTF8).getStr() |
198 |
); |
199 |
fprintf(stderr, "compare extension %d to %d\n", timeFolder.Seconds, timeFile.Seconds); |
200 |
|
201 |
if (timeFile.Seconds < timeFolder.Seconds) |
202 |
bNeedsSync = true; |
210 |
bNeedsSync = true; |
203 |
} |
211 |
} |
204 |
else |
212 |
else |
205 |
{ |
213 |
{ |
206 |
OSL_ASSERT(0); |
214 |
OSL_ASSERT(0); |
207 |
bNeedsSync = true; |
215 |
bNeedsSync = true; |
208 |
} |
216 |
} |
209 |
} |
217 |
} |
210 |
else |
218 |
else |
Lines 212-217
Link Here
|
212 |
OSL_ASSERT(0); |
220 |
OSL_ASSERT(0); |
213 |
bNeedsSync = true; |
221 |
bNeedsSync = true; |
214 |
} |
222 |
} |
|
|
223 |
|
215 |
return bNeedsSync; |
224 |
return bNeedsSync; |
216 |
} |
225 |
} |
217 |
|
226 |
|