[Compbench-devel] CompBenchmarks++/Qt-4/Plan PlanDefineBatch.cpp, 1.20, 1.21 PlanDefineBatch.h, 1.1
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-09-26 19:14:00
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv14635 Modified Files: PlanDefineBatch.cpp PlanDefineBatch.h Log Message: Uninstalled benchmarks are removed from batch definitions. Index: PlanDefineBatch.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanDefineBatch.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** PlanDefineBatch.cpp 17 Sep 2007 19:38:47 -0000 1.20 --- PlanDefineBatch.cpp 26 Sep 2007 19:13:57 -0000 1.21 *************** *** 353,356 **** --- 353,359 ---- connect(this, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(itemEdited(QTreeWidgetItem*, int))); + + connect(this, SIGNAL(sigRefreshBenchmarks()), + this, SLOT(doRefreshBenchmarks())); headerItem()->setHidden(true); *************** *** 360,363 **** --- 363,392 ---- } + void PlanDefineBatchList::packageRemoved(CBM::Package *P) + { + PlanDefineBatchListItem *Ri = (PlanDefineBatchListItem*) invisibleRootItem(); + PlanDefineBatchListItem *Pi; + PlanDefineBatchListItem *PBs; + PlanDefineBatchListItem *B; + + int pi, pn = Ri->childCount(); + int bi, bn; + + for(pi=0; pi<pn; pi++) { + Pi=(PlanDefineBatchListItem*) Ri->child(pi); + if (Pi->type()==PIPlanBatch) { + PBs=Pi->Nearest(PIBenchmarks); + bn=PBs->childCount(); + for (bi=0; bi<bn; bi++) { + B=(PlanDefineBatchListItem*) PBs->child(bi); + if (B->Benchmark()->Package()==P) { + Pi->Batch()->remove(B->Benchmark()); + PBs->takeChild(bi); + } + } + } + } + } + PlanDefineBatchListItem *PlanDefineBatchList::Item(CBM::PlanBatch *_batch) { *************** *** 376,379 **** --- 405,422 ---- } + void PlanDefineBatchList::doRefreshBenchmarks(void) + { + int pn = CBM::cbmSystem->packageNumber(); + CBM::Package *P; + int pi; + + for (pi=0; pi<pn; pi++) { + P=CBM::cbmSystem->Package(pi); + if (P->getStatus()<CBM::Package::Preconfigured) { + packageRemoved(P); + } + } + } + PlanDefineBatchListItem *PlanDefineBatchList::Item(CBM::PlanBatch *_batch, CBM::CompilerOptionSet *_options) *************** *** 832,835 **** --- 875,883 ---- } + void PlanDefineBatchList::refreshBenchmarks(void) + { + emit sigRefreshBenchmarks(); + } + PlanDefineBatchList::~PlanDefineBatchList() { Index: PlanDefineBatch.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanDefineBatch.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PlanDefineBatch.h 17 Sep 2007 19:38:47 -0000 1.15 --- PlanDefineBatch.h 26 Sep 2007 19:13:57 -0000 1.16 *************** *** 88,91 **** --- 88,100 ---- private: CBM::Plan *plan; + + void packageRemoved(CBM::Package *P); + + protected slots: + virtual void doRefreshBenchmarks(void); + + signals: + virtual void sigRefreshBenchmarks(void); + protected: virtual PlanDefineBatchListItem *Item(CBM::PlanBatch *_batch); *************** *** 185,188 **** --- 194,199 ---- CBM::CompilerOptions *_options, QString _newname); + + virtual void refreshBenchmarks(void); virtual ~PlanDefineBatchList(); |