From 5fc8b765122705c094ac4d4d368e769630a48570 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Tue, 22 Dec 2015 10:24:18 +0100 Subject: [PATCH] switch to FPC3 + Laz 1.6 --- src/ce_common.pas | 2 +- src/ce_d2syn.pas | 4 ++-- src/ce_dmdwrap.pas | 14 +++++++------- src/ce_editor.pas | 2 +- src/ce_libman.pas | 4 ++-- src/ce_libmaneditor.pas | 5 +++-- src/ce_main.lfm | 5 ++++- src/ce_main.pas | 5 +++-- src/ce_projinspect.lfm | 3 ++- src/ce_projinspect.pas | 22 +++++++++++----------- src/ce_symlist.lfm | 2 +- src/ce_symlist.pas | 3 ++- src/ce_synmemo.pas | 2 +- src/ce_tools.pas | 6 +++--- wiki/wiki.txt | 2 +- 15 files changed, 44 insertions(+), 37 deletions(-) diff --git a/src/ce_common.pas b/src/ce_common.pas index 58a91373..3dd22b49 100644 --- a/src/ce_common.pas +++ b/src/ce_common.pas @@ -11,7 +11,7 @@ uses Windows, JwaTlHelp32, {$ENDIF} {$IFDEF LINUX} - ExtCtrls, FileUtil, + ExtCtrls, FileUtil, LazFileUtils, {$ENDIF} {$IFNDEF CEBUILD} forms, diff --git a/src/ce_d2syn.pas b/src/ce_d2syn.pas index e380d06f..a98506da 100644 --- a/src/ce_d2syn.pas +++ b/src/ce_d2syn.pas @@ -6,7 +6,7 @@ interface uses Classes, SysUtils, Graphics, - SynEditHighlighter, SynEditHighlighterFoldBase, SynEditTypes, + SynEditHighlighter, SynEditHighlighterFoldBase, ce_dlangutils; const @@ -454,7 +454,7 @@ end; //TODO-cD2Syn: nested comments with multiple nesting on the same line. procedure TSynD2Syn.next; var - reader: PChar; + reader: PChar = nil; label _postString1; diff --git a/src/ce_dmdwrap.pas b/src/ce_dmdwrap.pas index 23501494..a9c6d356 100644 --- a/src/ce_dmdwrap.pas +++ b/src/ce_dmdwrap.pas @@ -921,7 +921,7 @@ end; procedure TPathsOpts.getOpts(aList: TStrings; base: TOptsGroup = nil); var - str: string; + str, sym: string; exts: TStringList; baseopt: TPathsOpts; rightList: TStringList; @@ -935,9 +935,9 @@ begin begin if isStringDisabled(str) then continue; - str := symbolExpander.get(str); - if not listAsteriskPath(str, aList, exts) then - aList.Add(str); + sym := symbolExpander.get(str); + if not listAsteriskPath(sym, aList, exts) then + aList.Add(sym); end; finally exts.Free; @@ -962,9 +962,9 @@ begin begin if isStringDisabled(str) then continue; - str := symbolExpander.get(str); - if not listAsteriskPath(str, aList, exts) then - aList.Add(str); + sym := symbolExpander.get(str); + if not listAsteriskPath(sym, aList, exts) then + aList.Add(sym); end; finally exts.Free; diff --git a/src/ce_editor.pas b/src/ce_editor.pas index 23991347..b5b55e3d 100644 --- a/src/ce_editor.pas +++ b/src/ce_editor.pas @@ -406,7 +406,7 @@ procedure TCEEditorWidget.updateImperative; const modstr: array[boolean] of string = ('...', 'MODIFIED'); var - md: string; + md: string = ''; begin if fDoc = nil then begin editorStatus.Panels[0].Text := ''; diff --git a/src/ce_libman.pas b/src/ce_libman.pas index 36ce4fa2..ba5f86d3 100644 --- a/src/ce_libman.pas +++ b/src/ce_libman.pas @@ -5,7 +5,7 @@ unit ce_libman; interface uses - Classes, SysUtils, FileUtil, ce_common, ce_writableComponent, ce_dcd, + Classes, SysUtils, FileUtil, ce_common, ce_writableComponent, ce_dcd, LazFileUtils, ce_dialogs; type @@ -129,7 +129,7 @@ end; destructor TLibraryManager.destroy; begin - forceDirectory(getCoeditDocPath); + ForceDirectoriesUTF8(getCoeditDocPath); LibMan.saveToFile(getCoeditDocPath + libFname); fCol.Free; inherited; diff --git a/src/ce_libmaneditor.pas b/src/ce_libmaneditor.pas index 1a232a9b..396f763f 100644 --- a/src/ce_libmaneditor.pas +++ b/src/ce_libmaneditor.pas @@ -6,8 +6,9 @@ interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, - Menus, ComCtrls, Buttons, ce_widget, ce_interfaces, ce_nativeproject, ce_dmdwrap, - ce_common, ce_dialogs, ce_sharedres, process, ce_dubproject, ce_observer; + Menus, ComCtrls, Buttons, LazFileUtils, + ce_widget, ce_interfaces, ce_nativeproject, ce_dmdwrap, ce_common, ce_dialogs, + ce_sharedres, process, ce_dubproject, ce_observer; type diff --git a/src/ce_main.lfm b/src/ce_main.lfm index 2065616f..41910d02 100644 --- a/src/ce_main.lfm +++ b/src/ce_main.lfm @@ -6,6 +6,8 @@ object CEMainForm: TCEMainForm AllowDropFiles = True Caption = 'Coedit' ChildSizing.Layout = cclLeftToRightThenTopToBottom + ClientHeight = 49 + ClientWidth = 745 Icon.Data = { F1B500000000010001000000000001002000DBB500001600000089504E470D0A 1A0A0000000D49484452000001000000010008060000005C72A8660000B5A249 @@ -1468,7 +1470,8 @@ object CEMainForm: TCEMainForm OnCloseQuery = FormCloseQuery OnDropFiles = FormDropFiles ShowHint = True - LCLVersion = '1.4.4.0' + LCLVersion = '1.6.0.1' + Visible = False object mainMenu: TMainMenu Images = imgList top = 1 diff --git a/src/ce_main.pas b/src/ce_main.pas index 247c761f..d88e3dd3 100644 --- a/src/ce_main.pas +++ b/src/ce_main.pas @@ -5,7 +5,7 @@ unit ce_main; interface uses - Classes, SysUtils, FileUtil, SynEditKeyCmds, SynHighlighterLFM, Forms, StdCtrls, + Classes, SysUtils, LazFileUtils, SynEditKeyCmds, SynHighlighterLFM, Forms, StdCtrls, AnchorDocking, AnchorDockStorage, AnchorDockOptionsDlg, Controls, Graphics, strutils, Dialogs, Menus, ActnList, ExtCtrls, process, XMLPropStorage, SynExportHTML, ce_common, ce_dmdwrap, ce_nativeproject, ce_dcd, ce_synmemo, ce_writableComponent, @@ -592,7 +592,8 @@ end; procedure TCELastDocsAndProjs.afterLoad; var docHandler: ICEMultiDocHandler; - str, focusedName: string; + str: string; + focusedName: string = ''; i: integer; begin docHandler := getMultiDocHandler; diff --git a/src/ce_projinspect.lfm b/src/ce_projinspect.lfm index ccce9592..9963cf38 100644 --- a/src/ce_projinspect.lfm +++ b/src/ce_projinspect.lfm @@ -3,6 +3,7 @@ inherited CEProjectInspectWidget: TCEProjectInspectWidget Height = 258 Top = 260 Width = 341 + ActiveControl = Tree AllowDropFiles = True Caption = 'Native project inspector' ClientHeight = 258 @@ -27,7 +28,7 @@ inherited CEProjectInspectWidget: TCEProjectInspectWidget Align = alClient AutoExpand = True BorderSpacing.Around = 2 - DefaultItemHeight = 18 + DefaultItemHeight = 16 Images = imgList ReadOnly = True RightClickSelect = True diff --git a/src/ce_projinspect.pas b/src/ce_projinspect.pas index f30220a3..a42c4eef 100644 --- a/src/ce_projinspect.pas +++ b/src/ce_projinspect.pas @@ -5,7 +5,7 @@ unit ce_projinspect; interface uses - Classes, SysUtils, FileUtil, TreeFilterEdit, Forms, Controls, Graphics, actnlist, + Classes, SysUtils, TreeFilterEdit, Forms, Controls, Graphics, actnlist, Dialogs, ExtCtrls, ComCtrls, Menus, Buttons, lcltype, ce_nativeproject, ce_interfaces, ce_common, ce_widget, ce_observer, ce_dialogs, ce_sharedres; @@ -376,7 +376,7 @@ end; procedure TCEProjectInspectWidget.updateImperative; var - src, fold, conf: string; + src, fold, conf, str: string; lst: TStringList; itm: TTreeNode; hasProj: boolean; @@ -417,11 +417,11 @@ begin end; end; // display Imports (-J) - for fold in FProject.currentConfiguration.pathsOptions.importStringPaths do + for str in FProject.currentConfiguration.pathsOptions.importStringPaths do begin - if fold = '' then + if str = '' then continue; - fold := expandFilenameEx(fProject.basePath, fold); + fold := expandFilenameEx(fProject.basePath, str); fold := symbolExpander.get(fold); itm := Tree.Items.AddChild(fImpsNode, fold); itm.ImageIndex := 5; @@ -429,11 +429,11 @@ begin end; fImpsNode.Collapse(false); // display Includes (-I) - for fold in FProject.currentConfiguration.pathsOptions.importModulePaths do + for str in FProject.currentConfiguration.pathsOptions.importModulePaths do begin - if fold = '' then + if str = '' then continue; - fold := expandFilenameEx(fProject.basePath, fold); + fold := expandFilenameEx(fProject.basePath, str); fold := symbolExpander.get(fold); itm := Tree.Items.AddChild(fInclNode, fold); itm.ImageIndex := 5; @@ -441,11 +441,11 @@ begin end; fInclNode.Collapse(false); // display extra sources (external .lib, *.a, *.d) - for src in FProject.currentConfiguration.pathsOptions.extraSources do + for str in FProject.currentConfiguration.pathsOptions.extraSources do begin - if src = '' then + if str = '' then continue; - src := expandFilenameEx(fProject.basePath, src); + src := expandFilenameEx(fProject.basePath, str); src := symbolExpander.get(src); lst := TStringList.Create; try diff --git a/src/ce_symlist.lfm b/src/ce_symlist.lfm index dda86105..f5fff9bd 100644 --- a/src/ce_symlist.lfm +++ b/src/ce_symlist.lfm @@ -24,7 +24,7 @@ inherited CESymbolListWidget: TCESymbolListWidget Width = 302 Align = alClient BorderSpacing.Around = 4 - DefaultItemHeight = 16 + DefaultItemHeight = 18 HideSelection = False Images = imgList ReadOnly = True diff --git a/src/ce_symlist.pas b/src/ce_symlist.pas index 0f48de52..45ef986e 100644 --- a/src/ce_symlist.pas +++ b/src/ce_symlist.pas @@ -610,7 +610,7 @@ end; function TCESymbolListWidget.TreeFilterEdit1FilterItem(Item: TObject; out Done: Boolean): Boolean; begin - if not fSmartFilter then exit; + if not fSmartFilter then exit(false); // if TreeFilterEdit1.Filter <> '' then tree.FullExpand @@ -686,6 +686,7 @@ function getCatNode(node: TTreeNode; stype: TSymbolType ): TTreeNode; end; // begin + result := nil; if node = nil then case stype of _alias : exit(ndAlias); _class : exit(ndClass); diff --git a/src/ce_synmemo.pas b/src/ce_synmemo.pas index 535ea3cc..dbdd93db 100644 --- a/src/ce_synmemo.pas +++ b/src/ce_synmemo.pas @@ -884,7 +884,7 @@ var len: Integer; begin // empty items can be produced if completion list is too long - if aKey = '' then exit; + if aKey = '' then exit(true); // otherwise always at least 20 chars but... // ... '20' depends on ce_dcd, case knd of, string literals length result := true; diff --git a/src/ce_tools.pas b/src/ce_tools.pas index 5ea66e93..5c9d5daf 100644 --- a/src/ce_tools.pas +++ b/src/ce_tools.pas @@ -5,7 +5,7 @@ unit ce_tools; interface uses - Classes, SysUtils, FileUtil, process, menus, ce_processes, + Classes, SysUtils, LazFileUtils, process, menus, ce_processes, ce_common, ce_writableComponent, ce_interfaces, ce_observer, ce_inspectors, ce_synmemo; @@ -139,7 +139,7 @@ end; procedure TCEToolItem.setChainBefore(value: TStringList); begin - // kept to reload old setting files. 'xhainBefore' is not saved anymore. + // kept to reload old setting files. 'chainBefore' is not saved anymore. end; procedure TCEToolItem.setChainAfter(value: TStringList); @@ -271,7 +271,7 @@ destructor TCETools.destroy; begin EntitiesConnector.removeObserver(self); // - forceDirectory(getCoeditDocPath); + ForceDirectoriesUTF8(getCoeditDocPath); saveToFile(getCoeditDocPath + toolsFname); fTools.Free; inherited; diff --git a/wiki/wiki.txt b/wiki/wiki.txt index c5881d41..e726e288 100644 --- a/wiki/wiki.txt +++ b/wiki/wiki.txt @@ -107,7 +107,7 @@ libc.so.6 Download ans setup the tools: -* [Download](http://lazarus.freepascal.org/index.php?page=downloads) and setup the latest Lazarus (1.4.4) version and FPC / FPC sources (2.6.4) for your platform. +* [Download](http://lazarus.freepascal.org/index.php?page=downloads) and setup the latest Lazarus version (1.6) and FPC + FPC sources (3.0.0.1) for your platform. * Windows: the three packages are bundled in an installer. Even on Windows 64 bit, the 32 version must be setup. * Linux: the three packages must be downloaded and setup individually. Take care to the version number because the official rpm/deb source of a Linux distribution does not always propose the latest version !