calendarui/controller/src/calenactionuiutils.cpp
changeset 58 ef813d54df51
parent 26 a949c2543c15
equal deleted inserted replaced
50:579cc610882e 58:ef813d54df51
    30 #include "calendar.hrh"
    30 #include "calendar.hrh"
    31 #include "hb_calencommands.hrh"
    31 #include "hb_calencommands.hrh"
    32 #include "caleninstanceid.h"
    32 #include "caleninstanceid.h"
    33 #include "CleanupResetAndDestroy.h"
    33 #include "CleanupResetAndDestroy.h"
    34 #include "calendateutils.h"
    34 #include "calendateutils.h"
       
    35 #include "OstTraceDefinitions.h"
       
    36 #ifdef OST_TRACE_COMPILER_IN_USE
       
    37 #include "calenactionuiutilsTraces.h"
       
    38 #endif
    35 
    39 
    36 // -----------------------------------------------------------------------------
    40 // -----------------------------------------------------------------------------
    37 // CCalenCommonUI::FindPossibleInstanceL
    41 // CCalenCommonUI::FindPossibleInstanceL
    38 // Finds an instance with the given instance id and instance view.
    42 // Finds an instance with the given instance id and instance view.
    39 // (other items were commented in a header).
    43 // (other items were commented in a header).
    40 // -----------------------------------------------------------------------------
    44 // -----------------------------------------------------------------------------
    41 //
    45 //
    42 AgendaEntry CalenActionUiUtils::findPossibleInstanceL(const TCalenInstanceId& id,
    46 AgendaEntry CalenActionUiUtils::findPossibleInstanceL(const TCalenInstanceId& id,
    43                                                          AgendaUtil* agendaUtil )
    47                                                          AgendaUtil* agendaUtil )
    44     {
    48     {
    45     TRACE_ENTRY_POINT;
    49     OstTraceFunctionEntry0( CALENACTIONUIUTILS_FINDPOSSIBLEINSTANCEL_ENTRY );
    46     
    50     
    47     QList<AgendaEntry> instances = agendaUtil->createEntryIdListForDay(id.mInstanceTime,
    51     AgendaUtil::FilterFlags filter = 
    48                                                                        AgendaUtil::FilterFlags(AgendaUtil::IncludeAll));
    52     		AgendaUtil::FilterFlags(AgendaUtil::IncludeAnniversaries |
       
    53 									 AgendaUtil::IncludeAppointments | 
       
    54 									 AgendaUtil::IncludeEvents |
       
    55 									 AgendaUtil::IncludeReminders |
       
    56 									 AgendaUtil::IncludeIncompletedTodos);
       
    57     QList<AgendaEntry> instances = 
       
    58 				agendaUtil->createEntryIdListForDay(id.mInstanceTime, filter);
    49     AgendaEntry result;
    59     AgendaEntry result;
    50 
    60 
    51     // For instances finishing the next day (now possible with unified DateTime editor),
    61     // For instances finishing the next day (now possible with unified DateTime editor),
    52     // we have to do our best to match the instance time exactly - otherwise we could
    62     // we have to do our best to match the instance time exactly - otherwise we could
    53     // match the LocalUid to the incorrect instance in a series.
    63     // match the LocalUid to the incorrect instance in a series.
    76                 instances.removeAt(i);
    86                 instances.removeAt(i);
    77                 }
    87                 }
    78             }
    88             }
    79         }
    89         }
    80 
    90 
    81     TRACE_EXIT_POINT;
    91     OstTraceFunctionExit0( CALENACTIONUIUTILS_FINDPOSSIBLEINSTANCEL_EXIT );
    82     return result;
    92     return result;
    83     }
    93     }
    84 
    94 
    85 
    95 
    86 // ----------------------------------------------------------------------------
    96 // ----------------------------------------------------------------------------
    92 //
   102 //
    93 void CalenActionUiUtils::setToDoCompleteStatus( AgendaUtil* agendaUtil,
   103 void CalenActionUiUtils::setToDoCompleteStatus( AgendaUtil* agendaUtil,
    94                                                  AgendaEntry& entry,
   104                                                  AgendaEntry& entry,
    95                                                  const bool status )
   105                                                  const bool status )
    96     {
   106     {
    97     TRACE_ENTRY_POINT;
   107     OstTraceFunctionEntry0( CALENACTIONUIUTILS_SETTODOCOMPLETESTATUS_ENTRY );
    98 
   108     
    99     ASSERT( !entry.isNull() );
   109     ASSERT( !entry.isNull() );
   100     QDateTime now = QDateTime::currentDateTime();
   110     QDateTime now = QDateTime::currentDateTime();
   101 
   111 
   102     // set as completed or restore and update the entry in the database
   112     // set as completed or restore and update the entry in the database
   103     agendaUtil->setCompleted(entry, status, now)
   113     agendaUtil->setCompleted(entry, status, now);
   104 
   114 
   105     TRACE_EXIT_POINT;
   115     OstTraceFunctionExit0( CALENACTIONUIUTILS_SETTODOCOMPLETESTATUS_EXIT );
   106     }
   116     }
   107 
   117 
   108 // End of file
   118 // End of file