зеркало из 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 \
|
||||
string \
|
||||
timer \
|
||||
necko \
|
||||
$(NULL)
|
||||
|
||||
XPIDLSRCS = oeIICal.idl
|
||||
|
|
|
@ -47,6 +47,9 @@
|
|||
#include "stdlib.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsISimpleEnumerator.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsNetCID.h"
|
||||
|
||||
extern "C" {
|
||||
#include "icalss.h"
|
||||
|
@ -633,7 +636,16 @@ oeICalImpl::SetServer( const char *str ) {
|
|||
#ifdef ICAL_DEBUG
|
||||
printf( "oeICalImpl::SetServer(%s)\n", str );
|
||||
#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;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче