diff -r dcf0eedfc1a3 -r d189ee25cf9d ipsservices/ipssosaoplugin/src/IpsSosAOSchedulerUtils.cpp
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOSchedulerUtils.cpp Thu Aug 19 09:38:05 2010 +0300
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOSchedulerUtils.cpp Tue Aug 31 15:04:17 2010 +0300
@@ -16,12 +16,7 @@
*
*/
-
-#include "emailtrace.h"
-#include "IpsSosAOSchedulerUtils.h"
-#include "ipssetdataextension.h"
-
-
+#include "ipssosaopluginheaders.h"
const TInt KAOSecondsIn24Hours = 86400;
//const TUint KAOEveryDayMask = 0x7f;
@@ -30,9 +25,10 @@
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
//
-CIpsSosAOSchedulerUtils::CIpsSosAOSchedulerUtils(
- const CIpsSetDataExtension& aExtentedSettings )
- : iExtentedSettings( aExtentedSettings )
+//
+CIpsSosAOSchedulerUtils::CIpsSosAOSchedulerUtils( CIpsSosAOSettingsHandler& aSettings ):
+ iSettings(aSettings)
+//
{
FUNC_LOG;
}
@@ -56,11 +52,14 @@
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
//
-CIpsSosAOSchedulerUtils* CIpsSosAOSchedulerUtils::NewL(
- const CIpsSetDataExtension& aExtentedSettings )
+//
+CIpsSosAOSchedulerUtils* CIpsSosAOSchedulerUtils::NewL(CIpsSosAOSettingsHandler& aSettings)
+//
{
FUNC_LOG;
- CIpsSosAOSchedulerUtils* self = NewLC( aExtentedSettings );
+ //
+ CIpsSosAOSchedulerUtils* self = NewLC(aSettings);
+ //
CleanupStack::Pop( self );
return self;
@@ -69,12 +68,15 @@
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
//
-CIpsSosAOSchedulerUtils* CIpsSosAOSchedulerUtils::NewLC(
- const CIpsSetDataExtension& aExtentedSettings )
+//
+CIpsSosAOSchedulerUtils* CIpsSosAOSchedulerUtils::NewLC(CIpsSosAOSettingsHandler& aSettings)
+//
{
FUNC_LOG;
CIpsSosAOSchedulerUtils* self =
- new ( ELeave ) CIpsSosAOSchedulerUtils( aExtentedSettings );
+ //
+ new ( ELeave ) CIpsSosAOSchedulerUtils(aSettings);
+ //
CleanupStack::PushL( self );
self->ConstructL();
@@ -220,8 +222,7 @@
TDay currentDay = aClock.DayNoInWeek();
TDay previousDay = GetPrevDay( currentDay );
TIpsSosAOValidConnectionDay result;
-
-
+
// Connection can be made anyday
if ( IsDaySelected( currentDay ) && IsDaySelected( previousDay ) )
{
@@ -242,17 +243,19 @@
result = EAOVCDConnectionPreviousDayOnly;
}
// no selected days this is wron in settings side but still return anyday
- else if ( iExtentedSettings.SelectedWeekDays() == 0 )
+ //
+ else if ( iSettings.SelectedWeekDays() == 0 )
{
result = EAOVCDConnectionAnyDay;
}
+ //
// Connection is not allowed
else
{
result = EAOVCDNoConnection;
}
-
+
return result;
}
@@ -382,8 +385,10 @@
TTime zeroTime( 0 );
TTime adjustedHomeTime = AdjustHomeTime( aClock );
- TTime selectedTimeStart = iExtentedSettings.SelectedTimeStart();
- TTime selectedTimeStop = iExtentedSettings.SelectedTimeStop();
+ //
+ TTime selectedTimeStart = iSettings.SelectedTimeStart();
+ TTime selectedTimeStop = iSettings.SelectedTimeStop();
+ //
adjustedHomeTime.SecondsFrom( zeroTime, aHome );
selectedTimeStart.SecondsFrom( zeroTime, aStart );
selectedTimeStop.SecondsFrom( zeroTime, aStop );
@@ -496,6 +501,7 @@
// ----------------------------------------------------------------------------
//
TTimeIntervalSeconds CIpsSosAOSchedulerUtils::CalcSecsToNextScheduledDay(
+//
const TTime& aClock,
const TTimeIntervalSeconds& aHome,
const TBool aScheduledDay )
@@ -506,16 +512,14 @@
// First check if all of the days are unchecked, which should not happen
// at all, but just in case
- if ( !iExtentedSettings.SelectedWeekDays() )
+
+ if ( !iSettings.SelectedWeekDays() )
{
- // Temporarly set all the days selected
return seconds;
- /* __ASSERT_DEBUG( (
- EFalse ),
- User::Panic( _L("AO"), KErrGeneral) );*/
}
TBool hit = EFalse;
+
TDay today = aClock.DayNoInWeek();
TDay dayAfter = GetNextDay( today );
TInt dayCount = KErrNotFound;
@@ -531,17 +535,19 @@
seconds = KAOSecondsIn24Hours - aHome.Int() +
dayCount * KAOSecondsIn24Hours;
-
+ //
return seconds;
}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
//
+//
TBool CIpsSosAOSchedulerUtils::IsDaySelected( const TUint aDay ) const
{
FUNC_LOG;
- return ( iExtentedSettings.SelectedWeekDays() >> aDay ) & 0x01;
+ return ( iSettings.SelectedWeekDays() >> aDay ) & 0x01;
+ //
}
// End of File