function _mapDupe(item) {
    // Figure out if we have something to key with.
    let key;
    let altKey;
    switch (item.type) {
      case "query":
        // Prior to Bug 610501, records didn't carry their Smart Bookmark
        // anno, so we won't be able to dupe them correctly. This altKey
        // hack should get them to dupe correctly.
        if (item.queryId) {
          key = "q" + item.queryId;
          altKey = "b" + item.bmkUri + ":" + item.title;
          break;
        }
        // No queryID? Fall through to the regular bookmark case.
      case "bookmark":
      case "microsummary":
        key = "b" + item.bmkUri + ":" + item.title;
        break;
      case "folder":
      case "livemark":
        key = "f" + item.title;
        break;
      case "separator":
        key = "s" + item.pos;
        break;
      default:
        return;
    }

    // Figure out if we have a map to use!
    // This will throw in some circumstances. That's fine.
    let guidMap = this._guidMap;

    // Give the GUID if we have the matching pair.
    this._log.trace("Finding mapping: " + item.parentName + ", " + key);
    let parent = guidMap[item.parentName];
    
    if (!parent) {
      this._log.trace("No parent => no dupe.");
      return undefined;
    }
      
    let dupe = parent[key];
    
    if (dupe) {
      this._log.trace("Mapped dupe: " + dupe);
      return dupe;
    }
    
    if (altKey) {
      dupe = parent[altKey];
      if (dupe) {
        this._log.trace("Mapped dupe using altKey " + altKey + ": " + dupe);
        return dupe;
      }
    }
    
    this._log.trace("No dupe found for key " + key + "/" + altKey + ".");
    return undefined;
  }
// Helper function to get a dupe GUID for an item.
Helper function to get a dupe GUID for an item.
Helper function to get a dupe GUID for an item .
function _mapDupe(item) {
    let key;
    let altKey;
    switch (item.type) {
      case "query":
        if (item.queryId) {
          key = "q" + item.queryId;
          altKey = "b" + item.bmkUri + ":" + item.title;
          break;
        }
      case "bookmark":
      case "microsummary":
        key = "b" + item.bmkUri + ":" + item.title;
        break;
      case "folder":
      case "livemark":
        key = "f" + item.title;
        break;
      case "separator":
        key = "s" + item.pos;
        break;
      default:
        return;
    }
    let guidMap = this._guidMap;
    this._log.trace("Finding mapping: " + item.parentName + ", " + key);
    let parent = guidMap[item.parentName];
    if (!parent) {
      this._log.trace("No parent => no dupe.");
      return undefined;
    }
    let dupe = parent[key];
    if (dupe) {
      this._log.trace("Mapped dupe: " + dupe);
      return dupe;
    }
    if (altKey) {
      dupe = parent[altKey];
      if (dupe) {
        this._log.trace("Mapped dupe using altKey " + altKey + ": " + dupe);
        return dupe;
      }
    }
    this._log.trace("No dupe found for key " + key + "/" + altKey + ".");
    return undefined;
  }
function _mapDupe ( item ) { let key ; let altKey ; switch ( item . type ) { case "query" : if ( item . queryId ) { key = "q" + item . queryId ; altKey = "b" + item . bmkUri + ":" + item . title ; break ; } case "bookmark" : case "microsummary" : key = "b" + item . bmkUri + ":" + item . title ; break ; case "folder" : case "livemark" : key = "f" + item . title ; break ; case "separator" : key = "s" + item . pos ; break ; default : return ; } let guidMap = this . _guidMap ; this . _log . trace ( "Finding mapping: " + item . parentName + ", " + key ) ; let parent = guidMap [ item . parentName ] ; if ( ! parent ) { this . _log . trace ( "No parent => no dupe." ) ; return undefined ; } let dupe = parent [ key ] ; if ( dupe ) { this . _log . trace ( "Mapped dupe: " + dupe ) ; return dupe ; } if ( altKey ) { dupe = parent [ altKey ] ; if ( dupe ) { this . _log . trace ( "Mapped dupe using altKey " + altKey + ": " + dupe ) ; return dupe ; } } this . _log . trace ( "No dupe found for key " + key + "/" + altKey + "." ) ; return undefined ; }
Helper function to get a dupe GUID for an item.
Helper function to get a dupe GUID for an item .
// Figure out if we have something to key with. // Prior to Bug 610501, records didn't carry their Smart Bookmark // anno, so we won't be able to dupe them correctly. This altKey // hack should get them to dupe correctly. // No queryID? Fall through to the regular bookmark case. // Figure out if we have a map to use! // This will throw in some circumstances. That's fine. // Give the GUID if we have the matching pair.