akonadi
22 #include "showaddressaction.h"
24 #include "contactactionssettings.h"
26 #include <kabc/address.h>
28 #include <ktoolinvocation.h>
30 using namespace Akonadi;
32 void ShowAddressAction::showAddress(
const KABC::Address &address )
35 ContactActionsSettings::self()->readConfig();
37 if ( ContactActionsSettings::self()->showAddressAction() == ContactActionsSettings::UseBrowser ) {
38 QString urlTemplate = ContactActionsSettings::self()->addressUrl();
40 urlTemplate.replace( QLatin1String(
"%s" ), address.street() ).
41 replace( QLatin1String(
"%r" ), address.region() ).
42 replace( QLatin1String(
"%l" ), address.locality() ).
43 replace( QLatin1String(
"%z" ), address.postalCode() ).
44 replace( QLatin1String(
"%n" ), address.country() ).
45 replace( QLatin1String(
"%c" ), address.countryToISO( address.country() ) );
47 if ( !urlTemplate.isEmpty() ) {
48 KToolInvocation::invokeBrowser( urlTemplate );
51 QString commandTemplate = ContactActionsSettings::self()->addressCommand();
53 commandTemplate.replace( QLatin1String(
"%s" ), address.street() ).
54 replace( QLatin1String(
"%r" ), address.region() ).
55 replace( QLatin1String(
"%l" ), address.locality() ).
56 replace( QLatin1String(
"%z" ), address.postalCode() ).
57 replace( QLatin1String(
"%n" ), address.country() ).
58 replace( QLatin1String(
"%c" ), address.countryToISO( address.country() ) );
60 if ( !commandTemplate.isEmpty() ) {
61 KRun::runCommand( commandTemplate, 0 );
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:27:41 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.