Version: (using KDE KDE 3.5.5) Installed from: SuSE RPMs 3.3.93 I have .h file with almost complete class definition, only construct is moved to .cpp file. I use [F2] to switch between .h and .cpp files. And it works fine. But I added before two last methods in .h file a commet // ------------------------------------------------------------------------------------------------------- to separate them. When I press F2 near the second method the cursor jumps at the first line of the first method (below the line). When I press F2 again nothing happens. If I remove this comment F2 works as intended. Or if I move more up. Of course I would like F2 just switches the files.
Getting a newer version from SVN might help. 3.3.94 fixes 256 bugs 3.4 SVN fixes extra 66 bugs.
3.3.94 -- still there. Btw. it works on any // comment really.
Ok, I guess I know where the bug is -- the behaviour of the switch is changed. When the .h is active switch search for the definition in .cpp if there is none, it does not make a switch. If the user is outside the method the switch is performed. While the search for the method definition is pretty nice, the rest is regression. The search should be an extra thing, but the switch should be performed all the time.
This should work.. and does here. Can you provide more info about your project? What buildsystem are you using? What are the paths of the respective files?
> This should work.. and does here. Here, sometimes. With 3.3.5 there was no search, but switch was 100% reliable. I can include those two files as attachment. > Can you provide more info about your project? C++ code, nothing fancy. Just one class. > What buildsystem are you using? make. > What are the paths of the respective files? The same. So it is /home/macias/prg/mambo/source/Builder.h /home/macias/prg/mambo/source/Builder.cpp Btw. I don't say there is no switch at all, I am just saying that I have to put cursor in empty line, or at the first line (#define) which guarantees the switch.
If you have function implementation in .h file and have your cursor positioned there then the switch will not work because it will decide that implementation is already at the cursor. This does make me think that we shall separate switch header/source from switch decl/def.
Alexander, thanks for explanation -- so it is changed as I suspected. Yes, such switch as would be good, because (at least I don't see it) there is no way to get "smart-switch" (combined those two in one). Btw. the decl/def switch should be a bit smarter, if I am outside the def/decl. it should find the nearest one and then switch. Currently it is mixed def/decl/header/source :-) because of lack of such find.
fixing up this wishlist report. KDevelop4 has no "switch .h/.cpp" but just a switch from declaration to definition (and vice versa). also this applies to cpp support not ada.
There is CTRL + SHIFT + C to switch .h and .cpp files. Marking as fixed.
sorry, but as I said, we don't have a "switch .h/.cpp", we only have "switch decl/def" which is a significant difference.
I would debate that being a significant difference, especially since, when not in a decl/def context, it does switch between .h/.cpp.
sometimes you want to switch quickly to the header and don't move the cursor, i.e. to the last position you where in. Right now ctrl + tab does that but it's not as fast as a single shortcut. So there is still place for this.
But you'll only have to move the cursor in the event that the header for the function you're editing is not the header for the file you're editing. How many times do you want to switch back and forth between a header and a function that's completely unrelated to the header?
Sorry milian, I completely missed your point, I didn't think about that.
*** This bug has been marked as a duplicate of bug 359136 ***