зеркало из https://github.com/mozilla/gecko-dev.git
Added ability in SetServer() function to resolve URLs ( Progress on bug 134008 )
This commit is contained in:
Родитель
0070bf23bd
Коммит
7a1df03205
|
@ -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,6 +636,15 @@ 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
|
||||||
|
|
||||||
|
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 );
|
strcpy( serveraddr, str );
|
||||||
|
|
||||||
icalfileset *stream;
|
icalfileset *stream;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче