/**
 * Can be used by subclasses to override the Account subclass constructed by the factory.
 *
 * This is automatically called by proxy() to construct proxy instances if no valid cached proxy is
 * found.
 *
 * The default implementation constructs Tp::Account objects.
 *
 * \param busName The bus/service name of the D-Bus account object the proxy is constructed for.
 * (Usually #TP_QT4_ACCOUNT_MANAGER_BUS_NAME).
 * \param objectPath The object path of the account.
 * \param connFactory The connection factory to use for the Account.
 * \param chanFactory The channel factory to use for the Account.
 * \param contactFactory The channel factory to use for the Account.
 * \return A pointer to the constructed Account object.
 */
AccountPtr AccountFactory::construct(const QString &busName, const QString &objectPath,
                                     const ConnectionFactoryConstPtr &connFactory,
                                     const ChannelFactoryConstPtr &chanFactory,
                                     const ContactFactoryConstPtr &contactFactory) const
{
    return Account::create(dbusConnection(), busName, objectPath, connFactory, chanFactory,
                           contactFactory);
}
Пример #2
0
int DBusHandler::Callbacks::dispatchDBus(int, unsigned int, void* data)
{
	if(!data) return 0;

	auto handler = static_cast<DBusHandler*>(data);
	while(1)
	{
		switch(dbus_connection_dispatch(&handler->dbusConnection()))
        {
            case DBUS_DISPATCH_DATA_REMAINS: break;
            case DBUS_DISPATCH_COMPLETE: return 0;
			case DBUS_DISPATCH_NEED_MEMORY: ny::sendWarning("DBUS_DISPATCH_NEED_MEMORY"); 
											return 0;
			default: ny::sendWarning("DBUS_DISPATCH_ERROR"); return 0;
        }
   }

   return 0;
}
Пример #3
0
/**
 * Transforms well-known names to the corresponding unique names, as is appropriate for Channel
 *
 * \param uniqueOrWellKnown The name to transform.
 * \return The unique name corresponding to \a uniqueOrWellKnown (which may be it itself).
 */
QString ChannelFactory::finalBusNameFrom(const QString &uniqueOrWellKnown) const
{
    return StatefulDBusProxy::uniqueNameFrom(dbusConnection(), uniqueOrWellKnown);
}