diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-26 15:23:13 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-26 15:23:13 +0300 |
commit | 20b8bac7a81b0ec3838d4bc972528cfc53572bd8 (patch) | |
tree | 6bb23a0acdbd99fb3fcb37f816e12ee0cb313092 | |
parent | 42706272085db04de11ba586e3e2c8a507e7af0d (diff) |
universal fix for all clist initialization problems (missing icons, menu items etc)
- also fixes #1211
-rw-r--r-- | src/mir_app/src/clc.h | 1 | ||||
-rw-r--r-- | src/mir_app/src/clistcore.cpp | 9 | ||||
-rw-r--r-- | src/mir_app/src/newplugins.cpp | 11 |
3 files changed, 14 insertions, 7 deletions
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h index 4f17a93dc5..c61a246dc3 100644 --- a/src/mir_app/src/clc.h +++ b/src/mir_app/src/clc.h @@ -39,6 +39,7 @@ struct ClcCacheEntry : public ClcCacheEntryBase /* clc.c */
extern int g_IconWidth, g_IconHeight;
extern HIMAGELIST hCListImages;
+extern bool g_bReadyToInitClist;
void fnClcOptionsChanged(void);
void fnInitAutoRebuild(HWND hWnd);
diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp index 7abfb01cc0..800bc4c0c6 100644 --- a/src/mir_app/src/clistcore.cpp +++ b/src/mir_app/src/clistcore.cpp @@ -27,6 +27,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "genmenu.h"
#include "extraicons.h"
+int LoadContactListModule2(void);
+int LoadCLCModule(void);
+
CLIST_INTERFACE cli = { 0 };
static wchar_t szTip[MAX_TIP_SIZE+1];
@@ -204,5 +207,11 @@ MIR_APP_DLL(CLIST_INTERFACE*) Clist_GetInterface(void) interfaceInited = 1;
}
+ if (g_bReadyToInitClist) {
+ LoadContactListModule2();
+ LoadCLCModule();
+ g_bReadyToInitClist = false;
+ }
+
return &cli;
}
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index 29346eadc1..21e8c78419 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -30,6 +30,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "langpack.h"
#include "netlib.h"
+bool g_bReadyToInitClist = false;
+
void LoadExtraIconsModule();
static int sttComparePluginsByName(const pluginEntry *p1, const pluginEntry *p2)
@@ -615,11 +617,10 @@ LBL_Error: /////////////////////////////////////////////////////////////////////////////////////////
// Contact list plugins support
-int LoadContactListModule2(void);
-int LoadCLCModule(void);
-
static bool loadClistModule(wchar_t* exe, pluginEntry *p)
{
+ g_bReadyToInitClist = true;
+
BASIC_PLUGIN_INFO bpi;
if (checkAPI(exe, &bpi, mirandaVersion, CHECKAPI_CLIST)) {
p->bpi = bpi;
@@ -642,10 +643,6 @@ static bool loadClistModule(wchar_t* exe, pluginEntry *p) p->bLoaded = true;
pluginDefault[0].pImpl = p;
- int rc = LoadContactListModule2();
- if (rc == 0)
- rc = LoadCLCModule();
-
LoadExtraIconsModule();
return true;
}
|