Changeset 9a44e8


Ignore:
Timestamp:
Jul 21, 2011, 4:03:13 PM (9 years ago)
Author:
rene <rene@…>
Branches:
ng_0.8, ng_0.9
Children:
880bd5
Parents:
d28e78
Message:

removed obsolete upgrade path from ABook-Storages

File:
1 edited

Legend:

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

    rd28e78 r9a44e8  
    105105        switch (currentVersion) {
    106106            case null:
    107                 vI_upgrade.__transferAllVIdentityABookToRDF(); // no break
     107                // no break
    108108            default:
    109109                vI_upgrade.__transferMovedUserPrefs(currentVersion);
     
    183183    },
    184184
    185     CardFields : Array("Custom1", "Custom2", "Custom3", "Custom4", "Notes"),
    186     // --------------------------------------------------------------------
    187     // remove all VirtualIdentity-related Information from the AddressBook
    188     // and transfer it to the RDF File.
    189     __transferAllVIdentityABookToRDF : function() {
    190         var returnVar = { prop : null, counter : 0, warning : true }
    191         for each (returnVar.prop in vI_upgrade.CardFields) {
    192             var queryString = "?(or(" +returnVar.prop + ",c,vIdentity:))";
    193             returnVar.prop = returnVar.prop.toLowerCase();
    194             returnVar = vI_storage._walkTroughCards(queryString,vI_upgrade.__transferVIdentityABookToRDF, returnVar )
    195         }
    196         vI_notificationBar.dump("\ntransferred " + returnVar.counter + " VirtualIdentity information items from AddressBook to RDF.\n")
    197     },
    198    
    199     __transferVIdentityABookToRDF: function(addrbook, Card, returnVar) {
    200         if (!Card[returnVar.prop].match(/^vIdentity:/)) return returnVar;
    201         if (returnVar.warning) {
    202             vI_notificationBar.dump("transferring VirtualIdentity information from AddressBook to RDF file,\nthis might take a while:\n");
    203             returnVar.warning = false
    204         }
    205        
    206         var newFullEmail=Card[returnVar.prop].replace(/vIdentity: /,"");
    207         var infoIndex = newFullEmail.indexOf(" (id")
    208         if (!infoIndex) infoIndex = newFullEmail.indexOf(" (smtp")
    209         var info = null; var id= null; var smtp = null;
    210         if ( infoIndex != -1) {
    211             info = newFullEmail.substr(infoIndex+2).replace(/\)/,"").split(/,/)
    212             newFullEmail = newFullEmail.substr(0, infoIndex);
    213         }
    214         if ( info && info[0] ) id = info[0];
    215         if ( info && info[1] ) smtp = info[1];
    216        
    217         var localIdentityData = new vI_identityData(newFullEmail, null, id, smtp, null)
    218        
    219         vI_upgrade.vI_rdfDatasource.updateRDF(localIdentityData.combinedName,
    220                         "email", localIdentityData, true, true, null, null)
    221         if (Card.secondEmail.replace(/^\s+|\s+$/g,""))
    222             vI_upgrade.vI_rdfDatasource.updateRDF(localIdentityData.combinedName,
    223                     "email", localIdentityData, true, true, null, null)
    224        
    225         Card[returnVar.prop] = "";
    226         Card.editCardToDatabase("");
    227         vI_notificationBar.dump(".");
    228         return { prop: returnVar.prop, counter : ++returnVar.counter, warning : returnVar.warning };
    229     },
    230    
    231185    openURL : function(aURL) {
    232186            var uri = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURI);
Note: See TracChangeset for help on using the changeset viewer.