eliot-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Eliot-dev] eliot/qt training_widget.cpp


From: Olivier Teulière
Subject: [Eliot-dev] eliot/qt training_widget.cpp
Date: Sat, 23 Jan 2010 23:34:23 +0000

CVSROOT:        /cvsroot/eliot
Module name:    eliot
Changes by:     Olivier Teulière <ipkiss>       10/01/23 23:34:23

Modified files:
        qt             : training_widget.cpp 

Log message:
        Make the code more robust by catching std::exception instead of only 
GameException

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/qt/training_widget.cpp?cvsroot=eliot&r1=1.13&r2=1.14

Patches:
Index: training_widget.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/qt/training_widget.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- training_widget.cpp 3 Jul 2009 21:40:15 -0000       1.13
+++ training_widget.cpp 23 Jan 2010 23:34:23 -0000      1.14
@@ -1,6 +1,6 @@
 /*****************************************************************************
  * Eliot
- * Copyright (C) 2008 Olivier Teulière
+ * Copyright (C) 2010 Olivier Teulière
  * Authors: Olivier Teulière <ipkiss @@ gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -215,7 +215,7 @@
                                      lineEditRack->text() != "");
         emit gameUpdated();
     }
-    catch (GameException &e)
+    catch (std::exception &e)
     {
         lineEditRack->setPalette(redPalette);
         emit notifyProblem(_q("Warning: Cannot set the rack to 
'%1'").arg(iText));
@@ -232,7 +232,7 @@
         m_game->trainingSetRackRandom(true, PublicGame::kRACK_ALL);
         emit gameUpdated();
     }
-    catch (GameException &e)
+    catch (std::exception &e)
     {
         emit notifyProblem(_q(e.what()));
     }
@@ -248,7 +248,7 @@
         m_game->trainingSetRackRandom(true, PublicGame::kRACK_NEW);
         emit gameUpdated();
     }
-    catch (GameException &e)
+    catch (std::exception &e)
     {
         emit notifyProblem(_q(e.what()));
     }
@@ -328,7 +328,7 @@
     for (int i = 0; i < qinput.size(); ++i)
     {
         if ((unsigned int)qinput.count(qinput[i], Qt::CaseInsensitive) >
-            m_bag->in(qtw(qinput.mid(i, 1))[0]))
+            m_bag->in(intInput[i]))
         {
             return Invalid;
         }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]