[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [PATCH] Dirwatcher isn't called in KDirLister redirections
From:       Gustavo Pichorim Boiko <boiko () conectiva ! com ! br>
Date:       2004-04-08 14:56:49
Message-ID: 200404081156.59346.boiko () conectiva ! com ! br
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Hi

I was testing KDirLister and I found this problem: when KDirLister is 
redirected (when KDirLister is called with devices:/devcdrommntcdrom, it is 
redirected to /mnt/cdrom), it doesn't set autoupdate to the redirected URL.

In my case, I was testing the supermount behaviour with DNotify and FAM, and 
when I called KDirLister directly to /mnt/cdrom, it works... Then I saw this 
problem.

The attached patch is intended to solve the problem (I don't know if it is the 
best way to solve it, but at least it works)

Please check the patch and tell me back if it is correctly or what I need to 
do to make it right.

Thanks
-- 
Gustavo Pichorim Boiko
--
boiko @ conectiva . com . br

["kdirlister_redirection.patch" (text/x-diff)]

--- kdelibs-3.2.1/kio/kio/kdirlister.cpp.orig	2004-03-23 10:15:40.113790324 -0300
+++ kdelibs-3.2.1/kio/kio/kdirlister.cpp	2004-03-23 10:15:47.367263627 -0300
@@ -1036,8 +1036,21 @@
   delete dir->rootItem;
   dir->rootItem = 0;
   dir->lstItems->clear();
+  
+  dir = new DirItem(newUrl);
+  
   itemsInUse.insert( newUrl.url(), dir );
   urlsCurrentlyListed.insert( newUrl.url(), listers );
+  
+  listers = urlsCurrentlyListed.find( newUrl.url() );
+  for (KDirLister *kdl = listers->first(); kdl; kdl=listers->next())
+  {
+  	if ( kdl->d->url.equals( newUrl, true ) && kdl->d->autoUpdate )
+	{
+		dir->incAutoUpdate();
+		break;
+	}
+  }
 }
 
 void KDirListerCache::renameDir( const KURL &oldUrl, const KURL &newUrl )

[Attachment #6 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic