Hi.<br><b><br>BUG :</b><br><br>I was going through the Strigi Service, and I noticed that it stores the folders to index in a service file named strigiservicerc (duh!) The problem is that the folder being watched are sometimes renamed/moved, and when that happens Strigi deletes its indexed metadata. Furthermore, if a directory in one of the indexed directories, and is moved out of it, the metadata is deleted. :-/ This all happens when the strigiservice is restarted. The culprit -> Nepomuk::IndexScheduler::removeOldAndUnwantedEntries()<br>
<br>Fixing this, in my opinion, would require us to watch the indexed directories for changes. Unfortunately crappy <i>inotify</i> doesn't allow this. If a watched directory is renamed it gives us a EventMoveSelf, but doesn't tell us what it has been renamed to or where it has been moved. (I know! Stupid!) So, the only solution I can think of is to watch its parent directory, that will atleast tell us what it's been renamed to. In order to know where it has been moved to we'll need to watch everything, which is a huge resource hog (Yes, Filewatcher, I'm talking about you!)<br>
<b><br>PATCHES :</b><br><br>For starters, we need to move the kinotify class to a better location, so that it can be used by both the filewatcher, and strigi.<br><br>In KINotify, I found a couple of functions to be implemented inefficiently ( O(n), when it can be close to O(1). ) So, I optimized it a little bit. The problem came while optimizing <i>KInotify::removeWatch( const QString& path )</i>. It currently removes all watches who's paths start with path, which doesn't seem right. It should <i>only</i> remove the watch corresponding to the given path. The full optimization patch does this.<br>
<br>I've tried to hack a solution to the <b>BUG</b>. This is just a preliminary patch! I created a new class called ConfigFolderWatcher (got a better name?). I didn't want to clutter up the <i>strigiservice</i> class. In order for this class to work I copied the kinotify class from the filewatch service (Temp. solution, you'll need to do the same) The current Patch works perfectly for renaming and moving to a sibling directory. But not for, well, anything else. Look at the source code! The filewatcher service suffers from a somewhat same problem. <br>
<b><br><br>SCRIPTS :</b><br><br>I usually tend to write scripts for stuff I do frequently, and I wrote a couple for Nepomuk. They are available over here -> <a href="http://pastebin.com/pxDVSWWQ">http://pastebin.com/pxDVSWWQ</a> . The service ones aren't perfect but they're useful. Has anyone else written any scripts which may be useful? If so, please share them! :-)<br>
<br>Thanks<br><br>- Vishesh Handa<br><br><br>