mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Windows: Fix a regression in calibre 7 that caused images in long text columns to not be displayed in the tooltip for the tooltip
Yet another Qt regression. Sigh. https://bugreports.qt.io/browse/QTBUG-122201
This commit is contained in:
parent
b9cdc80806
commit
28e71c1162
@ -22,7 +22,9 @@ from qt.core import (
|
|||||||
from calibre import (
|
from calibre import (
|
||||||
fit_image, human_readable, isbytestring, prepare_string_for_xml, strftime,
|
fit_image, human_readable, isbytestring, prepare_string_for_xml, strftime,
|
||||||
)
|
)
|
||||||
from calibre.constants import DEBUG, config_dir, dark_link_color, filesystem_encoding
|
from calibre.constants import (
|
||||||
|
DEBUG, config_dir, dark_link_color, filesystem_encoding, iswindows,
|
||||||
|
)
|
||||||
from calibre.db.search import CONTAINS_MATCH, EQUALS_MATCH, REGEXP_MATCH, _match
|
from calibre.db.search import CONTAINS_MATCH, EQUALS_MATCH, REGEXP_MATCH, _match
|
||||||
from calibre.db.utils import force_to_bool
|
from calibre.db.utils import force_to_bool
|
||||||
from calibre.ebooks.metadata import authors_to_string, fmt_sidx, string_to_authors
|
from calibre.ebooks.metadata import authors_to_string, fmt_sidx, string_to_authors
|
||||||
@ -914,8 +916,17 @@ class BooksModel(QAbstractTableModel): # {{{
|
|||||||
text = fffunc(field_obj, idfunc(idx))
|
text = fffunc(field_obj, idfunc(idx))
|
||||||
return (text) if force_to_bool(text) is None else None
|
return (text) if force_to_bool(text) is None else None
|
||||||
else:
|
else:
|
||||||
def func(idx):
|
if iswindows and dt == 'comments':
|
||||||
return (fffunc(field_obj, idfunc(idx), default_value=''))
|
# https://bugreports.qt.io/browse/QTBUG-122201
|
||||||
|
file_pat = re.compile(r'"file:///([a-zA-Z]):/(.+?)"')
|
||||||
|
def func(idx):
|
||||||
|
ans = fffunc(field_obj, idfunc(idx), default_value='')
|
||||||
|
if ans:
|
||||||
|
ans = file_pat.sub(r'"file:///\1%3a/\2"', ans)
|
||||||
|
return ans
|
||||||
|
else:
|
||||||
|
def func(idx):
|
||||||
|
return fffunc(field_obj, idfunc(idx), default_value='')
|
||||||
elif dt == 'datetime':
|
elif dt == 'datetime':
|
||||||
def func(idx):
|
def func(idx):
|
||||||
val = fffunc(field_obj, idfunc(idx), default_value=UNDEFINED_DATE)
|
val = fffunc(field_obj, idfunc(idx), default_value=UNDEFINED_DATE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user