News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Files modified externally not refreshed

Started by jumafra, January 16, 2008, 11:33:50 PM

Previous topic - Next topic

jumafra

Hello,

I have some post-build commands that create/replace a log file which I have open on C::B editor.
After build process ends, the file isn't refreshed/reloaded, unless C::B looses and regains focus.
Would it be possible to have it reload files which are modified externally immediatly?
Regards,
Juan.

edit:
Using Rev 4820 on WinXP SP2

MortenMacFly

Quote from: jumafra on January 16, 2008, 11:33:50 PM
Would it be possible to have it reload files which are modified externally immediatly?
This is rather unlikely.
Becasue that would require polling all files "permanently" for modification. I guess that's not desired. Currently the modification check is bound to when the editor gets activated again. At that time it's most likely the user wold like to really modify the file. So to avoid conflicts the question is raised there at minimal (computing) cost.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

MortenMacFly

Anyways: I guess it could be easy to implement as a plugin - something like a menu entry "refresh all open editors". A very simple (5-liner or so ;-)) C::B plugin.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

jumafra

Quote from: MortenMacFly on January 17, 2008, 01:19:25 PM
Currently the modification check is bound to when the editor gets activated again.
Right now C::B itself has to loose focus for the file(s) to be refreshed. Wouldn't it be better to poll open files when switching editor tabs?.

thomas

That might work, but then we'd probably have people working on notebooks complain that the CPU fan spins up every time. Not sure.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

jumafra

Yeah, that might increase resources usage unnecessarily for most C::B users.
I guess I'll have to bear with it, and remember to force refresh. Or maybe, as Morten suggests, to implement that as a plugin... If only I knew how.
Regards
Juan

thomas

"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

jumafra

Thanks Thomas. I'll give it a try when I have a proper wx building environment set.
Regards
Juan

MortenMacFly

Quote from: thomas on January 19, 2008, 01:10:33 PM
Like this:
Did I say 5-liner? Thomas did it in a two-liner... cool stuff! ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

thomas

Actually that plugin is harmless enough to be in the source tree and nightly builds.

There's nothing in it that could possibly break something. The worst thing to happen would be some CPU cycles burnt, and if someone doesn't like it, he doesn't need to load the plugin...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

dmoore

IMO those two lines are harmless+useful enough that they shouldn't be a plugin at all and part of the core (make it possible to disable in environment/editor settings)
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]