Ignore:
Timestamp:
Jun 17, 2013, 11:11:39 PM (12 years ago)
Author:
Dmitry A. Kuminov
Message:

core: OS/2: Don't cache plugin load attempts failed due to missing dependencies.

This would hide the plugin from Qt forever, even if all dependencies were later satisfied.
See #289 for details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/corelib/plugin/qlibrary.cpp

    r1151 r1152  
    582582    QByteArray key;
    583583    bool success = false;
     584
    584585
    585586#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
     
    662663                if (fileinfo.exists())
    663664#  endif
    664                 temporary_load =  load_sys();
     665#  if defined(Q_OS_OS2)
     666                APIRET rc = load_sys_rc();
     667                temporary_load = rc == NO_ERROR;
     668                temporary_failure = rc == ERROR_FILE_NOT_FOUND;
     669#  else
     670                temporary_load = load_sys();
     671#  endif
    665672#endif
    666673            }
     
    698705                qt_version = 0;
    699706                key = "unknown";
    700                 if (temporary_load)
    701                     unload_sys();
    702707            } else {
    703708                success = true;
     
    709714                    hTempModule = 0;
    710715                }
    711 
    712716            }
     717
     718
     719
    713720#endif
    714721        }
     
    718725
    719726#ifndef QT_NO_SETTINGS
    720         QStringList queried;
    721         queried << QString::number(qt_version,16)
    722                 << QString::number((int)debug)
    723                 << QLatin1String(key)
    724                 << lastModified;
    725         settings->setValue(regkey, queried);
     727        // Loading may fail due to a temporary failure like missing dependencies.
     728        // Do not caches such failures since in this case the plugin will be
     729        // ignored by Qt forever - even when these failures are fixed later.
     730        if (!temporary_failure) {
     731            QStringList queried;
     732            queried << QString::number(qt_version,16)
     733                    << QString::number((int)debug)
     734                    << QLatin1String(key)
     735                    << lastModified;
     736            settings->setValue(regkey, queried);
     737        }
    726738#endif
    727739    }
     
    734746                errorString = QLibrary::tr("The file '%1' is not a valid Qt plugin.").arg(fileName);
    735747        }
     748
    736749        return false;
    737750    }
Note: See TracChangeset for help on using the changeset viewer.