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

Add protected: QNetworkReply::setFinished()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • 4.8.0
    • 4.7.0
    • Core: I/O
    • None
    • any

      While trying to implement custom protocol handlers for QNetworkAccessManager, I spotted this:

      QNetworkReply::isFinished() is non-virtual, and is implemented to return d_func()->isFinished()

      Since d_func isn't accessible from outside Qt sources, the custom protocol handlers can't overload QNetworkReplyPrivate::isFinished(), therefore isFinished() always returns false (as per its definition in the base class in qnetworkreply_p.h).

      Because of this, some functions (e.g. a synchronous download along the lines of

      QNetworkReply *r=nam->get(whatever);
      while(!r->isFinished())
      QCoreApplication::instance()->processEvents();
      // do something)

      work fine for the builtin handlers, but there's no chance for a handler implemented outside of Qt to work correctly in this context.

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

            mgoetz Markus Goetz (Inactive)
            bero Bernhard Rosenkränzer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes