QT sqlite conversion fix

- QByteArray will be stored as str in the db
This commit is contained in:
Peter Šurda 2018-02-06 23:55:41 +01:00
parent 66bed6c7d6
commit c6834093ee
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -33,6 +33,7 @@ from pyelliptic.openssl import OpenSSL
import textwrap import textwrap
import debug import debug
import random import random
from sqlite3 import register_adapter
import string import string
from datetime import datetime, timedelta from datetime import datetime, timedelta
from helper_ackPayload import genAckPayload from helper_ackPayload import genAckPayload
@ -1328,6 +1329,10 @@ class MyForm(settingsmixin.SMainWindow):
self._player(soundFilename) self._player(soundFilename)
# Adapters and converters for QT <-> sqlite
def sqlInit(self):
register_adapter(QtCore.QByteArray, str)
# Try init the distro specific appindicator, # Try init the distro specific appindicator,
# for example the Ubuntu MessagingMenu # for example the Ubuntu MessagingMenu
def indicatorInit(self): def indicatorInit(self):
@ -4396,6 +4401,7 @@ def run():
app.setStyleSheet("QStatusBar::item { border: 0px solid black }") app.setStyleSheet("QStatusBar::item { border: 0px solid black }")
myapp = MyForm() myapp = MyForm()
myapp.sqlInit()
myapp.appIndicatorInit(app) myapp.appIndicatorInit(app)
myapp.indicatorInit() myapp.indicatorInit()
myapp.notifierInit() myapp.notifierInit()