~ubuntu-branches/ubuntu/quantal/akonadi/quantal

« back to all changes in this revision

Viewing changes to server/src/storage/itemretrievalmanager.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-01-24 23:43:13 UTC
  • mto: (3.1.12 sid)
  • mto: This revision was merged to the branch mainline in revision 69.
  • Revision ID: package-import@ubuntu.com-20120124234313-ooald4uh9w8jilyw
Tags: upstream-1.7.0
ImportĀ upstreamĀ versionĀ 1.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include "itemretrievaljob.h"
23
23
 
24
24
#include "resourceinterface.h"
25
 
#include "akdebug.h"
 
25
 
 
26
#include <akdbus.h>
 
27
#include <akdebug.h>
26
28
 
27
29
#include <QCoreApplication>
28
30
#include <QReadWriteLock>
75
77
  Q_UNUSED( newOwner );
76
78
  if ( oldOwner.isEmpty() )
77
79
    return;
78
 
  if ( !serviceName.startsWith( QLatin1String("org.freedesktop.Akonadi.Resource.") ) )
 
80
  AkDBus::AgentType type = AkDBus::Unknown;
 
81
  const QString resourceId = AkDBus::parseAgentServiceName( serviceName, type );
 
82
  if ( resourceId.isEmpty() || type != AkDBus::Resource )
79
83
    return;
80
 
  const QString resourceId = serviceName.mid( 33 );
81
84
  qDebug() << "Lost connection to resource" << serviceName << ", discarding cached interface";
82
85
  mResourceInterfaces.remove( resourceId );
83
86
}
93
96
    return iface;
94
97
 
95
98
  delete iface;
96
 
  iface = new OrgFreedesktopAkonadiResourceInterface( QLatin1String("org.freedesktop.Akonadi.Resource.") + id,
 
99
  iface = new OrgFreedesktopAkonadiResourceInterface( AkDBus::agentServiceName( id, AkDBus::Resource ),
97
100
                                                      QLatin1String("/"), mDBusConnection, this );
98
101
  if ( !iface || !iface->isValid() ) {
99
102
    qDebug() << QString::fromLatin1( "Cannot connect to agent instance with identifier '%1', error message: '%2'" )