Bug 410551 - Relative links incorrectly captured
Summary: Relative links incorrectly captured
Status: RESOLVED FIXED
Alias: None
Product: tellico
Classification: Applications
Component: general (show other bugs)
Version: 3.1.2
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: Robby Stephenson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-03 20:44 UTC by Pol del Aguila Pla
Modified: 2019-08-05 02:16 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pol del Aguila Pla 2019-08-03 20:44:37 UTC
SUMMARY
URL-type fields with the property "relative" set to "true" are incorrectly captured from the file manager and preceded with an erroneous ../.


STEPS TO REPRODUCE
1. Create an empty "test.tc" database of type "Book collection"
2. Create a directory "test_folder" in the same location and create a file "test.txt" inside it 
3. Use Collection -> Collection Fields -> New to add a Type URL field with name URL
4. Use Set properties to set the property "relative" to "true".
5. Use New to add a new element in the library, name it "Bla"
6. Set the URL property with the file manager to the file test.txt inside the test_folder directory and save the entry and database

OBSERVED RESULT
The URL field of the entry Bla is set to ../test_folder/test.txt. Every time one opens and closes Tellico, a new ../ prefix is added, i.e., ../../test_folder/test.txt, etc.

EXPECTED RESULT
The URL field of the entry Bla is set to test_folder/test.txt and clicking on it launches the system-configured application for .txt files.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux Mint 19.1 Tessa, KDE Frameworks 5.44.0 (The xcb windowing system)
Qt Version: 5.9.5 (built against 5.9.5)

ADDITIONAL INFORMATION
Comment 1 Robby Stephenson 2019-08-05 02:16:25 UTC
Git commit d32857b7cb8b03b6f8c89dcbdc41e557e298f29d by Robby Stephenson.
Committed on 05/08/2019 at 02:13.
Pushed by rstephenson into branch '3.2'.

Remove file name in QDir c'tor when calculating relative links

Since the data file name is used as the base url, the QDir should have a
directory used as the path instead.
FIXED-IN: 3.2.2

M  +4    -0    ChangeLog
M  +3    -3    src/gui/urlfieldlogic.cpp
M  +7    -0    src/tests/fieldtest.cpp

https://commits.kde.org/tellico/d32857b7cb8b03b6f8c89dcbdc41e557e298f29d