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

List:       kde-pim
Subject:    [Kde-pim] kmail separate reader window having previous/next buttons.
From:       <martin.p.bradley () bt ! com>
Date:       2005-08-24 9:04:03
Message-ID: 3046C179E69FC24AB83536978A17614D037E6C72 () i2km96-ukbr ! domain1 ! systemhost ! net
[Download RAW message or body]

Folks,

Version: KDE 3.5
Application: kdepim/kmail

In kmail mail can be opened in a separate window whenever it is double
clicked.  I want to add two new buttons to the toolbar of the separate
reader window.  These buttons are to change the contents of the separate
window to the next/previous email in the current list of messages in the
main window.  This feature has been on the wish list for a long time.


So far I have added one new button to the tool bar.  It can be added to
using the usual configure toolbar dialogue.  The button is connected to
a slot in kmreaderwin.cpp called void KMReaderWin::moveToNextMessage().

void KMReaderWin::moveToNextMessage() uses kmkernel->getKMMainWidget()
to get mainWidget, a pointer to the main widget.  "mainWidget->headers()
const" will give me a pointer to the header.
I have added a two const methods to kmheader.cpp to return to me the
serial number of the next message.  Sorry cannot remember the details of
this but since they are const they should not cause any problems.  (If
not let me know)

Within KMReaderWin::moveToNextMessageBy by using newly found next
message serial number I get a pointer to the next message.  Then using
this pointer I call setMsg which changes the viewer to display next
message which is what I wanted.  Something is wrong because after I then
close the separate viewer window kmail crashes.  I have left a dangling
pointer or something silly like that.  

Could someone point out to me what I am doing wrong or what I should be
using to get the separate reader window to display the new message once
I have obtained a pointer to it.  Or even a completely different better
way to do this.

Regard,
Martin.
_______________________________________________
kde-pim mailing list
kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/

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

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