Bug 409281 - Relative path not an option when choosing local PDF
Summary: Relative path not an option when choosing local PDF
Status: RESOLVED FIXED
Alias: None
Product: KBibTeX
Classification: Applications
Component: User interface (show other bugs)
Version: 0.9
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Thomas Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-28 14:33 UTC by mihael.vercek
Modified: 2020-02-11 07:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 0.9.2
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mihael.vercek 2019-06-28 14:33:23 UTC
SUMMARY
When choose local PDF for my source I only have option to select it from home file onward and to add it with absolute path only.

I have an option to choose it with relative path but that is only when I **open existing .bib file**, I do not have that choice if have created and **saved** new .bib file, then I can only choose PDF with absolute path even though KBibTex should have known where the new file is located since I have just saved it.

STEPS TO REPRODUCE
1. Create new .bib file in KBibTex
2. Save it somewhere and do **not** close KBibTex
3. Add local PDF to any of your sources

OBSERVED RESULT
I am presented with file picker in my **home** directory, I can navigate to my PDF but I can **only** save it absolute path.

EXPECTED RESULT
I am presented with file picker in directory where .bib was saved, I can navigate to my PDF and I can save it with relative path.



SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Thomas Fischer 2019-12-27 17:36:49 UTC
Sorry for the late response.
I think I have identified and fixed this bug. Please check the following version from my personal KBibTeX Git repository:
https://commits.kde.org/clones/kbibtex/thomasfischer/kbibtex/c363959bea4f2a7c07889fe2e3ee464dc26c4c5b

You can test this code without interfering with your default KBibTeX installation by following the "quick start" instructions:
https://userbase.kde.org/KBibTeX/Development#Quick_Start_to_Run_KBibTeX_from_Git

To fetch the Git version containing the fix for your bug, please run the following command:
bash run-kbibtex.sh https://anongit.kde.org/clones/kbibtex/thomasfischer/kbibtex.git bugs/kde409281

In order to close this bug, please report back if the bug has been indeed fixed.
Comment 2 Thomas Fischer 2020-02-11 07:27:37 UTC
Git commit c0a0570103c2bfcb8c1946df27af00da32b72cc9 by Thomas Fischer.
Committed on 10/02/2020 at 20:14.
Pushed by thomasfischer into branch 'master'.

Associating (new) URL with bibliography when saving

When saving a newly created bibliography to a file, set the file's
URL as a property to the bibliography object.
The URL stored in this property allows, among others, to recognize
URLs associated with individual entries, such as PDF files, as
relative to the BibTeX file. Without an URL, only absolute URLs
would be possible.

This commit is a manual forward-port of commit 750915c36f72a97c071
from branch 'kbibtex/0.10' which in its turn is a forward-port of
commit bde43759f26c2903bc6 from branch 'kbibtex/0.9'.

M  +2    -0    ChangeLog
M  +7    -9    src/parts/part.cpp

https://commits.kde.org/kbibtex/c0a0570103c2bfcb8c1946df27af00da32b72cc9
Comment 3 Thomas Fischer 2020-02-11 07:28:02 UTC
Git commit 750915c36f72a97c07187249b84ad27b21288811 by Thomas Fischer.
Committed on 10/02/2020 at 20:13.
Pushed by thomasfischer into branch 'kbibtex/0.10'.

Associating (new) URL with bibliography when saving

When saving a newly created bibliography to a file, set the file's
URL as a property to the bibliography object.
The URL stored in this property allows, among others, to recognize
URLs associated with individual entries, such as PDF files, as
relative to the BibTeX file. Without an URL, only absolute URLs
would be possible.

This commit is a manual forward-port of commit bde43759f26c2903bc6
from branch 'kbibtex/0.9'.

M  +2    -0    ChangeLog
M  +7    -9    src/parts/part.cpp

https://commits.kde.org/kbibtex/750915c36f72a97c07187249b84ad27b21288811
Comment 4 Thomas Fischer 2020-02-11 07:28:28 UTC
Git commit bde43759f26c2903bc669322dfdf723590d4d5f4 by Thomas Fischer.
Committed on 10/02/2020 at 20:04.
Pushed by thomasfischer into branch 'kbibtex/0.9'.

Associating (new) URL with bibliography when saving

When saving a newly created bibliography to a file, set the file's
URL as a property to the bibliography object.
The URL stored in this property allows, among others, to recognize
URLs associated with individual entries, such as PDF files, as
relative to the BibTeX file. Without an URL, only absolute URLs
would be possible.
FIXED-IN: 0.9.2

M  +2    -0    ChangeLog
M  +4    -4    src/parts/part.cpp

https://commits.kde.org/kbibtex/bde43759f26c2903bc669322dfdf723590d4d5f4