Bug 396597

Summary: biblatex uses "file" instead of "localfile"
Product: [Applications] KBibTeX Reporter: Erik Quaeghebeur <bugs.kde.org>
Component: GeneralAssignee: Thomas Fischer <fischer>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 0.8.1   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 0.9

Description Erik Quaeghebeur 2018-07-17 09:22:17 UTC
BibLaTeX uses "file" instead of "localfile":

> file  field (verbatim)
>       A local link to a pdf or other version of the work.
>       Not used by the standard bibliography styles.

KBibTeX uses "localfile" also in BibLaTeX mode. It should use "file" instead.

When I edit "localfile" to "file" in the Source tab and apply, then it is changed. However, if I visit the External tab (where the file is listed), then it is changed to localfile *without* indication, i.e., the Appply button does not activate, so selecting Ok modifies the entry without warning.
Comment 1 Thomas Fischer 2018-09-12 18:27:10 UTC
Yes, I can confirm this issue. In KBibTeX's code, basically all use scenarios of 'localfile' must be rewritten to treat 'file' equally when parsing/reading data and switching between 'localfile' and 'file' when writing BibTeX or BibLaTeX data, respectively.
Comment 2 Thomas Fischer 2018-09-13 19:32:16 UTC
I made some changes throughout KBibTeX to differenciate between 'localfile' and 'file' whenever appropriate.

Please test the code pushed to my personal clone of KBibTeX's repository (not yet in the official one) if it resolves the issue for you:
https://commits.kde.org/clones/kbibtex/thomasfischer/kbibtex/e749075867a3d4c36b0b92c28fcca0625250def6

In case you understand which code got changed in this commit, please try to use KBibTeX in a way that the changed code is actually triggered.

Btw, the setting to swith between BibTeX and BibLaTeX got moved from "User Interface" to "General".
Comment 3 Erik Quaeghebeur 2018-09-15 12:32:57 UTC
(In reply to Thomas Fischer from comment #2)
> 
> Please test the code pushed to my personal clone of KBibTeX's repository
> (not yet in the official one) if it resolves the issue for you:
> https://commits.kde.org/clones/kbibtex/thomasfischer/kbibtex/
> e749075867a3d4c36b0b92c28fcca0625250def6
I'm struggling to get this code running. For the official kde repository, I can build from master and may be able to build from any branch (using my package manager). However, when I clone your personal clone and build from it, I have trouble running. After I make install somewhere so that I can easily remove it (namely, in a subfolder of the build folder) and try to run, I get

./bin/kbibtex: error while loading shared libraries: libkbibtexgui.so.0: cannot open shared object file: No such file or directory

I guess it doen't know where to find it.

This is after I uninstalled kbibtex as installed using my package manager. Before that, I got a segfault clearly because the system was confused with the two versions hanging around. In any case, then I also saw the message

kbibtex.config: No field description for  "file" ( "file" )

pass by. That may be relevant.
Comment 4 Thomas Fischer 2018-09-16 20:32:30 UTC
I forced-pushed a few changes that may fix the "No field description" issue:
https://commits.kde.org/clones/kbibtex/thomasfischer/kbibtex/22460dc4adeb6499c4103d079f9cc7c83932979c

As for compiling and temporary installs, please look at
https://userbase.kde.org/KBibTeX/Development
My example there is to install into /tmp/usr, so it stays outside of the PMS-managed /usr and requires no su/sudo. It will require to set some environment variables and will disappear after reboot, though. A small shell script may help you to automate the task.
Comment 5 Thomas Fischer 2018-11-06 18:47:14 UTC
Git commit 0b66fed104d6c0217443ec77e722ac1edc6d43a4 by Thomas Fischer.
Committed on 02/11/2018 at 20:51.
Pushed by thomasfischer into branch 'master'.

BibLaTeX uses field 'file' where BibTeX uses 'localfile'

In KBibTeX's code, basically all use scenarios of field 'localfile'
got rewritten to treat field 'file' equally when parsing/reading
data and switching between 'localfile' and 'file' when writing
BibTeX or BibLaTeX data, respectively.
FIXED-IN: 0.9

M  +2    -2    src/gui/element/elementeditor.cpp
M  +9    -2    src/gui/element/elementwidgets.cpp
M  +6    -4    src/gui/element/findpdfui.cpp
M  +1    -1    src/io/fileexporterbibtex.cpp
M  +1    -1    src/io/fileimporterbibtex.cpp
M  +2    -1    src/io/fileimporterris.cpp
M  +1    -0    src/networking/CMakeLists.txt
M  +3    -2    src/networking/associatedfiles.cpp
M  +1    -0    src/program/docklets/valuelist.cpp
M  +8    -0    src/test/kbibtexfilestest.cpp

https://commits.kde.org/kbibtex/0b66fed104d6c0217443ec77e722ac1edc6d43a4