618 #ifndef QT_NO_PLUGIN_CHECK |
618 #ifndef QT_NO_PLUGIN_CHECK |
619 bool debug = !QLIBRARY_AS_DEBUG; |
619 bool debug = !QLIBRARY_AS_DEBUG; |
620 QByteArray key; |
620 QByteArray key; |
621 bool success = false; |
621 bool success = false; |
622 |
622 |
|
623 #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) |
|
624 if (fileName.endsWith(QLatin1String(".debug"))) { |
|
625 // refuse to load a file that ends in .debug |
|
626 // these are the debug symbols from the libraries |
|
627 // the problem is that they are valid shared library files |
|
628 // and dlopen is known to crash while opening them |
|
629 |
|
630 // pretend we didn't see the file |
|
631 errorString = QLibrary::tr("The shared library was not found."); |
|
632 pluginState = IsNotAPlugin; |
|
633 return false; |
|
634 } |
|
635 #endif |
|
636 |
623 QFileInfo fileinfo(fileName); |
637 QFileInfo fileinfo(fileName); |
624 |
638 |
625 #ifndef QT_NO_DATESTRING |
639 #ifndef QT_NO_DATESTRING |
626 lastModified = fileinfo.lastModified().toString(Qt::ISODate); |
640 lastModified = fileinfo.lastModified().toString(Qt::ISODate); |
627 #endif |
641 #endif |
628 QString regkey = QString::fromLatin1("Qt Plugin Cache %1.%2.%3/%4") |
642 QString regkey = QString::fromLatin1("Qt Plugin Cache %1.%2.%3/%4") |
629 .arg((QT_VERSION & 0xff0000) >> 16) |
643 .arg((QT_VERSION & 0xff0000) >> 16) |
630 .arg((QT_VERSION & 0xff00) >> 8) |
644 .arg((QT_VERSION & 0xff00) >> 8) |
631 .arg(QLIBRARY_AS_DEBUG ? QLatin1String("debug") : QLatin1String("false")) |
645 .arg(QLIBRARY_AS_DEBUG ? QLatin1String("debug") : QLatin1String("false")) |
632 .arg(fileName); |
646 .arg(fileName); |
|
647 #ifdef Q_WS_MAC |
|
648 // On Mac, add the application arch to the reg key in order to |
|
649 // cache plugin information separately for each arch. This prevents |
|
650 // Qt from wrongly caching plugin load failures when the archs |
|
651 // don't match. |
|
652 #if defined(__x86_64__) |
|
653 regkey += QLatin1String("-x86_64"); |
|
654 #elif defined(__i386__) |
|
655 regkey += QLatin1String("-i386"); |
|
656 #elif defined(__ppc64__) |
|
657 regkey += QLatin1String("-ppc64"); |
|
658 #elif defined(__ppc__) |
|
659 regkey += QLatin1String("-ppc"); |
|
660 #endif |
|
661 #endif // Q_WS_MAC |
|
662 |
633 QStringList reg; |
663 QStringList reg; |
634 #ifndef QT_NO_SETTINGS |
664 #ifndef QT_NO_SETTINGS |
635 if (!settings) { |
665 if (!settings) { |
636 settings = libraryData()->settings; |
666 settings = libraryData()->settings; |
637 if (!settings) { |
667 if (!settings) { |