~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to korganizer/plugins/printing/journal/journalprint.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
  without including the source code for Qt in the source distribution.
23
23
*/
24
24
 
25
 
#ifndef KORG_NOPRINTER
26
 
 
27
25
#include "journalprint.h"
28
26
#include "calprintpluginbase.h"
29
27
 
 
28
#include <calendarsupport/utils.h>
 
29
 
30
30
#include <libkdepim/kdateedit.h>
31
31
 
32
 
#include <kcal/journal.h>
33
 
#include <kcal/calendar.h>
 
32
#include <kcalcore/journal.h>
 
33
 
 
34
#include <Akonadi/Item>
34
35
 
35
36
#include <kconfig.h>
36
37
#include <kdebug.h>
117
118
void CalPrintJournal::print( QPainter &p, int width, int height )
118
119
{
119
120
  int x=0, y=0;
120
 
  Journal::List journals( mCalendar->journals() );
 
121
  Akonadi::Item::List journals( mCalendar->journals() );
121
122
  if ( mUseDateRange ) {
122
 
    Journal::List allJournals = journals;
 
123
    Akonadi::Item::List allJournals = journals;
123
124
    journals.clear();
124
 
    Journal::List::Iterator it = allJournals.begin();
 
125
    Akonadi::Item::List::Iterator it = allJournals.begin();
125
126
    for ( ; it != allJournals.end(); ++it ) {
126
 
      QDate dt = (*it)->dtStart().date();
 
127
      KCalCore::Journal::Ptr j = CalendarSupport::journal( *it );
 
128
      const QDate dt = j->dtStart().date();
127
129
      if ( mFromDate <= dt && dt <= mToDate ) {
128
130
        journals.append( *it );
129
131
      }
130
132
    }
131
133
  }
132
134
 
133
 
  drawHeader( p, i18n( "Journal entries" ), QDate(), QDate(),
134
 
              QRect( 0, 0, width, headerHeight() ) );
 
135
  QRect headerBox( 0, 0, width, headerHeight() );
 
136
  QRect footerBox( 0, height - footerHeight(), width, footerHeight() );
 
137
  height -= footerHeight();
 
138
 
 
139
  drawHeader( p, i18n( "Journal entries" ), QDate(), QDate(), headerBox );
135
140
  y = headerHeight() + 15;
136
141
 
137
 
  Journal::List::Iterator it = journals.begin();
 
142
  Akonadi::Item::List::Iterator it = journals.begin();
138
143
  for ( ; it != journals.end(); ++it ) {
139
 
    drawJournal( *it, p, x, y, width, height );
 
144
    drawJournal( CalendarSupport::journal( *it ), p, x, y, width, height );
140
145
  }
 
146
 
 
147
  drawFooter( p, footerBox );
141
148
}
142
 
 
143
 
#endif