~ubuntu-branches/ubuntu/trusty/kdepimlibs/trusty

« back to all changes in this revision

Viewing changes to akonadi/calendar/utils_p.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg, Rohan Garg, Philip Muškovac
  • Date: 2013-11-23 17:36:44 UTC
  • mfrom: (1.1.102)
  • Revision ID: package-import@ubuntu.com-20131123173644-p5ow94192ezsny8g
Tags: 4:4.11.80-0ubuntu1
[ Rohan Garg ]
* New upstream beta release
  - Bump akonadi requirement to 1.10.45
  - Update install files
  - Update symbols

[ Philip Muškovac ]
* kdepimlibs-dev/-dbg breaks/replaces kdepim-runtime/-dbg (<< 4:4.11.80)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <kmime/kmime_header_parsing.h>
26
26
 
27
27
#include <KEMailSettings>
 
28
#include <akonadi/collectiondialog.h>
 
29
 
 
30
#include <QWidget>
 
31
#include <QPointer>
28
32
 
29
33
using namespace Akonadi::CalendarUtils;
30
34
 
 
35
Akonadi::Collection
 
36
Akonadi::CalendarUtils::selectCollection( QWidget *parent,
 
37
                                          int &dialogCode,
 
38
                                          const QStringList &mimeTypes,
 
39
                                          const Akonadi::Collection &defaultCollection )
 
40
{
 
41
  QPointer<Akonadi::CollectionDialog> dlg( new Akonadi::CollectionDialog( parent ) );
 
42
 
 
43
  kDebug() << "selecting collections with mimeType in " << mimeTypes;
 
44
 
 
45
  dlg->changeCollectionDialogOptions( Akonadi::CollectionDialog::KeepTreeExpanded );
 
46
  dlg->setMimeTypeFilter( mimeTypes );
 
47
  dlg->setAccessRightsFilter( Akonadi::Collection::CanCreateItem );
 
48
  if ( defaultCollection.isValid() ) {
 
49
    dlg->setDefaultCollection( defaultCollection );
 
50
  }
 
51
  Akonadi::Collection collection;
 
52
 
 
53
  // FIXME: don't use exec.
 
54
  dialogCode = dlg->exec();
 
55
  if ( dialogCode == QDialog::Accepted ) {
 
56
    collection = dlg->selectedCollection();
 
57
 
 
58
    if ( !collection.isValid() ) {
 
59
      kWarning() <<"An invalid collection was selected!";
 
60
    }
 
61
  }
 
62
  delete dlg;
 
63
 
 
64
  return collection;
 
65
}
 
66
 
31
67
QString Akonadi::CalendarUtils::fullName()
32
68
{
33
69
  KEMailSettings settings;