Author Topic: Editor : Swap header/source  (Read 2249 times)

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 582
  • L'ami de l'homme. The friend of man.
    • LETARTARE
Editor : Swap header/source
« on: August 15, 2026, 03:00:59 pm »
Leap-15.6

Currently, on a file editor: if you ask to switch to the header/source the requested file opens in an editor all to the right of the open files.
If many files are opened, the layout is incorrectly appropriate.
Is there an option to open it next to the applicant ?
CB-13958, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 582
  • L'ami de l'homme. The friend of man.
    • LETARTARE
Re: Editor : Swap header/source
« Reply #1 on: Yesterday at 02:39:26 pm »
Not having found, I wrote a fix to do so.
But when analyzing the code I found an anomaly !

The class managing the exchange is called 'EditorManager' ('editormanager.h' and 'editormanager.cpp')

Also I offer you a test:
I use the renowned version 'cb-13951' (cb51) and 'cb-13958' (cb58)

1- open any version of 'Cb' but empty,
2- load the 'cb51.cbp' project, open the file 'include/editormanager.h'
3- load the 'cb58.cbp' project, open the file 'include/editormanager.h'
4- activate the project 'cb51' :
    4-1 select 'cb51::editormanager.h'
    4.2 use in the editor's survey menu' => 'Swap header/source' and validate :
    => a file ''cb51::editormanager.cpp' appears on the right ; it's good

    4.3-  select 'cb58::editormanager.h'
    4.4- use in the editor's survey menu' => 'Swap header/source' and validate :
    => the file 'cb51::editormanager.cpp' is selected !!, it's not the good file

This shows that the verification of belonging to the same project was not carried out in the code

If you could confirm these results, I'll drop off a ticket with the fix.
CB-13958, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'