Skip to content

Commit c683409

Browse files
committed
QT sqlite conversion fix
- QByteArray will be stored as str in the db
1 parent 66bed6c commit c683409

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/bitmessageqt/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import textwrap
3434
import debug
3535
import random
36+
from sqlite3 import register_adapter
3637
import string
3738
from datetime import datetime, timedelta
3839
from helper_ackPayload import genAckPayload
@@ -1328,6 +1329,10 @@ def _choose_ext(basename):
13281329

13291330
self._player(soundFilename)
13301331

1332+
# Adapters and converters for QT <-> sqlite
1333+
def sqlInit(self):
1334+
register_adapter(QtCore.QByteArray, str)
1335+
13311336
# Try init the distro specific appindicator,
13321337
# for example the Ubuntu MessagingMenu
13331338
def indicatorInit(self):
@@ -4396,6 +4401,7 @@ def run():
43964401
app.setStyleSheet("QStatusBar::item { border: 0px solid black }")
43974402
myapp = MyForm()
43984403

4404+
myapp.sqlInit()
43994405
myapp.appIndicatorInit(app)
44004406
myapp.indicatorInit()
44014407
myapp.notifierInit()

0 commit comments

Comments
 (0)