mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
d72e02983f
@ -254,12 +254,14 @@ class TemplateDialog(QDialog, Ui_TemplateDialog):
|
|||||||
self.textbox_changed()
|
self.textbox_changed()
|
||||||
self.rule = (None, '')
|
self.rule = (None, '')
|
||||||
|
|
||||||
self.template_tutorial.setText(_('Template language tutorial: ') +
|
tt = _('Template language tutorial')
|
||||||
|
self.template_tutorial.setText(
|
||||||
'<a href="http://manual.calibre-ebook.com/template_lang.html">'
|
'<a href="http://manual.calibre-ebook.com/template_lang.html">'
|
||||||
'http://manual.calibre-ebook.com/template_lang.html</a>')
|
'%s</a>'%tt)
|
||||||
self.template_func_reference.setText(_('Template function reference: ') +
|
tt = _('Template function reference')
|
||||||
|
self.template_func_reference.setText(
|
||||||
'<a href="http://manual.calibre-ebook.com/template_ref.html">'
|
'<a href="http://manual.calibre-ebook.com/template_ref.html">'
|
||||||
'http://manual.calibre-ebook.com/template_ref.html</a>')
|
'%s</a>'%tt)
|
||||||
|
|
||||||
def textbox_changed(self):
|
def textbox_changed(self):
|
||||||
cur_text = unicode(self.textbox.toPlainText())
|
cur_text = unicode(self.textbox.toPlainText())
|
||||||
|
@ -192,6 +192,8 @@ class ConditionEditor(QWidget): # {{{
|
|||||||
action = self.current_action
|
action = self.current_action
|
||||||
if not action:
|
if not action:
|
||||||
return
|
return
|
||||||
|
m = self.fm[col]
|
||||||
|
dt = m['datatype']
|
||||||
tt = ''
|
tt = ''
|
||||||
if col == 'identifiers':
|
if col == 'identifiers':
|
||||||
tt = _('Enter either an identifier type or an '
|
tt = _('Enter either an identifier type or an '
|
||||||
|
@ -509,7 +509,8 @@ class ResultCache(SearchQueryParser): # {{{
|
|||||||
valq_mkind, valq = self._matchkind(query)
|
valq_mkind, valq = self._matchkind(query)
|
||||||
|
|
||||||
loc = self.field_metadata[location]['rec_index']
|
loc = self.field_metadata[location]['rec_index']
|
||||||
split_char = self.field_metadata[location]['is_multiple']['cache_to_list']
|
split_char = self.field_metadata[location]['is_multiple'].get(
|
||||||
|
'cache_to_list', ',')
|
||||||
for id_ in candidates:
|
for id_ in candidates:
|
||||||
item = self._data[id_]
|
item = self._data[id_]
|
||||||
if item is None:
|
if item is None:
|
||||||
|
@ -575,7 +575,6 @@ class CustomColumns(object):
|
|||||||
def custom_columns_in_meta(self):
|
def custom_columns_in_meta(self):
|
||||||
lines = {}
|
lines = {}
|
||||||
for data in self.custom_column_label_map.values():
|
for data in self.custom_column_label_map.values():
|
||||||
display = data['display']
|
|
||||||
table, lt = self.custom_table_names(data['num'])
|
table, lt = self.custom_table_names(data['num'])
|
||||||
if data['normalized']:
|
if data['normalized']:
|
||||||
query = '%s.value'
|
query = '%s.value'
|
||||||
|
@ -141,6 +141,22 @@ static void sort_concat_finalize2(sqlite3_context *context) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void sort_concat_finalize3(sqlite3_context *context) {
|
||||||
|
SortConcatList *list;
|
||||||
|
unsigned char *ans;
|
||||||
|
|
||||||
|
list = (SortConcatList*) sqlite3_aggregate_context(context, sizeof(*list));
|
||||||
|
|
||||||
|
if (list != NULL && list->vals != NULL && list->count > 0) {
|
||||||
|
qsort(list->vals, list->count, sizeof(list->vals[0]), sort_concat_cmp);
|
||||||
|
ans = sort_concat_do_finalize(list, '&');
|
||||||
|
if (ans != NULL) sqlite3_result_text(context, (char*)ans, -1, SQLITE_TRANSIENT);
|
||||||
|
free(ans);
|
||||||
|
sort_concat_free(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// }}}
|
// }}}
|
||||||
|
|
||||||
// identifiers_concat {{{
|
// identifiers_concat {{{
|
||||||
@ -237,7 +253,8 @@ MYEXPORT int sqlite3_extension_init(
|
|||||||
sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi){
|
sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi){
|
||||||
SQLITE_EXTENSION_INIT2(pApi);
|
SQLITE_EXTENSION_INIT2(pApi);
|
||||||
sqlite3_create_function(db, "sortconcat", 2, SQLITE_UTF8, NULL, NULL, sort_concat_step, sort_concat_finalize);
|
sqlite3_create_function(db, "sortconcat", 2, SQLITE_UTF8, NULL, NULL, sort_concat_step, sort_concat_finalize);
|
||||||
sqlite3_create_function(db, "sort_concat", 2, SQLITE_UTF8, NULL, NULL, sort_concat_step, sort_concat_finalize2);
|
sqlite3_create_function(db, "sortconcat_bar", 2, SQLITE_UTF8, NULL, NULL, sort_concat_step, sort_concat_finalize2);
|
||||||
|
sqlite3_create_function(db, "sortconcat_amper", 2, SQLITE_UTF8, NULL, NULL, sort_concat_step, sort_concat_finalize3);
|
||||||
sqlite3_create_function(db, "identifiers_concat", 2, SQLITE_UTF8, NULL, NULL, identifiers_concat_step, identifiers_concat_finalize);
|
sqlite3_create_function(db, "identifiers_concat", 2, SQLITE_UTF8, NULL, NULL, identifiers_concat_step, identifiers_concat_finalize);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user