Commit fdc643d5 authored by Tobias Koenig's avatar Tobias Koenig
Browse files

Namespace cleanup, changed PIM to Akonadi in libakonadi

svn path=/trunk/KDE/kdepim/akonadi/; revision=589291
parent c289483f
......@@ -21,7 +21,7 @@
#include "deletecommand.h"
#include <libakonadi/itemdeletejob.h>
using namespace PIM;
using namespace Akonadi;
DeleteCommand::DeleteCommand(const QString & uid) :
mUid( uid )
......
......@@ -22,7 +22,7 @@
#include <libakonadi/itemfetchjob.h>
using namespace PIM;
using namespace Akonadi;
FetchCommand::FetchCommand(const QString & uid) :
mUid( uid )
......
......@@ -36,26 +36,26 @@ ListCommand::ListCommand( const QString &path )
void ListCommand::exec()
{
PIM::CollectionListJob collectionJob( mPath.toUtf8() );
Akonadi::CollectionListJob collectionJob( mPath.toUtf8() );
if ( !collectionJob.exec() ) {
err() << "Error listing collection '" << mPath << "': "
<< collectionJob.errorText()
<< endl;
return;
} else {
foreach( PIM::Collection *collection, collectionJob.collections() ) {
foreach( Akonadi::Collection *collection, collectionJob.collections() ) {
out() << collection->name() << endl;
}
}
if ( mPath.indexOf( "/", 1 ) > 0 ) {
PIM::ItemFetchJob itemFetchJob( mPath.toUtf8() );
Akonadi::ItemFetchJob itemFetchJob( mPath.toUtf8() );
if ( !itemFetchJob.exec() ) {
err() << "Error listing items at '" << mPath << "': "
<< itemFetchJob.errorText()
<< endl;
} else {
foreach( PIM::Item *item, itemFetchJob.items() ) {
foreach( Akonadi::Item *item, itemFetchJob.items() ) {
QString str;
str = "Item: " + item->reference().persistanceID();
if ( !item->reference().externalUrl().isEmpty() ) {
......@@ -74,13 +74,13 @@ void ListCommand::exec()
}
#if 0
PIM::MessageFetchJob messageJob( mPath.toUtf8() );
Akonadi::MessageFetchJob messageJob( mPath.toUtf8() );
if ( !messageJob.exec() ) {
err() << "Error listing messages at '" << mPath << "': "
<< messageJob.errorText()
<< endl;
} else {
foreach( PIM::Message *m, messageJob.messages() ) {
foreach( Akonadi::Message *m, messageJob.messages() ) {
KMime::Message *message = m->mime();
out() << "Subject: " << message->subject()->asUnicodeString() << endl;
}
......
......@@ -39,7 +39,7 @@ class Dialog : public QDialog
{
QVBoxLayout *layout = new QVBoxLayout( this );
mView = new PIM::AgentTypeView( this );
mView = new Akonadi::AgentTypeView( this );
QDialogButtonBox *box = new QDialogButtonBox( this );
......@@ -71,18 +71,18 @@ class Dialog : public QDialog
}
private:
PIM::AgentTypeView *mView;
Akonadi::AgentTypeView *mView;
QString mAgentType;
};
AgentWidget::AgentWidget( QWidget *parent )
: QWidget( parent )
{
mManager = new PIM::AgentManager( this );
mManager = new Akonadi::AgentManager( this );
QGridLayout *layout = new QGridLayout( this );
mView = new PIM::AgentInstanceView( this );
mView = new Akonadi::AgentInstanceView( this );
layout->addWidget( mView, 0, 0, 1, 5 );
......
......@@ -24,7 +24,7 @@
#include <QtGui/QWidget>
namespace PIM {
namespace Akonadi {
class AgentInstanceView;
class AgentManager;
}
......@@ -43,8 +43,8 @@ class AgentWidget : public QWidget
void synchronizeAgent();
private:
PIM::AgentInstanceView *mView;
PIM::AgentManager *mManager;
Akonadi::AgentInstanceView *mView;
Akonadi::AgentManager *mManager;
};
#endif
......@@ -31,10 +31,10 @@ CollectionWidget::CollectionWidget( QWidget *parent )
{
QVBoxLayout *layout = new QVBoxLayout( this );
mView = new PIM::CollectionView();
mView = new Akonadi::CollectionView();
layout->addWidget( mView );
mModel = new PIM::MessageCollectionModel( this );
mModel = new Akonadi::MessageCollectionModel( this );
mView->setModel( mModel );
}
......
......@@ -24,7 +24,7 @@
#include <QtGui/QWidget>
namespace PIM {
namespace Akonadi {
class CollectionView;
class MessageCollectionModel;
}
......@@ -37,8 +37,8 @@ class CollectionWidget : public QWidget
CollectionWidget( QWidget *parent = 0 );
private:
PIM::MessageCollectionModel *mModel;
PIM::CollectionView *mView;
Akonadi::MessageCollectionModel *mModel;
Akonadi::CollectionView *mView;
};
#endif
......@@ -39,7 +39,7 @@ class Dialog : public QDialog
{
QVBoxLayout *layout = new QVBoxLayout( this );
mView = new PIM::AgentInstanceView( this );
mView = new Akonadi::AgentInstanceView( this );
QDialogButtonBox *box = new QDialogButtonBox( this );
......@@ -71,18 +71,18 @@ class Dialog : public QDialog
}
private:
PIM::AgentInstanceView *mView;
Akonadi::AgentInstanceView *mView;
QString mAgentInstance;
};
ProfileWidget::ProfileWidget( QWidget *parent )
: QWidget( parent )
{
mManager = new PIM::ProfileManager( this );
mManager = new Akonadi::ProfileManager( this );
QGridLayout *layout = new QGridLayout( this );
mView = new PIM::ProfileView( this );
mView = new Akonadi::ProfileView( this );
layout->addWidget( mView, 0, 0, 1, 5 );
......
......@@ -24,7 +24,7 @@
#include <QtGui/QWidget>
namespace PIM {
namespace Akonadi {
class ProfileView;
class ProfileManager;
}
......@@ -43,8 +43,8 @@ class ProfileWidget : public QWidget
void removeAgentInstance();
private:
PIM::ProfileView *mView;
PIM::ProfileManager *mManager;
Akonadi::ProfileView *mView;
Akonadi::ProfileManager *mManager;
};
#endif
......@@ -170,7 +170,7 @@ void DataProvider::saveFile()
void DataProvider::loadAkonadi()
{
if ( mAgendaModel ) {
PIM::MessageFetchJob job( "res2/foo2" );
Akonadi::MessageFetchJob job( "res2/foo2" );
if ( !job.exec() ) {
KMessageBox::error( 0, "Error fetching messages" );
} else {
......@@ -182,7 +182,7 @@ void DataProvider::loadAkonadi()
void DataProvider::saveAkonadi()
{
if ( mAgendaModel ) {
// PIM::JobQueue jobQueue( this );
// Akonadi::JobQueue jobQueue( this );
KCal::ICalFormat format;
foreach( Event e, mAgendaModel->events() ) {
KCal::Event *event = new KCal::Event();
......@@ -191,7 +191,7 @@ void DataProvider::saveAkonadi()
event->setDtEnd( e.end );
event->setFloats( false );
QString ical = format.toICalString( event );
PIM::ItemAppendJob *job = new PIM::ItemAppendJob( "res2/foo2", ical.toUtf8(),
Akonadi::ItemAppendJob *job = new Akonadi::ItemAppendJob( "res2/foo2", ical.toUtf8(),
"text/calendar", this );
if ( !job->exec() ) {
KMessageBox::error( 0, i18n("Error") );
......
......@@ -25,7 +25,7 @@
#include "agentinstancemodel.h"
#include "agentmanager.h"
using namespace PIM;
using namespace Akonadi;
class AgentInstanceInfo
{
......
......@@ -22,7 +22,7 @@
#include <QtCore/QAbstractItemModel>
namespace PIM {
namespace Akonadi {
class AgentInstanceModel : public QAbstractItemModel
{
......
......@@ -24,7 +24,7 @@
#include "agentmanager.h"
#include "agentmanagerinterface.h"
using namespace PIM;
using namespace Akonadi;
class AgentManager::Private
{
......
......@@ -17,14 +17,14 @@
02110-1301, USA.
*/
#ifndef PIM_AGENTMANAGER_H
#define PIM_AGENTMANAGER_H
#ifndef AKONADI_AGENTMANAGER_H
#define AKONADI_AGENTMANAGER_H
#include <QtCore/QObject>
class QIcon;
namespace PIM {
namespace Akonadi {
class AgentManager : public QObject
{
......
......@@ -23,7 +23,7 @@
#include "agenttypemodel.h"
#include "agentmanager.h"
using namespace PIM;
using namespace Akonadi;
class AgentTypeInfo
{
......
......@@ -22,7 +22,7 @@
#include <QtCore/QAbstractItemModel>
namespace PIM {
namespace Akonadi {
/**
* This class provides a model for available agent types.
......
......@@ -23,7 +23,7 @@
#include <QtCore/QString>
#include <QtCore/QStringList>
using namespace PIM;
using namespace Akonadi;
class Collection::Private
{
......@@ -35,26 +35,26 @@ class Collection::Private
QHash<QByteArray, CollectionAttribute*> attributes;
};
PIM::Collection::Collection( const QString &path ) :
Collection::Collection( const QString &path ) :
d( new Collection::Private() )
{
d->path = path;
d->type = Unknown;
}
PIM::Collection::~Collection( )
Collection::~Collection( )
{
qDeleteAll( d->attributes );
delete d;
d = 0;
}
QString PIM::Collection::path() const
QString Collection::path() const
{
return d->path;
}
QString PIM::Collection::name( ) const
QString Collection::name( ) const
{
if ( d->name.isEmpty() && d->path != root() ) {
QString name = d->path.mid( d->path.lastIndexOf( delimiter() ) + 1 );
......@@ -63,22 +63,22 @@ QString PIM::Collection::name( ) const
return d->name;
}
void PIM::Collection::setName( const QString & name )
void Collection::setName( const QString & name )
{
d->name = name;
}
Collection::Type PIM::Collection::type() const
Collection::Type Collection::type() const
{
return d->type;
}
void PIM::Collection::setType( Type type )
void Collection::setType( Type type )
{
d->type = type;
}
QList<QByteArray> PIM::Collection::contentTypes() const
QList<QByteArray> Collection::contentTypes() const
{
CollectionContentTypeAttribute *attr = const_cast<Collection*>( this )->attribute<CollectionContentTypeAttribute>();
if ( attr )
......@@ -86,62 +86,62 @@ QList<QByteArray> PIM::Collection::contentTypes() const
return QList<QByteArray>();
}
void PIM::Collection::setContentTypes( const QList<QByteArray> & types )
void Collection::setContentTypes( const QList<QByteArray> & types )
{
CollectionContentTypeAttribute* attr = attribute<CollectionContentTypeAttribute>( true );
attr->setContentTypes( types );
}
QString PIM::Collection::parent( ) const
QString Collection::parent( ) const
{
return d->parent;
}
void PIM::Collection::setParent( const QString &parent )
void Collection::setParent( const QString &parent )
{
d->parent = parent;
}
QString PIM::Collection::delimiter()
QString Collection::delimiter()
{
return QLatin1String( "/" );
}
QString PIM::Collection::root( )
QString Collection::root( )
{
return QString();
}
QString PIM::Collection::searchFolder( )
QString Collection::searchFolder( )
{
return root() + QLatin1String( "Search" );
}
QString PIM::Collection::prefix()
QString Collection::prefix()
{
return QLatin1String( "/" );
}
QByteArray PIM::Collection::collectionMimeType( )
QByteArray Collection::collectionMimeType( )
{
return QByteArray( "inode/directory" );
}
void PIM::Collection::addAttribute( CollectionAttribute * attr )
void Collection::addAttribute( CollectionAttribute * attr )
{
if ( d->attributes.contains( attr->type() ) )
delete d->attributes.take( attr->type() );
d->attributes.insert( attr->type(), attr );
}
CollectionAttribute * PIM::Collection::attribute( const QByteArray & type ) const
CollectionAttribute * Collection::attribute( const QByteArray & type ) const
{
if ( d->attributes.contains( type ) )
return d->attributes.value( type );
return 0;
}
bool PIM::Collection::hasAttribute( const QByteArray & type ) const
bool Collection::hasAttribute( const QByteArray & type ) const
{
return d->attributes.contains( type );
}
......@@ -17,14 +17,14 @@
02110-1301, USA.
*/
#ifndef PIM_COLLECTION_H
#define PIM_COLLECTION_H
#ifndef AKONADI_COLLECTION_H
#define AKONADI_COLLECTION_H
#include <libakonadi/collectionattribute.h>
#include <libakonadi/job.h>
#include <kdepim_export.h>
namespace PIM {
namespace Akonadi {
/**
This class represents a collection of PIM objects, such as a folder on a mail- or
......
......@@ -19,28 +19,28 @@
#include "collectionattribute.h"
using namespace PIM;
using namespace Akonadi;
PIM::CollectionAttribute::~ CollectionAttribute( )
CollectionAttribute::~ CollectionAttribute( )
{
}
PIM::CollectionContentTypeAttribute::CollectionContentTypeAttribute( const QList< QByteArray > & contentTypes )
CollectionContentTypeAttribute::CollectionContentTypeAttribute( const QList< QByteArray > & contentTypes )
{
mContentTypes = contentTypes;
}
QByteArray PIM::CollectionContentTypeAttribute::type() const
QByteArray CollectionContentTypeAttribute::type() const
{
return QByteArray( "ContentTypes" );
}
QList< QByteArray > PIM::CollectionContentTypeAttribute::contentTypes( ) const
QList< QByteArray > CollectionContentTypeAttribute::contentTypes( ) const
{
return mContentTypes;
}
void PIM::CollectionContentTypeAttribute::setContentTypes( const QList< QByteArray > & contentTypes )
void CollectionContentTypeAttribute::setContentTypes( const QList< QByteArray > & contentTypes )
{
mContentTypes = contentTypes;
}
......@@ -17,13 +17,13 @@
02110-1301, USA.
*/
#ifndef PIM_COLLECTIONATTRIBUTE_H
#define PIM_COLLECTIONATTRIBUTE_H
#ifndef AKONADI_COLLECTIONATTRIBUTE_H
#define AKONADI_COLLECTIONATTRIBUTE_H
#include <QtCore/QByteArray>
#include <QtCore/QList>
namespace PIM {
namespace Akonadi {
/**
Stores specific collection attributes (ACLs, unread counts, quotas, etc.).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment