From ae502af2aca3fa3409f0b9833bbfc1719a296e04 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sat, 14 Jun 2014 15:38:59 +0000 Subject: DBEditor: Even more proper capitalization :) git-svn-id: http://svn.miranda-ng.org/main/trunk@9468 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/DbEditorPP/src/exportimport.cpp | 40 +++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 14 deletions(-) (limited to 'plugins/DbEditorPP/src/exportimport.cpp') diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp index 4e967c6d70..42e4307b09 100644 --- a/plugins/DbEditorPP/src/exportimport.cpp +++ b/plugins/DbEditorPP/src/exportimport.cpp @@ -192,21 +192,28 @@ char *NickFromHContact(MCONTACT hContact) return nick; } - -void exportDB(MCONTACT hContact, char* module) // hContact == -1 export entire db. module == NULL export entire contact. -{ // hContact == -1, module == "" - all contacts - FILE* file = NULL; - char fileName[MAX_PATH]; +// hContact == -1 export entire db. module == NULL export entire contact. +// hContact == -1, module == "" - all contacts +void exportDB(MCONTACT hContact, char *module) +{ int nullcontactDone = 0; - ModuleSettingLL modlist; ModSetLinkLinkItem *mod; // enum all the modules - if (!EnumModules(&modlist)) { msg(Translate("Error Loading Module List"),modFullname); return;} + ModuleSettingLL modlist; + if (!EnumModules(&modlist)) { + msg(Translate("Error loading module list"),modFullname); + return; + } - if (Openfile(fileName, ((int)hContact==-1)?NULL:module)) + char fileName[MAX_PATH]; + if (Openfile(fileName, (hContact==INVALID_CONTACT_ID)?NULL:module)) { - if (!(file = fopen(fileName, "wt"))) { msg(Translate("Couldn't open file for writing"), modFullname); return; } + FILE *file = fopen(fileName, "wt"); + if (!file) { + msg(Translate("Couldn't open file for writing"), modFullname); + return; + } SetCursor(LoadCursor(NULL,IDC_WAIT)); @@ -473,7 +480,8 @@ void importSettings(MCONTACT hContact, char *importstring ) break; case 'g': case 'G': - { char *pstr; + { + char *pstr; for(pstr=end+2;*pstr;pstr++) { if (*pstr=='\\') { switch(pstr[1]) { @@ -483,7 +491,9 @@ void importSettings(MCONTACT hContact, char *importstring ) default: *pstr=pstr[1]; break; } MoveMemory(pstr+1,pstr+2,lstrlenA(pstr+2)+1); - } } } + } + } + } case 'u': case 'U': db_set_utf(hContact,module, setting, (end+2)); @@ -568,11 +578,13 @@ INT_PTR CALLBACK ImportDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam { MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA); int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_TEXT)); - char *string; if (length) { - string = (char*)_alloca(length+1); - if (!string) {msg(Translate("Couldn't allocate enough memory!"), modFullname); DestroyWindow(hwnd); } + char *string = (char*)_alloca(length+1); + if (!string) { + msg(Translate("Couldn't allocate enough memory!"), modFullname); + DestroyWindow(hwnd); + } GetDlgItemText(hwnd, IDC_TEXT, string, length+1); importSettings(hContact, string); refreshTree(1); -- cgit v1.2.3