• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

akonadi/contact

  • sources
  • kde-4.14
  • kdepimlibs
  • akonadi
  • contact
recentcontactscollectionrequestjob.cpp
1 /*
2  This file is part of Akonadi Contact.
3 
4  Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
5 
6  This library is free software; you can redistribute it and/or modify it
7  under the terms of the GNU Library General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or (at your
9  option) any later version.
10 
11  This library is distributed in the hope that it will be useful, but WITHOUT
12  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14  License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to the
18  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  02110-1301, USA.
20 */
21 
22 #include "recentcontactscollectionrequestjob.h"
23 
24 #include "recentcontactscollections_p.h"
25 
26 #include <kglobal.h>
27 #include <klocalizedstring.h>
28 #include <kstandarddirs.h>
29 
30 using namespace Akonadi;
31 
32 #ifndef KDE_USE_FINAL
33 static const QByteArray sRecentContactsType = "recent-contacts";
34 #endif
35 
36 RecentContactsCollectionRequestJob::RecentContactsCollectionRequestJob( QObject *parent )
37  : SpecialCollectionsRequestJob( RecentContactsCollections::self(), parent ),
38  d( 0 )
39 {
40  static QMap<QByteArray, QString> displayNameMap;
41  displayNameMap.insert( "recent-contacts", i18nc( "recent contacts folder", "Recent Contacts" ) );
42 
43  static QMap<QByteArray, QString> iconNameMap;
44  iconNameMap.insert( "recent-contacts", QLatin1String( "folder" ) );
45 
46  QVariantMap options;
47  options.insert( QLatin1String( "Name" ), displayNameMap.value( "recent-contacts" ) );
48  options.insert( QLatin1String( "Path" ), QString( KGlobal::dirs()->localxdgdatadir() + QLatin1String( "recent-contacts" ) ) );
49 
50  setDefaultResourceType( QLatin1String( "akonadi_contacts_resource" ) );
51  setDefaultResourceOptions( options );
52 
53  setTypes( displayNameMap.keys() );
54  setNameForTypeMap( displayNameMap );
55  setIconForTypeMap( iconNameMap );
56 }
57 
58 RecentContactsCollectionRequestJob::~RecentContactsCollectionRequestJob()
59 {
60 }
61 
62 void RecentContactsCollectionRequestJob::requestDefaultCollection()
63 {
64  SpecialCollectionsRequestJob::requestDefaultCollection( sRecentContactsType );
65 }
66 
67 void RecentContactsCollectionRequestJob::requestCollection( const AgentInstance &instance )
68 {
69  SpecialCollectionsRequestJob::requestCollection( sRecentContactsType, instance );
70 }
71 
Akonadi::RecentContactsCollections
Definition: recentcontactscollections_p.h:39
QByteArray
QMap
QMap::keys
QList< Key > keys() const
Akonadi::RecentContactsCollectionRequestJob::RecentContactsCollectionRequestJob
RecentContactsCollectionRequestJob(QObject *parent=0)
Creates a new recent contacts collection request job.
Definition: recentcontactscollectionrequestjob.cpp:36
QObject
QString
Akonadi::RecentContactsCollectionRequestJob::requestCollection
void requestCollection(const AgentInstance &instance)
Requests the recent contacts collection in the given resource instance.
Definition: recentcontactscollectionrequestjob.cpp:67
Akonadi::RecentContactsCollectionRequestJob::~RecentContactsCollectionRequestJob
~RecentContactsCollectionRequestJob()
Destroys the recent contacts collection request job.
Definition: recentcontactscollectionrequestjob.cpp:58
QLatin1String
QMap::insert
iterator insert(const Key &key, const T &value)
Akonadi::RecentContactsCollectionRequestJob::requestDefaultCollection
void requestDefaultCollection()
Requests the recent contacts collection in the default resource.
Definition: recentcontactscollectionrequestjob.cpp:62
QMap::value
const T value(const Key &key) const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi/contact

Skip menu "akonadi/contact"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal