From c6834093ee07406b385a81c5994977fab8a42b1e Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Tue, 6 Feb 2018 23:55:41 +0100 Subject: [PATCH] QT sqlite conversion fix - QByteArray will be stored as str in the db --- src/bitmessageqt/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 51d26388..9fb5fb29 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -33,6 +33,7 @@ from pyelliptic.openssl import OpenSSL import textwrap import debug import random +from sqlite3 import register_adapter import string from datetime import datetime, timedelta from helper_ackPayload import genAckPayload @@ -1328,6 +1329,10 @@ class MyForm(settingsmixin.SMainWindow): self._player(soundFilename) + # Adapters and converters for QT <-> sqlite + def sqlInit(self): + register_adapter(QtCore.QByteArray, str) + # Try init the distro specific appindicator, # for example the Ubuntu MessagingMenu def indicatorInit(self): @@ -4396,6 +4401,7 @@ def run(): app.setStyleSheet("QStatusBar::item { border: 0px solid black }") myapp = MyForm() + myapp.sqlInit() myapp.appIndicatorInit(app) myapp.indicatorInit() myapp.notifierInit()