From b0967d67606b7add15b50e1b3fc46db4d613a081 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 18 Nov 2015 12:22:44 +0100 Subject: Fix loading of Flash plugin on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So far we were only storing the filenames, not the full paths. While at it also fix the loading on 32 bit Windows, and do not hardcode the location of the Windows directory. Change-Id: Ie5d9a23b941ff9bde36e687c37c412b15b4d65c8 Reviewed-by: Michael BrĂ¼ning --- src/core/content_client_qt.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/core/content_client_qt.cpp') diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp index 01e1fe383..1d4923c70 100644 --- a/src/core/content_client_qt.cpp +++ b/src/core/content_client_qt.cpp @@ -107,10 +107,19 @@ void AddPepperFlashFromSystem(std::vector* plugins) { QStringList pluginPaths; #if defined(Q_OS_WIN) && defined(Q_PROCESSOR_X86_32) - QDir pluginDir("C:/Windows/SysWOW64/Macromed/Flash"); - pluginDir.setFilter(QDir::Files); - QStringList nameFilters("pepflashplayer*.dll"); - pluginPaths << pluginDir.entryList(nameFilters); + QString winDir = QDir::fromNativeSeparators(qgetenv("WINDIR")); + if (winDir.isEmpty()) + winDir = QString::fromLatin1("C:/Windows"); + + const QStringList pluginDirs = { winDir + "/SysWOW64/Macromed/Flash", + winDir + "/System32/Macromed/Flash" }; + const QStringList nameFilters("pepflashplayer*.dll"); + Q_FOREACH (const QString &dirPath, pluginDirs) { + QDir pluginDir(dirPath); + pluginDir.setFilter(QDir::Files); + Q_FOREACH (const QFileInfo &info, pluginDir.entryInfoList(nameFilters)) + pluginPaths << info.absoluteFilePath(); + } #endif #if defined(Q_OS_OSX) pluginPaths << "/Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin"; // Mac OS X -- cgit v1.2.3