Sync/SyncEvoStorageModel.cpp
/*
 * Handle asynchronous D-Bus calls. Since there are only two for this class, we don't need to turn this function into a
 * dispatcher.
 *
 * GetConfigs returns a list of the available configs. For each item in the list, we place a GetConfig call to retrieve
 * the template configuration for that particular config name.
 *
 * GetConfig returns the template configuration for a given service. We may or may not add the configuration to the list.
 */
Handle asynchronous D-Bus calls. Since there are only two for this class, we don't need to turn this function into a
dispatcher.

GetConfigs returns a list of the available configs. For each item in the list, we place a GetConfig call to retrieve
the template configuration for that particular config name.

GetConfig returns the template configuration for a given service. We may or may not add the configuration to the list.
Handle asynchronous D - Bus calls . Since there are only two for this class we don ' t need to turn this function into a dispatcher . GetConfigs returns a list of the available configs . For each item in the list we place a GetConfig call to retrieve the template configuration for that particular config name . GetConfig returns the template configuration for a given service . We may or may not add the configuration to the list .
void
MeeGo::Sync::SyncEvoStorageModel::asyncCallFinished(QDBusPendingCallWatcher *call)
{
  if (!m_error) {
    if ("GetConfigs" == DBUS_CALL_FUNCTION_NAME(call)) {
      QDBusPendingReply<QStringList> reply = *call;
      QStringList configs = reply.argumentAt<0>();
      if (reply.isError()) {
        SyncEvoStatic::reportDBusError(QString(__PRETTY_FUNCTION__), reply.error());
        m_error = true;
      }
      else {
        for (int Nix = 0 ; Nix < configs.count() ; Nix++)
          SyncEvoStatic::dbusCall(
            QList<QProperty>()
              << QProperty("DBusFunctionName", "GetConfig")
              << QProperty("Template", call->property("Template").toBool())
              << QProperty("ConfigName", reply.argumentAt<0>()[Nix]),
            this, SLOT(asyncCallFinished(QDBusPendingCallWatcher *)),
            m_serverInterface->GetConfig(
              reply.argumentAt<0>()[Nix] + 
                (call->property("Template").toBool()
                  ? ("@" + QUuid::createUuid().toString())
                  : QString("")),
              call->property("Template").toBool()));
        if (call->property("Template").toBool())
          SyncEvoStatic::dbusCall(
            QList<QProperty>()
              << QProperty("DBusFunctionName", "GetConfigs")
              << QProperty("Template", false),
            this, SLOT(asyncCallFinished(QDBusPendingCallWatcher *)),
            m_serverInterface->GetConfigs(false));
      }
    }
    else
    if ("GetConfig" == DBUS_CALL_FUNCTION_NAME(call)) {
      QDBusPendingReply<QStringMultiMap> reply = *call;
      if (reply.isError()) {
        SyncEvoStatic::reportDBusError(QString(__PRETTY_FUNCTION__), reply.error());
        if (reply.error().name() != "org.syncevolution.Exception")
          m_error = true;
      }
      else
        maybeAddToList(call->property("ConfigName").toString(), reply.argumentAt<0>(), call->property("Template").toBool());
    }
  }
  call->deleteLater();
}
void MeeGo :: Sync :: SyncEvoStorageModel :: asyncCallFinished ( QDBusPendingCallWatcher * call ) { if ( ! m_error ) { if ( " " == DBUS_CALL_FUNCTION_NAME ( call ) ) { QDBusPendingReply < QStringList > reply = * call ; QStringList configs = reply . argumentAt < 0 > ( ) ; if ( reply . isError ( ) ) { SyncEvoStatic :: reportDBusError ( QString ( __PRETTY_FUNCTION__ ) , reply . error ( ) ) ; m_error = true ; } else { for ( int Nix = 0 ; Nix < configs . count ( ) ; Nix ++ ) SyncEvoStatic :: dbusCall ( QList < QProperty > ( ) << QProperty ( " " , " " ) << QProperty ( " " , call -> property ( " " ) . toBool ( ) ) << QProperty ( " " , reply . argumentAt < 0 > ( ) [ Nix ] ) , this , SLOT ( asyncCallFinished ( QDBusPendingCallWatcher * ) ) , m_serverInterface -> GetConfig ( reply . argumentAt < 0 > ( ) [ Nix ] + ( call -> property ( " " ) . toBool ( ) ? ( " " + QUuid :: createUuid ( ) . toString ( ) ) : QString ( " " ) ) , call -> property ( " " ) . toBool ( ) ) ) ; if ( call -> property ( " " ) . toBool ( ) ) SyncEvoStatic :: dbusCall ( QList < QProperty > ( ) << QProperty ( " " , " " ) << QProperty ( " " , false ) , this , SLOT ( asyncCallFinished ( QDBusPendingCallWatcher * ) ) , m_serverInterface -> GetConfigs ( false ) ) ; } } else if ( " " == DBUS_CALL_FUNCTION_NAME ( call ) ) { QDBusPendingReply < QStringMultiMap > reply = * call ; if ( reply . isError ( ) ) { SyncEvoStatic :: reportDBusError ( QString ( __PRETTY_FUNCTION__ ) , reply . error ( ) ) ; if ( reply . error ( ) . name ( ) != " " ) m_error = true ; } else maybeAddToList ( call -> property ( " " ) . toString ( ) , reply . argumentAt < 0 > ( ) , call -> property ( " " ) . toBool ( ) ) ; } } call -> deleteLater ( ) ; }
Handle asynchronous D-Bus calls.
Handle asynchronous D - Bus calls .
/*
         * Retrieve the actual configurations as well
         */