Changeset 24afa6


Ignore:
Timestamp:
Mar 4, 2010, 11:28:57 AM (10 years ago)
Author:
rene <rene@…>
Branches:
multiEdit, ng_0.6, ng_0.8, ng_0.9
Children:
c0e9d6
Parents:
0c6f0f
Message:

only use values if they are set (don't set null as name, email or id, smtp)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/v_identity.xml

    r0c6f0f r24afa6  
    333333        vI_notificationBar.dump("\n** v_identity.xml msgIdentityCloneElem.doCommand() \n")
    334334        // copy selected Menu-Value from clone to orig.
    335         var MenuItems = this._msgIdentityPopupElem.childNodes
    336         for (var index = 0; index < MenuItems.length; index++) {
    337             if ( MenuItems[index].getAttribute("value") == this.selectedMenuItem.identityData.id.key ) {
    338                 this._msgIdentityElem.selectedItem = MenuItems[index];
    339                 this._msgIdentityElem.value = MenuItems[index].getAttribute("value");
    340                 break;
     335        vI_notificationBar.dump("** v_identity.xmlcopy selected Menu-Value from clone to orig. Searching for id=" + this.selectedMenuItem.identityData.id.key + " \n")
     336       
     337        if ( this.selectedMenuItem.identityData.id.key != null ) {
     338            var MenuItems = this._msgIdentityPopupElem.childNodes
     339            for (var index = 0; index < MenuItems.length; index++) {
     340                if ( MenuItems[index].getAttribute("value") == this.selectedMenuItem.identityData.id.key ) {
     341                    this._msgIdentityElem.selectedItem = MenuItems[index];
     342                    this._msgIdentityElem.value = MenuItems[index].getAttribute("value");
     343                    break;
     344                }
    341345            }
    342         }
    343         this._msgIdentityPopupElem.doCommand();
    344        
     346            this._msgIdentityPopupElem.doCommand();
     347        }
    345348        this.identityData = this.selectedMenuItem.identityData.getDuplicate();
    346349       
     
    534537            var oldIdentityData = this._identityDataStorage;
    535538            this._identityDataStorage = val;
    536            
    537539            if (oldIdentityData) { // indicates that it's not first time after clean
    538540                vI_notificationBar.dump("** v_identity.xml previousID: fullName='" + oldIdentityData.fullName + "' email='" + oldIdentityData.email + "' smtp='" + oldIdentityData.smtp.key + "' id='" + oldIdentityData.id.key + "'\n");
    539541                vI_notificationBar.dump("** v_identity.xml newID: fullName='" + this._identityDataStorage.fullName + "' email='" + this._identityDataStorage.email + "' smtp='" + this._identityDataStorage.smtp.key + "' id='" + this._identityDataStorage.id.key + "'\n");
    540                 if (!this._identityDataStorage.id.key) {
    541                     this._identityDataStorage.id.key = oldIdentityData.id.key;
    542                     var idName = this._identityDataStorage.id.value;
    543                     // this._identityDataStorage.sideDescription = (idName)?" - "+idName:"";
    544                     vI_notificationBar.dump("** v_identity.xml set new Id: " + this._identityDataStorage.id.key + " '" + this._identityDataStorage.id.value + "'\n")
    545                 }
     542                if (!this._identityDataStorage.combinedName) this._identityDataStorage.fullName = oldIdentityData.fullName;
     543                if (!this._identityDataStorage.email) this._identityDataStorage.email = oldIdentityData.email;
     544                if (!this._identityDataStorage.smtp.key) this._identityDataStorage.smtp.key = oldIdentityData.smtp.key;
     545                if (!this._identityDataStorage.id.key) this._identityDataStorage.id.key = oldIdentityData.id.key;
    546546                this._identityDataStorage.extras.setValues();
    547            
    548547                this.checkForVirtualIdentity();
    549548            }
Note: See TracChangeset for help on using the changeset viewer.