Pass a store dir path to nio HttpClient
This commit is contained in:
parent
9023d28c43
commit
15da828c70
1
TODO.md
1
TODO.md
|
@ -4,6 +4,7 @@
|
|||
- Cleanup unused icons
|
||||
|
||||
- Bug fixes
|
||||
- Something weird happening when nio store is created first time
|
||||
- 100% CPU usage when hitting top edge to trigger messages loading
|
||||
- Sending `![A picture](https://picsum.photos/256/256)` → not clickable?
|
||||
- Icons, images and HStyle singleton aren't reloaded
|
||||
|
|
|
@ -6,7 +6,9 @@ from concurrent.futures import ThreadPoolExecutor
|
|||
from threading import Event
|
||||
from typing import DefaultDict, Tuple
|
||||
|
||||
from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal, pyqtSlot
|
||||
from PyQt5.QtCore import (
|
||||
QObject, QStandardPaths, pyqtProperty, pyqtSignal, pyqtSlot
|
||||
)
|
||||
|
||||
import nio
|
||||
|
||||
|
@ -43,13 +45,19 @@ class Client(QObject):
|
|||
|
||||
self.pool: ThreadPoolExecutor = ThreadPoolExecutor(6)
|
||||
|
||||
self.nio: nio.client.HttpClient = \
|
||||
nio.client.HttpClient(self.host, username, device_id)
|
||||
store_path = self.manager.backend.getDir(
|
||||
QStandardPaths.AppDataLocation
|
||||
)
|
||||
|
||||
self.nio: nio.client.HttpClient = nio.client.HttpClient(
|
||||
self.host, username, device_id, store_path=store_path
|
||||
)
|
||||
|
||||
# Since nio clients can't handle more than one talk operation
|
||||
# at a time, this one is used exclusively to poll the sync API
|
||||
self.nio_sync: nio.client.HttpClient = \
|
||||
nio.client.HttpClient(self.host, username, device_id)
|
||||
self.nio_sync: nio.client.HttpClient = nio.client.HttpClient(
|
||||
self.host, username, device_id, store_path=store_path
|
||||
)
|
||||
|
||||
self.net = NetworkManager(self.host, self.port, self.nio)
|
||||
self.net_sync = NetworkManager(self.host, self.port, self.nio_sync)
|
||||
|
|
|
@ -40,7 +40,6 @@ HGlassRectangle {
|
|||
area.onEditingFinished: setTyping(false) // when lost focus
|
||||
|
||||
Keys.onReturnPressed: {
|
||||
console.log( "enter")
|
||||
event.accepted = true
|
||||
|
||||
if (event.modifiers & Qt.ShiftModifier ||
|
||||
|
|
Loading…
Reference in New Issue
Block a user