diff --git a/extensions/bingtranslate.cpp b/extensions/bingtranslate.cpp index f6a3a4d..3a1ca9d 100644 --- a/extensions/bingtranslate.cpp +++ b/extensions/bingtranslate.cpp @@ -113,6 +113,6 @@ std::pair Translate(const std::wstring& text) FormatString(L"/ttranslatev3?fromLang=%s&to=%s&text=%s%s", translateFrom.Copy(), translateTo.Copy(), Escape(text), token.Copy()).c_str() }) if (auto translation = Copy(JSON::Parse(httpRequest.response)[0][L"translations"][0][L"text"].String())) return { true, translation.value() }; - else return { false, FormatString(L"%s: %s", TRANSLATION_ERROR, httpRequest.response) }; + else return { false, FormatString(L"%s (token=%s): %s", TRANSLATION_ERROR, std::exchange(token.Acquire().contents, L""), httpRequest.response) }; else return { false, FormatString(L"%s (code=%u)", TRANSLATION_ERROR, httpRequest.errorCode) }; } diff --git a/extensions/devtools.cpp b/extensions/devtools.cpp index e2955ac..e8694bb 100644 --- a/extensions/devtools.cpp +++ b/extensions/devtools.cpp @@ -21,7 +21,7 @@ extern Settings settings; namespace { QLabel* statusLabel; - AutoHandle<> process; + AutoHandle<> process = NULL; QWebSocket webSocket; std::atomic idCounter = 0; Synchronized>>> mapQueue; @@ -161,7 +161,7 @@ namespace DevTools int id = idCounter += 1; if (!Connected()) return {}; mapQueue->try_emplace(id, response); - QMetaObject::invokeMethod(&webSocket, std::bind(&QWebSocket::sendTextMessage, webSocket, S(FormatString(LR"({"id":%d,"method":"%S","params":%s})", id, method, params)))); + QMetaObject::invokeMethod(&webSocket, std::bind(&QWebSocket::sendTextMessage, &webSocket, S(FormatString(LR"({"id":%d,"method":"%S","params":%s})", id, method, params)))); try { if (auto result = create_task(response).get()[L"result"]) return result; } catch (...) {} return {}; }