Changeset 861b8b


Ignore:
Timestamp:
Aug 26, 2008, 2:15:29 PM (11 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
a11c79
Parents:
9c7348
Message:

construct rdf-source URI from UNC, to enable other places than file:// .

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_rdfDatasource.js

    r9c7348 r861b8b  
    4646   
    4747    init: function() {
    48         if (vI_rdfDatasource.rdfDataSource) return;
     48        if (vI_rdfDatasource.rdfDataSource) return;     
     49        var protoHandler = Components.classes["@mozilla.org/network/protocol;1?name=file"]
     50            .getService(Components.interfaces.nsIFileProtocolHandler)
     51        var newFile = Components.classes["@mozilla.org/file/local;1"]
     52                    .createInstance(Components.interfaces.nsILocalFile);
     53       
    4954        var file = Components.classes["@mozilla.org/file/directory_service;1"]
    5055            .getService(Components.interfaces.nsIProperties)
    5156            .get("ProfD", Components.interfaces.nsIFile);
    52         vI_notificationBar.dump("## vI_rdfDatasource read rdf from '" + file.path + "/" + vI_rdfDatasource.rdfFileName + "'\n");
     57        var delimiter = (file.path.match(/\\/))?"\\":"/";
     58
     59        newFile.initWithPath(file.path + delimiter + vI_rdfDatasource.rdfFileName);
     60        var fileURI = protoHandler.newFileURI(newFile);
     61
     62        vI_notificationBar.dump("## vI_rdfDatasource read rdf from '" + fileURI.spec + "'\n");
     63
    5364        vI_rdfDatasource.rdfDataSource =
    54             vI_rdfDatasource.rdfService.GetDataSourceBlocking("file://" + file.path + "/" + vI_rdfDatasource.rdfFileName);
     65            vI_rdfDatasource.rdfService.GetDataSourceBlocking(fileURI.spec);
    5566    },
    5667   
Note: See TracChangeset for help on using the changeset viewer.