Added ability in SetServer() function to resolve URLs ( Progress on bug 134008 )

This commit is contained in:
mostafah%oeone.com 2002-04-11 20:35:04 +00:00
Родитель 0070bf23bd
Коммит 7a1df03205
2 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -52,6 +52,7 @@ REQUIRES = xpcom \
appshell \ appshell \
string \ string \
timer \ timer \
necko \
$(NULL) $(NULL)
XPIDLSRCS = oeIICal.idl XPIDLSRCS = oeIICal.idl

Просмотреть файл

@ -47,6 +47,9 @@
#include "stdlib.h" #include "stdlib.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsISimpleEnumerator.h" #include "nsISimpleEnumerator.h"
#include "nsString.h"
#include "nsIURL.h"
#include "nsNetCID.h"
extern "C" { extern "C" {
#include "icalss.h" #include "icalss.h"
@ -633,7 +636,16 @@ oeICalImpl::SetServer( const char *str ) {
#ifdef ICAL_DEBUG #ifdef ICAL_DEBUG
printf( "oeICalImpl::SetServer(%s)\n", str ); printf( "oeICalImpl::SetServer(%s)\n", str );
#endif #endif
strcpy( serveraddr, str );
if( strncmp( str, "file:///", strlen( "file:///" ) ) == 0 ) {
nsCOMPtr<nsIURL> url( do_CreateInstance(NS_STANDARDURL_CONTRACTID) );
nsCString filePath;
filePath = str;
url->SetSpec( filePath );
url->GetFilePath( filePath );
strcpy( serveraddr, filePath.get() );
} else
strcpy( serveraddr, str );
icalfileset *stream; icalfileset *stream;