summaryrefslogtreecommitdiffstats
path: root/src/core/content_client_qt.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2015-11-18 12:22:44 +0100
committerKai Koehne <kai.koehne@theqtcompany.com>2015-12-01 13:05:44 +0000
commitb0967d67606b7add15b50e1b3fc46db4d613a081 (patch)
treed1e17565854d10a43c561fd8c4f531780be1c787 /src/core/content_client_qt.cpp
parentd03473563cbd81f9a2b8127fe9c362d2b572a6c5 (diff)
Fix loading of Flash plugin on Windows
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 <michael.bruning@theqtcompany.com>
Diffstat (limited to 'src/core/content_client_qt.cpp')
-rw-r--r--src/core/content_client_qt.cpp17
1 files changed, 13 insertions, 4 deletions
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<content::PepperPluginInfo>* 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