rem: node.setAttribute("http: 
add:  if( thisCalendar.remote == true ) { var profileFile = this.getProfileDirectory(); profileFile.append( "Calendar" ); profileFile.append("RemoteCalendar"+this.rootContainer.getSubNodes().length+".ics"); var CalendarPath  = profileFile.path; } else { CalendarPath = thisCalendar.remotePath; }  node.setAttribute("http: 
context: calendarManager.prototype.getAndConvertAllOldCalendars = function calMan_getAllCalendars(){   //if the file CalendarDataFile.ics exists in the users profile directory, move it to Calendar/CalendarDataFile.ics   var oldCalendarFile = this.getProfileDirectory();   oldCalendarFile.append( "CalendarDataFile.ics" );   var newCalendarFile = this.getProfileDirectory();   newCalendarFile.append( "Calendar" );   newCalendarFile.append( "CalendarDataFile.ics" );   var oldCalendarDataFile = new File( oldCalendarFile.path );   var newCalendarDataFile = new File( newCalendarFile.path );      if( oldCalendarDataFile.exists() )   {      alert( "moving "+oldCalendarDataFile.path+" to "+newCalendarDataFile.path );      oldCalendarDataFile.copy( newCalendarDataFile.path );      oldCalendarDataFile.remove( );   }   //go through the prefs file, calendars are stored in there.      var ServerArray = getCharPref(prefService.getBranch( "calendar." ), "servers.array", "" );      var ArrayOfCalendars = ServerArray.split( "," );      //don't count the default server, so this starts at 1   for( var i = 1; i < ArrayOfCalendars.length; i++ )   {      if( ArrayOfCalendars[i] >= this.nextCalendarNumber )         this.nextCalendarNumber = parseInt( ArrayOfCalendars[i] )+1;      thisCalendar = new CalendarObject();            try {          thisCalendar.serverNumber = ArrayOfCalendars[i];         thisCalendar.name = getCharPref(prefService.getBranch( "calendar." ), "server"+ArrayOfCalendars[i]+".name", "" );         thisCalendar.path = getCharPref(prefService.getBranch( "calendar." ), "server"+ArrayOfCalendars[i]+".path", "" );         thisCalendar.active = getBoolPref(prefService.getBranch( "calendar." ), "server"+ArrayOfCalendars[i]+".active", false );         thisCalendar.remote = getBoolPref(prefService.getBranch( "calendar." ), "server"+ArrayOfCalendars[i]+".remote", false );         thisCalendar.remotePath = getCharPref(prefService.getBranch( "calendar." ), "server"+ArrayOfCalendars[i]+".remotePath", "" );                  this.calendars[ this.calendars.length ] = thisCalendar;      }      catch ( e )      {         dump( "error: could not get calendar information from preferences\n"+e );      }      //now convert it, and put it in the RDF file.      var node = this.rootContainer.addNode(name);      node.setAttribute("http://home.netscape.com/NC-rdf#active", thisCalendar.name);      node.setAttribute("http://home.netscape.com/NC-rdf#serverNumber", this.rootContainer.getSubNodes().length);      node.setAttribute("http://home.netscape.com/NC-rdf#name", thisCalendar.name);      node.setAttribute("http://home.netscape.com/NC-rdf#path", "RemoteCalendar"+this.rootContainer.getSubNodes().length+".ics");      node.setAttribute("http://home.netscape.com/NC-rdf#remote", thisCalendar.remote);      node.setAttribute("http://home.netscape.com/NC-rdf#remotePath", thisCalendar.remotePath);      this.rdf.flush();      //if the file CalendarDataFile.ics exists in the users profile directory, move it to Calendar/CalendarDataFile.ics      var newCalendarFile = this.getProfileDirectory();      newCalendarFile.append( "Calendar" );      newCalendarFile.append( "RemoteCalendar"+this.rootContainer.getSubNodes().length+".ics" );         var oldCalendarDataFile = new File( thisCalendar.path );      var newCalendarDataFile = new File( newCalendarFile.path );         if( oldCalendarDataFile.exists() )      {         alert( "moving "+oldCalendarDataFile.path+" to "+newCalendarDataFile.path );         oldCalendarDataFile.copy( newCalendarDataFile.path );         oldCalendarDataFile.remove( );      }      prefService.getBranch( "calendar." ).clearUserPref( "server"+thisCalendar.serverNumber+".name" );      prefService.getBranch( "calendar." ).clearUserPref( "server"+thisCalendar.serverNumber+".path" );      prefService.getBranch( "calendar." ).clearUserPref( "server"+thisCalendar.serverNumber+".active" );      prefService.getBranch( "calendar." ).clearUserPref( "server"+thisCalendar.serverNumber+".remote" );      prefService.getBranch( "calendar." ).clearUserPref( "server"+thisCalendar.serverNumber+".remotePath" );   }   try   {      prefService.getBranch( "calendar." ).clearUserPref( "server0.active" );   } catch( e ) {   }      try   {      prefService.getBranch( "calendar." ).clearUserPref( "servers.array" );   } catch( e ) {   }   try   {      prefService.getBranch( "calendar." ).clearUserPref( "servers.count" );   } catch( e ) {   }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/ee4b88b5848f58fef6e8bce24c261fbc6a8d3147/calendarManager.js/buggy/calendar/resources/content/calendarManager.js