Skip to content

Add two settings to configure relative path for file links.#773

Merged
nevenz merged 1 commit intoorgzly:masterfrom
xiaoruoruo:master
Nov 20, 2020
Merged

Add two settings to configure relative path for file links.#773
nevenz merged 1 commit intoorgzly:masterfrom
xiaoruoruo:master

Conversation

@xiaoruoruo
Copy link
Contributor

Addresses #496

Current behavior was

  • file:/xxx relative to root.
  • file:xxx relative to Environment.getExternalStorageDirectory().getPath().

The new behavior in this commit is:

  • file:/xxx relative to pref AppPreferences#fileAbsoluteRoot(), default to "/"
  • file:xxx relative to pref AppPreferences#fileRelativeRoot(), default to Environment.getExternalStorageDirectory().getPath()

Added two basic settings in the Image category for these two prefs. The setting is text only, could potentially be directoyr picker.

The path following behavior is changed in ImageLoader and Widget.followLinkToFile, now both uses LinkFindTarget.

@nevenz nevenz merged commit ea2b78b into orgzly:master Nov 20, 2020
@nevenz
Copy link
Member

nevenz commented Nov 20, 2020

I've moved (and renamed in the process) preferences under "Note", as they are not used only for images.

I've also removed default from pref_key_file_absolute_root for consistency (now "Not set", was "/"). I think it's obvious what default is for that one, much more then what it is for relative links. Ideally both would have it, but there's more involved in setting it for relative links as it's not static.

We might want to add a preference for ~/ as well in the future. And instead of current default for relative links use repository's location (per #496).

Thanks!

@nevenz nevenz added this to the v1.8.5 milestone Nov 20, 2020
@rjack
Copy link

rjack commented Apr 17, 2021

Hi, this a great feature, just wanted to point out that the documentation lists this option as already available while it's actually yet to be released.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants