- 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
- implement: config shortcuts
- 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
- enhancement: support C++ using type alias;

View File

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

View File

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