~ubuntu-branches/ubuntu/vivid/knemo/vivid

« back to all changes in this revision

Viewing changes to src/knemod/interfacestatistics.cpp

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2013-05-11 18:56:39 UTC
  • mfrom: (2.2.5 experimental)
  • Revision ID: package-import@ubuntu.com-20130511185639-br5lb3qjrxtec0zf
Tags: 0.7.6-2
* Upload to unstable.
* Use canonical Vcs-Svn URI.

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
        if ( loaded )
123
123
        {
124
124
            hoursToArchive( QDateTime::currentDateTime() );
125
 
            checkRebuild( mStorageData.calendar->calendarType(), true );
 
125
            checkRebuild( mStorageData.calendar->calendarSystem(), true );
126
126
        }
127
127
    }
128
128
 
129
129
    if ( !mStorageData.calendar )
130
130
    {
131
 
        mStorageData.calendar = KCalendarSystem::create( mInterface->settings().calendar );
 
131
        mStorageData.calendar = KCalendarSystem::create( mInterface->settings().calendarSystem );
132
132
        foreach( StatisticsModel * s, mModels )
133
133
        {
134
134
            s->setCalendar( mStorageData.calendar );
350
350
    mSaveTimer->stop();
351
351
    mWarnTimer->stop();
352
352
 
353
 
    QString origCalendarType;
 
353
    KLocale::CalendarSystem origCalendarSystem = KLocale::QDateCalendar;
354
354
    if ( mStorageData.calendar )
355
 
       origCalendarType = mStorageData.calendar->calendarType();
 
355
       origCalendarSystem = mStorageData.calendar->calendarSystem();
356
356
 
357
 
    if ( mInterface->settings().calendar != origCalendarType )
 
357
    if ( mInterface->settings().calendarSystem != origCalendarSystem )
358
358
    {
359
 
        mStorageData.calendar = KCalendarSystem::create( mInterface->settings().calendar );
 
359
        mStorageData.calendar = KCalendarSystem::create( mInterface->settings().calendarSystem );
360
360
 
361
361
        foreach( StatisticsModel * s, mModels )
362
362
        {
363
363
            s->setCalendar( mStorageData.calendar );
364
364
        }
365
 
        if ( !origCalendarType.isEmpty() )
 
365
        if ( mStorageData.calendar )
366
366
        {
367
367
            StatisticsModel *hours = mModels.value( KNemoStats::Hour );
368
368
            StatisticsModel *days = mModels.value( KNemoStats::Day );
377
377
        }
378
378
    }
379
379
 
380
 
    checkRebuild( origCalendarType );
 
380
    checkRebuild( origCalendarSystem );
381
381
 
382
382
    if ( generalSettings->saveInterval > 0 )
383
383
    {
818
818
    }
819
819
}
820
820
 
821
 
void InterfaceStatistics::checkRebuild( const QString &oldCalendar, bool force )
 
821
void InterfaceStatistics::checkRebuild( const KLocale::CalendarSystem oldCalendar, bool force )
822
822
{
823
823
    QList<StatsRule> newRules = mInterface->settings().statsRules;
824
824
    bool forceWeek = false;
825
825
 
826
 
    if ( oldCalendar != mInterface->settings().calendar )
 
826
    if ( oldCalendar != mInterface->settings().calendarSystem )
827
827
    {
828
828
        StatisticsModel *hours = mModels.value( KNemoStats::Hour );
829
829
        StatisticsModel *days = mModels.value( KNemoStats::Day );