> Another cleanup patch. The remaining user of next_dialog, do_fromcwd,
> requires slightly more invasive refactoring, hence is not included with
> these changes.

Huh???  Doesn't this straightforward patch do it?:

2003-07-28  Gary R. Van Sickle  <[EMAIL PROTECTED]>
        * fromcwd.cc (do_fromcwd): Change return type to bool.  Eliminate
        use of next_dialog, return true or false instead.
        * localdir.cc (LocalDirPage::OnNext): Use do_fromcwd()'s return
        value instead of next_dialog.
-- 
Gary R. Van Sickle
Brewer.  Patriot. 
Index: fromcwd.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/fromcwd.cc,v
retrieving revision 2.27
diff -p -u -b -r2.27 fromcwd.cc
--- fromcwd.cc  19 May 2002 12:54:16 -0000      2.27
+++ fromcwd.cc  29 Jul 2003 02:42:33 -0000
@@ -71,7 +71,7 @@ private:
   bool found;
 };
   
-void
+bool
 do_fromcwd (HINSTANCE h, HWND owner)
 {
   // Assume we won't find the INI file.
@@ -80,15 +80,12 @@ do_fromcwd (HINSTANCE h, HWND owner)
   if (found_ini)
     {
       // Found INI, load it.
-      next_dialog = IDD_S_LOAD_INI;
-      return;
+      return true;
     }
 
-  next_dialog = IDD_CHOOSE;
-
   IniParseFeedback myFeedback;
   IniDBBuilderPackage myBuilder(myFeedback);
   ScanFindVisitor myVisitor (myBuilder);
   Find(".").accept(myVisitor);
-  return;
+  return false;
 }
Index: localdir.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/localdir.cc,v
retrieving revision 2.13
diff -p -u -b -r2.13 localdir.cc
--- localdir.cc 26 Jul 2003 09:16:51 -0000      2.13
+++ localdir.cc 29 Jul 2003 02:42:34 -0000
@@ -198,13 +198,14 @@ LocalDirPage::OnNext ()
     {
       if (source == IDC_SOURCE_CWD)
        {
-         do_fromcwd (GetInstance (), GetHWND ());
-         if (next_dialog == IDD_S_LOAD_INI)
+         bool found_ini;
+         found_ini = do_fromcwd (GetInstance (), GetHWND ());
+         if (found_ini)
            {
              Progress.SetActivateTask (WM_APP_START_SETUP_INI_DOWNLOAD);
              return IDD_INSTATUS;
            }
-         return next_dialog;
+         return IDD_CHOOSE;
        }
     }
   else

Reply via email to