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

QNetworkDiskCache incompatible between releases

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 4.8.5, 5.0.0 Beta 1, 5.2.0 Beta1
    • Network: Cache
    • None

    Description

      When we updated from Qt 4.8 to 5.0 we faced the issue that old cache from 4.8 made the Qt 5 application crash. So we had to remove our cache directory.

      Now with the update from Qt5.1 to Qt5.2 beta we face the issue that our NetworkAccessManager is simply hanging forever while processing a request. However once we clear the old cache it works fine again.

      We use a QNetworkAccessManager for loading our content.
      The cache is configured like this:

          QString cacheLocation =
                  QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
      
          if (!cacheLocation.isEmpty()) {
              cacheLocation += QLatin1String("/httpCache");
      
              QNetworkDiskCache *diskCache = new QNetworkDiskCache(this);
              diskCache->setCacheDirectory(cacheLocation);
              mNetworkAccessManager.setCache(diskCache);
          } else {
              qWarning() << "CacheLocation is not supported on this platform, "
                            "no disk cache is used!";
          }
      

      We will probably simply work this around by appending a qt version to the path... But it is still a bit annoying.

      Regards,
      Erik

      Attachments

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

        Activity

          People

            shkearns Shane Kearns
            ablu Erik Schilling
            Votes:
            5 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes