Author Topic: [bug report] bug when moving file(s) from a virtual folder to another  (Read 4244 times)

Offline r0d

  • Single posting newcomer
  • *
  • Posts: 6
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.
« Last Edit: April 02, 2008, 08:01:55 pm by r0d »

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: [bug report] bug when moving file(s) from a virtual folder to another
« Reply #1 on: April 02, 2008, 11:08:09 pm »
I can confirm this.

Here's a patch that fixes this issue:

Code: [Select]
--- 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;
 }


Offline r0d

  • Single posting newcomer
  • *
  • Posts: 6
Re: [bug report] bug when moving file(s) from a virtual folder to another
« Reply #2 on: April 03, 2008, 01:54:30 am »
Thanks for reply.

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

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: [bug report] bug when moving file(s) from a virtual folder to another
« Reply #3 on: April 03, 2008, 07:32:54 am »
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.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: [bug report] bug when moving file(s) from a virtual folder to another
« Reply #4 on: April 03, 2008, 07:36:30 am »
Will look into this today. :)
Be a part of the solution, not a part of the problem.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: [bug report] bug when moving file(s) from a virtual folder to another
« Reply #5 on: April 03, 2008, 07:48:03 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.
Code: [Select]
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.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: [bug report] bug when moving file(s) from a virtual folder to another
« Reply #6 on: April 03, 2008, 12:36:08 pm »
... 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" .

Offline r0d

  • Single posting newcomer
  • *
  • Posts: 6
Re: [bug report] bug when moving file(s) from a virtual folder to another
« Reply #7 on: April 03, 2008, 01:28:01 pm »
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.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: [bug report] bug when moving file(s) from a virtual folder to another
« Reply #8 on: April 03, 2008, 01:35:28 pm »
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.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: [bug report] bug when moving file(s) from a virtual folder to another
« Reply #9 on: April 03, 2008, 05:32:44 pm »
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.