[immodule-qt] Re: [SCIM] scim-qtimm 0.7 released

LiuCougar liucougar at gmail.com
Mon Sep 6 06:34:38 EEST 2004


On Mon, 6 Sep 2004 11:27:26 +0800, Zhe Su <james.su at gmail.com> wrote:
> Hi,
>   I just read though this new code, and found that there is no exit
> point in the for (;;) {...} loop. Is it correct?
Oops, sorry about that, the rectified version is:
void QApplication::postIMEvent( QObject *receiver, QIMEvent *event )
{
    if( event->type() == QEvent::IMCompose )
        postEvent( receiver, event );
    else {
        QPostEventList * l = receiver->postedEvents;

        //get rid of IMCompose event posted before
        if ( event->type() == QEvent::IMCompose ) {
            l->first();
            QPostEvent * cur = 0;
            for ( ;; ) {
                while ( (cur=l->current()) != 0 &&
                        ( cur->receiver != receiver ||
                          cur->event == 0 ||
                          cur->event->type() != event->type() ) )
                    l->next();
                if ( l->current() != 0 ) {
                    if ( cur->event->type() == QEvent::IMCompose ) {
                        delete cur->event;
                        l->remove(cur);
                    }
                } else
                  break;
            }
        }
        sendEvent( receiver, event );
        delete event;
    }
}

Thanks for correcting me ;)

Regards,

-- 
"People's characters are strengthened through struggle against
difficulties; they are weakened by comfort."
- Old Chinese adage



More information about the immodule-qt mailing list