[qt5] remove usage of QPointer in icdata
QPointer doesn't protect anything here, it didn't protect anything. It's not possible to delete FcitxQtInputContextProxy outside of input context. Fix #13
This commit is contained in:
parent
909637a5e1
commit
927c3e2041
|
@ -754,12 +754,10 @@ FcitxQtInputContextProxy* QFcitxPlatformInputContext::validICByWindow(QWindow* w
|
||||||
if (iter == m_icMap.end())
|
if (iter == m_icMap.end())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
auto &data = iter->second;
|
auto &data = iter->second;
|
||||||
if (data.proxy.isNull()) {
|
if (!data.proxy || !data.proxy->isValid()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
} else if (data.proxy->isValid()) {
|
|
||||||
return data.proxy.data();
|
|
||||||
}
|
}
|
||||||
return nullptr;
|
return data.proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ enum FcitxKeyState {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FcitxQtICData {
|
struct FcitxQtICData {
|
||||||
FcitxQtICData() : capacity(0), proxy(0), surroundingAnchor(-1), surroundingCursor(-1) {}
|
FcitxQtICData() : capacity(0), proxy(nullptr), surroundingAnchor(-1), surroundingCursor(-1) {}
|
||||||
FcitxQtICData(const FcitxQtICData& that) = delete;
|
FcitxQtICData(const FcitxQtICData& that) = delete;
|
||||||
~FcitxQtICData() {
|
~FcitxQtICData() {
|
||||||
if (proxy) {
|
if (proxy) {
|
||||||
|
@ -120,7 +120,7 @@ struct FcitxQtICData {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QFlags<FcitxCapacityFlags> capacity;
|
QFlags<FcitxCapacityFlags> capacity;
|
||||||
QPointer<FcitxQtInputContextProxy> proxy;
|
FcitxQtInputContextProxy *proxy;
|
||||||
QRect rect;
|
QRect rect;
|
||||||
QString surroundingText;
|
QString surroundingText;
|
||||||
int surroundingAnchor;
|
int surroundingAnchor;
|
||||||
|
|
Loading…
Reference in New Issue