Author Topic: C::B is not saving the settings  (Read 13596 times)

mauser

  • Guest
C::B is not saving the settings
« on: January 02, 2006, 09:03:29 pm »
I built the rev1650, and each time i start it opens compiler setting dialog and tips even if i set the default compiler and disable tips. it seems not to save settings. or maybe some conflict with previous version.

Offline BlackRose

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: C::B is not saving the settings
« Reply #1 on: January 03, 2006, 09:49:54 am »
I have similar problem - each time I start C::B it shows dialog "Compilers auto-detection" with no selected compiler.

I'm using unofficial SVN HEAD revision 1648 (2/1/2006) build from http://paginas.terra.com.br/informatica/mauricio/codeblocks/

As I have been searching for solution I found out some problem when C::B opens its configuration file - maybe some encoding problem, see picture...



(I'm using W2k SP4, Czech version - you can see some special czech characters.)

Note that opening of <AppData> folder is successful, problem occurs at time of opening config file...

BlackRose
« Last Edit: January 03, 2006, 11:36:53 am by BlackRose »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: C::B is not saving the settings
« Reply #2 on: January 03, 2006, 10:22:08 am »
Try if that fixes it. I doubt it will, but it is worth a try.  :?

If it doesn't (which I am afraid of) then it is a bug inside wxPathList.

Unluckily, I have no way of debugging that kind of error.

Code
Index: configmanager.cpp
===================================================================
--- configmanager.cpp (revision 1647)
+++ configmanager.cpp (working copy)
@@ -72,7 +72,7 @@
     wxString loc = absFileName;
     if (loc.IsEmpty())
         loc = ConfigManager::LocateDataFile(_T("default.conf"));
-    doc = new TiXmlDocument(_C(loc));
+    doc = new TiXmlDocument(loc.fn_str());
     if(!doc->LoadFile())
     {
         doc->InsertEndChild(TiXmlDeclaration("1.0", "UTF-8", "yes"));
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline BlackRose

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: C::B is not saving the settings
« Reply #3 on: January 03, 2006, 10:51:25 am »
Thanks for your solution. Unfortunately I'm not using SVN source to compile C::B. I'm using only precompiled binaries - I have to wait until changes will be published :(

grv575

  • Guest
Re: C::B is not saving the settings
« Reply #4 on: January 03, 2006, 12:16:03 pm »
view->layouts->save current?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: C::B is not saving the settings
« Reply #5 on: January 03, 2006, 03:02:47 pm »
view->layouts->save current?
No, look at his screenshot. There is an A-some-unknown-diacritic instead of an i-acute in the pathname, so it fails to open.

I have no idea where that character comes from, though. The patch above replaces the mb_str macro with fn_str() because the documentation says "converts to the format the native filesystem expects". Very likely, it will change nothing at all because it is the same anyway, but it is worth a try.

The location of the home folder is queried from Windows and (along with a few fallback paths) fed to a wxPathList from which the final, fully-qualified filename is returned.
It is unlikely that Windows returns a bad path (even Windows should really know its own paths), so I am afraid it might come from wxPathList. But having no Czech System here, there's no way I could verify that theory.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline BlackRose

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: C::B is not saving the settings
« Reply #6 on: January 03, 2006, 03:30:52 pm »
Please can you make a "temp" build of C::B with your suggested change and send it to me ? I will test it and we should be immediately sure if it has solved the problem.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: C::B is not saving the settings
« Reply #7 on: January 04, 2006, 12:25:25 am »
Hmm... I just noticed that wxString::fn_str() returns wxChar* (which was the reason why I did not use it in the first place, now I remember  :?) so that does not compile at all... TinyXML does not accept wchar_t arguments.  :(

So... I assume it is a general problem with Unicode filenames... Give me a little time, I'll have to work out a loader which reads in the file and passes the contents to TinyXML in a buffer, this should work. Unluckily that means that I'll have to do the same for saving, again.

When I have it running for me, I'll mail it to you for testing (not tonight any more, though).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline BlackRose

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: C::B is not saving the settings
« Reply #8 on: January 04, 2006, 07:05:43 am »
OK, I will wait for it :)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: C::B is not saving the settings
« Reply #9 on: January 04, 2006, 03:02:24 pm »
OK, I will wait for it :)
I believe it works now...
Tried to mail it to the "centrum" address, but was rejected with the message "illegal attachement". :(
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline BlackRose

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: C::B is not saving the settings
« Reply #10 on: January 04, 2006, 05:15:17 pm »
Please check PM.

Offline CmKaHo

  • Multiple posting newcomer
  • *
  • Posts: 26
Re: C::B is not saving the settings
« Reply #11 on: January 04, 2006, 08:15:51 pm »
Thomas, could you, please, send this patch to me. I have the same problem - I am also using czech XP. I am able to test it and send you a results.

Thanx,
Karel

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: C::B is not saving the settings
« Reply #12 on: January 04, 2006, 08:19:38 pm »
It is in svn since about 4 hours. :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline BlackRose

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: C::B is not saving the settings
« Reply #13 on: January 05, 2006, 06:39:56 am »
Thank You, now C::B works OK - at starting found my previous configurations, changes in settings seem to be saved! Good job done!

Tahank You very much.

BlackRose

Offline BlackRose

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: C::B is not saving the settings
« Reply #14 on: January 12, 2006, 08:54:10 am »
While working in C::B rev 1719 I have found similar problem with default.workspace file. It seems to occur only at closing of C::B IDE when changes in default.workspace have to be saved.
See selected line in picture and 3rd line from bottom:


As a result no change in default.workspace is saved.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: C::B is not saving the settings
« Reply #15 on: January 12, 2006, 03:14:19 pm »
Hmm... again, hard to figure for me, having no comparable system  :?
From looking at the sources, the only possible loophole which I can see is the Windows API function SHGetFolderPath (and the conversion of the result). From this point, everything related to the pathname of default.workspace works on wxStrings, which shouldn't have that kind of problem.

Can you look in Code::Blocks' debug log? It should say something like "Saving workspace some/path/to/workspace" - does this show the wrong path there too?


Problem is identified, is the same issue as it was with configurations. The same applies to projects as well. Yiannis will work on it this afternoon, since he can test it on his system, too.
« Last Edit: January 12, 2006, 03:49:43 pm by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline BlackRose

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: C::B is not saving the settings
« Reply #16 on: January 16, 2006, 06:46:26 am »
I'm currently using C::B rev1763. Problem seems to be solved, workspace is saved pretty good :D. Thank you


Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: C::B is not saving the settings
« Reply #17 on: January 18, 2006, 12:13:23 am »
BlackRose: What are you using to show those I/O calls?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

takeshimiya

  • Guest
Re: C::B is not saving the settings
« Reply #19 on: January 18, 2006, 12:28:26 am »
From Sysinternals: Filemon, Regmon, and Process Explorer are a must utilities.
I wonder if there are any counterparts in linux.

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: C::B is not saving the settings
« Reply #20 on: January 18, 2006, 01:46:09 am »
Quote from: Takeshi Miya
I wonder if there are any counterparts in linux.

Something able to show everything in /proc with a nice interface would do :)

KDE has some kind of taskmanager and there're many wmdocks and Karamba thingies, but I'ven't searched further in this subject.

Offline BlackRose

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: C::B is not saving the settings
« Reply #21 on: January 18, 2006, 03:18:07 pm »
rickg22: I'm too late with my answer so I can only confirm: Yes, I'm using FileMon. :)