From f4ab8d1b8466efaed401a75a1d181fc45ff43d5e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 2 Jan 2014 17:24:17 +0000 Subject: minus std::string & 3 std::vectors git-svn-id: http://svn.miranda-ng.org/main/trunk@7461 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/extraicons/options_ei.cpp | 66 +++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'src/modules/extraicons/options_ei.cpp') diff --git a/src/modules/extraicons/options_ei.cpp b/src/modules/extraicons/options_ei.cpp index 369efa6315..7529f29153 100644 --- a/src/modules/extraicons/options_ei.cpp +++ b/src/modules/extraicons/options_ei.cpp @@ -445,13 +445,13 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP ExtraIcon *extra = extraIconsBySlot[k]; if (extra->getType() == EXTRAICON_TYPE_GROUP) { - ExtraIconGroup *group = (ExtraIconGroup *) extra; + ExtraIconGroup *group = (ExtraIconGroup *)extra; vector ids; - for (unsigned int j = 0; j < group->items.size(); j++) + for (int j = 0; j < group->items.getCount(); j++) ids.push_back(group->items[j]->getID()); Tree_AddExtraIconGroup(tree, ids, extra->isEnabled()); } - else Tree_AddExtraIcon(tree, (BaseExtraIcon *) extra, extra->isEnabled()); + else Tree_AddExtraIcon(tree, (BaseExtraIcon *)extra, extra->isEnabled()); } TVSORTCB sort = { 0 }; @@ -481,7 +481,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP lastUsedSlot = MIN(lastUsedSlot, GetNumberOfSlots()); // Get user data and create new groups - vector groups; + LIST groups(1); BYTE pos = 0; int firstEmptySlot = 0; @@ -509,7 +509,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP } else { char name[128]; - mir_snprintf(name, SIZEOF(name), "__group_%d", groups.size()); + mir_snprintf(name, SIZEOF(name), "__group_%d", groups.getCount()); ExtraIconGroup *group = new ExtraIconGroup(name); @@ -521,7 +521,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP } group->setSlot(slot); - groups.push_back(group); + groups.insert(group); } ht = TreeView_GetNextSibling(tree, ht); @@ -540,15 +540,15 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP } CallService(MS_DB_MODULE_DELETE, 0, (LPARAM) MODULE_NAME "Groups"); - db_set_w(NULL, MODULE_NAME "Groups", "Count", (WORD)groups.size()); - for (unsigned k = 0; k < groups.size(); k++) { + db_set_w(NULL, MODULE_NAME "Groups", "Count", groups.getCount()); + for (int k = 0; k < groups.getCount(); k++) { ExtraIconGroup *group = groups[k]; char setting[512]; mir_snprintf(setting, SIZEOF(setting), "%d_count", k); - db_set_w(NULL, MODULE_NAME "Groups", setting, (WORD)group->items.size()); + db_set_w(NULL, MODULE_NAME "Groups", setting, (WORD)group->items.getCount()); - for (unsigned j = 0; j < group->items.size(); j++) { + for (int j = 0; j < group->items.getCount(); j++) { BaseExtraIcon *extra = group->items[j]; mir_snprintf(setting, SIZEOF(setting), "%d_%d", k, j); @@ -573,6 +573,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP } delete[] oldSlots; + groups.destroy(); return TRUE; } @@ -600,8 +601,9 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0); } } - break; } + break; + case TVN_KEYDOWN: { TV_KEYDOWN *nmkd = (TV_KEYDOWN *) lpnmhdr; @@ -611,34 +613,32 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (hItem != NULL) SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0); } - break; } + break; + case NM_RCLICK: - { - HTREEITEM hSelected = (HTREEITEM) SendMessage(tree, TVM_GETNEXTITEM, TVGN_DROPHILITE, 0); - if (hSelected != NULL && !IsSelected(tree, hSelected)) { - UnselectAll(tree); - TreeView_SelectItem(tree, hSelected); - } + HTREEITEM hSelected = (HTREEITEM) SendMessage(tree, TVM_GETNEXTITEM, TVGN_DROPHILITE, 0); + if (hSelected != NULL && !IsSelected(tree, hSelected)) { + UnselectAll(tree); + TreeView_SelectItem(tree, hSelected); + } - int sels = GetNumSelected(tree); - if (sels > 1) { - if (ShowPopup(hwndDlg, 0) == ID_GROUP) { - GroupSelectedItems(tree); - SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0); - } + int sels = GetNumSelected(tree); + if (sels > 1) { + if (ShowPopup(hwndDlg, 0) == ID_GROUP) { + GroupSelectedItems(tree); + SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0); } - else if (sels == 1) { - HTREEITEM hItem = TreeView_GetSelection(tree); - vector*ids = Tree_GetIDs(tree, hItem); - if (ids->size() > 1) { - if (ShowPopup(hwndDlg, 1) == ID_UNGROUP) { - UngroupSelectedItems(tree); - SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0); - } + } + else if (sels == 1) { + HTREEITEM hItem = TreeView_GetSelection(tree); + vector*ids = Tree_GetIDs(tree, hItem); + if (ids->size() > 1) { + if (ShowPopup(hwndDlg, 1) == ID_UNGROUP) { + UngroupSelectedItems(tree); + SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM) hwndDlg, 0); } } - break; } } } -- cgit v1.2.3