Skip to content

Commit 4dc49dd

Browse files
SettingsBase: Add remove file callback
Signed-off-by: Vitaliy Andreevich <[email protected]>
1 parent 95c1281 commit 4dc49dd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/core/SettingsBase.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ class SettingsBase {
208208
_focus_cb = cb;
209209
}
210210

211+
// обработчик удаления файлов с устройства типа f(Text path)
212+
void onFileRemove(FileCallback cb) {
213+
_remove_cb = cb;
214+
}
215+
211216
// тикер, вызывать в родительском классе
212217
void tick() {
213218
#ifndef SETT_NO_DB
@@ -456,6 +461,9 @@ class SettingsBase {
456461
if (granted) {
457462
fs.remove(value.c_str());
458463
_sendFs(true);
464+
if (_remove_cb) {
465+
_remove_cb(value);
466+
}
459467
return;
460468
}
461469
break;
@@ -482,6 +490,7 @@ class SettingsBase {
482490
}
483491

484492
private:
493+
FileCallback _remove_cb = nullptr;
485494
BuildCallback _build_cb = nullptr;
486495
UpdateCallback _upd_cb = nullptr;
487496
FocusCallback _focus_cb = nullptr;

0 commit comments

Comments
 (0)