From 66cb02d1c3dc62a727798ce1ef3ebf7ebb10324a Mon Sep 17 00:00:00 2001 From: tux3 Date: Mon, 27 Apr 2015 17:59:44 +0200 Subject: [PATCH] Fix qTox Android build --- qtox.pro | 5 +++-- src/core/core.cpp | 10 +++++----- src/core/corefile.cpp | 4 ++-- src/nexus.cpp | 1 + 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/qtox.pro b/qtox.pro index 674026cbf..5f31e6b89 100644 --- a/qtox.pro +++ b/qtox.pro @@ -345,6 +345,7 @@ contains(ENABLE_SYSTRAY_GTK_BACKEND, NO) { src/autoupdate.h \ src/widget/callconfirmwidget.h \ src/widget/systemtrayicon.h \ + src/misc/qrwidget.h \ src/widget/systemtrayicon_private.h SOURCES += \ @@ -404,7 +405,9 @@ contains(ENABLE_SYSTRAY_GTK_BACKEND, NO) { src/chatlog/documentcache.cpp \ src/chatlog/pixmapcache.cpp \ src/offlinemsgengine.cpp \ + src/misc/qrwidget.cpp \ src/widget/genericchatroomwidget.cpp + } SOURCES += \ @@ -424,7 +427,6 @@ SOURCES += \ src/video/videoframe.cpp \ src/widget/gui.cpp \ src/toxme.cpp \ - src/misc/qrwidget.cpp \ src/core/core.cpp \ src/core/coreav.cpp \ src/core/coreencryption.cpp \ @@ -455,6 +457,5 @@ HEADERS += \ src/video/netvideosource.h \ src/widget/gui.h \ src/toxme.h \ - src/misc/qrwidget.h \ src/profilelocker.h \ src/avatarbroadcaster.h diff --git a/src/core/core.cpp b/src/core/core.cpp index 09b046646..a377190ec 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -29,8 +29,8 @@ #include #include +#include #include -#include #include #include @@ -546,7 +546,7 @@ void Core::onReadReceiptCallback(Tox*, uint32_t friendnumber, uint32_t receipt, void Core::acceptFriendRequest(const QString& userId) { uint32_t friendId = tox_friend_add_norequest(tox, CUserId(userId).data(), nullptr); - if (friendId == UINT32_MAX) + if (friendId == std::numeric_limits::max()) { emit failedToAddFriend(userId); } @@ -580,7 +580,7 @@ void Core::requestFriendship(const QString& friendAddress, const QString& messag uint32_t friendId = tox_friend_add(tox, CFriendAddress(friendAddress).data(), cMessage.data(), cMessage.size(), nullptr); - if (friendId == UINT32_MAX) + if (friendId == std::numeric_limits::max()) { emit failedToAddFriend(userId); } @@ -1049,7 +1049,7 @@ void Core::loadFriends() void Core::checkLastOnline(uint32_t friendId) { const uint64_t lastOnline = tox_friend_get_last_online(tox, friendId, nullptr); - if (lastOnline != UINT64_MAX) + if (lastOnline != std::numeric_limits::max()) emit friendLastSeenChanged(friendId, QDateTime::fromTime_t(lastOnline)); } @@ -1287,7 +1287,7 @@ QString Core::getPeerName(const ToxID& id) const CUserId cid(id.toString()); uint32_t friendId = tox_friend_by_public_key(tox, (uint8_t*)cid.data(), nullptr); - if (friendId == UINT32_MAX) + if (friendId == std::numeric_limits::max()) { qWarning() << "Core::getPeerName: No such peer "+id.toString(); return name; diff --git a/src/core/corefile.cpp b/src/core/corefile.cpp index 4b5f355ea..ded02f213 100644 --- a/src/core/corefile.cpp +++ b/src/core/corefile.cpp @@ -22,7 +22,7 @@ void CoreFile::sendAvatarFile(Core* core, uint32_t friendId, const QByteArray& d uint64_t filesize = data.size(); uint32_t fileNum = tox_file_send(core->tox, friendId, TOX_FILE_KIND_AVATAR, filesize, nullptr, filename, TOX_HASH_LENGTH, nullptr); - if (fileNum == UINT32_MAX) + if (fileNum == std::numeric_limits::max()) { qWarning() << "CoreFile::sendAvatarFile: Can't create the Tox file sender"; return; @@ -46,7 +46,7 @@ void CoreFile::sendFile(Core* core, uint32_t friendId, QString Filename, QString QByteArray fileName = Filename.toUtf8(); uint32_t fileNum = tox_file_send(core->tox, friendId, TOX_FILE_KIND_DATA, filesize, nullptr, (uint8_t*)fileName.data(), fileName.size(), nullptr); - if (fileNum == UINT32_MAX) + if (fileNum == std::numeric_limits::max()) { qWarning() << "CoreFile::sendFile: Can't create the Tox file sender"; emit core->fileSendFailed(friendId, Filename); diff --git a/src/nexus.cpp b/src/nexus.cpp index a1502dce4..ed6812dcd 100644 --- a/src/nexus.cpp +++ b/src/nexus.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #ifdef Q_OS_ANDROID #include