Catalog Json file don't store Title and Format

Bug #1818838 reported by Katja on 2019-03-06
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Undecided
Unassigned

Bug Description

The Title and Format is not stored in the Json file. From bug#1247897 I can sse it works at least in 2013.
I cannot find what changed in the past but now the parent-child coding does not find the pointer from book-Option dialog to the catalog-Option Dialog.
@Kovid, if there is any simple adjustment, I am happy to learn from you.

Otherwise, here is my solution:

...\calibre-3.39.1\src\calibre\gui2\dialogs\catalog.py abt row 49
#kwy Mar 2019: call with pointer
#old: pw = catalog_widget.PluginWidget()
pw = catalog_widget.PluginWidget(self)

...\calibre-3.39.1\src\calibre\gui2\catalog\catalog_bibtex.py abt row 30
...\calibre-3.39.1\src\calibre\gui2\catalog\catalog_csv_xml.py abt rrow 41
...\calibre-3.39.1\src\calibre\gui2\catalog\catalog_epub_mobi.py abt row 43
#kwy Mar 2019: call with parent
#old: def __init__(self, parent=None):
def __init__(self, parent):
    self.parent_pointer = parent
    parent = None

...\calibre-3.39.1\src\calibre\gui2\catalog\catalog_epub_mobi.py abt row 291
#kwy Mar 2019: replace child-call by pointer-call
#replace
        self.parentWidget().blockSignals(True)
        for peer in self.parentWidget().children():
            if peer == self:
                continue
            elif peer.children():
                for child in peer.children():
                    if child.objectName() == 'format':
                        current_format = child.currentText().strip()
                    elif child.objectName() == 'title':
                        current_title = unicode(child.text()).strip()
        self.parentWidget().blockSignals(False)
#by
current_title = unicode(self.parent_pointer.title.text()).strip()
current_format = self.parent_pointer.format.currentText().strip()

...\calibre-3.39.1\src\calibre\gui2\catalog\catalog_epub_mobi.py abt row 809
#kwy Mar 2019: replace child-call by pointer-call
#kwy: but avoid confusion when overwriting in GUI with space
#replace all code by
if format:
    index = self.parent_pointer.format.findText(format)
    self.parent_pointer.format.blockSignals(True)
    self.parent_pointer.format.setCurrentIndex(index)
    self.parent_pointer.format.blockSignals(False)
if title:
    self.parent_pointer.title.setText(title)

fyi:
I take the Archive today and see the Content of calibre/src/calibre/library/catalogs as well in calibre/src/calibre/gui2/catalogs. But in GIT I cannot see catalogs in Gui2 anymore. So everthing seems ok beside the Archive.

I really hope ou like to implement this
regards,
Katja

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
Katja (katjawy) wrote :

thanks @kovid.
Your solution looks much smarter than mine.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers