Author Topic: Where to store the configuration of Code::Blocks  (Read 17713 times)

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Where to store the configuration of Code::Blocks
« on: August 12, 2005, 10:15:56 pm »
Where will you prefer to store the configuration (in the Windows ver.)?

If you vote for the INI File, where will be the best place for it?
In the same dir. as Code::Blocks? In the Documents and Settings of the current windows user?

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Where to store the configuration of Code::Blocks
« Reply #1 on: August 12, 2005, 10:21:54 pm »
the best place for the INI File is in the same dir. as Code::Blocks

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Where to store the configuration of Code::Blocks
« Reply #2 on: August 12, 2005, 10:40:03 pm »
Accounting for the fact that code::blocks comes with tinyxml and does its project files in xml, I'd prefer an xml file, both for consistency, and for "coolness". It would be cross-platform and backwards-compatible, too.
Since there is no choice for that, the vote is .ini file.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Where to store the configuration of Code::Blocks
« Reply #3 on: August 12, 2005, 10:58:06 pm »
Accounting for the fact that code::blocks comes with tinyxml and does its project files in xml, I'd prefer an xml file...
i agree, second that

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Where to store the configuration of Code::Blocks
« Reply #4 on: August 13, 2005, 12:04:05 am »
No, wait...

Can I take my vote back? I just realized  that if the path used is the same path to the executable, you can't run Code::Blocks from a CD or a readonly device.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Where to store the configuration of Code::Blocks
« Reply #5 on: August 13, 2005, 12:33:00 am »
What about something like %APPDATA%/codeblocks/codeblocks.ini on Windows and something like ~/.codeblocks under Linux? That would be the way every "good" application is doing it.

Speaking of taking back votes... could we have an option to vote for "xml", too? :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Where to store the configuration of Code::Blocks
« Reply #6 on: August 13, 2005, 01:37:11 am »
I'd say xml is a must. Heck, I DO have a class for writing data into native XML! :shock:
I had written it for my job :P Maybe i could adapt it to read xml, too!

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: Where to store the configuration of Code::Blocks
« Reply #7 on: August 13, 2005, 04:20:57 am »
Haha, I was about to put an XML option, I want something different to the Registry right now! Because wxConfig INI's backend is already implemented. It's a one-line change to support INI files.

But the best way to handle an XML configuration file is already in the wxWidgets roadmap:  :wink:

http://www.wxwidgets.org/roadmap.htm
-Write wxConfig implementation using XML as backend:
    * Portable wxXMLConfig for all platforms


It's on the roadmap, so it will be implemented at some time, but of course, if you want wxXMLConfig right now, you must implement yourself (I don't think it would be difficult).
And then you can contribute it to the wxWidgets code itself. :)

Anyone?
« Last Edit: August 13, 2005, 04:26:13 am by takeshimiya »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Where to store the configuration of Code::Blocks
« Reply #8 on: August 13, 2005, 12:05:08 pm »
http://www.wxwidgets.org/roadmap.htm
[...]
It's on the roadmap, so it will be implemented at some time, but of course, if you want wxXMLConfig right now, you must implement yourself

But... but... but... we already have tinyxml packaged with code::blocks!

Tinyxml can read and write xml, and it is quite easy to use, and platform independent. Tinyxml works reliably and is reasonably efficient.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline squizzz

  • Almost regular
  • **
  • Posts: 132
Re: Where to store the configuration of Code::Blocks
« Reply #9 on: August 13, 2005, 12:46:42 pm »
Quote
Where will you prefer to store the configuration (in the Windows ver.)?
Definitely any external file (XML or .INI), rather than registry.

Quote
If you vote for the INI File, where will be the best place for it?
In the same dir. as Code::Blocks? In the Documents and Settings of the current windows user?
I'd love to have it in the same dir as C::B, but this solution has some downsides, like rick22 mentioned.
I think I vote for Thomas' "something like %APPDATA%/codeblocks/codeblocks.ini on Windows and something like ~/.codeblocks under Linux" as default setting, with user's ability to change it to any other dir at Settings->Environment. ;)
this space is for rent

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: Where to store the configuration of Code::Blocks
« Reply #10 on: August 13, 2005, 01:37:41 pm »
I think I vote for Thomas' "something like %APPDATA%/codeblocks/codeblocks.ini on Windows and something like ~/.codeblocks under Linux" as default setting, with user's ability to change it to any other dir at Settings->Environment. ;)
So you want to make it a setting where to store the settings? Where would you store that setting then?
I suppose if you drop the "any other dir" and just allow %APPDATA%/codeblocks and the installation directory you can look for it in those locations (preferably in that order, so if one user wants different settings from any system-wide ones he can have C::B create one in his %APPDATA% folder).

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Where to store the configuration of Code::Blocks
« Reply #11 on: August 13, 2005, 02:13:33 pm »
Letting the user place the config files may be disadvantageous (and Urxae is right... where to store that info, in the registry? :) )

%APPDATA% is really the place that is designated for that purpose under Windows, it works like a charm, too.
When I lately got a new PC, I just copied the Thunderbird and Firefox folders from %APPDATA% over the network, and I had all my email and all my settings on the new PC. That is really how software should work :)
I wish Office worked that way, too!

Under Linux, I think that ~/.bash_profile, ~/.fetchmailrc, ~/.gnome, ~/.ssh, or ~/.mozilla are good examples for a scheme that works and that each user is able to understand.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Where to store the configuration of Code::Blocks
« Reply #12 on: August 13, 2005, 03:51:52 pm »
Where would you store that setting then?...
it could be a commandline option which overrules the standard %APPDATA%/codeblocks/codeblocks.ini on Windows when it's given

[update]
more clearly spoken:
if there is no overruling commandline option which tells codeblocks to use a specific codeblocks.ini it should use the standard %APPDATA%/codeblocks/codeblocks.ini

so for testing and temporary configurations one can use a specific config.ini by using that commandline option, while the user-specific config.ini is used normally
« Last Edit: August 13, 2005, 03:56:43 pm by tiwag »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Where to store the configuration of Code::Blocks
« Reply #13 on: August 13, 2005, 04:06:28 pm »
Now there is a really good idea :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: Where to store the configuration of Code::Blocks
« Reply #14 on: August 13, 2005, 04:28:35 pm »
if there is no overruling commandline option which tells codeblocks to use a specific codeblocks.ini it should use the standard %APPDATA%/codeblocks/codeblocks.ini

so for testing and temporary configurations one can use a specific config.ini by using that commandline option, while the user-specific config.ini is used normally
Yes of course that works, but I was replying to squizzz suggesting it should be an option under Settings->Environment which doesn't. This is indeed probably the best solution, provided you substitute .xml for .ini ;).

Another idea is to do the above, and if no command line option is given and the appdata file isn't found (ie. this is the first time this user starts C::B), look for a settings file in the C::B directory and copy it to the appdata location. That way, if some [company/group] wants to use certain coding standards that deviate from the default C::B options, it can provide its own default options [on disk images/in custom installers/as a separate download]. Doesn't hurt to be optimistic, does it? 8)

Oh, and I think %APPDATA%/codeblocks/codeblocks.[ini/xml] isn't the best filename, it's a bit redundant. %APPDATA%/codeblocks/settings.[ini/xml] is much better, I think. (and ~/.codeblocks/settings.[ini/xml] on Linux, of course)