Forum > Third party

Cross platform DirectoryWatcher

<< < (2/4) > >>

ASerge:

--- Quote from: Wosi on July 02, 2017, 07:30:21 pm ---Please tell me if you find a bug.

--- End quote ---
OnGetData is called without synchronization with the main thread. When used in GUI applications, this can cause problems.

Wosi:

--- Quote from: hnb on July 02, 2017, 08:48:04 pm ---https://synopse.info/files/html/Synopse%20mORMot%20Framework%20SAD%201.18.html#TITL_34

Any part of mORMot can be integrated with Lazarus or FPC at any time. FPC RTL/FCL is licensed under modified LGPL with static linking exception, see: http://wiki.freepascal.org/modified_LGPL

--- End quote ---

Thanks, I copied the license text from mORMot.


--- Quote from: ASerge on July 02, 2017, 08:53:39 pm ---
--- Quote from: Wosi on July 02, 2017, 07:30:21 pm ---Please tell me if you find a bug.

--- End quote ---
OnGetData is called without synchronization with the main thread. When used in GUI applications, this can cause problems.

--- End quote ---

Works as intended. If synchronization is important then the user of the library has to take care of it inside the callback.

JuhaManninen:
The nested method calls when constructing TDirectoryWatcherBuilder is a nice idea.
However I think the user should have an option to use a more traditional way of setting properties.
For example there should be:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---property Recursive: Boolean read FRecursively write FRecursively;property OnDirectoryChanged: TDirectoryEvent read FCallBack write FCallBack;Note the naming convention for the event property, they typically start with On...
The event type itself could be TDirectoryChangedEvent, and the event variable could be FOnDirectoryChanged instead of FCallBack.
The event handler in the example is poorly named. It should be DirectoryChanged or maybe FileChanged instead of OnFileEvent.

Is there a need to separate events for directories and files?

@hnb, you are an FPC developer, or at least a semi-developer due to your generics collection work.
Can you influence this DirectoryWatcher going into FPC libs?
We can also ask about it in fpc-dev list.

hnb:

--- Quote from: JuhaManninen on July 03, 2017, 01:07:18 pm ---@hnb, you are an FPC developer, or at least a semi-developer due to your generics collection work.

--- End quote ---
I have no idea x)

--- Quote from: JuhaManninen on July 03, 2017, 01:07:18 pm ---Can you influence this DirectoryWatcher going into FPC libs?
We can also ask about it in fpc-dev list.

--- End quote ---
No need to ask on fpc-dev list. The library will be added to FCL (rather synchronized with not committed yet similar library).

hnb:
@Wosi please check PM from me.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version