[Bug 45885] Kdevelop MDI wizard generates incorrect code for slotFileQuit() method

Rosbacke rosbacke at nada.kth.se
Sun Dec 1 16:12:05 UTC 2002


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
     
http://bugs.kde.org/show_bug.cgi?id=45885     
rosbacke at nada.kth.se changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rosbacke at nada.kth.se



------- Additional Comments From rosbacke at nada.kth.se  2002-12-01 16:11 -------
This only fixes the problem for qt3 but introduces a new bug for  qt2. The original code depend on ~KMainWindow to be called (The closed  widget must be deleted) to iterate over memberList. This is probably  OK for qt2 but in qt3, the deletions are post-poned and the loop never   iterates over the windows.  However, using qt2 with the suggested fix would result in iterating   over every second window which I would consider a bug (not confirmed).  I would suggest the following code:        QList<KMainWindow> tList(*memberList);      for(w=tList.first(); w!=0; w=tList.next())        {  	// only close the window if the closeEvent is accepted. If the user  presses Cancel on the saveModified() dialog,  	// the window and the application stay open.  	if(!w->close())  	  break;        }    To replace the original code:        for(w=memberList->first(); w!=0; w=memberList->first())      {        // only close the window if the closeEvent is accepted. If the user  presses Cancel on the saveModified() dialog,        // the window and the application stay open.        if(!w->close())  	break;      }    //------------    This would work with both qt2 and qt3.   --- Mikael Rosbacke (rosbacke(at)nada.kth.se)




More information about the KDevelop-devel mailing list