/[projects]/queensgui/src/queensmain.cpp
ViewVC logotype

Diff of /queensgui/src/queensmain.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3 by torben, Thu Jul 19 22:26:42 2007 UTC revision 4 by torben, Thu Jul 19 23:44:01 2007 UTC
# Line 32  Line 32 
32  #include "board.h"  #include "board.h"
33  #include "queens.h"  #include "queens.h"
34  #include "solution.h"  #include "solution.h"
35  #include "solutionvector.h"  
36  #include "solutionlist.h"  #include "containervector.h"
37  #include "solutionhash.h"  #include "containerlist.h"
38  #include "solutionmnvector.h"  #include "containerhash.h"
39    #include "containermnvector.h"
40    
41  #include "config.h"  #include "config.h"
42    
# Line 82  QueensMain::QueensMain(QWidget *parent, Line 83  QueensMain::QueensMain(QWidget *parent,
83      m_sortalgo = SortList;      m_sortalgo = SortList;
84      m_solutions = NULL;      m_solutions = NULL;
85      m_queens = NULL;      m_queens = NULL;
86            m_sol = NULL;
87            
88      connect(m_quit,      connect(m_quit,
89          SIGNAL( clicked() ),          SIGNAL( clicked() ),
# Line 143  void QueensMain::start() Line 145  void QueensMain::start()
145           delete m_solutions;           delete m_solutions;
146      switch (m_sortalgo) {      switch (m_sortalgo) {
147              case SortList:              case SortList:
148                      m_solutions = new SolutionList(this);                      m_solutions = new ContainerList(this);
149                      break;                      break;
150              case SortVector:              case SortVector:
151                      m_solutions = new SolutionVector(this);                      m_solutions = new ContainerVector(this);
152                      break;                      break;
153              case SortHash:              case SortHash:
154                      m_solutions = new SolutionHash(this);                      m_solutions = new ContainerHash(this);
155                      break;                      break;
156              case SortMNVector:              case SortMNVector:
157                      m_solutions = new SolutionMNVector(this);                      m_solutions = new ContainerMNVector(this);
158                      break;                      break;
159      }      }
160                    
# Line 172  void QueensMain::start() Line 174  void QueensMain::start()
174    
175      m_elapsed.start();      m_elapsed.start();
176      m_time.start();      m_time.start();
177      m_queens = new Queens(this, m_solutions, m_sizeSelector->value() ,false);      m_queens = new Queens(this, m_sol, m_solutions, m_sizeSelector->value() ,false);
178      m_queens->start();      m_queens->start();
179  }  }
180    
# Line 220  void QueensMain::showSolution() Line 222  void QueensMain::showSolution()
222  {  {
223          int index = m_list->currentItem();          int index = m_list->currentItem();
224          Solution* sol = m_solutions->solution( index );          Solution* sol = m_solutions->solution( index );
225          m_board->setMatrix( *sol );          m_board->setMatrix( sol );
226  }  }
227    
228  void QueensMain::resize(int size)  void QueensMain::resize(int size)

Legend:
Removed from v.3  
changed lines
  Added in v.4

  ViewVC Help
Powered by ViewVC 1.1.20