Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Daniel Nachbaur <daniel.nachbaur@epfl.ch>

cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(Deflect VERSION 0.14.0)
project(Deflect VERSION 0.14.1)
set(Deflect_VERSION_ABI 7)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/common)
Expand Down
29 changes: 16 additions & 13 deletions deflect/qt/QmlStreamerImpl.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*********************************************************************/
/* Copyright (c) 2015-2016, EPFL/Blue Brain Project */
/* Daniel.Nachbaur <daniel.nachbaur@epfl.ch> */
/* Raphael Dumusc <raphael.dumusc@epfl.ch> */
/* Copyright (c) 2015-2018, EPFL/Blue Brain Project */
/* Daniel.Nachbaur <daniel.nachbaur@epfl.ch>*/
/* Raphael Dumusc <raphael.dumusc@epfl.ch> */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or */
Expand Down Expand Up @@ -105,10 +105,18 @@ void QmlStreamer::Impl::_afterRender(const QImage image)
if (!_sendFuture.valid() || !_sendFuture.get())
return;

if (!_stream && !_setupDeflectStream())
if (!_stream)
{
qWarning() << "Could not setup Deflect stream";
return;
try
{
_setupDeflectStream();
}
catch (const std::runtime_error& e)
{
qWarning() << e.what();
_onStreamClosed();
return;
}
}

if (image.isNull())
Expand Down Expand Up @@ -248,16 +256,13 @@ std::string QmlStreamer::Impl::_getDeflectStreamIdentifier() const
return streamId.empty() ? DEFAULT_STREAM_ID : streamId;
}

bool QmlStreamer::Impl::_setupDeflectStream()
void QmlStreamer::Impl::_setupDeflectStream()
{
if (!_stream)
_stream.reset(new Stream(_getDeflectStreamIdentifier(), _streamHost));

if (!_stream->isConnected())
return false;

if (!_stream->registerForEvents())
return false;
throw std::runtime_error("Stream failed to register for events");

if (_sizeHints != SizeHints())
_stream->sendSizeHints(_sizeHints);
Expand Down Expand Up @@ -297,8 +302,6 @@ bool QmlStreamer::Impl::_setupDeflectStream()

connect(_eventReceiver.get(), &EventReceiver::closed, this,
&QmlStreamer::Impl::_onStreamClosed);

return true;
}

void QmlStreamer::Impl::_connectTouchInjector()
Expand Down
2 changes: 1 addition & 1 deletion deflect/qt/QmlStreamerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private slots:
void _send(QKeyEvent& keyEvent);
bool _sendToWebengineviewItems(QKeyEvent& keyEvent);
std::string _getDeflectStreamIdentifier() const;
bool _setupDeflectStream();
void _setupDeflectStream();

void _connectTouchInjector();
void _setupMouseModeSwitcher();
Expand Down
4 changes: 4 additions & 0 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Changelog {#Changelog}

## Deflect 0.14

### 0.14.1 (git master)
* [192](https://github.com/BlueBrain/Deflect/pull/192):
QmlStreamer bugfix: gracefully exit if the stream connection fails.

### 0.14.0 (23-10-2017)

* [191](https://github.com/BlueBrain/Deflect/pull/191):
Expand Down