mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-09 21:36:13 +00:00
IPC: notifications - add removeOldestHistory
This commit is contained in:
@@ -78,6 +78,10 @@ Item {
|
||||
NotificationService.dismissOldestActive();
|
||||
}
|
||||
|
||||
function removeOldestHistory() {
|
||||
NotificationService.removeOldestHistory();
|
||||
}
|
||||
|
||||
function dismissAll() {
|
||||
NotificationService.dismissAllActive();
|
||||
}
|
||||
|
||||
@@ -710,6 +710,19 @@ Singleton {
|
||||
return false;
|
||||
}
|
||||
|
||||
function removeOldestHistory() {
|
||||
if (historyList.count > 0) {
|
||||
const oldest = historyList.get(historyList.count - 1);
|
||||
if (oldest.cachedImage && !oldest.cachedImage.startsWith("image://")) {
|
||||
Quickshell.execDetached(["rm", "-f", oldest.cachedImage]);
|
||||
}
|
||||
historyList.remove(historyList.count - 1);
|
||||
saveHistory();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function clearHistory() {
|
||||
try {
|
||||
Quickshell.execDetached(["sh", "-c", `rm -rf "${Settings.cacheDirImagesNotifications}"*`]);
|
||||
|
||||
Reference in New Issue
Block a user