From 8d11fbd2e7c7139083892656eb3e6b3cf94d0bcb Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Wed, 30 Jun 2010 17:52:49 +0300 Subject: Rename all the "newClass" pseudo-constructors to "create". Since these are static methods, you need to type the class name anyway, so there is no need to type it again after "new". Plain "new" would have been ideal, but unfortunately it is a keyword. For consistency, the Caps constructors have been renamed too, although they did not follow the "newClass" pattern. --- examples/echo/main.cpp | 2 +- src/QGst/bin.cpp | 2 +- src/QGst/bin.h | 2 +- src/QGst/caps.cpp | 6 +++--- src/QGst/caps.h | 6 +++--- src/QGst/ghostpad.cpp | 4 ++-- src/QGst/ghostpad.h | 8 ++++---- src/QGst/pad.cpp | 2 +- src/QGst/pad.h | 2 +- src/QGst/pipeline.cpp | 2 +- src/QGst/pipeline.h | 2 +- tests/capstest.cpp | 10 +++++----- tests/childproxytest.cpp | 6 +++--- tests/propertiestest.cpp | 6 +++--- tests/refpointertest.cpp | 2 +- tests/signalstest.cpp | 6 +++--- 16 files changed, 34 insertions(+), 34 deletions(-) diff --git a/examples/echo/main.cpp b/examples/echo/main.cpp index 5054932..f044caa 100644 --- a/examples/echo/main.cpp +++ b/examples/echo/main.cpp @@ -33,7 +33,7 @@ int main(int argc, char **argv) QCoreApplication app(argc, argv); QGst::init(&argc, &argv); - QGst::PipelinePtr pipeline = QGst::Pipeline::newPipeline(); + QGst::PipelinePtr pipeline = QGst::Pipeline::create(); QGst::ElementPtr src = QGst::ElementFactory::make("audiotestsrc"); QGst::ElementPtr sink = QGst::ElementFactory::make("autoaudiosink"); diff --git a/src/QGst/bin.cpp b/src/QGst/bin.cpp index 506a569..503a5ad 100644 --- a/src/QGst/bin.cpp +++ b/src/QGst/bin.cpp @@ -22,7 +22,7 @@ namespace QGst { //static -BinPtr Bin::newBin(const QGlib::String & name) +BinPtr Bin::create(const QGlib::String & name) { GstElement *bin = gst_bin_new(name); gst_object_ref_sink(GST_OBJECT(bin)); diff --git a/src/QGst/bin.h b/src/QGst/bin.h index d37629f..ad7a663 100644 --- a/src/QGst/bin.h +++ b/src/QGst/bin.h @@ -26,7 +26,7 @@ class Bin : public Element, public ChildProxy { QGST_WRAPPER(Bin) public: - static BinPtr newBin(const QGlib::String & name = QGlib::String()); + static BinPtr create(const QGlib::String & name = QGlib::String()); bool add(const ElementPtr & element); bool remove(const ElementPtr & element); diff --git a/src/QGst/caps.cpp b/src/QGst/caps.cpp index a390f83..f39e8f3 100644 --- a/src/QGst/caps.cpp +++ b/src/QGst/caps.cpp @@ -22,19 +22,19 @@ namespace QGst { //static -CapsPtr Caps::newSimple(const QGlib::String & mediaType) +CapsPtr Caps::createSimple(const QGlib::String & mediaType) { return CapsPtr::wrap(gst_caps_new_simple(mediaType, NULL), false); } //static -CapsPtr Caps::newAny() +CapsPtr Caps::createAny() { return CapsPtr::wrap(gst_caps_new_any(), false); } //static -CapsPtr Caps::newEmpty() +CapsPtr Caps::createEmpty() { return CapsPtr::wrap(gst_caps_new_empty(), false); } diff --git a/src/QGst/caps.h b/src/QGst/caps.h index 40d5327..e6c2a8b 100644 --- a/src/QGst/caps.h +++ b/src/QGst/caps.h @@ -29,9 +29,9 @@ class Caps : public QGlib::RefCountedObject { QGST_WRAPPER(Caps) public: - static CapsPtr newSimple(const QGlib::String & mediaType); - static CapsPtr newAny(); - static CapsPtr newEmpty(); + static CapsPtr createSimple(const QGlib::String & mediaType); + static CapsPtr createAny(); + static CapsPtr createEmpty(); static CapsPtr fromString(const QGlib::String & string); QGlib::String toString() const; diff --git a/src/QGst/ghostpad.cpp b/src/QGst/ghostpad.cpp index c6fc53d..ec52d83 100644 --- a/src/QGst/ghostpad.cpp +++ b/src/QGst/ghostpad.cpp @@ -19,14 +19,14 @@ namespace QGst { -GhostPadPtr GhostPad::newGhostPad(const PadPtr & target, const QGlib::String & name) +GhostPadPtr GhostPad::create(const PadPtr & target, const QGlib::String & name) { GstPad *gp = gst_ghost_pad_new(name, target); gst_object_ref_sink(gp); return GhostPadPtr::wrap(GST_GHOST_PAD(gp), false); } -GhostPadPtr GhostPad::newGhostPad(PadDirection direction, const QGlib::String & name) +GhostPadPtr GhostPad::create(PadDirection direction, const QGlib::String & name) { GstPad *gp = gst_ghost_pad_new_no_target(name, static_cast(direction)); gst_object_ref_sink(gp); diff --git a/src/QGst/ghostpad.h b/src/QGst/ghostpad.h index d2e12ab..6a27734 100644 --- a/src/QGst/ghostpad.h +++ b/src/QGst/ghostpad.h @@ -25,10 +25,10 @@ class GhostPad : public Pad { QGST_WRAPPER(GhostPad) public: - static GhostPadPtr newGhostPad(const PadPtr & target, - const QGlib::String & name = QGlib::String()); - static GhostPadPtr newGhostPad(PadDirection direction, - const QGlib::String & name = QGlib::String()); + static GhostPadPtr create(const PadPtr & target, + const QGlib::String & name = QGlib::String()); + static GhostPadPtr create(PadDirection direction, + const QGlib::String & name = QGlib::String()); PadPtr target() const; bool setTarget(const PadPtr & target); diff --git a/src/QGst/pad.cpp b/src/QGst/pad.cpp index ec115a7..a99527b 100644 --- a/src/QGst/pad.cpp +++ b/src/QGst/pad.cpp @@ -24,7 +24,7 @@ namespace QGst { //static -PadPtr Pad::newPad(PadDirection direction, const QGlib::String & name) +PadPtr Pad::create(PadDirection direction, const QGlib::String & name) { GstPad *pad = gst_pad_new(name, static_cast(direction)); return PadPtr::wrap(pad, false); diff --git a/src/QGst/pad.h b/src/QGst/pad.h index 25ef442..d991798 100644 --- a/src/QGst/pad.h +++ b/src/QGst/pad.h @@ -25,7 +25,7 @@ class Pad : public Object { QGST_WRAPPER(Pad) public: - static PadPtr newPad(PadDirection direction, const QGlib::String & name = QGlib::String()); + static PadPtr create(PadDirection direction, const QGlib::String & name = QGlib::String()); PadDirection direction() const; diff --git a/src/QGst/pipeline.cpp b/src/QGst/pipeline.cpp index 672df0e..ddef07e 100644 --- a/src/QGst/pipeline.cpp +++ b/src/QGst/pipeline.cpp @@ -20,7 +20,7 @@ namespace QGst { //static -PipelinePtr Pipeline::newPipeline(const QGlib::String & name) +PipelinePtr Pipeline::create(const QGlib::String & name) { GstElement *p = gst_pipeline_new(name); gst_object_ref_sink(p); diff --git a/src/QGst/pipeline.h b/src/QGst/pipeline.h index ca887c6..570e7f1 100644 --- a/src/QGst/pipeline.h +++ b/src/QGst/pipeline.h @@ -25,7 +25,7 @@ class Pipeline : public Bin { QGST_WRAPPER(Pipeline) public: - static PipelinePtr newPipeline(const QGlib::String & name = QGlib::String()); + static PipelinePtr create(const QGlib::String & name = QGlib::String()); }; } diff --git a/tests/capstest.cpp b/tests/capstest.cpp index f4a8ed3..3d69f25 100644 --- a/tests/capstest.cpp +++ b/tests/capstest.cpp @@ -30,7 +30,7 @@ private Q_SLOTS: void CapsTest::simpleTest() { - QGst::CapsPtr caps = QGst::Caps::newSimple("video/x-raw-yuv"); + QGst::CapsPtr caps = QGst::Caps::createSimple("video/x-raw-yuv"); QVERIFY(caps->isSimple()); QVERIFY(!caps->isEmpty()); QVERIFY(!caps->isAny()); @@ -51,7 +51,7 @@ void CapsTest::simpleTest() void CapsTest::anyTest() { - QGst::CapsPtr caps = QGst::Caps::newAny(); + QGst::CapsPtr caps = QGst::Caps::createAny(); QVERIFY(!caps->isSimple()); QVERIFY(!caps->isEmpty()); QVERIFY(caps->isAny()); @@ -64,7 +64,7 @@ void CapsTest::fullTest() s.setValue("width", 320); s.setValue("height", 240); - QGst::CapsPtr caps = QGst::Caps::newEmpty(); + QGst::CapsPtr caps = QGst::Caps::createEmpty(); QVERIFY(!caps->isSimple()); QVERIFY(caps->isEmpty()); QVERIFY(!caps->isAny()); @@ -76,7 +76,7 @@ void CapsTest::fullTest() QVERIFY(!caps->isAny()); QVERIFY(caps->size() == 1); - QGst::CapsPtr caps2 = QGst::Caps::newSimple("video/x-raw-yuv"); + QGst::CapsPtr caps2 = QGst::Caps::createSimple("video/x-raw-yuv"); caps2->setValue("width", 320); caps2->setValue("height", 240); @@ -85,7 +85,7 @@ void CapsTest::fullTest() void CapsTest::writabilityTest() { - QGst::CapsPtr caps = QGst::Caps::newSimple("video/x-raw-yuv"); + QGst::CapsPtr caps = QGst::Caps::createSimple("video/x-raw-yuv"); QVERIFY(GST_CAPS_REFCOUNT_VALUE(caps) == 1); { diff --git a/tests/childproxytest.cpp b/tests/childproxytest.cpp index 5a73770..6bb1910 100644 --- a/tests/childproxytest.cpp +++ b/tests/childproxytest.cpp @@ -29,7 +29,7 @@ private Q_SLOTS: void ChildProxyTest::inspectionTest() { - QGst::BinPtr bin = QGst::Bin::newBin(); + QGst::BinPtr bin = QGst::Bin::create(); QVERIFY(!bin.isNull()); QCOMPARE(bin->childrenCount(), static_cast(0)); @@ -53,7 +53,7 @@ void ChildProxyTest::inspectionTest() void ChildProxyTest::removeTest() { - QGst::BinPtr bin = QGst::Bin::newBin(); + QGst::BinPtr bin = QGst::Bin::create(); QVERIFY(!bin.isNull()); QCOMPARE(bin->childrenCount(), static_cast(0)); @@ -68,7 +68,7 @@ void ChildProxyTest::removeTest() void ChildProxyTest::propertiesTest() { - QGst::BinPtr bin = QGst::Bin::newBin(); + QGst::BinPtr bin = QGst::Bin::create(); QVERIFY(!bin.isNull()); QGst::ElementPtr tee = QGst::ElementFactory::make("tee", "mytee"); diff --git a/tests/propertiestest.cpp b/tests/propertiestest.cpp index ec069a4..aa15f51 100644 --- a/tests/propertiestest.cpp +++ b/tests/propertiestest.cpp @@ -29,7 +29,7 @@ private Q_SLOTS: void PropertiesTest::findPropertyTest() { - QGst::BinPtr object = QGst::Bin::newBin(); + QGst::BinPtr object = QGst::Bin::create(); QGlib::ParamSpecPtr param = object->findProperty("name"); QVERIFY(!param.isNull()); @@ -40,7 +40,7 @@ void PropertiesTest::findPropertyTest() void PropertiesTest::listPropertiesTest() { - QGst::BinPtr object = QGst::Bin::newBin(); + QGst::BinPtr object = QGst::Bin::create(); QList paramlist = object->listProperties(); QVERIFY(!paramlist.isEmpty()); @@ -52,7 +52,7 @@ void PropertiesTest::listPropertiesTest() void PropertiesTest::getPropertyTest() { - QGst::BinPtr object = QGst::Bin::newBin(); + QGst::BinPtr object = QGst::Bin::create(); try { QString name = object->property("name").get(); diff --git a/tests/refpointertest.cpp b/tests/refpointertest.cpp index c82a673..bdfdb1a 100644 --- a/tests/refpointertest.cpp +++ b/tests/refpointertest.cpp @@ -78,7 +78,7 @@ static void testMethod(const QGlib::ObjectPtr & obj) void RefPointerTest::compilationTest() { //This is mostly a compilation test. If it compiles, it's fine, if it doesn't, there is a problem. - QGst::BinPtr bin = QGst::Bin::newBin(); + QGst::BinPtr bin = QGst::Bin::create(); { //operator=() diff --git a/tests/signalstest.cpp b/tests/signalstest.cpp index 2d9c33b..96391e7 100644 --- a/tests/signalstest.cpp +++ b/tests/signalstest.cpp @@ -42,8 +42,8 @@ void SignalsTest::closureTestClosure(const QGst::ObjectPtr & obj, QGst::ObjectPt void SignalsTest::closureTest() { - QGst::PipelinePtr pipeline = QGst::Pipeline::newPipeline("mypipeline"); - QGst::BinPtr bin = QGst::Bin::newBin("mybin"); + QGst::PipelinePtr pipeline = QGst::Pipeline::create("mypipeline"); + QGst::BinPtr bin = QGst::Bin::create("mybin"); closureCalled = false; QGlib::Signal::connect(bin, "parent-set", this, &SignalsTest::closureTestClosure); @@ -80,7 +80,7 @@ void SignalsTest::emitTestClosure(const QGlib::ObjectPtr & instance, const QGlib void SignalsTest::emitTest() { - QGst::BinPtr bin = QGst::Bin::newBin("mybin"); + QGst::BinPtr bin = QGst::Bin::create("mybin"); QGlib::SignalHandler handler = QGlib::Signal::connect(bin, "notify::name", this, &SignalsTest::emitTestClosure); -- cgit v1.2.3