From 50e035243e34ba89710c1aedbd86a62b537e09e2 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Thu, 27 May 2010 22:57:10 +0100 Subject: [PATCH] Fix create_custom_column.py not to remove the '#' on the key used for the custcol dict --- src/calibre/gui2/dialogs/config/create_custom_column.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/dialogs/config/create_custom_column.py b/src/calibre/gui2/dialogs/config/create_custom_column.py index 5ff048ed0a..3d5cb8ba53 100644 --- a/src/calibre/gui2/dialogs/config/create_custom_column.py +++ b/src/calibre/gui2/dialogs/config/create_custom_column.py @@ -131,9 +131,10 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn): else: date_format = {'date_format': None} + key = self.parent.db.field_metadata.custom_field_prefix+col if not self.editing_col: self.parent.db.field_metadata - self.parent.custcols[self.parent.db.field_metadata.custom_field_prefix+col] = { + self.parent.custcols[key] = { 'label':col, 'name':col_heading, 'datatype':col_type, @@ -144,13 +145,13 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn): 'is_multiple':is_multiple, } item = QListWidgetItem(col_heading, self.parent.columns) - item.setData(Qt.UserRole, QVariant(col)) + item.setData(Qt.UserRole, QVariant(key)) item.setFlags(Qt.ItemIsEnabled|Qt.ItemIsUserCheckable|Qt.ItemIsSelectable) item.setCheckState(Qt.Checked) else: idx = self.parent.columns.currentRow() item = self.parent.columns.item(idx) - item.setData(Qt.UserRole, QVariant(col)) + item.setData(Qt.UserRole, QVariant(key)) item.setText(col_heading) self.parent.custcols[self.orig_column_name]['label'] = col self.parent.custcols[self.orig_column_name]['name'] = col_heading