AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Projekte TMSWebUpdate - eine neue WebUpdate-Komponente
Thema durchsuchen
Ansicht
Themen-Optionen

TMSWebUpdate - eine neue WebUpdate-Komponente

Ein Thema von Marco Steinebach · begonnen am 27. Feb 2008 · letzter Beitrag vom 11. Aug 2013
 
Benutzerbild von Diamondback2007
Diamondback2007

Registriert seit: 2. Feb 2007
260 Beiträge
 
Delphi 2007 Professional
 
#11

Re: TWebUpdate - eine neue WebUpdate-Komponente

  Alt 21. Jul 2008, 10:27
Kleiner Tipp zur Optmierung noch, ist mir grade so beim Durchlesen aufgefallen:
Delphi-Quellcode:
procedure TWebUpdate.CheckForUpdates;

  ...

  ini := TIniFile.Create (fTempDir + IniName);
  ma := ini.ReadInteger ('Version', 'Major', 0);
  mi := ini.ReadInteger ('Version', 'Minor', 0);
  re := ini.ReadInteger ('Version', 'Release', 0);
  bu := ini.ReadInteger ('Version', 'Build', 0);

  SetLength (fFiles,0); // <-- Diese Zeile neu eingefügt

  SectionCount := 1;
  FileCount := 0;
  while Ini.SectionExists ('File'+null(SectionCount, 3)) do
  begin
    s := ini.ReadString ('File'+null(SectionCount, 3), 'Name', '');
    if LinkExists (fUpdateURL + s) then
    begin
      SetLength (fFiles, Length(fFiles)+1);
      with fFiles[FileCount] do
      begin
        name := s;
        Path := ini.ReadString ('File'+null(SectionCount, 3), 'Path', '');
        if ((Path <> '') and
            (copy (Path, Length(Path)-1, 1) <> '\')) then
          Path := Path + '\';
        if fStartname = 'then
          if ini.ReadBool ('File'+null(SectionCount, 3), 'Start', false) then
            fStartname := name;
      end;
      FileCount := FileCount + 1;
    end
    else
      if Assigned (OnError) then
        OnError (self, TWU_FileNotFound, s);
    SectionCount := SectionCount + 1;
  end;
  ini.Free;

  ...
Hier setzt du dir sage und schreibe 4 Mal den Wert für 'File'+null(SectionCount, 3) neu zusammen. Speicher ihn doch in einer Variablen, dann hast dus einfacher und schneller ists auch noch.
Fabian E.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:02 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz