2007/6/1, Andreas Pakulat <apaku gmx.de>:
> On 31.05.07 13:58:35, dukju ahn wrote:
> > Rather than emitting removedEntries(), having
virtual interface is more good.
> > This virtual interface will be called instead of
emitting signal.
> > And each managers just implement their own
removedEntries() and somthing.
>
> But then the Watcher class is bound to the project
manager, I was saying
> that it should be a more general-purpose wrapper
around
> QFileSystemWatcher to provide more fine-grained signals
(instead of
> directoryChanged the user of the class is notified when
files are
> added/deleted). This is something that will be used
elsewhere in
> KDevelop.
It can't be separated from projectmanager. It uses
Project*Items to determine
whether some file/dir was created/deleted or not. Thus, to
guarantee
proper operation, its signals(or virtual interfaces
whatever) should be
handled by projectmanager. For example, if one directory was
copied
by external action, the projectmanager should parse that
directory to create
proper ProjectFolderItem or FileItem.
Moreover, connecting its signal from other component is
unsafe. For ex.
when the files/dir are deleted,
QList<ProjectFileItem*> is given
as an argument. ProjectManager will delete that from model.
Then, other
component recevies already deleted pointer and it
segfaults.
If we need signal for other componenet than project manager,
we can
have each project manager emit signals inside that virtual
interface. Only
after proper operations are taken, the signals can be
emitted safely.
And other plugins get the pointer via IProject::watcher() or
something.
_______________________________________________
KDevelop-devel mailing list
KDevelop-devel kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel
|