Author Topic: TortoiseSVN plugin and read/write properties of files in codeblocks  (Read 3079 times)

Offline Jan van den Borst

  • Multiple posting newcomer
  • *
  • Posts: 99
Hi All,
I once made a CB SVN plugin based on TortoiseSVN. This allows me to checkout (lock) a file out of subversion from within codeblocks. Subversion then makes the checked-out file read/write instead of write-only.

My problem is that I still cannot edit the file, loaded in the editor, because codeblocks still thinks it is read-only. How can I force codeblocks to re-read the read-write attributes of the file so I can edit the file in the codeblocks editor again.


Offline Gagh

  • Multiple posting newcomer
  • *
  • Posts: 12
Hi Jan,

Just had a nice browse through the headers, looking for something simular, setting the filestate for a scm plugin so it displays the correct state and hopefully correct icon.

Haven't completely figured it out, but if you know the filename, I think you might be able to get the cbEditor where the file is loaded and call reload on it. That might be a wise choice after doing something to the file through svn.

Another approach might be to get the projectfile and call SetFileState on it with the new state. Don't know if the editor gets an event and  knows the changed state and will allow you to edit after that. As you have the source of C::B, just go and look what the different managers and their contained classes offer, you might get lucky and find the correct way to accomplish what you want.

Good luck, if I figure out how to do it, I'll let you know.
OS: winXP sp3 | FreeBSD 7.0-stable | Ubuntu
Compiler: mingw 5.1.3 | gcc 4.2.1 | gcc 4.2.1
IDE: Code::Blocks SVN (on all) WX: 2.8.7 | 2.8.0 | 2.8.8