summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-09-25 18:59:47 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-09-25 18:59:47 +0000
commit2eea33b2dcc64a02461a95b026d01c54c651fe26 (patch)
tree4e7ac2b3c336ae7e279ebf94a16075e8f422e3aa /src/modules
parent27035a4a46167dc714b770c77561f14e8d0b945d (diff)
protocols are unloadable now
git-svn-id: http://svn.miranda-ng.org/main/trunk@1656 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/plugins/newplugins.cpp3
-rw-r--r--src/modules/plugins/pluginopts.cpp16
-rw-r--r--src/modules/protocols/protoaccs.cpp9
3 files changed, 7 insertions, 21 deletions
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp
index 667aabccfc..4b16fbeb5c 100644
--- a/src/modules/plugins/newplugins.cpp
+++ b/src/modules/plugins/newplugins.cpp
@@ -338,9 +338,6 @@ void Plugin_Uninit(pluginEntry* p)
int Plugin_UnloadDyn(pluginEntry* p)
{
if (p->bpi.hInst) {
- if ( hasMuuid(p->bpi.Interfaces, miid_protocol))
- KillProtoAccounts(p->bpi.pluginInfo->shortName);
-
if ( CallPluginEventHook(p->bpi.hInst, hOkToExitEvent, 0, 0) != 0)
return FALSE;
diff --git a/src/modules/plugins/pluginopts.cpp b/src/modules/plugins/pluginopts.cpp
index 7f1483a5b1..9761c14ce5 100644
--- a/src/modules/plugins/pluginopts.cpp
+++ b/src/modules/plugins/pluginopts.cpp
@@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define IS_DATABASE (1 << 14)
-extern MUUID miid_clist, miid_database;
+extern MUUID miid_clist, miid_database, miid_protocol;
HANDLE hevLoadModule, hevUnloadModule;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -61,7 +61,6 @@ static BOOL dialogListPlugins(WIN32_FIND_DATA* fd, TCHAR* path, WPARAM, LPARAM l
return TRUE;
int isdb = hasMuuid(pi, miid_database);
- int isclist = hasMuuid(pi, miid_clist);
PluginListItemData* dat = (PluginListItemData*)mir_alloc(sizeof(PluginListItemData));
dat->hInst = hInst;
@@ -81,7 +80,7 @@ static BOOL dialogListPlugins(WIN32_FIND_DATA* fd, TCHAR* path, WPARAM, LPARAM l
it.iItem = iRow;
it.iSubItem = 1;
it.iImage = (hInst != NULL) ? 2 : 3;
- if (isdb || isclist)
+ if (isdb || hasMuuid(pi, miid_clist) || hasMuuid(pi, miid_protocol))
it.iImage += 2;
ListView_SetItem(hwndList, &it);
@@ -304,7 +303,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
if ( !ListView_GetItem(hwndList, &it))
break;
- PluginListItemData* dat = (PluginListItemData*)it.lParam;
+ PluginListItemData *dat = (PluginListItemData*)it.lParam;
if (dat->flags & IS_DATABASE) {
ListView_SetItemState(hwndList, hdr->iItem, 0x3000, LVIS_STATEIMAGEMASK);
return FALSE;
@@ -349,11 +348,10 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
SetWindowTextA( GetDlgItem(hwndDlg, IDC_PLUGINAUTHOR), sel ? dat->author : "");
SetWindowTextA( GetDlgItem(hwndDlg, IDC_PLUGINEMAIL), sel ? dat->authorEmail : "");
- {
- TCHAR* p = Langpack_PcharToTchar(dat->description);
- SetWindowText( GetDlgItem(hwndDlg, IDC_PLUGINLONGINFO), sel ? p : _T(""));
- mir_free(p);
- }
+
+ mir_ptr<TCHAR> p( Langpack_PcharToTchar(dat->description));
+ SetWindowText( GetDlgItem(hwndDlg, IDC_PLUGINLONGINFO), sel ? p : _T(""));
+
SetWindowTextA( GetDlgItem(hwndDlg, IDC_PLUGINCPYR), sel ? dat->copyright : "");
SetWindowTextA( GetDlgItem(hwndDlg, IDC_PLUGINURL), sel ? dat->homepage : "");
if (equalUUID(miid_last, dat->uuid))
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index 65ad1e3de7..0b31bfab25 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -614,15 +614,6 @@ void UnloadAccountsModule()
/////////////////////////////////////////////////////////////////////////////////////////
-void KillProtoAccounts(const char *szProtoName)
-{
- for (int i=0; i < accounts.getCount(); i++)
- if ( !strcmp(szProtoName, accounts[i]->szProtoName))
- DeactivateAccount(accounts[i], true, false);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
void BuildProtoMenus()
{
for (int i=0; i < accounts.getCount(); i++) {