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

void AgentManager::load (  )  [private]

Loads the internal state from config file.

Definition at line 382 of file agentmanager.cpp.

References configPath(), mAgentInstances, and mAgents.

{
  QSettings file( configPath( false ), QSettings::IniFormat );
  file.beginGroup( "Instances" );
  QStringList entries = file.childGroups();
  for ( int i = 0; i < entries.count(); ++i ) {
    const QString instanceIdentifier = entries[ i ];

    if ( mAgentInstances.contains( instanceIdentifier ) ) {
      mTracer->warning( QLatin1String( "AgentManager::load" ),
                        QString( "Duplicated instance identifier '%1' found in agentsrc" ).arg( instanceIdentifier ) );
      continue;
    }

    file.beginGroup( entries[ i ] );

    const QString agentType = file.value( "AgentType" ).toString();
    if ( !mAgents.contains( agentType ) ) {
      mTracer->warning( QLatin1String( "AgentManager::load" ),
                        QString( "Reference to unknown agent type '%1' in agentsrc" ).arg( agentType ) );
      file.endGroup();
      continue;
    }

    AgentInstanceInfo instance;
    instance.identifier = instanceIdentifier;
    instance.agentType = agentType;
    if ( instance.start( mAgents.value( agentType ), this ) )
      mAgentInstances.insert( instanceIdentifier, instance );
    file.endGroup();
  }

  file.endGroup();
}


Generated by  Doxygen 1.6.0   Back to index