From c83e582af2ee14b7a490328b5340367cd2084654 Mon Sep 17 00:00:00 2001 From: Elyahw <136118735+elyahw@users.noreply.github.com> Date: Sat, 21 Sep 2024 19:18:14 +0100 Subject: [PATCH] Touch parent folder on file modification --- .../markor/activity/DocumentEditAndViewFragment.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/net/gsantner/markor/activity/DocumentEditAndViewFragment.java b/app/src/main/java/net/gsantner/markor/activity/DocumentEditAndViewFragment.java index ba88eff0b5..3182b4ee82 100644 --- a/app/src/main/java/net/gsantner/markor/activity/DocumentEditAndViewFragment.java +++ b/app/src/main/java/net/gsantner/markor/activity/DocumentEditAndViewFragment.java @@ -813,6 +813,11 @@ public boolean saveDocument(final boolean forceSaveEmpty) { // Document is written iff writeable && content has changed final CharSequence text = _hlEditor.getText(); if (!_document.isContentSame(text)) { + // Touch parent folder on edit + File current_parent_folder = _document.file.getAbsoluteFile().getParentFile(); + long currentTime = System.currentTimeMillis(); + current_parent_folder.setLastModified(currentTime); + final int minLength = GsContextUtils.TEXTFILE_OVERWRITE_MIN_TEXT_LENGTH; if (!forceSaveEmpty && text != null && text.length() < minLength) { final String message = activity.getString(R.string.wont_save_min_length, minLength);