From f62331d17c8266e36071ebcf096c151c34ea487d Mon Sep 17 00:00:00 2001 From: Alexey Kulakov Date: Fri, 17 Jan 2014 12:28:10 +0000 Subject: small changes (defaults, initialization) git-svn-id: http://svn.miranda-ng.org/main/trunk@7686 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/QuickSearch/i_ok.inc | 15 +++++++-------- plugins/QuickSearch/sr_global.pas | 14 +++++++------- plugins/QuickSearch/sr_optdialog.pas | 4 ++-- plugins/QuickSearch/sr_window.pas | 8 ++++---- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/plugins/QuickSearch/i_ok.inc b/plugins/QuickSearch/i_ok.inc index bbeb383fb0..08bfafab09 100644 --- a/plugins/QuickSearch/i_ok.inc +++ b/plugins/QuickSearch/i_ok.inc @@ -260,7 +260,7 @@ end; procedure LoadOneItem(hContact:THANDLE;column:pcolumnitem;proto:integer; var res:tQSRec); var - tmp:uint_ptr; + tmp:int_ptr; lmodule,srv:PAnsiChar; DbEvent:HDBEVENT; cni:TCONTACTINFO; @@ -269,7 +269,7 @@ var begin FillChar(res,SizeOf(tQSRec),0); res.data:=uint_ptr(-1); - res.text:=nil; + mFreeMem(res.text); with column^ do begin @@ -286,7 +286,7 @@ begin srv:=ParseVarString(service,hContact,nil) else srv:=service; - tmp:=uint_ptr(CallService(srv,TWPARAM(wparam.value),TLPARAM(lparam.value))); + tmp:=int_ptr(CallService(srv,TWPARAM(wparam.value),TLPARAM(lparam.value))); if (restype and ACF_SCRIPT_SERVICE)<>0 then mFreeMem(srv); @@ -494,6 +494,9 @@ begin SetLength(MainBuf,cnt,qsopt.numcolumns); SetLength(FlagBuf,cnt); + for i:=0 to cnt1-1 do + FillChar(MainBuf[i][0],qsopt.numcolumns*SizeOf(tQSRec),0); + for i:=0 to qsopt.numcolumns-1 do begin with qsopt.columns[i] do @@ -515,11 +518,7 @@ begin if cnt1=cnt then break; // additional checking hContact:=db_find_next(hContact); end; - if cnt1<>cnt then - begin - SetLength(MainBuf,cnt1); - SetLength(FlagBuf,cnt1); - end; + end; //----- Status bar ----- diff --git a/plugins/QuickSearch/sr_global.pas b/plugins/QuickSearch/sr_global.pas index a6d1caab98..31cb02ba1d 100644 --- a/plugins/QuickSearch/sr_global.pas +++ b/plugins/QuickSearch/sr_global.pas @@ -417,7 +417,7 @@ begin begin StrDupW(title,'UserID'); width :=80; - flags :=COL_ON; + flags :=COL_ON+COL_FILTER; setting_type :=QST_CONTACTINFO; cnftype :=CNF_UNIQUEID; end; @@ -428,7 +428,7 @@ begin begin StrDupW(title,'Nickname'); width :=76; - flags :=COL_ON; + flags :=COL_ON+COL_FILTER; setting_type :=QST_SERVICE; StrDup(service,MS_CLIST_GETCONTACTDISPLAYNAME); restype :=ACF_RUNICODE; @@ -443,7 +443,7 @@ begin begin StrDupW(title,'First name'); width :=68; - flags :=COL_ON; + flags :=COL_ON+COL_FILTER; setting_type :=QST_CONTACTINFO; cnftype :=CNF_FIRSTNAME; end; @@ -454,7 +454,7 @@ begin begin StrDupW(title,'Last name'); width :=66; - flags :=COL_ON; + flags :=COL_ON+COL_FILTER; setting_type :=QST_CONTACTINFO; cnftype :=CNF_LASTNAME; end; @@ -465,7 +465,7 @@ begin begin StrDupW(title,'Group'); width :=80; - flags :=COL_ON; + flags :=COL_ON+COL_FILTER; setting_type :=QST_SETTING; datatype :=QSTS_STRING; StrDup(module ,'CList'); @@ -478,7 +478,7 @@ begin begin StrDupW(title,'Container'); width :=80; - flags :=COL_ON; + flags :=COL_ON+COL_FILTER; setting_type :=QST_SETTING; datatype :=QSTS_STRING; StrDup(module ,'Tab_SRMsg'); @@ -491,7 +491,7 @@ begin begin StrDupW(title,'E-mail'); width :=116; - flags :=COL_ON; + flags :=COL_ON+COL_FILTER; setting_type :=QST_CONTACTINFO; cnftype :=CNF_EMAIL; end; diff --git a/plugins/QuickSearch/sr_optdialog.pas b/plugins/QuickSearch/sr_optdialog.pas index a161fd28dc..4178849543 100644 --- a/plugins/QuickSearch/sr_optdialog.pas +++ b/plugins/QuickSearch/sr_optdialog.pas @@ -341,7 +341,7 @@ begin flags:=0; if ListView_GetCheckState(list,i)=BST_CHECKED then - flags:=flags or COL_ON; + flags:=flags or COL_ON or COL_FILTER; setting_type:=CB_GetData(GetDlgItem(Dialog,IDC_C_VARTYPE)); @@ -797,7 +797,7 @@ begin if ListView_GetCheckSTate(listhwnd,i)=0 then flags:=flags and not COL_ON else - flags:=flags or COL_ON; + flags:=flags or COL_ON or COL_FILTER; end; CloneColumn(qsopt.columns[i],editcolumns[idx]); end; diff --git a/plugins/QuickSearch/sr_window.pas b/plugins/QuickSearch/sr_window.pas index dea7113310..47a1e7bf8a 100644 --- a/plugins/QuickSearch/sr_window.pas +++ b/plugins/QuickSearch/sr_window.pas @@ -447,8 +447,7 @@ begin // get cell text if text=pWideChar(-1) then begin - if (qsopt.columns[column].flags or COL_INIT)<>0 then //?? - mFreeMem(MainBuf[row,column].text); + mFreeMem(MainBuf[row,column].text); LoadOneItem(contact,@qsopt.columns[column],0,MainBuf[row,column]); text:=MainBuf[row,column].text; end; @@ -502,7 +501,7 @@ begin row:=FindBufNumber(contact); mFreeMem(MainBuf[row,grcol].text); - StrDupW(MainBuf[row,grcol].text,group); + StrDupW (MainBuf[row,grcol].text,group); // LoadOneItem(contact,qsopt.columns[grcol],0,MainBuf[row,grcol]); UpdateLVCell(i,grcol); @@ -548,7 +547,7 @@ begin row:=FindBufNumber(contact); mFreeMem(MainBuf[row,grcol].text); - StrDupW(MainBuf[row,grcol].text,container); + StrDupW (MainBuf[row,grcol].text,container); // LoadOneItem(contact,qsopt.columns[grcol],0,MainBuf[row,grcol]); UpdateLVCell(i,grcol); @@ -1760,6 +1759,7 @@ begin i:=Length(MainBuf); SetLength(MainBuf,i+1); SetLength(MainBuf[i],qsopt.numcolumns); + FillChar(MainBuf[i][0],qsopt.numcolumns*SizeOf(tQSRec),0); SetLength(FlagBuf,i+1); AddContact(i,wParam); -- cgit v1.2.3