00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "itemmonitor.h"
00021 #include "itemmonitor_p.h"
00022
00023 #include "itemfetchscope.h"
00024
00025 #include <QtCore/QStringList>
00026
00027 using namespace Akonadi;
00028
00029 ItemMonitor::ItemMonitor()
00030 : d( new Private( this ) )
00031 {
00032 }
00033
00034 ItemMonitor::~ItemMonitor()
00035 {
00036 delete d;
00037 }
00038
00039 void ItemMonitor::setItem( const Item &item )
00040 {
00041 if ( item == d->mItem )
00042 return;
00043
00044 d->mMonitor->setItemMonitored( d->mItem, false );
00045
00046 d->mItem = item;
00047
00048 d->mMonitor->setItemMonitored( d->mItem, true );
00049
00050
00051 ItemFetchJob* job = new ItemFetchJob( d->mItem );
00052 job->setFetchScope( fetchScope() );
00053
00054 d->connect( job, SIGNAL( result( KJob* ) ), d, SLOT( initialFetchDone( KJob* ) ) );
00055 }
00056
00057 Item ItemMonitor::item() const
00058 {
00059 return d->mItem;
00060 }
00061
00062 void ItemMonitor::itemChanged( const Item& )
00063 {
00064 }
00065
00066 void ItemMonitor::itemRemoved()
00067 {
00068 }
00069
00070 void ItemMonitor::setFetchScope( const ItemFetchScope &fetchScope )
00071 {
00072 d->mMonitor->setItemFetchScope( fetchScope );
00073 }
00074
00075 ItemFetchScope &ItemMonitor::fetchScope()
00076 {
00077 return d->mMonitor->itemFetchScope();
00078 }
00079
00080 #include "itemmonitor_p.moc"