News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

[bug report] bug when moving file(s) from a virtual folder to another

Started by r0d, April 02, 2008, 08:00:21 PM

Previous topic - Next topic

r0d

Greetings,

i looked for the right place to post a bug report, but didn't find. If here is not the right place, please say me.

Well, here's the description of the bug:
1. Moving a file from a virtual folder to another.
2. Modify (write into) this file
Result: crash of C::B

Config:
OS: Ubuntu 7.10
C::B 8.02

This bug occur every times this operation is done.

Today I tried with the Windows version (C::B 8.02 also), and the crash don't occur, thus this bug is only on the ubuntu (*nux ?) version.

Hope it helps.
r0d.

Jenna

I can confirm this.

Here's a patch that fixes this issue:


--- codeblocks-1.0svn.orig/src/sdk/cbproject.cpp        2008-03-10 17:55:06.000000000 +0100
+++ codeblocks-1.0svn.work/src/sdk/cbproject.cpp        2008-04-02 23:00:01.000000000 +0200
@@ -1226,6 +1226,8 @@

     SetModified(true);

+    Manager::Get()->GetProjectManager()->RebuildTree();
+
     return true;
}


r0d

Thanks for reply.

That means that i have to modify the source of C::B and rebuild it?

Jenna

Yes.
Or wait until the bug is fixed in this or another way in svn, and then download the next nightly, or wait until I upload a patched version to my repo.

I will do so in some hours (I can post it here if it's done), because at work my upload is 16 times faster than at home (ISDN).

The svn-versions in my repo are build for debian from etch up to unstable/experimental, but should also work under Ubuntu.

Biplab

Be a part of the solution, not a part of the problem.

Jenna

Quote from: Biplab on April 03, 2008, 07:36:30 AM
Will look into this today. :)

Hi Biplab,

the crash happens in line 280 in "projectfile.cpp" when the new image should be set in the tree after changing the files content.

tree->SetItemImage(m_TreeItemId, (int)state, wxTreeItemIcon_Normal);


"m_TreeItemId" only gets set when the tree is build (or rebuild), so I think it's invalid after dragging the node.

The crash does not appear when the project is saved before editing (after saving the project, C::B does a rebuild of the tree).
So I think the easiest way is to rebuild the tree after dragging is completed.

Another solution would be to renew "m_TreeItemId" only, but I haven't got the time to figure out the right place for doing this, so I went the easy way.

Jenna

Quote from: jens on April 03, 2008, 07:32:54 AM
... I can post it here if it's done ...

A patched version is in my repo (see signature).
It's based on svn4984 and therefore called "*1.0svn4984-1*.deb" .

r0d

Thank you very much, for this. But sorry (I am ashamed) I won't use it. I'm not accustomed to linux yet, and i don't have the time to start the process of modifying my IDE. In a few month i will, when i'll be more "zen" with linux.
Thank you one more time.

Jenna

If you follow the instructions on my website you can use "apt-get", "synaptic", "aptitude" or any other "apt"-frontend I perhaps don't know to update C::B.
The only thing is to remove the 8.02-version of C::B before (or to force downgrade), because the package-managers only look for version numbers (1.0 for svn and 8.02 for stable) and not for the package date.

Biplab

Thanks r0d for the pointing this bug and Jens for the patch. Fixed in revision 4985. :)
Be a part of the solution, not a part of the problem.