From d8859def37bbe793760b7fdd4d675ee97606bf22 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 25 Mar 2016 10:47:06 -0700 Subject: [PATCH] fix for AccountManagerAuth::Type register, consts --- libraries/networking/src/AccountManager.cpp | 4 +++- libraries/networking/src/UserActivityLogger.cpp | 6 ------ libraries/networking/src/UserActivityLogger.h | 1 - libraries/networking/src/udt/SendQueue.cpp | 6 +++--- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/libraries/networking/src/AccountManager.cpp b/libraries/networking/src/AccountManager.cpp index af30132b70..ec68ee7369 100644 --- a/libraries/networking/src/AccountManager.cpp +++ b/libraries/networking/src/AccountManager.cpp @@ -81,6 +81,8 @@ AccountManager::AccountManager() : qRegisterMetaType("QHttpMultiPart*"); + qRegisterMetaType(); + connect(&_accountInfo, &DataServerAccountInfo::balanceChanged, this, &AccountManager::accountInfoBalanceChanged); } @@ -215,7 +217,7 @@ void AccountManager::sendRequest(const QString& path, if (thread() != QThread::currentThread()) { QMetaObject::invokeMethod(this, "sendRequest", Q_ARG(const QString&, path), - Q_ARG(AccountManagerAuth::Type, AccountManagerAuth::Required), + Q_ARG(AccountManagerAuth::Type, authType), Q_ARG(QNetworkAccessManager::Operation, operation), Q_ARG(const JSONCallbackParameters&, callbackParams), Q_ARG(const QByteArray&, dataByteArray), diff --git a/libraries/networking/src/UserActivityLogger.cpp b/libraries/networking/src/UserActivityLogger.cpp index f2019ba9a9..2406753b0d 100644 --- a/libraries/networking/src/UserActivityLogger.cpp +++ b/libraries/networking/src/UserActivityLogger.cpp @@ -58,8 +58,6 @@ void UserActivityLogger::logAction(QString action, QJsonObject details, JSONCall // if no callbacks specified, call our owns if (params.isEmpty()) { - params.jsonCallbackReceiver = this; - params.jsonCallbackMethod = "requestFinished"; params.errorCallbackReceiver = this; params.errorCallbackMethod = "requestError"; } @@ -70,10 +68,6 @@ void UserActivityLogger::logAction(QString action, QJsonObject details, JSONCall params, NULL, multipart); } -void UserActivityLogger::requestFinished(QNetworkReply& requestReply) { - // qCDebug(networking) << object; -} - void UserActivityLogger::requestError(QNetworkReply& errorReply) { qCDebug(networking) << errorReply.error() << "-" << errorReply.errorString(); } diff --git a/libraries/networking/src/UserActivityLogger.h b/libraries/networking/src/UserActivityLogger.h index 2811be86a8..fa323f1cca 100644 --- a/libraries/networking/src/UserActivityLogger.h +++ b/libraries/networking/src/UserActivityLogger.h @@ -39,7 +39,6 @@ public slots: void wentTo(QString destinationType, QString destinationName); private slots: - void requestFinished(QNetworkReply& requestReply); void requestError(QNetworkReply& errorReply); private: diff --git a/libraries/networking/src/udt/SendQueue.cpp b/libraries/networking/src/udt/SendQueue.cpp index 6fb6ab00e7..121a888c62 100644 --- a/libraries/networking/src/udt/SendQueue.cpp +++ b/libraries/networking/src/udt/SendQueue.cpp @@ -337,8 +337,8 @@ void SendQueue::run() { // which can lock the NodeList if it's attempting to clear connections // for now we guard this by capping the time this thread and sleep for - const int MAX_SEND_QUEUE_SLEEP_USECS = 5000000; - if (timeToSleep.count() > MAX_SEND_QUEUE_SLEEP_USECS) { + const microseconds MAX_SEND_QUEUE_SLEEP_USECS { 5000000 }; + if (timeToSleep > MAX_SEND_QUEUE_SLEEP_USECS) { // alright, we're in a weird state // we want to know why this is happening so we can implement a better fix than this guard // send some details up to the API (if the user allows us) that indicate how we could such a large timeToSleep @@ -355,7 +355,7 @@ void SendQueue::run() { // hopefully send this event using the user activity logger UserActivityLogger::getInstance().logAction(SEND_QUEUE_LONG_SLEEP_ACTION, longSleepObject); - timeToSleep = std::chrono::microseconds(MAX_SEND_QUEUE_SLEEP_USECS); + timeToSleep = MAX_SEND_QUEUE_SLEEP_USECS; } std::this_thread::sleep_for(timeToSleep);