From b03787099a79de94c599df692558f765eedf5360 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 27 Apr 2017 15:36:51 +0200 Subject: [PATCH] chore(CMakeLists.txt): deal with qt includes and Winsockapi --- linphone-desktop/CMakeLists.txt | 6 ++++++ linphone-desktop/src/components/calls/CallsListModel.cpp | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/linphone-desktop/CMakeLists.txt b/linphone-desktop/CMakeLists.txt index 87fe09651..5245b3977 100644 --- a/linphone-desktop/CMakeLists.txt +++ b/linphone-desktop/CMakeLists.txt @@ -63,6 +63,12 @@ endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS}") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG") +# See: http://stackoverflow.com/a/1372836 +if(WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WINSOCKAPI_") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_WINSOCKAPI_") +endif() + # ------------------------------------------------------------------------------ # Define packages, libs, sources, headers, resources and languages. # ------------------------------------------------------------------------------ diff --git a/linphone-desktop/src/components/calls/CallsListModel.cpp b/linphone-desktop/src/components/calls/CallsListModel.cpp index 38727b344..10138684c 100644 --- a/linphone-desktop/src/components/calls/CallsListModel.cpp +++ b/linphone-desktop/src/components/calls/CallsListModel.cpp @@ -176,7 +176,7 @@ void CallsListModel::addCall (const shared_ptr &linphoneCall) { CallModel *call = new CallModel(linphoneCall); - qInfo() << "Add call:" << call; + qInfo() << QStringLiteral("Add call:") << call; App::getInstance()->getEngine()->setObjectOwnership(call, QQmlEngine::CppOwnership); @@ -188,16 +188,15 @@ void CallsListModel::addCall (const shared_ptr &linphoneCall) { } void CallsListModel::removeCall (const shared_ptr &linphoneCall) { - // TODO: It will be (maybe) necessary to use a single scheduled function in the future. QTimer::singleShot( DELAY_BEFORE_REMOVE_CALL, this, [this, linphoneCall]() { CallModel *call = &linphoneCall->getData("call-model"); - qInfo() << "Removing call:" << call; + qInfo() << QStringLiteral("Removing call:") << call; int index = mList.indexOf(call); if (index == -1 || !removeRow(index)) - qWarning() << "Unable to remove call:" << call; + qWarning() << QStringLiteral("Unable to remove call:") << call; if (mList.empty()) App::getInstance()->getCallsWindow()->close();