Hello CB-Team,
in the Code::Blocks IDE is an issue, that the wrong workspace will be opend by a defined set of the configuration.
System:
Code::Blocks 16.01
Windows 10 (1703)
Konfiguration:
checked, (General Settings) -> Allow only one running instance (will take place after restart)
checkes, (General Settings) -> Use an already running instance (if possible)
!! The Filetype ".workspace" is registered to CB-Launcher !!
Plugins:
File-Manager (to open Workspace by double click)
Description:
By opening a workspace with a double click in the File-Manager-Tree the Code::Blocks IDE opens the correct workspace (first time). When i now close the workpace and try to open an other workspace, the codeblocks opens the first workspace again.
Analyse:
In the system the "Manager::GetCmdLineParser()" in the "src/app.cpp" add only new command lines an in the case of a workspace, only the first entry will be used every time.
See Function: int CodeBlocksApp::ParseCmdLine(MainFrame* handlerFrame, const wxString& CmdLineString)
I'm not sure if it is a good Idea to delete all entrys in the CmdLineParser, create a new wxCmdLineParser or if they are used for other parts.
My first solution was, that i change the direction of reading the parameter of the Parser, to get the last insertet entry first.
Code:
filesInCmdLine = (count != 0) || (!m_AutoFile.empty());
for (int param = count - 1; param >= 0; param--) { // is it a project/workspace? FileType ft = FileTypeOf(parser.GetParam(param)); wxFileName fn(parser.GetParam(param)); ...
In th current trunk i see no changes for the following release at this function.
Please check if it is an issue that is still in the Code::Blocks.
I think it will also occur by opening/changing workspaces out of the windows explorer (doubleclick on workspacefiles).
This report looks the same as [#384]. Is this the case?
What is the value of CmdLineString every time the function is called?
Related
Tickets:
#384Thanks for the quick response.
Sorry this issue is a little bit hard to explain.
It is not a compile error, is a functional issue by open/change workspaces with CB.
The value in the CmdLineString is the selected workspace-file.
In the following line the parser will be set to a "static" Pointer of the CmdLineParser in the Manager-Class:
wxCmdLineParser& parser = *Manager::GetCmdLineParser();
With every "CloseWorkspace and DoubleClick on an other Workspacefile" the Manager::GetCmdLineParser()->GetParamCount() incremeted.
Code with Log-Output an Comment-Description:
int CodeBlocksApp::ParseCmdLine(MainFrame* handlerFrame, const wxString& CmdLineString)
{
I hope this helps to understand it a little bit better.
Ops, I've linked the wrong issue... See this one [#348].
I don't think your solution is good...
Related
Tickets:
#348Hi Teodor,
yes i think thats exact the same issue.
I know that it was a very quick and dirty workaround and it normally makes no sence to keep all the previous CmdLines in the Parser from the new CB instance, so i try to apply the patch in the wxWidgets.
Thanks for this link.
The patch works fine.
The search direction can be "reverted" and the log output of the count stays at max 1, after the first workspace change.
This Ticket can be closed.
wxWidgets problem, fixed in wx3.0.2