Skip to content

Commit

Permalink
File need to be renamed when the drawing change from star to dso
Browse files Browse the repository at this point in the history
  • Loading branch information
pchev committed Dec 4, 2021
1 parent ec19010 commit a051543
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion skychart/pu_voconfig.pas
Expand Up @@ -1008,7 +1008,7 @@ procedure Tf_voconfig.ReloadVO(fn: string);

procedure Tf_voconfig.Updateconfig(Sender: TObject);
var
objtype, extfn: string;
objtype, oldtype, extfn: string;
i: integer;
config: TCCDconfig;
begin
Expand All @@ -1033,6 +1033,7 @@ procedure Tf_voconfig.Updateconfig(Sender: TObject);
extfn := Fcurrentconfig;
config := TCCDconfig.Create(self);
config.Filename := extfn;
oldtype := config.GetValue('VOcat/catalog/objtype', '');
config.SetValue('VOcat/catalog/objtype', objtype);
config.SetValue('VOcat/update/fullcat', FullDownload.Checked);
config.DeletePath('VOcat/data');
Expand Down Expand Up @@ -1071,6 +1072,11 @@ procedure Tf_voconfig.Updateconfig(Sender: TObject);
config.Flush;
config.Free;
end;
if (oldtype<>'')and(oldtype<>objtype) then begin
RenameFile(extfn,StringReplace(extfn,'vo_'+oldtype+'_','vo_'+objtype+'_',[]));
extfn:=ChangeFileExt(extfn,'.xml');
RenameFile(extfn,StringReplace(extfn,'vo_'+oldtype+'_','vo_'+objtype+'_',[]));
end;
finally
screen.Cursor := crDefault;
CloseTimer.Enabled := True;
Expand Down

0 comments on commit a051543

Please sign in to comment.