Author Topic: Change default class creation header extension from .h to .hpp  (Read 246 times)

Offline Feelzor

  • Single posting newcomer
  • *
  • Posts: 2
Change default class creation header extension from .h to .hpp
« on: November 03, 2017, 12:55:25 pm »
Hello!

I must be extremely dumb, but even though I searched a lot, I found many useful things in the settings, I could not find a way to change this settings.

You know, when you create new file > class, it automatically sets the header extension to .h for C++ projects. I must admit I do not really like that, as I always have to manually change the .h to .hpp before creating the file, and I often forget to do so.
So I was wondering, is there a way to set in the settings the default extension for header files? If not, I'll keep doing it manually, and if there is a plugin available for that, do not hesitate to give me its name, I do not care whether it's a plugin or a setting :D

Thanks a bunch for your answers, and I hope this question has not been answered yet / I'm not too dumb ^^

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1540
Re: Change default class creation header extension from .h to .hpp
« Reply #1 on: November 03, 2017, 08:17:52 pm »
currently there is no setting for this.
This are hard coded extensions in the source.
If the devs are ok with it i could make a patch for this.

The question is where to put this setting. One solution would be to provide it only in the config file...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10356
Re: Change default class creation header extension from .h to .hpp
« Reply #2 on: November 03, 2017, 08:41:35 pm »
Put it in the class creation dialog. And make it possible to change the source extension, too.
<debugger plugin maintainer>
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Feelzor

  • Single posting newcomer
  • *
  • Posts: 2
Re: Change default class creation header extension from .h to .hpp
« Reply #3 on: November 04, 2017, 11:35:05 am »
Ah okay, so it's not me just being dumb :')
For the settings, maybe in the class creation dialog, putting a ticking box "remember class extension" and if it's ticked, it remembers the setting ^^

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1540
Re: Change default class creation header extension from .h to .hpp
« Reply #4 on: November 06, 2017, 10:35:39 am »
does it even need a control? How about saving the currently extension by default?

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1540
Re: Change default class creation header extension from .h to .hpp
« Reply #5 on: November 07, 2017, 08:24:27 pm »
Here is a patch that stores the extension of the header and the implementation file by default. I don't think that a setting is needed.

If this should be a setting i think we should it make global for all new file dialog. This would be a lot more work...

greetings