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

akonadi

  • Akonadi
  • PartFetcher
Public Member Functions | List of all members
Akonadi::PartFetcher Class Reference

#include <partfetcher.h>

Inherits KJob.

Public Member Functions

 PartFetcher (const QModelIndex &index, const QByteArray &partName, QObject *parent=0)
 
virtual ~PartFetcher ()
 
QModelIndex index () const
 
Item item () const
 
QByteArray partName () const
 
virtual void start ()
 

Detailed Description

Convenience class for getting payload parts from an Akonadi Model.

This class can be used to retrieve individual payload parts from an EntityTreeModel, and fetch them asynchronously from the Akonadi storage if necessary.

The requested part is emitted though the partFetched signal.

Example:

const QModelIndex index = view->selectionModel()->currentIndex();
PartFetcher *fetcher = new PartFetcher( index, Akonadi::MessagePart::Envelope );
connect( fetcher, SIGNAL(result(KJob*)), SLOT(fetchResult(KJob*)) );
fetcher->start();
...
MyClass::fetchResult( KJob *job )
{
if ( job->error() ) {
qDebug() << job->errorText();
return;
}
PartFetcher *fetcher = qobject_cast<PartFetcher*>( job );
const Item item = fetcher->item();
// do something with the item
}
Akonadi::PartFetcher
Convenience class for getting payload parts from an Akonadi Model.
Definition partfetcher.h:74
Akonadi::PartFetcher::start
virtual void start()
Starts the fetch operation.
Definition partfetcher.cpp:116
Akonadi::PartFetcher::item
Item item() const
Returns the item that contains the fetched payload part.
Definition partfetcher.cpp:179
Akonadi::PartFetcher::PartFetcher
PartFetcher(const QModelIndex &index, const QByteArray &partName, QObject *parent=0)
Creates a new part fetcher.
Definition partfetcher.cpp:105
Akonadi::PartFetcher::index
QModelIndex index() const
Returns the index of the item the part was fetched from.
Definition partfetcher.cpp:165
Akonadi::MessagePart::Envelope
AKONADI_KMIME_EXPORT const char * Envelope
The part identifier for envelope parts.
Definition messageparts.cpp:23
Author
Stephen Kelly steve.nosp@m.ire@.nosp@m.gmail.nosp@m..com
Since
4.4

Definition at line 73 of file partfetcher.h.

Constructor & Destructor Documentation

◆ PartFetcher()

PartFetcher::PartFetcher ( const QModelIndex & index,
const QByteArray & partName,
QObject * parent = 0 )

Creates a new part fetcher.

Parameters
indexThe index of the item to fetch the part from.
partNameThe name of the payload part to fetch.
parentThe parent object.

Definition at line 105 of file partfetcher.cpp.

◆ ~PartFetcher()

PartFetcher::~PartFetcher ( )
virtual

Destroys the part fetcher.

Definition at line 111 of file partfetcher.cpp.

Member Function Documentation

◆ index()

QModelIndex PartFetcher::index ( ) const

Returns the index of the item the part was fetched from.

Definition at line 165 of file partfetcher.cpp.

◆ item()

Item PartFetcher::item ( ) const

Returns the item that contains the fetched payload part.

Definition at line 179 of file partfetcher.cpp.

◆ partName()

QByteArray PartFetcher::partName ( ) const

Returns the name of the part that has been fetched.

Definition at line 172 of file partfetcher.cpp.

◆ start()

void PartFetcher::start ( )
virtual

Starts the fetch operation.

Definition at line 116 of file partfetcher.cpp.


The documentation for this class was generated from the following files:
  • partfetcher.h
  • partfetcher.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

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

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 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
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