[haiku-commits] haiku: hrev50584 - src/kits/storage/mime

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 9 Oct 2016 21:28:04 +0200 (CEST)

hrev50584 adds 1 changeset to branch 'master'
old head: fe2557b6eb55be3c2d36e1ee396e0f10e41bd214
new head: 069c56970470c956ff1133cf970b42a78ec03561
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=069c56970470+%5Efe2557b6eb55

----------------------------------------------------------------------------

069c56970470: 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

                             [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev50584
Commit:      069c56970470c956ff1133cf970b42a78ec03561
URL:         http://cgit.haiku-os.org/haiku/commit/?id=069c56970470
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Sun Oct  9 19:25:53 2016 UTC

Ticket:      https://dev.haiku-os.org/ticket/12955

----------------------------------------------------------------------------

1 file changed, 7 insertions(+), 5 deletions(-)
src/kits/storage/mime/Database.cpp | 12 +++++++-----

----------------------------------------------------------------------------

diff --git a/src/kits/storage/mime/Database.cpp 
b/src/kits/storage/mime/Database.cpp
index c176f3d..84239e7 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;


Other related posts: