~ubuntu-branches/ubuntu/vivid/kdepim/vivid

« back to all changes in this revision

Viewing changes to backupmail/backupmailkernel.cpp

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman, Jonathan Riddell, Rohan Garg, Scott Kitterman
  • Date: 2012-11-21 13:12:36 UTC
  • mfrom: (0.2.33)
  • Revision ID: package-import@ubuntu.com-20121121131236-32ijw9a2txrar80k
Tags: 4:4.9.80-0ubuntu1
[ Jonathan Riddell ]
* New upstream beta release

[ Rohan Garg ]
* Add nepomuk-core-dev to build-deps

[ Scott Kitterman ]
* Add new package, libpimcommon4
  - Add libpimcommon4.install
  - Add to debian/control, including kdepim-dbg and kdepim-dev depends
  - Add to kdepim-dev.install
* Remove usr/bin/backupmail and related files from kmail.install as they are
  not provided by upstream anymore
* Add usr/bin/pimsettingexporter and related files to kmail.install
* Add libnepomukwidgets-dev to build-depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
  Copyright (c) 2012 Montel Laurent <montel@kde.org>
3
 
 
4
 
  This program is free software; you can redistribute it and/or modify it
5
 
  under the terms of the GNU General Public License, version 2, as
6
 
  published by the Free Software Foundation.
7
 
 
8
 
  This program is distributed in the hope that it will be useful, but
9
 
  WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11
 
  General Public License for more details.
12
 
 
13
 
  You should have received a copy of the GNU General Public License along
14
 
  with this program; if not, write to the Free Software Foundation, Inc.,
15
 
  51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
16
 
*/
17
 
 
18
 
#include "backupmailkernel.h"
19
 
 
20
 
#include <kglobal.h>
21
 
#include <kpimidentities/identitymanager.h>
22
 
#include <messagecomposer/akonadisender.h>
23
 
#include <mailcommon/foldercollectionmonitor.h>
24
 
#include <akonadi/session.h>
25
 
#include <akonadi/entitytreemodel.h>
26
 
#include <akonadi/entitymimetypefiltermodel.h>
27
 
#include <akonadi/changerecorder.h>
28
 
 
29
 
BackupMailKernel::BackupMailKernel( QObject *parent )
30
 
  : QObject( parent )
31
 
{
32
 
  mMessageSender = new AkonadiSender( this );
33
 
  mIdentityManager = new KPIMIdentities::IdentityManager( false, this );
34
 
  mFolderCollectionMonitor = new MailCommon::FolderCollectionMonitor( this );
35
 
 
36
 
  Akonadi::Session *session = new Akonadi::Session( "Backup Mail Kernel ETM", this );
37
 
  folderCollectionMonitor()->setSession( session );
38
 
  mEntityTreeModel = new Akonadi::EntityTreeModel( folderCollectionMonitor(), this );
39
 
  mEntityTreeModel->setIncludeUnsubscribed( false );
40
 
  mEntityTreeModel->setItemPopulationStrategy( Akonadi::EntityTreeModel::LazyPopulation );
41
 
 
42
 
  mCollectionModel = new Akonadi::EntityMimeTypeFilterModel( this );
43
 
  mCollectionModel->setSourceModel( mEntityTreeModel );
44
 
  mCollectionModel->addMimeTypeInclusionFilter( Akonadi::Collection::mimeType() );
45
 
  mCollectionModel->setHeaderGroup( Akonadi::EntityTreeModel::CollectionTreeHeaders );
46
 
  mCollectionModel->setDynamicSortFilter( true );
47
 
  mCollectionModel->setSortCaseSensitivity( Qt::CaseInsensitive );
48
 
}
49
 
 
50
 
KPIMIdentities::IdentityManager *BackupMailKernel::identityManager()
51
 
{
52
 
  return mIdentityManager;
53
 
}
54
 
 
55
 
MessageSender *BackupMailKernel::msgSender()
56
 
{
57
 
  return mMessageSender;
58
 
}
59
 
 
60
 
Akonadi::EntityMimeTypeFilterModel *BackupMailKernel::collectionModel() const
61
 
{
62
 
  return mCollectionModel;
63
 
}
64
 
 
65
 
KSharedConfig::Ptr BackupMailKernel::config()
66
 
{
67
 
  return KGlobal::config();
68
 
}
69
 
 
70
 
void BackupMailKernel::syncConfig()
71
 
{
72
 
  Q_ASSERT( false );
73
 
}
74
 
 
75
 
MailCommon::JobScheduler* BackupMailKernel::jobScheduler() const
76
 
{
77
 
  Q_ASSERT( false );
78
 
  return 0;
79
 
}
80
 
 
81
 
Akonadi::ChangeRecorder *BackupMailKernel::folderCollectionMonitor() const
82
 
{
83
 
  return mFolderCollectionMonitor->monitor();
84
 
}
85
 
 
86
 
void BackupMailKernel::updateSystemTray()
87
 
{
88
 
  Q_ASSERT( false );
89
 
}
90
 
 
91
 
bool BackupMailKernel::showPopupAfterDnD()
92
 
{
93
 
  return false;
94
 
}
95
 
 
96
 
qreal BackupMailKernel::closeToQuotaThreshold()
97
 
{
98
 
  return 80;
99
 
}
100
 
 
101
 
QStringList BackupMailKernel::customTemplates()
102
 
{
103
 
  Q_ASSERT( false );
104
 
  return QStringList();
105
 
}
106
 
 
107
 
bool BackupMailKernel::excludeImportantMailFromExpiry()
108
 
{
109
 
  Q_ASSERT( false );
110
 
  return true;
111
 
}
112
 
 
113
 
Akonadi::Entity::Id BackupMailKernel::lastSelectedFolder()
114
 
{
115
 
  Q_ASSERT( false );
116
 
  return Akonadi::Entity::Id();
117
 
}
118
 
 
119
 
void BackupMailKernel::setLastSelectedFolder(const Akonadi::Entity::Id& col)
120
 
{
121
 
  Q_UNUSED(col);
122
 
}
123
 
 
124
 
 
125
 
 
126