- Timestamp:
- Jun 17, 2013, 11:11:39 PM (12 years ago)
- Location:
- trunk/src/corelib/plugin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/plugin/qlibrary.cpp
r1151 r1152 582 582 QByteArray key; 583 583 bool success = false; 584 bool temporary_failure = false; 584 585 585 586 #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) … … 662 663 if (fileinfo.exists()) 663 664 # 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 665 672 #endif 666 673 } … … 698 705 qt_version = 0; 699 706 key = "unknown"; 700 if (temporary_load)701 unload_sys();702 707 } else { 703 708 success = true; … … 709 714 hTempModule = 0; 710 715 } 711 712 716 } 717 #else 718 if (temporary_load) 719 unload_sys(); 713 720 #endif 714 721 } … … 718 725 719 726 #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 } 726 738 #endif 727 739 } … … 734 746 errorString = QLibrary::tr("The file '%1' is not a valid Qt plugin.").arg(fileName); 735 747 } 748 pluginState = temporary_failure ? MightBeAPlugin : IsNotAPlugin; 736 749 return false; 737 750 } -
trunk/src/corelib/plugin/qlibrary_os2.cpp
r1111 r1152 96 96 } 97 97 98 bool QLibraryPrivate::load_sys()98 APIRET QLibraryPrivate::load_sys_rc() 99 99 { 100 100 pHnd = 0; … … 131 131 errorString += QLibrary::tr(" (failed module: %1)") 132 132 .arg(QFile::decodeName(errModule)); 133 return false; 133 pHnd = 0; 134 return rc; 134 135 } 135 136 … … 140 141 qualifiedFileName = QDir::fromNativeSeparators(QFile::decodeName(QByteArray(errModule))); 141 142 142 return true;143 return NO_ERROR; 143 144 } 144 145 -
trunk/src/corelib/plugin/qlibrary_p.h
r846 r1152 109 109 ~QLibraryPrivate(); 110 110 111 #if defined(Q_OS_OS2) 112 APIRET load_sys_rc(); 113 bool load_sys() { return load_sys_rc() == NO_ERROR; } 114 #else 111 115 bool load_sys(); 116 #endif 112 117 bool unload_sys(); 113 118 void *resolve_sys(const char *);
Note:
See TracChangeset
for help on using the changeset viewer.