Changeset 6311 for branches/1.6


Ignore:
Timestamp:
May 4, 2016, 11:24:57 AM (9 years ago)
Author:
gah
Message:

fixes for binary data in putFile, defer loader setting default value

Location:
branches/1.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.6/gui/scripts/loader.tcl

    r6024 r6311  
    246246    set str [string trim [$_owner xml get $path.default]]
    247247    if { $str != "" } {
    248         bind $itk_component(hull) <Map> [itcl::code $this SetDefaultValue $str]
     248        SetDefaultValue $str
    249249    }
    250250}
     
    326326# SetDefaultValue --
    327327#
    328 #       Sets the designated default value for the loader.  This must be done
    329 #       after the entire application is assembled, otherwise the default
    330 #       values set up by the loader will be overwritten by the various widgets
    331 #       themselves when they try to set their default values.
    332 #
    333 #       This is called from a  <Map> event to the loader (combobox).  This
    334 #       will get trigger the first time the loader is displayed.  The binding
    335 #       is then removed.
     328#   Sets the designated default value for the loader.  This must be done
     329#   after the entire application is assembled, otherwise the default values
     330#   set up by the loader will be overwritten by the various widgets
     331#   themselves when they try to set their default values.
     332#
     333#   This is called from a <Map> event to the loader (combobox).  This will
     334#   get trigger the first time the loader is displayed.  The binding is
     335#   then removed.
    336336#
    337337itcl::body Rappture::Loader::SetDefaultValue { value } {
    338     after idle [itcl::code $this value $value]
    339     # We're done. Remove the binding.
    340     bind $itk_component(hull) <Map> {}
     338    after 100 [itcl::code $this value $value]
    341339}
    342340
  • branches/1.6/src/core/RpLibrary.cc

    r5679 r6311  
    17911791
    17921792    // check for binary data
    1793     // FIXME: I've already appended a NUL-byte of this assuming that
     1793    // FIXME: I've already appended a NUL-byte to this assuming that
    17941794    //        it's a ASCII string. This test must come before.
    17951795    if (Rappture::encoding::isBinary(value.c_str(), value.length())) {
     
    20472047        return *this;
    20482048    }
    2049     if (compress == RPLIB_COMPRESS) {
     2049    if ((compress == RPLIB_COMPRESS) ||
     2050        (Rappture::encoding::isBinary(fileBuf.bytes(), fileBuf.size()))) {     
    20502051        putData(path, fileBuf.bytes(), fileBuf.size(), append);
    20512052    } else {
    2052         /* Always append a NUL-byte to the end of ASCII strings. */
    20532053        fileBuf.append("\0", 1);
    20542054        put(path, fileBuf.bytes(), "", append, RPLIB_TRANSLATE);
Note: See TracChangeset for help on using the changeset viewer.