~unity-team/libqtdbusmock/trunk

« back to all changes in this revision

Viewing changes to src/libqtdbusmock/DBusMock.cpp

  • Committer: Pete Woods
  • Date: 2013-11-15 15:51:22 UTC
  • mfrom: (25.1.4 trunk)
  • Revision ID: pete.woods@canonical.com-20131115155122-jkazscyb3k8zo0uk
Handle different mock interfaces on the same dbus name

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
                const QString &path, const QString &interface,
87
87
                QDBusConnection::BusType busType) {
88
88
        Q_UNUSED(interface);
89
 
        auto it(d->m_mockInterfaces.find(name));
 
89
        QString id(name);
 
90
        id.append(':');
 
91
        id.append(path);
 
92
        auto it(d->m_mockInterfaces.find(id));
90
93
        if (it == d->m_mockInterfaces.end()) {
91
94
                switch (busType) {
92
95
                case QDBusConnection::SystemBus:
93
 
                        it = d->m_mockInterfaces.insert(name,
 
96
                        it = d->m_mockInterfaces.insert(id,
94
97
                                        QSharedPointer<OrgFreedesktopDBusMockInterface>(
95
98
                                                        new OrgFreedesktopDBusMockInterface(name, path,
96
99
                                                                        d->m_testRunner.systemConnection())));
97
100
                        break;
98
101
                case QDBusConnection::SessionBus:
99
 
                        it = d->m_mockInterfaces.insert(name,
 
102
                        it = d->m_mockInterfaces.insert(id,
100
103
                                        QSharedPointer<OrgFreedesktopDBusMockInterface>(
101
104
                                                        new OrgFreedesktopDBusMockInterface(name, path,
102
105
                                                                        d->m_testRunner.sessionConnection())));