diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-01-10 14:35:18 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-01-11 14:38:46 +0000 |
commit | 5c35bdfe3bb2646ec94244e12c0ed04d33b30639 (patch) | |
tree | 0cf990f390ec46478047668693ca264dea3e9734 /src | |
parent | 7457808cb15c3f906454c0ef0f9db63b956dbd44 (diff) |
QAxSelect dialog (64bit): Display complete list of 32 bit controls
No longer filter out duplicate CLSIDs and enable loading of 32 bit
out-of-process controls.
Change-Id: I1bddc717e81e6d16ee698e5b9c4ebcb10a8c048b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/activeqt/container/qaxselect.cpp | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/activeqt/container/qaxselect.cpp b/src/activeqt/container/qaxselect.cpp index 4aea0a8..77e0a3c 100644 --- a/src/activeqt/container/qaxselect.cpp +++ b/src/activeqt/container/qaxselect.cpp @@ -162,15 +162,6 @@ QString Control::toolTip() const inline bool operator<(const Control &c1, const Control &c2) { return c1.compare(c2) < 0; } inline bool operator==(const Control &c1, const Control &c2) { return !c1.compare(c2); } -class FindByClsidPredicate : public std::unary_function<bool, Control> { -public: - explicit FindByClsidPredicate(const QString &clsid) : m_clsid(clsid) {} - inline bool operator()(const Control &c) const { return m_clsid == c.clsid; } - -private: - const QString m_clsid; -}; - static LONG RegistryQueryValue(HKEY hKey, LPCWSTR lpSubKey, LPBYTE lpData, LPDWORD lpcbData) { LONG ret = ERROR_FILE_NOT_FOUND; @@ -259,13 +250,8 @@ public: : QAbstractListModel(parent) { m_controls = readControls(L"CLSID", unsigned(QSysInfo::WordSize)); - if (QSysInfo::WordSize == 64) { // Append the 32bit controls as disabled items. - const QList<Control> controls = readControls(L"Wow6432Node\\CLSID", 32u); - for (const Control &c : controls) { - if (std::find_if(m_controls.constBegin(), m_controls.constEnd(), FindByClsidPredicate(c.clsid)) == m_controls.constEnd()) - m_controls.append(c); - } - } + if (QSysInfo::WordSize == 64) // Append the 32bit controls + m_controls += readControls(L"Wow6432Node\\CLSID", 32u); std::sort(m_controls.begin(), m_controls.end()); } @@ -298,8 +284,11 @@ QVariant ControlList::data(const QModelIndex &index, int role) const Qt::ItemFlags ControlList::flags(const QModelIndex &index) const { Qt::ItemFlags result = QAbstractListModel::flags(index); - if (!index.isValid() || m_controls.at(index.row()).wordSize != QSysInfo::WordSize) - result &= ~Qt::ItemIsEnabled; + if (index.isValid()) { + const Control &control = m_controls.at(index.row()); + if (control.type == InProcessControl && control.wordSize != QSysInfo::WordSize) + result &= ~Qt::ItemIsEnabled; + } return result; } |