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

List:       kde-bugs-dist
Subject:    Bug#43208: Fix for bug #43208 "kde standard application endless loop on File/Quit"
From:       Scott Zuk <szuk () telusplanet ! net>
Date:       2002-06-12 9:29:34
[Download RAW message or body]

As stated in the original bug report, kdevelop templates generate 
a broken slotFileQuit() function in the <project>App class.  The 
for loop doesn't iterate over memberList but instead gets stuck on
the first item.  Below is how the fixed for loop should iterate 
(based on example in /usr/share/doc/qt3-doc/qptrlist.html).


~Scott

-------------------------------------------------------------------------------
void KwaveviewApp::slotFileQuit()
{
  slotStatusMsg(i18n("Exiting..."));
  saveOptions();
  // close the first window, the list makes the next one the first again.
  // This ensures that queryClose() is called on each window to ask for closing
  KMainWindow* w;
  if(memberList)
  {
    /* FIXED!  FOR LOOP CHANGED FROM TEMPLATE BECAUSE PROGRAM WASN'T EXITING PROPERLY \
*/  //for(w=memberList->first(); w!=0; w=memberList->first())  // <= Programs don't \
quit with these conditions because the loop gets stuck on the first list item  \
for(w=memberList->first(); w; w=memberList->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;
    }
  }
}

(Complete bug history is available at http://bugs.kde.org/db/43/43208.html)


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

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