[Telepathy-commits] [telepathy-qt4/master] Don't use "using namespace", explicitly use individual classes instead

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Dec 9 07:24:58 PST 2008


---
 tests/pinocchio/conn-basics.cpp |   17 +++++++++++------
 tests/pinocchio/lib.cpp         |    4 ++--
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/tests/pinocchio/conn-basics.cpp b/tests/pinocchio/conn-basics.cpp
index f480173..960ca3f 100644
--- a/tests/pinocchio/conn-basics.cpp
+++ b/tests/pinocchio/conn-basics.cpp
@@ -12,6 +12,11 @@
 
 using namespace Telepathy::Client;
 
+using Telepathy::Client::Connection;
+using Telepathy::Client::ConnectionManagerInterface;
+using Telepathy::Client::DBus::PeerInterface;
+using Telepathy::Client::DBus::PropertiesInterface;
+
 class TestConnBasics : public PinocchioTest
 {
     Q_OBJECT
@@ -66,7 +71,7 @@ void TestConnBasics::initTestCase()
     // Escape to the low-level API to make a Connection; this uses
     // pseudo-blocking calls for simplicity. Do not do this in production code
 
-    mCM = new Telepathy::Client::ConnectionManagerInterface(
+    mCM = new ConnectionManagerInterface(
         pinocchioBusName(), pinocchioObjectPath());
 
     QDBusPendingReply<QString, QDBusObjectPath> reply;
@@ -307,16 +312,16 @@ void TestConnBasics::testInterfaceFactory()
     QVERIFY(disconnect(mConn, SIGNAL(readinessChanged(uint)),
           this, SLOT(expectNotYetConnected(uint))));
 
-    DBus::PropertiesInterface* props = mConn->propertiesInterface();
+    PropertiesInterface* props = mConn->propertiesInterface();
     QVERIFY(props != NULL);
 
-    DBus::PropertiesInterface* props2 =
-        mConn->optionalInterface<DBus::PropertiesInterface>(Connection::BypassInterfaceCheck);
+    PropertiesInterface* props2 =
+        mConn->optionalInterface<PropertiesInterface>(Connection::BypassInterfaceCheck);
     QVERIFY(props2 == props);
 
-    DBus::PeerInterface* notListed = mConn->optionalInterface<DBus::PeerInterface>();
+    PeerInterface* notListed = mConn->optionalInterface<PeerInterface>();
     QVERIFY(notListed == NULL);
-    notListed = mConn->optionalInterface<DBus::PeerInterface>(Connection::BypassInterfaceCheck);
+    notListed = mConn->optionalInterface<PeerInterface>(Connection::BypassInterfaceCheck);
     QVERIFY(notListed != NULL);
 
     delete mConn;
diff --git a/tests/pinocchio/lib.cpp b/tests/pinocchio/lib.cpp
index 9a14727..cfcac7b 100644
--- a/tests/pinocchio/lib.cpp
+++ b/tests/pinocchio/lib.cpp
@@ -8,8 +8,8 @@
 #include <TelepathyQt4/Debug>
 #include <TelepathyQt4/Client/DBus>
 
-using namespace Telepathy::Client;
-using namespace Telepathy::Client::DBus;
+using Telepathy::Client::DBus::DBusDaemonInterface;
+using Telepathy::Client::PendingOperation;
 
 PinocchioTest::~PinocchioTest()
 {
-- 
1.5.6.5




More information about the Telepathy-commits mailing list