summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-04-30 15:03:27 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-04-30 15:03:27 +0000
commite3bc0d7e9099b2d91dcc997fab851ddb78b852ea (patch)
tree1cfeb70ad4fd05fbbc4f01e693a926481fd53b23 /src
parent1ef1cbc2bf5df453bf5357416b10ffb50a4cec8d (diff)
no need to change an extra icon if nothing is change
git-svn-id: http://svn.miranda-ng.org/main/trunk@16794 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/BaseExtraIcon.cpp7
-rw-r--r--src/mir_app/src/ExtraIcon.h1
-rw-r--r--src/mir_app/src/extraicons.cpp14
3 files changed, 14 insertions, 8 deletions
diff --git a/src/mir_app/src/BaseExtraIcon.cpp b/src/mir_app/src/BaseExtraIcon.cpp
index 2ff3beaf3f..4503a85ed9 100644
--- a/src/mir_app/src/BaseExtraIcon.cpp
+++ b/src/mir_app/src/BaseExtraIcon.cpp
@@ -29,7 +29,8 @@ BaseExtraIcon::BaseExtraIcon(int id, const char *name, const TCHAR *description,
m_OnClick(OnClick),
m_onClickParam(param),
m_tszDescription(mir_tstrdup(description)),
- m_szDescIcon(mir_strdup(descIcon))
+ m_szDescIcon(mir_strdup(descIcon)),
+ m_hOldImage(INVALID_HANDLE_VALUE)
{
}
@@ -76,6 +77,10 @@ void BaseExtraIcon::onClick(MCONTACT hContact)
int BaseExtraIcon::ClistSetExtraIcon(MCONTACT hContact, HANDLE hImage)
{
+ if (hImage == m_hOldImage)
+ return 0;
+
+ m_hOldImage = hImage;
ExtraIcon *tmp = extraIconsByHandle[m_id - 1];
if (tmp != this)
return tmp->ClistSetExtraIcon(hContact, hImage);
diff --git a/src/mir_app/src/ExtraIcon.h b/src/mir_app/src/ExtraIcon.h
index 3d00bf5a04..26cc63133c 100644
--- a/src/mir_app/src/ExtraIcon.h
+++ b/src/mir_app/src/ExtraIcon.h
@@ -93,6 +93,7 @@ protected:
ptrA m_szDescIcon;
MIRANDAHOOKPARAM m_OnClick;
LPARAM m_onClickParam;
+ HANDLE m_hOldImage;
};
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/extraicons.cpp b/src/mir_app/src/extraicons.cpp
index bdaa2d746f..6a127fde5b 100644
--- a/src/mir_app/src/extraicons.cpp
+++ b/src/mir_app/src/extraicons.cpp
@@ -35,8 +35,8 @@ int SortFunc(const ExtraIcon *p1, const ExtraIcon *p2)
if (ret != 0)
return ret;
- int id1 = (p1->getType() != EXTRAICON_TYPE_GROUP) ? ((BaseExtraIcon*) p1)->getID() : 0;
- int id2 = (p2->getType() != EXTRAICON_TYPE_GROUP) ? ((BaseExtraIcon*) p2)->getID() : 0;
+ int id1 = (p1->getType() != EXTRAICON_TYPE_GROUP) ? ((BaseExtraIcon*)p1)->getID() : 0;
+ int id2 = (p2->getType() != EXTRAICON_TYPE_GROUP) ? ((BaseExtraIcon*)p2)->getID() : 0;
return id1 - id2;
}
@@ -80,7 +80,7 @@ int Clist_SetExtraIcon(MCONTACT hContact, int slot, HANDLE hImage)
if (cli.hwndContactTree == 0)
return -1;
- int icol = ExtraImage_ExtraIDToColumnNum( ConvertToClistSlot(slot));
+ int icol = ExtraImage_ExtraIDToColumnNum(ConvertToClistSlot(slot));
if (icol == -1)
return -1;
@@ -88,7 +88,7 @@ int Clist_SetExtraIcon(MCONTACT hContact, int slot, HANDLE hImage)
if (hItem == 0)
return -1;
- SendMessage(cli.hwndContactTree, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(icol,hImage));
+ SendMessage(cli.hwndContactTree, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(icol, hImage));
return 0;
}
@@ -289,7 +289,7 @@ HANDLE ExtraIcon_Add(HICON hIcon)
void fnReloadExtraIcons()
{
- SendMessage(cli.hwndContactTree, CLM_SETEXTRASPACE, db_get_b(NULL,"CLUI","ExtraColumnSpace",18), 0);
+ SendMessage(cli.hwndContactTree, CLM_SETEXTRASPACE, db_get_b(NULL, "CLUI", "ExtraColumnSpace", 18), 0);
SendMessage(cli.hwndContactTree, CLM_SETEXTRAIMAGELIST, 0, 0);
if (hExtraImageList)
@@ -299,7 +299,7 @@ void fnReloadExtraIcons()
SendMessage(cli.hwndContactTree, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hExtraImageList);
SendMessage(cli.hwndContactTree, CLM_SETEXTRACOLUMNS, EXTRA_ICON_COUNT, 0);
- NotifyEventHooks(hEventExtraImageListRebuilding,0,0);
+ NotifyEventHooks(hEventExtraImageListRebuilding, 0, 0);
bImageCreated = true;
}
@@ -379,7 +379,7 @@ static void EI_PostCreate(BaseExtraIcon *extra, const char *name, int _hLang)
}
}
-EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterCallback(const char *name, const char *description, const char *descIcon,
+EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterCallback(const char *name, const char *description, const char *descIcon,
MIRANDAHOOK RebuildIcons, MIRANDAHOOK ApplyIcon,
MIRANDAHOOKPARAM OnClick, LPARAM onClickParam, int _hLang)
{