forked from caelestia-dots/shell
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathpatch.diff
More file actions
28 lines (26 loc) · 972 Bytes
/
Copy pathpatch.diff
File metadata and controls
28 lines (26 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- plugin/src/Caelestia/Services/QuickShare/quickshare_service.hpp
+++ plugin/src/Caelestia/Services/QuickShare/quickshare_service.hpp
@@ -62,6 +62,7 @@
Q_INVOKABLE void acceptIncomingTransfer();
Q_INVOKABLE void rejectIncomingTransfer();
Q_INVOKABLE void clearHistory();
+ Q_INVOKABLE void removeHistoryEntry(int index);
private:
void startDiscovery();
--- plugin/src/Caelestia/Services/QuickShare/quickshare_service.cpp
+++ plugin/src/Caelestia/Services/QuickShare/quickshare_service.cpp
@@ -194,6 +194,15 @@
saveHistory();
}
+void QuickShareService::removeHistoryEntry(int index) {
+ if (index >= 0 && index < m_transferHistory.size()) {
+ m_transferHistory.removeAt(index);
+ emit transferHistoryChanged();
+ saveHistory();
+ }
+}
+
+
void QuickShareService::loadHistory() {
QSettings settings("Dim", "Caelestia-QuickShare");
m_transferHistory = settings.value("history").value<QVariantList>();