deleted unused interfaces and classes related to old centralized option system

This commit is contained in:
Basile Burg 2015-05-11 09:12:49 +02:00
parent 8379d50a8a
commit c865145041
3 changed files with 1 additions and 133 deletions

View File

@ -7,7 +7,7 @@ uses
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, Forms, lazcontrols, runtimetypeinfocontrols, ce_observer,
ce_libman, ce_tools, ce_dcd, ce_main, ce_writableComponent, ce_options,
ce_libman, ce_tools, ce_dcd, ce_main, ce_writableComponent,
ce_symstring, ce_staticmacro, ce_inspectors, LResources, ce_editoroptions,
ce_dockoptions, ce_shortcutseditor, ce_mru;

View File

@ -10,28 +10,6 @@ uses
type
(**
* An implementer can save and load some stuffs when Coedit starts/quits
*)
ICESessionOptionsObserver = interface
['ICESessionOptionsObserver']
// persistent things are about to be saved.
procedure sesoptBeforeSave;
// persistent things can be declared to aFiler.
procedure sesoptDeclareProperties(aFiler: TFiler);
// persistent things have just been reloaded.
procedure sesoptAfterLoad;
end;
(**
* An implementer gets and gives back some things
*)
TCESessionOptionsSubject = class(TCECustomSubject)
protected
function acceptObserver(aObject: TObject): boolean; override;
end;
(**
* An implementer declares some actions on demand.
*)
@ -268,12 +246,6 @@ type
procedure subjProjFocused(aSubject: TCEProjectSubject; aProj: TCEProject); {$IFDEF RELEASE}inline;{$ENDIF}
procedure subjProjChanged(aSubject: TCEProjectSubject; aProj: TCEProject); {$IFDEF RELEASE}inline;{$ENDIF}
procedure subjProjCompiling(aSubject: TCEProjectSubject; aProj: TCEProject);{$IFDEF RELEASE}inline;{$ENDIF}
(**
* TCESessionOptionsSubject primitives.
*)
procedure subjSesOptsBeforeSave(aSubject: TCESessionOptionsSubject); {$IFDEF RELEASE}inline;{$ENDIF}
procedure subjSesOptsDeclareProperties(aSubject: TCESessionOptionsSubject; aFiler: TFiler);{$IFDEF RELEASE}inline;{$ENDIF}
procedure subjSesOptsAfterLoad(aSubject: TCESessionOptionsSubject); {$IFDEF RELEASE}inline;{$ENDIF}
{
@ -381,37 +353,6 @@ begin
end;
{$ENDREGION}
{$REGION TCESessionOptionsSubject ----------------------------------------------}
function TCESessionOptionsSubject.acceptObserver(aObject: TObject): boolean;
begin
exit(aObject is ICESessionOptionsObserver);
end;
procedure subjSesOptsBeforeSave(aSubject: TCESessionOptionsSubject);
var
i: Integer;
begin
with aSubject do for i:= 0 to fObservers.Count-1 do
(fObservers.Items[i] as ICESessionOptionsObserver).sesoptBeforeSave;
end;
procedure subjSesOptsDeclareProperties(aSubject: TCESessionOptionsSubject; aFiler: TFiler);
var
i: Integer;
begin
with aSubject do for i:= 0 to fObservers.Count-1 do
(fObservers.Items[i] as ICESessionOptionsObserver).sesoptDeclareProperties(aFiler);
end;
procedure subjSesOptsAfterLoad(aSubject: TCESessionOptionsSubject);
var
i: Integer;
begin
with aSubject do for i:= 0 to fObservers.Count-1 do
(fObservers.Items[i] as ICESessionOptionsObserver).sesoptAfterLoad;
end;
{$ENDREGION}
{$REGION Misc subjects ---------------------------------------------------------}
function TCEMainMenuSubject.acceptObserver(aObject: TObject): boolean;
begin

View File

@ -1,73 +0,0 @@
unit ce_options;
{$I ce_defines.inc}
interface
uses
Classes, SysUtils, ce_common, ce_writableComponent, ce_observer;
type
TCEOptions = class(TWritableLfmTextComponent)
private
fSubjPersObservers: TCECustomSubject;
protected
procedure defineProperties(Filer: TFiler); override;
procedure beforeLoad; override;
procedure beforeSave; override;
procedure afterLoad; override;
public
constructor Create(aOwner: TComponent); override;
destructor Destroy; override;
end;
implementation
uses
ce_interfaces;
constructor TCEOptions.Create(aOwner: TComponent);
begin
inherited;
fSubjPersObservers := TCESessionOptionsSubject.Create;
//
EntitiesConnector.addSubject(fSubjPersObservers);
end;
destructor TCEOptions.Destroy;
begin
EntitiesConnector.removeSubject(fSubjPersObservers);
EntitiesConnector.endUpdate;
//
fSubjPersObservers.Free;
inherited;
end;
procedure TCEOptions.defineProperties(Filer: TFiler);
begin
subjSesOptsDeclareProperties(TCESessionOptionsSubject(fSubjPersObservers), Filer);
end;
procedure TCEOptions.beforeLoad;
begin
// ensure that the observers will be know:
// during the app init a bulk update operation is happening,
// cf. ce_observer.pas, initialization section.
if EntitiesConnector.isUpdating then
EntitiesConnector.forceUpdate;
inherited;
end;
procedure TCEOptions.beforeSave;
begin
subjSesOptsBeforeSave(TCESessionOptionsSubject(fSubjPersObservers));
end;
procedure TCEOptions.afterLoad;
begin
subjSesOptsAfterLoad(TCESessionOptionsSubject(fSubjPersObservers));
end;
initialization
RegisterClasses([TCEOptions]);
end.