[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: KDE/kdepim/kleopatra
From: Laurent Montel <montel () kde ! org>
Date: 2007-06-19 14:03:37
Message-ID: 200706191603.37617.montel () kde ! org
[Download RAW message or body]
On Tuesday 19 June 2007 10:39:58 David Faure wrote:
> On Monday 18 June 2007, Laurent Montel wrote:
> > On Saturday 16 June 2007 09:49:16 David Faure wrote:
> > > On Friday 15 June 2007, Laurent Montel wrote:
> > > > + QString dbusService;
> > > > + int result = KDBusServiceStarter::self()->findServiceFor(
> > > > "DBUS/Mailer", QString::null, &error, &dbusService ); if ( result !=
> > > > 0 ) {
> > > > kDebug() << "Couldn't connect to KMail\n";
> > > > KMessageBox::error( this,
> > > > @@ -439,6 +440,27 @@
> > > > return;
> > > > }
> > > >
> > > > + //TODO look at if we can find kmail when embedded into kontact
> > > > + bool kmailFound = false;
> > > > + QDBusConnection dbus = QDBusConnection::sessionBus();
> > > > + QDBusReply<QStringList> reply =
> > > > dbus.interface()->registeredServiceNames(); + if ( !reply.isValid()
> > > > ) + return;
> > > > +
> > > > + const QStringList allServices = reply;
> > > > + for ( QStringList::const_iterator it = allServices.begin(), end =
> > > > allServices.end() ; it != end ; ++it ) { + const QString
> > > > service = *it;
> > > > + if ( service.startsWith( "org.kde.kmail" ) ) {
> > > > + kmailFound = true;
> > > > + break;
> > > > + }
> > > > + }
> > > > +
> > > > + if(!kmailFound)
> > > > + {
> > > > + //TODO launch it into kontact
> > > > + }
> > >
> > > Hmm all of this is what KDBusServiceStarter::self()->findServiceFor( )
> > > is supposed to do. If it doesn't work, it should be debugged, but the
> > > above code shouldn't be necessary.
> >
> > I just start to port it.
> > I didn't start to test it.
>
> Hmm, but then why did you add all this code? It wasn't there before, so
> it's not needed now either.
>
> > But KDBusServiceStarter::self()->findServiceFor( ) is able to find when
> > kmail is embedded into kontact ?
>
> Yes, just like KDCOPServiceStarter was able to do this in kde3.
> It looks up who provides DBUS/ResourceBackend/IMAP, finds that
> KMail.desktop does, and that file also says
> X-DBUS-ServiceName=org.kde.kmail so KDBusServiceStarter will look whether
> org.kde.kmail is registered (and it is, when kmail is embedded into
> kontact, at least it's supposed to ;).
It's right now same as it's embedded we create a org.kde.kmail.
In kde3 it was a sub-element to kontact dcop id.
so it used :
kapp->dcopClient()->findObject(...)
which is not necessary now.
I will fix it
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic