Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
pooler committed Dec 18, 2017
2 parents c8c896e + 1897797 commit 964914f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gui/qt/qrtextedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def qr_input(self):
except BaseException as e:
self.show_error(str(e))
data = ''
if not data:
data = ''
self.setText(data)
return data

Expand Down
3 changes: 2 additions & 1 deletion lib/qrscanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def scan_barcode(device='', timeout=-1, display=True, threaded=False):
libzbar.zbar_symbol_set_first_symbol.restype = ctypes.POINTER(ctypes.c_int)
proc = libzbar.zbar_processor_create(threaded)
libzbar.zbar_processor_request_size(proc, 640, 480)
libzbar.zbar_processor_init(proc, device, display)
if libzbar.zbar_processor_init(proc, device.encode('utf-8'), display) != 0:
raise RuntimeError("Can not start QR scanner; initialization failed.")
libzbar.zbar_processor_set_visible(proc)
if libzbar.zbar_process_one(proc, timeout):
symbols = libzbar.zbar_processor_get_results(proc)
Expand Down

0 comments on commit 964914f

Please sign in to comment.