Reported by eckard_klotz here: https://forums.codeblocks.org/index.php/topic,24487.15.html the ask personality dialog is no longer working. It is always loaded the "default" personality.
to reproduce this:
1) copy the "default.conf" and rename it to "second_conf.conf"
2) start codeblocks with --personality=ask
3) select "second_conf.conf"
4) Codeblocks will load "default.conf", you can confirm this in the first line in the code:blocks log tab
I tracked the problem to the PlaceWindow(&dlg) call in SetupPersonality
Code
void CodeBlocksApp::SetupPersonality(const wxString& personality) { if (personality.CmpNoCase(_T("ask")) == 0) { const wxArrayString items(Manager::Get()->GetPersonalityManager()->GetPersonalitiesList()); wxSingleChoiceDialog dlg(nullptr, _("Please choose which personality (profile) to load:"), _("Personalities (profiles)"), items); PlaceWindow(&dlg); if (dlg.ShowModal() == wxID_OK) Manager::Get()->GetPersonalityManager()->SetPersonality(dlg.GetStringSelection()); } else Manager::Get()->GetPersonalityManager()->SetPersonality(personality, true); }
in this call the configuration manager is initialized before the personality is set, so this leads to the config manager initializing always to default (GetPersonality() returns "default" if no personality is set)
Code
#0 ?? PersonalityManager::GetPersonality (this=0x4241f70) (\codeblocks_svn\src\sdk\personalitymanager.cpp:38) #1 0x709a7e92 CfgMgrBldr::CfgMgrBldr(this=0x426bd10) (\codeblocks_svn\src\sdk\configmanager.cpp:183) #2 0x70c6e1c5 Mgr<CfgMgrBldr>::Get() (include/manager.h:225) #3 0x709aa073 CfgMgrBldr::GetConfigManager(name_space=...) (\codeblocks_svn\src\sdk\configmanager.cpp:431) #4 0x70a0b7a6 Manager::GetConfigManager(this=0x4265a30, name_space=...) (\codeblocks_svn\src\sdk\manager.cpp:493) #5 0x709f5053 PlaceWindow(w=0x1dae440, mode=pdlBest, enforce=false) (\codeblocks_svn\src\sdk\globals.cpp:1368) #6 0x4084f3 CodeBlocksApp::SetupPersonality(this=0x1e6c8e0, personality=...) (\codeblocks_svn\src\src\app.cpp:1260) #7 0x407a37 CodeBlocksApp::ParseCmdLine(this=0x1e6c8e0, handlerFrame=0x0, CmdLineString=..., CWD=...) (\codeblocks_svn\src\src\app.cpp:1218) #8 0x403c52 CodeBlocksApp::OnInit(this=0x1e6c8e0) (\codeblocks_svn\src\src\app.cpp:647) #9 0x4fa202 wxAppConsoleBase::CallOnInit(this=0x1e6c8e0) (wxWidgets-3.1.4/include/wx/app.h:93) #10 0x64c73da2 wxEntryReal(int&, wchar_t**) () (\codeblocks_svn\src\devel31_64\wxmsw314u_gcc_custom.dll:??) #11 0x4027cb WinMain(hInstance=0x400000, hPrevInstance=0x0, nCmdShow=10) (\codeblocks_svn\src\src\app.cpp:349) #12 0x4dec6a main () (??:??)
i think we should simply remove the PlaceWindow(&dlg) call here...
Any suggestions?
Forum thread: https://forums.codeblocks.org/index.php/topic,24502
That call to PlaceWindow() was added in revision 12304, so it is compatible with the observations of eckard_klotz here (r12286 works, r12312 does not work).
Yes, I know I've added it. The question is how to prevent this happening in the future...
Dear All.
Please excuse that I post this answer more than once. But I'm unsure what discussion you prefer.
BlueHazzard wrote in the Code::Blocks nightly-forum:
That sounds good. What ever the reason is, if you could reproduce the result it should be possible to find the reason.
BlueHazzard wrote in the Code::Blocks nightly-forum:
Yes I can confirm.
Please stay well and healthy,
Eckard Klotz.
I've pushed a fix for this problem. Please test and report if there are any other regressions.
I get assertion failed at personalitymanager.cpp:37 (m_ready). I am not using personalities.
Now I can't open C::B anymore
This is the stack trace:
I know what it is... I'll fix in a minute...
Fixed [r12452]
Related
Commit: [r12452]
Dear Developers.
Today I have downloaded the 24 May 2021 build (12452)
I can confirm that the issue reported by me regarding the --personality="ask" is not occurring with the new build.
Thanks for your effort to solve it.
Please stay well and healthy,
Eckard Klotz.