Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

[SOLVED]request for a new CodeblocksEvent type : end of a 'multiple files add'

<< < (2/4) > >>

thomas:
Nasty hack, I think. I'm against such a message, not only because I think it's not necessary, but there is no good way to implement it either.

orel:
cb_EVT               cb_EVT
  |                        |                              |  svn command execution
  |                        |                              |
---------------------------------------------------------------------------->
  |<-------- 5s -------->|                       |                                             time
  |                       |<-------- 5s -------->|
  |                       |                               |
timer start            |                               |
                    timer start                   timer end



--- Quote from: kkez on November 30, 2007, 11:57:58 am ---Well, no. I don't "get the time between each cbEVT_PROJECT_FILE_ADDED event", i hardcode it (which is easier and safe, )

--- End quote ---

Even if YOU don't 'get the time between each cbEVT_PROJECT_FILE_ADDED', the timer does. So i don't understand the difference between hardcoding this timer and reseting it when receiving the event, and measuring the time between the events and seeing if it is less than an hardcoded value!!!  :D  To me it is really the same or i am not getting it at all !!


--- Quote from: kkez on November 30, 2007, 11:57:58 am ---why should a file take 5 seconds to be added?

--- End quote ---

Because as you see in the diagram, you have to wait at least 5 seconds to execute the command. Those 5 seconds represents the timer expiration needed to understand that no more file will be added.


--- Quote from: thomas on November 30, 2007, 01:19:53 pm ---Nasty hack, I think.

--- End quote ---
Which hack are you talking about? the one with the timer or the one with the new message.


--- Quote from: thomas on November 30, 2007, 01:19:53 pm --- I'm against such a message, not only because I think it's not necessary, but there is no good way to implement it either.

--- End quote ---

I really don't want to insist but why there is no good way to implement it?
You only have to send this event once, when all files has been added, as I said at the end of the for loop in ProjectManager::AddMultipleFilesToProject ()

MortenMacFly:

--- Quote from: orel on November 30, 2007, 03:38:15 pm ---You only have to send this event once, when all files has been added, as I said at the end of the for loop in ProjectManager::AddMultipleFilesToProject ()

--- End quote ---
If that's all, please provide a patch accordingly. But I see a drawback: One could think it's good to listen to both: cbEVT_PROJECT_FILE_ADDED and cbEVT_PROJECT_MULTIPLE_FILES_ADDED. In both cases when the last file is added an operation listening on both would be executed two times.

orel:

--- Quote from: MortenMacFly on November 30, 2007, 03:51:14 pm ---
--- Quote from: orel on November 30, 2007, 03:38:15 pm ---You only have to send this event once, when all files has been added, as I said at the end of the for loop in ProjectManager::AddMultipleFilesToProject ()

--- End quote ---
If that's all, please provide a patch accordingly. But I see a drawback: One could think it's good to listen to both: cbEVT_PROJECT_FILE_ADDED and cbEVT_PROJECT_MULTIPLE_FILES_ADDED. In both cases when the last file is added an operation listening on both would be executed two times.

--- End quote ---

Thank you Morten, i will provide a little patch tonight when i come back from work. Yes that's exactly all i need. For the drawback, it is not clearly one, because those messages are not giving at all the same kind of information about the soft. To me, one gives you the name of the last added file while the other gives you a clue about CodeBlocks current status (here : CB saying i'm done adding new file to one project!!).

kkez:
Since i don't know how it's coded, here's another solution: we could send from Code::Blocks a cbEVT_PROJECT_MULTIPLE_FILES_ARE_GOING_TO_BE_ADDED event (sorry for the name) which only sends the number of files that will be added. Then one listen to every cbEVT_PROJECT_FILE_ADDED and on the last he can do whatever he want. Nasty hack too, but it should be doable..


--- Quote from: orel on November 30, 2007, 03:38:15 pm ---
--- Quote from: kkez on November 30, 2007, 11:57:58 am ---why should a file take 5 seconds to be added?

--- End quote ---

Because as you see in the diagram, you have to wait at least 5 seconds to execute the command. Those 5 seconds represents the timer expiration needed to understand that no more file will be added.
--- End quote ---
Mine was a justification for the "5 seconds" span. What i meant is: there's no file that will take 5 seconds to load, so waiting 5 seconds is safe.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version