Commit b100d8b 1 parent eeb72b9 commit b100d8b Copy full SHA for b100d8b
File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -343,6 +343,21 @@ namespace newplus::utilities
343
343
}
344
344
}
345
345
346
+ inline void update_last_write_time (const std::filesystem::path path)
347
+ {
348
+ const std::filesystem::file_time_type now = std::filesystem::file_time_type::clock::now ();
349
+
350
+ std::filesystem::last_write_time (path, now);
351
+
352
+ if (std::filesystem::is_directory (path))
353
+ {
354
+ for (const auto & entry : std::filesystem::recursive_directory_iterator (path))
355
+ {
356
+ std::filesystem::last_write_time (entry.path (), now);
357
+ }
358
+ }
359
+ }
360
+
346
361
inline HRESULT copy_template (const template_item* template_entry, const ComPtr<IUnknown> site_of_folder)
347
362
{
348
363
HRESULT hr = S_OK;
@@ -376,6 +391,9 @@ namespace newplus::utilities
376
391
// Copy file and determine final filename
377
392
std::filesystem::path target_final_fullpath = template_entry->copy_object_to (GetActiveWindow (), target_fullpath);
378
393
394
+ // Touch all files and set last modified to "now"
395
+ update_last_write_time (target_final_fullpath);
396
+
379
397
// Consider copy completed. If we do tracing after enter_rename_mode, then rename mode won't consistently work
380
398
trace.UpdateState (true );
381
399
Trace::EventCopyTemplate (target_final_fullpath.extension ().c_str ());
You can’t perform that action at this time.
0 commit comments