Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-22659

QXmlInputSource misuses QIODevice and doesn't behave according to its own documentation

    XMLWordPrintable

Details

    • d457f148cf1efbea3db5fdc87c418cc9647e2baf (5.0), 425272e7405eed077cb65a101d5dd1fafc4b11d2 (4.8)

    Description

      /*!
          Constructs an input source and gets the data from device \a dev.
          If \a dev is not open, it is opened in read-only mode. If \a dev
          is 0 or it is not possible to read from the device, the input
          source will contain no data.
      
          \sa setData() fetchData() QIODevice
      */
      QXmlInputSource::QXmlInputSource(QIODevice *dev)
      {
          init();
          d->inputDevice = dev;
          d->inputDevice->setTextModeEnabled(false);
      }
      

      Above function does not open the input device before setting text mode.
      Needs something like

      if (!dev->isOpen())
          dev->open(QIODevice::ReadOnly);
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              shkearns Shane Kearns
              shkearns Shane Kearns
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes