[Psi-devel] Re: History deletion bugfix
Rafael Roquetto
rafaelroquetto at gmail.com
Tue Jun 21 13:04:57 PDT 2005
Sorry but I cant use CVS rite now for some reason
Itll have to be split this way
Thanx
On 6/21/05, Rafael Roquetto <rafaelroquetto at gmail.com> wrote:
> Ok, I have got it.
>
> When Psi try to delete history file, it fails because the file is
> already open by the logger (I guess). The solution I found was simply
> opening the file with WriteOnly flag and writing a NULL character to
> it, hence the file is empty and it works.
>
> Im just going to make some arrangements and send you the patch.
>
> Regards,
> Rafael
>
> On 6/21/05, Rafael Roquetto <rafaelroquetto at gmail.com> wrote:
> > It works well good on Linux... But I have just found out it is not
> > working under Windows... and I have already figured out why.
> > Well, first, it wasnt working because, even though it erased the
> > .history file, it wasnt flushing it from memory. What I did was
> > clearing a QPtrList containing the events, thus flushing it from
> > memory.
> > This is working on Windows, it flushes the memory as it should do.
> > Nevertheless, it is not erasing the .history file on windows (ive
> > just found that now). Thats another bug. Maybe thats just happening to
> > me, but I doubt, since I have already deleted my PsiData folder and it
> > has been recreated by Psi.
> > The point is that QDir::remove() returns false when it should return
> > true, meaning it was unable to delete the .history file.
> > If I try to delete the file by hand, while psi is running, the Windows
> > does not allow me, giving me an error message box which says the file
> > is being used by another application and I cant be deleted (Psi) in
> > this case.
> >
> > And I have no idea why it happens. Maybe the file is not being closed
> > after being opened and read. Im gonna try to use some native Win32 API
> > calls only to check if im able to delete this file, as the
> > QDir::remove() doesnt provide me enough feedback nor a clue, it just
> > returns false. Then if the Win32 API fails to delete it, I can at
> > least get the error (maybe shared access, I dont know)... Suggestions
> > are welcome.
> >
> > Cheers,
> > Rafael
> >
> > On 6/21/05, Remko Troncon <remko at psi-im.org> wrote:
> > > > By the way, I have just found out this bugfix doesnt work on Windows,
> > > > only on Linux....
> > >
> > > What do you mean by 'not working' ?
> > >
> > > cheers,
> > > Remko
> > > _______________________________________________
> > > Psi-devel-affinix.com mailing list
> > > Psi-devel-affinix.com at lists.affinix.com
> > > http://lists.affinix.com/listinfo.cgi/psi-devel-affinix.com
> > >
> >
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: historydlg.cpp.diff
Type: text/x-patch
Size: 580 bytes
Desc: not available
Url : http://listserver.dreamhost.com/pipermail/psi-devel-affinix.com/attachments/20050621/ba04cf5b/historydlg.cpp.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eventdb.h.diff
Type: text/x-patch
Size: 1150 bytes
Desc: not available
Url : http://listserver.dreamhost.com/pipermail/psi-devel-affinix.com/attachments/20050621/ba04cf5b/eventdb.h.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eventdb.cpp.diff
Type: text/x-patch
Size: 850 bytes
Desc: not available
Url : http://listserver.dreamhost.com/pipermail/psi-devel-affinix.com/attachments/20050621/ba04cf5b/eventdb.cpp.bin
More information about the Psi-devel-affinix.com
mailing list