Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[FEATURE] Support for relative paths in widgets
Is implemented for the following edit widget types: * File Name * Photo * Web View If the path which is selected with the file browser is located in the same directory as the .qgs project file or below, paths are converted to relative paths. This increases portability of a qgs project with multimedia information attached.
- Loading branch information
Showing
3 changed files
with
47 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75df5f2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m-kuhn nice! One thing I'm not sure about is whether this is a good idea to have this behaviour by default. I think it should be a non-default option for the widgets, so that users have to opt-in to storing relative paths.
My rationale is that otherwise this is making data dependant on a project's location. I think in general it is bad practice to make data dependant on a project, as it breaks portability of the data.
75df5f2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As soon as a path outside the .qgs project folder is chosen the absolute path will be used.
I assume that whenever you place a file in the same (or a sub-) folder of the .qgs project it's ok to assume it's bound to this directory structure.
75df5f2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m-kuhn i still disagree :) I think at least the project setting for storing absolute/relative paths should be respected.
75df5f2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nyalldawson I agree that there still is a small risk that it is desirable to turn it off in certain situations.
I think that in general the assumption of a common directory indicating a preference for relative paths is quite accurate.
What I want to avoid is having to enable it for 20 different file widgets in the same project, so respecting the project setting would be a good approach (a widget-specific override flag can still be added later) but the project setting is off by default :(