Commit b0378709 authored by Ronan Abhamon's avatar Ronan Abhamon

chore(CMakeLists.txt): deal with qt includes and Winsockapi

parent 353398c7
......@@ -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.
# ------------------------------------------------------------------------------
......
......@@ -176,7 +176,7 @@ void CallsListModel::addCall (const shared_ptr<linphone::Call> &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<linphone::Call> &linphoneCall) {
}
void CallsListModel::removeCall (const shared_ptr<linphone::Call> &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<CallModel>("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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment