List Info

Thread: Odd behavior from KFileItem




Odd behavior from KFileItem
user name
2006-07-28 16:20:20
Hi all,

I posted this to the PyKDE list, and didn't get anything
definitive. 
Can anyone here help?  Thanks in advance!

Paul

> I'm seeing some odd behavior from KFileItem.  I use
KIO.listRecursive to get files:
>    def locateFiles(self, url):
>         self.kurl = KURL(url)
>         job = KIO.listRecursive(self.kurl, False)
>         QObject.connect(job,
SIGNAL("entries(KIO::Job*, 
 >		const KIO::UDSEntryList&)"), self.newItems)
> 
> For each of the found files, I create a KFileItem:
>     def newItems(self, job, list):
>         newFiles = []
>         for udsList in list:
>             f = KFileItem(udsList, self.kurl, False,
True)
>             newFiles.append(f)
>             self.files.append(f)
> 
> Later on, I display the data for each of the found
files:
> class FileItem:
>     def __init__(self, destDirBase, template,
kFileItem, parent):
>         self._kFileItem = kFileItem
>         self.size = str(self._kFileItem.size())
>         if self.size == None:
>             self.size = "Unknown"
>         self.time = self._kFileItem.timeString()
> 
> The size always ends up as None.  
 > I've pulled apart the UDSEntryList and the size
appears to be
 > correct there.  Somehow KFileItem is not storing it.
> 
> Also, the KFileItem::timeString is off; for example,
"ls" reports the time 
 > correctly as "Jul 20 11:03", while the
timeString reports
 > "2006-07-20 3:03 pm".  Is this a locale
issue?
> My "date" command is showing this:
"Thu Jul 20 13:38:44 EDT 2006".
> 
> I'm running PyKde3 and python 2.4.3.
> 
> 
> Any light you could shed on either of these issues
would be greatly appreciated!
> 
> Paul
 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )