trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: April 2012

Re: [trinity-devel] 2nd Patch [was Re: [trinity-devel] k3b -bug ('K3bAudioEditorWidget::Range* r' previously declared here)]

From: "E. Liddell" <ejlddll@...>
Date: Wed, 18 Apr 2012 17:37:07 -0400
On Wed, 18 Apr 2012 15:52:26 -0500
"David C. Rankin" <drankinatty@...> wrote:

> On 04/18/2012 03:36 PM, David C. Rankin wrote:
> > On 04/18/2012 03:26 PM, David C. Rankin wrote:
> >> else {
> >> = findRange( e->pos() );
> >
> > with the 'r' = of course :)
> >
> 
> Here is what I have come up with from the additional posts here. I've updated 
> the patch to bug report 958. The link to the new patch is here:
> 
> http://bugs.pearsoncomputing.net/attachment.cgi?id=549
> 
> The code reads:
> 
> void K3bAudioEditorWidget::mousePressEvent( TQMouseEvent* e )
> {
>    Range* r = findRangeEdge( e->pos(), &end );
>    m_draggedRange = 0;
>    m_draggedMarker = 0;
>    bool end;
> 
>    if (r) {
>      m_draggedRange = r;
>      m_draggingRangeEnd = end;
>      setSelectedRange( r );
>    }
>    else {
>      r = findRange( e->pos() );
>      d->movedRange = r;
>      d->lastMovePosition = posToMsf( e->pos().x() );
>      setSelectedRange( r );
>      m_draggedMarker = findMarker( e->pos() );
>    }
> 
>    TQFrame::mousePressEvent(e);
> }
> 
> You guys that do the approval before Darrell submits, take a look and let us 
> know if it is good. I'm on to the next one..

Are you sure that compiles?  I would have assumed end needed to be declared before
using a reference to it as an argument to findRangeEdge(), which was why I put things
in the order that I did.  Or maybe I'm wrong.