From 069c56970470c956ff1133cf970b42a78ec03561 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 9 Oct 2016 21:25:53 +0200 Subject: [PATCH] Fix incorrect use of _SendMonitorUpdate Icon size is only a boolean here (true for a large icon, false otherwise). Using B_LARGE_ICON directly is not appropriate. As found by Murai Takashi, but there was a second case in the same file which I also fixed. ticket : #12955 --- src/kits/storage/mime/Database.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/kits/storage/mime/Database.cpp b/src/kits/storage/mime/Database.cpp index c176f3d33f..84239e7772 100644 --- a/src/kits/storage/mime/Database.cpp +++ b/src/kits/storage/mime/Database.cpp @@ -1114,9 +1114,10 @@ Database::DeleteIcon(const char *type, icon_size which) { const char *attr = which == B_MINI_ICON ? kMiniIconAttr : kLargeIconAttr; status_t status = fLocation->DeleteAttribute(type, attr); - if (status == B_OK) - _SendMonitorUpdate(B_ICON_CHANGED, type, which, B_META_MIME_DELETED); - else if (status == B_ENTRY_NOT_FOUND) + if (status == B_OK) { + _SendMonitorUpdate(B_ICON_CHANGED, type, (which == B_LARGE_ICON), + B_META_MIME_DELETED); + } else if (status == B_ENTRY_NOT_FOUND) status = B_OK; return status; @@ -1135,10 +1136,11 @@ Database::DeleteIcon(const char *type, icon_size which) status_t Database::DeleteIcon(const char *type) { - // TODO: extra notification for vector icon (uses B_LARGE_ICON now) + // TODO: extra notification for vector icon (for now we notify a "large" + // icon) status_t status = fLocation->DeleteAttribute(type, kIconAttr); if (status == B_OK) { - _SendMonitorUpdate(B_ICON_CHANGED, type, B_LARGE_ICON, + _SendMonitorUpdate(B_ICON_CHANGED, type, true, B_META_MIME_DELETED); } else if (status == B_ENTRY_NOT_FOUND) status = B_OK;