aboutsummaryrefslogtreecommitdiff
path: root/launcher/icons/IconList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/icons/IconList.cpp')
-rw-r--r--launcher/icons/IconList.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/launcher/icons/IconList.cpp b/launcher/icons/IconList.cpp
index 01043ad2..1dfc6432 100644
--- a/launcher/icons/IconList.cpp
+++ b/launcher/icons/IconList.cpp
@@ -354,15 +354,18 @@ const MMCIcon *IconList::icon(const QString &key) const
bool IconList::deleteIcon(const QString &key)
{
- int iconIdx = getIconIndex(key);
- if (iconIdx == -1)
+ if (!iconFileExists(key))
return false;
- auto &iconEntry = icons[iconIdx];
- if (iconEntry.has(IconType::FileBased))
- {
- return QFile::remove(iconEntry.m_images[IconType::FileBased].filename);
- }
- return false;
+
+ return QFile::remove(icon(key)->getFilePath());
+}
+
+bool IconList::trashIcon(const QString &key)
+{
+ if (!iconFileExists(key))
+ return false;
+
+ return FS::trash(icon(key)->getFilePath(), nullptr);
}
bool IconList::addThemeIcon(const QString& key)