~blue-shell/kdepim-runtime/kde-accounts-4.10

« back to all changes in this revision

Viewing changes to resources/facebook/facebookresource_notes.cpp

  • Committer: Àlex Fiestas
  • Date: 2013-03-28 11:01:50 UTC
  • Revision ID: git-v1:38995d4cfb18d2c78b0410746628eeea32836349
Merge with master facebook resource

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright 2010, 2011 Thomas McGuire <mcguire@kde.org>
2
 
   Copyright 2011 Roeland Jago Douma <unix@rullzer.com>
3
 
 
4
 
   This library is free software; you can redistribute it and/or modify
5
 
   it under the terms of the GNU Library General Public License as published
6
 
   by the Free Software Foundation; either version 2 of the License or
7
 
   ( at your option ) version 3 or, at the discretion of KDE e.V.
8
 
   ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version.
9
 
 
10
 
   This library is distributed in the hope that it will be useful,
11
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 
   Library General Public License for more details.
14
 
 
15
 
   You should have received a copy of the GNU Library General Public License
16
 
   along with this library; see the file COPYING.LIB.  If not, write to
17
 
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
 
   Boston, MA 02110-1301, USA.
 
1
/*
 
2
  Copyright 2010, 2011 Thomas McGuire <mcguire@kde.org>
 
3
  Copyright 2011 Roeland Jago Douma <unix@rullzer.com>
 
4
 
 
5
  This library is free software; you can redistribute it and/or modify
 
6
  it under the terms of the GNU Library General Public License as published
 
7
  by the Free Software Foundation; either version 2 of the License or
 
8
  ( at your option ) version 3 or, at the discretion of KDE e.V.
 
9
  ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version.
 
10
 
 
11
  This library is distributed in the hope that it will be useful,
 
12
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
  Library General Public License for more details.
 
15
 
 
16
  You should have received a copy of the GNU Library General Public License
 
17
  along with this library; see the file COPYING.LIB.  If not, write to
 
18
  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
19
  Boston, MA 02110-1301, USA.
19
20
*/
 
21
 
20
22
#include "facebookresource.h"
21
23
#include "settings.h"
22
24
#include "settingsdialog.h"
30
32
#include <Akonadi/EntityDisplayAttribute>
31
33
#include <Akonadi/ItemFetchJob>
32
34
#include <Akonadi/ItemFetchScope>
33
 
#include <akonadi/changerecorder.h>
 
35
#include <Akonadi/ChangeRecorder>
34
36
 
35
37
using namespace Akonadi;
36
38
 
48
50
    setItemStreamingEnabled( true );
49
51
 
50
52
    Item::List noteItems;
51
 
    foreach( const KFbAPI::NoteInfo &noteInfo, listJob->allNotes() ) {
 
53
    foreach ( const KFbAPI::NoteInfo &noteInfo, listJob->allNotes() ) {
52
54
      Item note;
53
55
      note.setRemoteId( noteInfo.id() );
54
56
      note.setPayload<KMime::Message::Ptr>( noteInfo.asNote() );
82
84
  mCurrentJobs.removeAll( job );
83
85
 
84
86
  if ( noteJob->error() ) {
85
 
    abortWithError( i18n( "Unable to get information about note from server: %1", noteJob->errorText() ) );
 
87
    abortWithError( i18n( "Unable to get information about note from server: %1",
 
88
                          noteJob->errorText() ) );
86
89
  } else {
87
90
    Item note = noteJob->property( "Item" ).value<Item>();
88
91
    note.setPayload( noteJob->noteInfo().first().asNote() );