From 03fc9b5fa72fd3197ca1e496f2c22e640304a602 Mon Sep 17 00:00:00 2001 From: Maxim Doucet Date: Wed, 27 May 2015 18:34:47 +0200 Subject: [PATCH 1/3] Fix issue synergy/synergy#4720 --- src/gui/src/PluginManager.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/gui/src/PluginManager.cpp b/src/gui/src/PluginManager.cpp index fd3a24e4..d1dc8762 100644 --- a/src/gui/src/PluginManager.cpp +++ b/src/gui/src/PluginManager.cpp @@ -194,13 +194,7 @@ QString PluginManager::getPluginUrl(const QString& pluginName) process.start(program, args); bool success = process.waitForStarted(); - if (!success || !process.waitForFinished()) - { - emit error(tr("Could not get Linux package type.")); - return ""; - } - - bool isDeb = (process.exitCode() == 0); + bool isDeb = (success && process.waitForFinished() & (process.exitCode() == 0)); int arch = getProcessorArch(); if (arch == kProcessorArchLinux32) { From 97bac70fae702435bf3cb4bc06f33654df7cdf57 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Fri, 29 May 2015 16:55:22 -0700 Subject: [PATCH 2/3] Stop writing into and clear buffer when no GUI #4721 --- src/lib/ipc/IpcLogOutputter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/ipc/IpcLogOutputter.cpp b/src/lib/ipc/IpcLogOutputter.cpp index 6ce8d774..cf0fa03c 100644 --- a/src/lib/ipc/IpcLogOutputter.cpp +++ b/src/lib/ipc/IpcLogOutputter.cpp @@ -95,6 +95,13 @@ IpcLogOutputter::show(bool showIfEmpty) bool IpcLogOutputter::write(ELevel, const char* text) { + if (!m_ipcServer.hasClients(kIpcClientGui)) { + if (!m_buffer.empty()) { + m_buffer.clear(); + } + return true; + } + // ignore events from the buffer thread (would cause recursion). if (m_bufferThread != nullptr && Thread::getCurrentThread().getID() == m_bufferThreadId) { From bd3a8e9429eed22edde9f76895abefc9888873e6 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Fri, 29 May 2015 17:48:53 -0700 Subject: [PATCH 3/3] Fixed unittest for ipcLogOutputter #4721 --- src/test/unittests/ipc/IpcLogOutputterTests.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/unittests/ipc/IpcLogOutputterTests.cpp b/src/test/unittests/ipc/IpcLogOutputterTests.cpp index 9233256b..1a110cee 100644 --- a/src/test/unittests/ipc/IpcLogOutputterTests.cpp +++ b/src/test/unittests/ipc/IpcLogOutputterTests.cpp @@ -52,7 +52,7 @@ TEST(IpcLogOutputterTests, write_threadingEnabled_bufferIsSent) ON_CALL(mockServer, hasClients(_)).WillByDefault(Return(true)); - EXPECT_CALL(mockServer, hasClients(_)).Times(2); + EXPECT_CALL(mockServer, hasClients(_)).Times(4); EXPECT_CALL(mockServer, send(IpcLogLineMessageEq("mock 1\n"), _)).Times(1); EXPECT_CALL(mockServer, send(IpcLogLineMessageEq("mock 2\n"), _)).Times(1); @@ -69,7 +69,7 @@ TEST(IpcLogOutputterTests, write_overBufferMaxSize_firstLineTruncated) ON_CALL(mockServer, hasClients(_)).WillByDefault(Return(true)); - EXPECT_CALL(mockServer, hasClients(_)).Times(1); + EXPECT_CALL(mockServer, hasClients(_)).Times(4); EXPECT_CALL(mockServer, send(IpcLogLineMessageEq("mock 2\nmock 3\n"), _)).Times(1); IpcLogOutputter outputter(mockServer, false); @@ -88,7 +88,7 @@ TEST(IpcLogOutputterTests, write_underBufferMaxSize_allLinesAreSent) ON_CALL(mockServer, hasClients(_)).WillByDefault(Return(true)); - EXPECT_CALL(mockServer, hasClients(_)).Times(1); + EXPECT_CALL(mockServer, hasClients(_)).Times(3); EXPECT_CALL(mockServer, send(IpcLogLineMessageEq("mock 1\nmock 2\n"), _)).Times(1); IpcLogOutputter outputter(mockServer, false); @@ -106,7 +106,7 @@ TEST(IpcLogOutputterTests, write_overBufferRateLimit_lastLineTruncated) ON_CALL(mockServer, hasClients(_)).WillByDefault(Return(true)); - EXPECT_CALL(mockServer, hasClients(_)).Times(2); + EXPECT_CALL(mockServer, hasClients(_)).Times(6); EXPECT_CALL(mockServer, send(IpcLogLineMessageEq("mock 1\n"), _)).Times(1); EXPECT_CALL(mockServer, send(IpcLogLineMessageEq("mock 3\n"), _)).Times(1); @@ -134,7 +134,7 @@ TEST(IpcLogOutputterTests, write_underBufferRateLimit_allLinesAreSent) ON_CALL(mockServer, hasClients(_)).WillByDefault(Return(true)); - EXPECT_CALL(mockServer, hasClients(_)).Times(2); + EXPECT_CALL(mockServer, hasClients(_)).Times(6); EXPECT_CALL(mockServer, send(IpcLogLineMessageEq("mock 1\nmock 2\n"), _)).Times(1); EXPECT_CALL(mockServer, send(IpcLogLineMessageEq("mock 3\nmock 4\n"), _)).Times(1);