void QDBusAdaptorConnector::addAdaptor(QDBusAbstractAdaptor *adaptor) { // find the interface name const QMetaObject *mo = adaptor->metaObject(); int ciid = mo->indexOfClassInfo(QCLASSINFO_DBUS_INTERFACE); if (ciid != -1) { QMetaClassInfo mci = mo->classInfo(ciid); if (*mci.value()) { // find out if this interface exists first const char *interface = mci.value(); AdaptorMap::Iterator it = qLowerBound(adaptors.begin(), adaptors.end(), QByteArray(interface)); if (it != adaptors.end() && qstrcmp(interface, it->interface) == 0) { // exists. Replace it (though it's probably the same) if (it->adaptor != adaptor) { // reconnect the signals disconnectAllSignals(it->adaptor); connectAllSignals(adaptor); } it->adaptor = adaptor; } else { // create a new one AdaptorData entry; entry.interface = interface; entry.adaptor = adaptor; adaptors << entry; // connect the adaptor's signals to our relaySlot slot connectAllSignals(adaptor); } } } }
RadioToggleButton::RadioToggleButton(sf::Window* window, ButtonGroup* buttongroup, float width, float height, std::string text, const sf::Texture* textureactive, const sf::Texture* textureinainactive, const sf::Texture* texturehover) : Button(window, width, height, text, textureactive, textureinainactive, texturehover), buttongroup(buttongroup) { buttongroup->addButton(this); disconnectAllSignals(); signalclicked.connect(std::bind(&RadioToggleButton::clickedSlot, this)); }