Skip to content

Commit c649d1d

Browse files
committed
Fixes in bitmessageqt
1 parent 948b0be commit c649d1d

File tree

8 files changed

+11
-13
lines changed

8 files changed

+11
-13
lines changed

src/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def __new__(mcs, name, bases, namespace):
286286
# pylint: disable=protected-access
287287
result = super(CommandHandler, mcs).__new__(
288288
mcs, name, bases, namespace)
289-
result.config = BMConfigParser()
289+
result.config = config
290290
result._handlers = {}
291291
apivariant = result.config.safeGet('bitmessagesettings', 'apivariant')
292292
for func in namespace.values():

src/bitmessageqt/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,7 +2415,7 @@ def displayNewInboxMessage(
24152415
if acct.feedback != GatewayAccount.ALL_OK:
24162416
if acct.feedback == GatewayAccount.REGISTRATION_DENIED:
24172417
dialogs.EmailGatewayDialog(
2418-
self, BMConfigParser(), acct).exec_()
2418+
self, config, acct).exec_()
24192419
# possible other branches?
24202420
except AttributeError:
24212421
pass
@@ -2497,7 +2497,7 @@ def click_pushButtonAddSubscription(self):
24972497
))
24982498

24992499
def click_pushButtonStatusIcon(self):
2500-
dialogs.IconGlossaryDialog(self, config=BMConfigParser()).exec_()
2500+
dialogs.IconGlossaryDialog(self, config=config).exec_()
25012501

25022502
def click_actionHelp(self):
25032503
dialogs.HelpDialog(self).exec_()
@@ -2524,10 +2524,10 @@ def on_action_Send(self):
25242524

25252525
def on_action_SpecialAddressBehaviorDialog(self):
25262526
"""Show SpecialAddressBehaviorDialog"""
2527-
dialogs.SpecialAddressBehaviorDialog(self, BMConfigParser())
2527+
dialogs.SpecialAddressBehaviorDialog(self, config)
25282528

25292529
def on_action_EmailGatewayDialog(self):
2530-
dialog = dialogs.EmailGatewayDialog(self, config=BMConfigParser())
2530+
dialog = dialogs.EmailGatewayDialog(self, config=config)
25312531
# For Modal dialogs
25322532
dialog.exec_()
25332533
try:
@@ -3058,7 +3058,8 @@ def on_action_InboxAddSenderToBlackList(self):
30583058
queryreturn = sqlQuery('''select * from blacklist where address=?''',
30593059
addressAtCurrentInboxRow)
30603060
if queryreturn == []:
3061-
label = "\"" + tableWidget.item(currentInboxRow, 2).subject + "\" in " + config.get(recipientAddress, "label")
3061+
label = "\"" + tableWidget.item(currentInboxRow, 2).subject + "\" in " + config.get(
3062+
recipientAddress, "label")
30623063
sqlExecute('''INSERT INTO blacklist VALUES (?,?, ?)''',
30633064
label,
30643065
addressAtCurrentInboxRow, True)

src/bitmessageqt/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(self, parent=None, firstrun=False):
4545

4646
self.parent = parent
4747
self.firstrun = firstrun
48-
self.config = BMConfigParser()
48+
self.config = config
4949
self.net_restart_needed = False
5050
self.timer = QtCore.QTimer()
5151

src/bitmessageqt/support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def createSupportMessage(myapp):
145145
config.safeGet('bitmessagesettings', 'opencl')
146146
) if openclEnabled() else "None"
147147
locale = getTranslationLanguage()
148-
socks = getSOCKSProxyType(BMConfigParser()) or "N/A"
148+
socks = getSOCKSProxyType(config) or "N/A"
149149
upnp = config.safeGet('bitmessagesettings', 'upnp', "N/A")
150150
connectedhosts = len(network.stats.connectedHostsList())
151151

src/helper_startup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ def start_proxyconfig():
355355
"""Check socksproxytype and start any proxy configuration plugin"""
356356
if not get_plugin:
357357
return
358+
config_ready.wait()
358359
proxy_type = config.safeGet('bitmessagesettings', 'socksproxytype')
359360
if proxy_type and proxy_type not in ('none', 'SOCKS4a', 'SOCKS5'):
360361
try:

src/namecoin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,5 +370,4 @@ def ensureNamecoinOptions():
370370

371371
# Set default port now, possibly to found value.
372372
if not hasPort:
373-
config.set(configSection, "namecoinrpcport",
374-
defaults.namecoinDefaultRpcPort)
373+
config.set(configSection, "namecoinrpcport", defaults.namecoinDefaultRpcPort)

src/network/knownnodes.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,6 @@ def readKnownNodes():
165165
'Failed to read nodes from knownnodes.dat', exc_info=True)
166166
createDefaultKnownNodes()
167167

168-
config = BMConfigParser()
169-
170168
# your own onion address, if setup
171169
onionhostname = config.safeGet('bitmessagesettings', 'onionhostname')
172170
if onionhostname and ".onion" in onionhostname:

src/tests/test_config_process.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class TestProcessConfig(TestProcessProto):
1717

1818
def test_config_defaults(self):
1919
"""Test settings in the generated config"""
20-
config = BMConfigParser()
2120
self._stop_process()
2221
self._kill_process()
2322
config.read(os.path.join(self.home, 'keys.dat'))

0 commit comments

Comments
 (0)