# HG changeset patch # User Hasan Yavuz Ă–ZDERYA # Date 2018-04-03 16:08:38 # Node ID 2c5e57ebc103b10062120230e655ad2035f811eb # Parent 9ce163ba1b8887649e3c1c6a828dc4d3021d81cc remove ambiguity with `QObject::sink` method diff --git a/src/source.cpp b/src/source.cpp --- a/src/source.cpp +++ b/src/source.cpp @@ -29,7 +29,7 @@ Source::~Source() } } -void Source::connect(Sink* sink) +void Source::connectSink(Sink* sink) { Q_ASSERT(!sinks.contains(sink)); Q_ASSERT(sink->connectedSource() == NULL); diff --git a/src/source.h b/src/source.h --- a/src/source.h +++ b/src/source.h @@ -39,7 +39,7 @@ public: /// Connects a sink to this source. Trying to connect an already /// connected sink is an error. - void connect(Sink* sink); + void connectSink(Sink* sink); /// Disconnects an already connected sink. Trying to disconnect an /// unconnected sink is an error. diff --git a/tests/test.cpp b/tests/test.cpp --- a/tests/test.cpp +++ b/tests/test.cpp @@ -98,7 +98,7 @@ TEST_CASE("source", "[memory, stream]") REQUIRE(source.numChannels() == 3); REQUIRE(source.hasX() == false); - source.connect(&sink); + source.connectSink(&sink); REQUIRE(sink.numChannels() == 3); REQUIRE(sink.hasX() == false); @@ -120,7 +120,7 @@ TEST_CASE("source must set/unset sink 's TestSink sink; TestSource source(3, false); - source.connect(&sink); + source.connectSink(&sink); REQUIRE(sink.connectedSource() == &source); source.disconnect(&sink); @@ -135,7 +135,7 @@ TEST_CASE("source disconnect all sinks", // connect sinks for (int i = 0; i < 3; i++) { - source.connect(&sinks[i]); + source.connectSink(&sinks[i]); } source.disconnectSinks(); diff --git a/tests/test_stream.cpp b/tests/test_stream.cpp --- a/tests/test_stream.cpp +++ b/tests/test_stream.cpp @@ -52,7 +52,7 @@ TEST_CASE("changing stream number of cha { Stream s; TestSource so(3, false); - so.connect(&s); + so.connectSink(&s); // nc=3, x= false REQUIRE(s.numChannels() == 3); @@ -106,7 +106,7 @@ TEST_CASE("adding data to a stream with } TestSource so(3, false); - so.connect(&s); + so.connectSink(&s); // test so._feed(pack); @@ -147,7 +147,7 @@ TEST_CASE("adding data to a stream with } TestSource so(3, true); - so.connect(&s); + so.connectSink(&s); // test so._feed(pack); @@ -194,7 +194,7 @@ TEST_CASE("paused stream shouldn't store } TestSource so(3, false); - so.connect(&s); + so.connectSink(&s); // test s.pause(true); @@ -227,7 +227,7 @@ TEST_CASE("clear stream data", "[memory, } TestSource so(3, false); - so.connect(&s); + so.connectSink(&s); // test so._feed(pack);