Skip to content

Library modification appearently triggers reindexing of all PDFs #8420

@tobiasdiez

Description

@tobiasdiez

JabRef version

5.4 (latest release)

Operating system

Windows

Details on version and operating system

Windows 11

Checked with the latest development build

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Have a library with at least one entry having a PDF.
  2. Give JabRef time to generate the index.
  3. Change something in the database.
  4. Go to the background notification tab, where you get something like
    image

Note the last item, from which one gets the impression that the whole index has been rebuild.

However, looking at the code:

indexingTaskManager.updateDatabaseName(tabTitle.toString());

is triggered by the "rename of the tab" (i.e. appending the star to signal the change of the library).
But luckily
public void updateDatabaseName(String name) {
DefaultTaskExecutor.runInJavaFXThread(() -> this.titleProperty().set(Localization.lang("Indexing for %0", name)));
}

only updates the name, and doesn't really create a new index.

Proposed change:

  • Extract some of the logic of updateTabTitle to get a short display name for a database to a helper method.
  • Make the database context a constructor argument of the indexing task manager (to make it clear that each library has its own manager)
  • Then in the indexing task manager listen to changes of the filename (i.e rename) and update the title (using the extracted helper method from above)

cc @btut

Appendix

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions