mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-29 04:14:56 +01:00
Only prevent stripping of white space in S&R widget.
This commit is contained in:
parent
c82eebd09e
commit
89bc79eddd
2 changed files with 13 additions and 1 deletions
|
|
@ -136,7 +136,7 @@ def get_value(self, g):
|
|||
return g.value()
|
||||
elif isinstance(g, (QLineEdit, QTextEdit)):
|
||||
func = getattr(g, 'toPlainText', getattr(g, 'text', None))()
|
||||
ans = unicode(func)
|
||||
ans = unicode(func).strip()
|
||||
if not ans:
|
||||
ans = None
|
||||
return ans
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
import re
|
||||
|
||||
from PyQt4.Qt import QLineEdit, QTextEdit
|
||||
|
||||
from calibre.gui2.convert.search_and_replace_ui import Ui_Form
|
||||
from calibre.gui2.convert import Widget
|
||||
from calibre.gui2 import error_dialog
|
||||
|
|
@ -72,3 +74,13 @@ def pre_commit_check(self):
|
|||
_('Invalid regular expression: %s')%err, show=True)
|
||||
return False
|
||||
return True
|
||||
|
||||
def get_vaule(self, g):
|
||||
if isinstance(g, (QLineEdit, QTextEdit)):
|
||||
func = getattr(g, 'toPlainText', getattr(g, 'text', None))()
|
||||
ans = unicode(func)
|
||||
if not ans:
|
||||
ans = None
|
||||
return ans
|
||||
else:
|
||||
return Widget.get_value(self, g)
|
||||
|
|
|
|||
Loading…
Reference in a new issue