From 905d8395b0abb405b22dc1b9ceeca58e0983e10c Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sun, 30 Oct 2016 12:51:20 +0100 Subject: [PATCH] dupIgnore has no effect when list not sorted --- src/ce_ceproject.pas | 2 -- src/ce_dubproject.pas | 11 +++++++---- src/ce_gdb.lfm | 24 ++++++++++++------------ src/ce_gdb.pas | 9 ++++++++- src/ce_libman.pas | 15 ++++++++++++--- src/ce_main.pas | 7 ++++++- 6 files changed, 45 insertions(+), 23 deletions(-) diff --git a/src/ce_ceproject.pas b/src/ce_ceproject.pas index 7d4a1d0b..1c6ec1e8 100644 --- a/src/ce_ceproject.pas +++ b/src/ce_ceproject.pas @@ -154,9 +154,7 @@ begin fProjectSubject := TCEProjectSubject.create; // fLibAliases := TStringList.Create; - fLibAliases.Duplicates:=TDuplicates.dupIgnore; fSrcs := TStringList.Create; - fSrcs.Duplicates:=TDuplicates.dupIgnore; fSrcs.OnChange := @subMemberChanged; fConfigs := TCollection.create(TCompilerConfiguration); // diff --git a/src/ce_dubproject.pas b/src/ce_dubproject.pas index d5115502..ceb43554 100644 --- a/src/ce_dubproject.pas +++ b/src/ce_dubproject.pas @@ -299,11 +299,11 @@ begin fBuildTypes := TStringList.Create; fConfigs := TStringList.Create; fSrcs := TStringList.Create; + fSrcs.Sorted:=true; + fSrcs.Duplicates:=dupIgnore; fImportPaths := TStringList.Create; - fSrcs.Duplicates:=TDuplicates.dupIgnore; - fImportPaths.Duplicates:=TDuplicates.dupIgnore; - fConfigs.Duplicates:=TDuplicates.dupIgnore; - fBuildTypes.Duplicates:=TDuplicates.dupIgnore; + fImportPaths.Sorted:=true; + fImportPaths.Duplicates:=dupIgnore; // json.Add('name', ''); endModification; @@ -771,6 +771,8 @@ begin fBuildTypes.Add(itemname); end; end; + deleteDups(fConfigs); + deleteDups(fBuildTypes); fConfigsCount := fConfigs.Count * fBuildTypes.Count; end; @@ -912,6 +914,7 @@ begin finally lst.Free; end; + deleteDups(fSrcs); end; function TCEDubProject.findTargetKindInd(value: TJSONObject): boolean; diff --git a/src/ce_gdb.lfm b/src/ce_gdb.lfm index 7acf0101..8e97cd51 100644 --- a/src/ce_gdb.lfm +++ b/src/ce_gdb.lfm @@ -1,46 +1,46 @@ inherited CEGdbWidget: TCEGdbWidget Left = 640 - Height = 625 + Height = 668 Top = 213 Width = 517 ActiveControl = Back Caption = 'GDB commander' - ClientHeight = 625 + ClientHeight = 668 ClientWidth = 517 inherited Back: TPanel - Height = 619 + Height = 662 Top = 6 Width = 517 - ClientHeight = 619 + ClientHeight = 662 ClientWidth = 517 inherited Content: TPanel - Height = 583 + Height = 626 Width = 517 - ClientHeight = 583 + ClientHeight = 626 ClientWidth = 517 object Panel1: TPanel[0] Left = 0 - Height = 381 + Height = 424 Top = 166 Width = 517 Align = alClient BevelOuter = bvNone - ClientHeight = 381 + ClientHeight = 424 ClientWidth = 517 TabOrder = 0 object GroupBox3: TGroupBox Left = 0 - Height = 184 + Height = 227 Top = 197 Width = 517 Align = alClient Caption = 'CPU' - ClientHeight = 154 + ClientHeight = 197 ClientWidth = 513 TabOrder = 0 object cpuVIewer: TTIPropertyGrid Left = 0 - Height = 154 + Height = 197 Hint = 'cpu registers' Top = 0 Width = 513 @@ -110,7 +110,7 @@ inherited CEGdbWidget: TCEGdbWidget object Panel3: TPanel[1] Left = 4 Height = 28 - Top = 551 + Top = 594 Width = 509 Align = alBottom BorderSpacing.Around = 4 diff --git a/src/ce_gdb.pas b/src/ce_gdb.pas index 8cce76eb..2b397b48 100644 --- a/src/ce_gdb.pas +++ b/src/ce_gdb.pas @@ -10,7 +10,7 @@ uses StdCtrls, ValEdit, process, fpjson, typinfo, {$IFDEF UNIX}Unix,{$ENDIF} ce_common, ce_interfaces, ce_widget, ce_processes, ce_observer, ce_synmemo, ce_sharedres, ce_stringrange, ce_dsgncontrols, ce_dialogs, ce_dbgitf, - ce_ddemangle, ce_writableComponent, ce_symstring; + ce_ddemangle, ce_writableComponent; type @@ -504,8 +504,10 @@ begin fShowGdbOutput:=true; fIgnoredSignals := TStringList.Create; fIgnoredSignals.Duplicates:= dupIgnore; + fIgnoredSignals.Sorted:=true; fCommandsHistory := TStringList.Create; fCommandsHistory.Duplicates:= dupIgnore; + fCommandsHistory.Sorted:=true; fShortcuts := TCEDebugShortcuts.Create; end; @@ -2111,6 +2113,11 @@ begin edit1.Text := ''; end; + +//TODO-cGDB: copy from call stack list +//TODO-cGDB: replace value list editor by TListView +//to set focus on variable of a triggered watchpoint. + procedure TCEGdbWidget.setGpr(reg: TCpuRegister; val: TCpuGprValue); const spec = 'set $%s = 0x%X'; diff --git a/src/ce_libman.pas b/src/ce_libman.pas index 6b56e245..36250904 100644 --- a/src/ce_libman.pas +++ b/src/ce_libman.pas @@ -166,8 +166,6 @@ begin fModulesByName := TModulesByName.create; fDependencies := TStringList.Create; fClients := TStringList.Create; - fDependencies.Duplicates := dupIgnore; - fClients.Duplicates := dupIgnore; fEnabled:=true; end; @@ -438,11 +436,15 @@ procedure TLibraryManager.FPOObservedChanged(ASender: TObject; Operation: TFPObservedOperation; Data: Pointer); var i,j: integer; + obj: TObject; lib: TLibraryItem; cli: TLibraryItem; begin if data.isNil then exit; + obj := TObject(data); + if not (obj is TLibraryItem) then + exit; lib := TLibraryItem(data); case operation of ooDeleteItem: if fItemsByAlias.contains(lib.libAlias) then @@ -462,7 +464,8 @@ begin ooAddItem: begin fItemsByAlias.insert(lib.libAlias, lib); - updateCrossDependencies; + // TODO-cupdate on addition, item ctor is not yet finished ! + //updateCrossDependencies; end; end; end; @@ -705,6 +708,12 @@ begin dep.clients.Add(lib.libAlias); end; end; + for i := 0 to fCollection.Count-1 do + begin + lib := libraryByIndex[i]; + deleteDups(lib.clients); + deleteDups(lib.dependencies); + end; end; initialization diff --git a/src/ce_main.pas b/src/ce_main.pas index e14244af..4bb2a1ed 100644 --- a/src/ce_main.pas +++ b/src/ce_main.pas @@ -597,6 +597,7 @@ begin inherited; fStaticSwitches := TStringList.create; fStaticSwitches.Duplicates := TDuplicates.dupIgnore; + fStaticSwitches.Sorted:=true; end; @@ -1282,6 +1283,7 @@ begin accept := GetKeyShiftState = [ssCtrl]; end; +//TODO-cdocking: remove the usage of TAnchorDockSplitterEx from Laz 1.8 RC1 (OnMouseWheel public) procedure TCEMainForm.DockSplitterMw(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); var offs: integer; @@ -2193,6 +2195,9 @@ begin openFile(TMenuItem(Sender).Hint); end; +//TODO-cbugfix: OpenDialogs, double path separator when shortcuts resolved +// i.e when ofNoDereferenceLinks is not set. + procedure TCEMainForm.actFileOpenExecute(Sender: TObject); var fname: string; @@ -2602,7 +2607,6 @@ begin ldc: dmdProc.Executable :='ldmd2' + exeExt; gdc: dmdProc.Executable :='gdmd' + exeExt; end; - TStringList(dmdproc.Parameters).Duplicates:=TDuplicates.dupIgnore; dmdproc.Parameters.Add(fDoc.fileName); if not asObj then dmdproc.Parameters.Add('-of' + fname + exeExt) @@ -2640,6 +2644,7 @@ begin LibMan.getLibFiles(nil, dmdproc.Parameters); LibMan.getLibSourcePath(nil, dmdproc.Parameters); end; + deleteDups(dmdproc.Parameters); dmdproc.Execute; while dmdproc.Running do application.ProcessMessages;