Skip to content

Wrong relative icon path #8

Description

@Vasilich

after applying the icon path to projects the new icon file path should have path, relative to project. But now it calculates path from one folder up from project file.
The reason:
in file Shared\IDE\ProjectResource.pas procedure TIconResource.SaveToProjectResource there is a call

IconFileName := ExtractRelativePath(ExtractFileDir(AProject.FileName), FFileName);

ExtractRelativePath expects 1st argument as path with trailing path separator, but ExtractFileDir returns the path without trailing delimiter, so ExtractRelativePath thinks that it is full path with filename and takes one level upper.
Solution: as ExtractRelativePath can recognize whether 1s argument is directory name or path name, we can just use

IconFileName := ExtractRelativePath(AProject.FileName, FFileName);

Tested by me locally on D11.1, and with that change it works as expected.

I don't use git, so cannot make any pull request,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions