From e82bdee165d477280dc65f87388c77ff27e29281 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 24 Jun 2013 09:47:35 +0200 Subject: [PATCH] QFactoryLoader: Add namefilter for Windows. No longer try to load all files in the directory as a plugin which can cause problems when for example installers move files around. [ChangeLog][QtCore][QFactoryLoader][Windows] QFactoryLoader now filters potential plugins by the ".dll" suffix. Task-number: QTBUG-31476 Change-Id: Ia19d6211c72765aaba0a5d06e6d3b501e8a40fff Reviewed-by: Lars Knoll --- src/corelib/plugin/qfactoryloader.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index dce750b5ad..53b38c3be2 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -120,7 +120,11 @@ void QFactoryLoader::update() if (!QDir(path).exists(QLatin1String("."))) continue; - QStringList plugins = QDir(path).entryList(QDir::Files); + QStringList plugins = QDir(path).entryList( +#ifdef Q_OS_WIN + QStringList(QStringLiteral("*.dll")), +#endif + QDir::Files); QLibraryPrivate *library = 0; #ifdef Q_OS_MAC