def _serialize_item(i, item, stream):
 stream.writeQString(_encode_url(item.url))
 stream.writeQString(item.title)
 stream.writeQString(_encode_url(item.original_url))
 stream.writeUInt32(BACK_FORWARD_TREE_VERSION)
 stream.writeUInt64(0)
 stream.writeInt64((i + 1))
 stream.writeUInt64(0)
 stream.writeQString(None)
 stream.writeBool(False)
 stream.writeInt64((i + 1))
 stream.writeQString(None)
 try:
  stream.writeInt32(item.user_data['scroll-pos'].x())
 except (KeyError, TypeError):
  stream.writeInt32(0)
 try:
  stream.writeInt32(item.user_data['scroll-pos'].y())
 except (KeyError, TypeError):
  stream.writeInt32(0)
 stream.writeFloat(1)
 stream.writeBool(False)
 stream.writeQString(None)
 stream.writeBool(False)

def _serialize_item ( i , item , stream ) : stream . writeQString ( _encode_url ( item . url ) ) stream . writeQString ( item . title ) stream . writeQString ( _encode_url ( item . original_url ) ) stream . writeUInt32 ( BACK_FORWARD_TREE_VERSION ) stream . writeUInt64 ( 0 ) stream . writeInt64 ( ( i + 1 ) ) stream . writeUInt64 ( 0 ) stream . writeQString ( None ) stream . writeBool ( False ) stream . writeInt64 ( ( i + 1 ) ) stream . writeQString ( None ) try : stream . writeInt32 ( item . user_data [ 'scroll-pos' ] . x ( ) ) except ( KeyError , TypeError ) : stream . writeInt32 ( 0 ) try : stream . writeInt32 ( item . user_data [ 'scroll-pos' ] . y ( ) ) except ( KeyError , TypeError ) : stream . writeInt32 ( 0 ) stream . writeFloat ( 1 ) stream . writeBool ( False ) stream . writeQString ( None ) stream . writeBool ( False )
internal function: serialize native types .