- fix: editor's inproject property not correctly setted (and may cause devcpp to crash when close project)

This commit is contained in:
royqh1979@gmail.com 2021-10-07 00:48:05 +08:00
parent e6d4bdd43c
commit ec458a880a
3 changed files with 6 additions and 1 deletions

View File

@ -25,6 +25,7 @@ Version 0.6.0
- fix: editors disappeared when close/close all - fix: editors disappeared when close/close all
- implement: config shortcuts - implement: config shortcuts
- implement: handle windows logout message - implement: handle windows logout message
- fix: editor's inproject property not correctly setted (and may cause devcpp to crash when close project)
Version 0.5.0 Version 0.5.0
- enhancement: support C++ using type alias; - enhancement: support C++ using type alias;

View File

@ -2794,6 +2794,7 @@ void Editor::setInProject(bool newInProject)
{ {
if (mInProject == newInProject) if (mInProject == newInProject)
return; return;
mInProject = newInProject;
if (mInProject) { if (mInProject) {
initParser(); initParser();
} else { } else {

View File

@ -29,6 +29,8 @@ public:
bool WindowLogoutEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, long *result){ bool WindowLogoutEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, long *result){
MSG * pMsg = static_cast<MSG *>(message); MSG * pMsg = static_cast<MSG *>(message);
if (pMsg->message == WM_QUERYENDSESSION) { if (pMsg->message == WM_QUERYENDSESSION) {
if (pMsg->lParam == 0
|| (pMsg->lParam & ENDSESSION_LOGOFF)) {
if (!pMainWindow->close()) { if (!pMainWindow->close()) {
*result = 0; *result = 0;
} else { } else {
@ -36,6 +38,7 @@ bool WindowLogoutEventFilter::nativeEventFilter(const QByteArray &eventType, voi
} }
return true; return true;
} }
}
return false; return false;
} }