Logo Search packages:      
Sourcecode: akonadi version File versions  Download package

void AgentManager::removeAgentInstance ( const QString &  identifier  )  [slot]

Removes the agent with the given identifier.

Definition at line 180 of file agentmanager.cpp.

References agentInstanceRemoved(), mAgentInstances, and save().

{
  if ( !mAgentInstances.contains( identifier ) ) {
    mTracer->warning( QLatin1String( "AgentManager::removeAgentInstance" ),
                      QString( "Agent instance with identifier '%1' does not exist" ).arg( identifier ) );
    return;
  }

  AgentInstanceInfo instance = mAgentInstances.value( identifier );
  if ( instance.agentControlInterface ) {
    instance.agentControlInterface->cleanup();
  } else {
    mTracer->error( QLatin1String( "AgentManager::removeAgentInstance" ),
                    QString( "Agent instance '%1' has no interface!" ).arg( identifier ) );
  }

  delete instance.resourceInterface;
  delete instance.agentControlInterface;
  delete instance.agentStatusInterface;
  delete instance.controller;

  mAgentInstances.remove( identifier );

  save();

  emit agentInstanceRemoved( identifier );
}


Generated by  Doxygen 1.6.0   Back to index