Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Modifying ReadONly file attribute from project manager (patch)
MortenMacFly:
Attached is a patch that allows changing the read-only attribute of a file through the file properties in the project tab. I need this very often when working with SVN... Probably it's useful for others, too.
Usage: Select a file in you projects, right-click, select "Properties", notice the checkbox at the end which allows you to toggle the state.
Notice: The Unix implementation is untested, but should work and do no harm.
Feedback is welcome!
[attachment deleted by admin]
ollydbg:
Nice to hear. will test it later ( don't have much time right now )
One thought: what's the difference between your patch and nanyu's plugin.
see here:
http://forums.codeblocks.org/index.php/topic,10163.0.html
MortenMacFly:
--- Quote from: ollydbg on October 21, 2009, 04:03:53 am ---One thought: what's the difference between your patch and nanyu's plugin.
--- End quote ---
This plugin sets files automatically to read-only (and only read-only) at editor level. That means the editor that belongs to a file is set read-only to avoid any editing. My patch works on file level (not editor level), thus is really modifies the file attribute to read-only or writable. This is needed in case the file is read-only on the hard disk (usually if under version control like CVS) and you still want to edit it. So there is no editor needed for this operation. Hence it depends on the platform (file system) you are working on.
Actually this should be part of the file manager plugin by dmoore, but it fits nicely into the file properties dialog which cannot be modified by a plugin.
killerbot:
@Martin, could you think this is also possible "http://forums.codeblocks.org/index.php/topic,11295.0.html" ?
Then it is even more user friendly, an no right click - properties - check needed ...
MortenMacFly:
--- Quote from: killerbot on October 21, 2009, 07:03:03 am ---@Martin, could you think this is also possible "http://forums.codeblocks.org/index.php/topic,11295.0.html" ?
--- End quote ---
I think this is possible. However, I am not sure if we all agree to do that. As of now we don't modify any attributes at all as they may have a reason. So we assume the file's state is simply set. This is a philosophy we followed so far. What you are suggesting can be really erroneous for these reasons:
- There is no wxWidgets support for doing any file manipulation like that. So we need to implement this ourselves for all platforms.
- However, wxWidgtes support is planned but just not implemented, so most likely we have to change it at a later time.
- What happens if the user does not have the right to change the file's attributes or if they are "virtual" like on network shares under Windows?
- What if these are not files, but links (symlinks)?
- What about user/group/admin rights under Linux/Unix? What flag (file mask) to set exactly?
So - you see: It's easier to leave all that decision to the user and it's favourite file manager. The user knows the state of the file, the permissions and file operations possible to do (on the platform/OS). C::B would need to trial-and-error all the time and we would need to implement quite a complex logic and nearly a tiny file explorer. Still from my daily use I see the benefit as I stumble across this nearly every day. I also see this as a nice feature for the file manager plugin. Maybe it fits better there...
So - I'd like to hear Yiannis words on that.
Ps: That's why I provide this functionality as a patch only btw... not appied to trunk and open for discussion.
Navigation
[0] Message Index
[#] Next page
Go to full version