Brought up-to-date with latest changes in XPCOM and Timer interface

git-svn-id: svn://10.0.0.236/trunk@129087 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mostafah%oeone.com 2002-09-09 15:29:16 +00:00
parent 05b8c06de4
commit 2c949c891f
2 changed files with 25 additions and 27 deletions

View File

@ -34,29 +34,10 @@
*
* ***** END LICENSE BLOCK ***** */
//#ifndef WIN32
//#include <unistd.h>
//#endif
//#define __cplusplus__ 1
//#include <vector>
//#include "oeICalImpl.h"
//#include "oeICalEventImpl.h"
//#include "nsMemory.h"
//#include "stdlib.h"
//#include "nsCOMPtr.h"
//#include "nsISimpleEnumerator.h"
//#include "nsString.h"
//#include "nsIURL.h"
//#include "nsNetCID.h"
//#include "nsEscape.h"
#include "oeICalContainerImpl.h"
#include "nsISupportsArray.h"
#include "nsComponentManagerUtils.h"
//extern "C" {
// #include "icalss.h"
//}
icaltimetype ConvertFromPrtime( PRTime indate );
PRTime ConvertToPrtime ( icaltimetype indate );
@ -65,7 +46,7 @@ oeICalContainerImpl::oeICalContainerImpl()
#ifdef ICAL_DEBUG
printf( "oeICalContainerImpl::oeICalContainerImpl()\n" );
#endif
NS_INIT_REFCNT();
NS_INIT_ISUPPORTS();
m_batchMode = false;

View File

@ -53,7 +53,8 @@
#include "nsEscape.h"
#include "nsISupportsArray.h"
#include "nsXPCOM.h"
#include "nsComponentManagerUtils.h"
extern "C" {
#include "icalss.h"
}
@ -94,7 +95,7 @@ oeEventEnumerator::oeEventEnumerator( )
:
mCurrentIndex( 0 )
{
NS_INIT_REFCNT();
NS_INIT_ISUPPORTS();
}
oeEventEnumerator::~oeEventEnumerator()
@ -150,7 +151,7 @@ oeDateEnumerator::oeDateEnumerator( )
:
mCurrentIndex( 0 )
{
NS_INIT_REFCNT();
NS_INIT_ISUPPORTS();
}
oeDateEnumerator::~oeDateEnumerator()
@ -236,7 +237,7 @@ oeICalImpl::oeICalImpl()
#ifdef ICAL_DEBUG
printf( "oeICalImpl::oeICalImpl()\n" );
#endif
NS_INIT_REFCNT();
NS_INIT_ISUPPORTS();
m_batchMode = false;
@ -261,7 +262,13 @@ oeICalImpl::~oeICalImpl()
}
m_todoobserverlist.clear();
if( m_alarmtimer ) {
if ( m_alarmtimer->GetDelay() != 0 )
PRUint32 delay = 0;
#ifdef NS_INIT_REFCNT //A temporary way of keeping backward compatibility with Mozilla 1.0 source compile
delay = m_alarmtimer->GetDelay();
#else
m_alarmtimer->GetDelay( &delay );
#endif
if ( delay != 0 )
m_alarmtimer->Cancel();
m_alarmtimer->Release();
m_alarmtimer = nsnull;
@ -1673,7 +1680,13 @@ void oeICalImpl::SetupAlarmManager() {
tmplistptr = tmplistptr->next;
}
if( m_alarmtimer ) {
if ( m_alarmtimer->GetDelay() != 0 )
PRUint32 delay = 0;
#ifdef NS_INIT_REFCNT //A temporary way of keeping backward compatibility with Mozilla 1.0 source compile
delay = m_alarmtimer->GetDelay();
#else
m_alarmtimer->GetDelay( &delay );
#endif
if ( delay != 0 )
m_alarmtimer->Cancel();
m_alarmtimer->Release();
m_alarmtimer = nsnull;
@ -1690,7 +1703,11 @@ void oeICalImpl::SetupAlarmManager() {
if( NS_FAILED( rv ) )
m_alarmtimer = nsnull;
else
#ifdef NS_INIT_REFCNT //A temporary way of keeping backward compatibility with Mozilla 1.0 source compile
m_alarmtimer->Init( AlarmTimerCallback, this, timediff*1000, PR_TRUE, NS_TYPE_ONE_SHOT );
#else
m_alarmtimer->InitWithFuncCallback( AlarmTimerCallback, this, timediff*1000, nsITimer::TYPE_ONE_SHOT );
#endif
}
}