dfaure added a comment.
Right, from a performance point of view, I believe this code was flushing far too much. In fact even now those calls to flush() are all unnecessary. Just one flush before closing the file is enough to be sure, or even without it, it will work (socket notifier says closed => stream flushes) REPOSITORY R269 BluezQt REVISION DETAIL https://phabricator.kde.org/D26320 To: mlaurent, dfaure Cc: kossebau, apol, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns