[Compbench-devel] CompBenchmarks++/Qt-4/Plan PlanDefineBatch.cpp, 1.6, 1.7 PlanDefineBatch.h, 1.6,
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-05-21 19:59:18
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6626 Modified Files: PlanDefineBatch.cpp PlanDefineBatch.h Log Message: Rename methods fixed (signal is now set). Index: PlanDefineBatch.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanDefineBatch.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PlanDefineBatch.cpp 21 May 2007 19:42:14 -0000 1.6 --- PlanDefineBatch.cpp 21 May 2007 19:59:14 -0000 1.7 *************** *** 139,142 **** --- 139,143 ---- { setFlags(Qt::ItemIsEditable | flags()); + addChild(new PlanDefineBatchListItem(PICompilers)); addChild(new PlanDefineBatchListItem(PIOptionSets)); *************** *** 262,265 **** --- 263,268 ---- Qt::QueuedConnection); + connect(this, SIGNAL(itemChanged(QTreeWidgetItem*, int)), + this, SLOT(itemEdited(QTreeWidgetItem*, int))); headerItem()->setHidden(true); *************** *** 318,321 **** --- 321,343 ---- } + void PlanDefineBatchList::itemEdited(QTreeWidgetItem *item, int) + { + PlanDefineBatchListItem *I = (PlanDefineBatchListItem*) item; + + switch(item->type()) { + case PIPlanBatch: + App->planBatchRenamed(I->Batch(), + I->text(0)); + break; + case PIOptionSet: + + App->planOptionSetRenamed(I->Nearest(PIPlanBatch)->Batch(), + I->OptionSet(), + I->text(0)); + break; + default: + break; + } + } void PlanDefineBatchList::doPlanBatchRegister(CBM::PlanBatch *_batch) *************** *** 353,359 **** PlanDefineBatchListItem *I = Item(_batch); - printf("plan ren?\n"); if (I) { - printf("plan ren!\n"); I->Batch()->setId(_newname.toStdString()); } --- 375,379 ---- *************** *** 399,406 **** PlanDefineBatchListItem *I = Item(_batch, _options); - printf("rename I=%x\n", (unsigned int) I); if (I) { ! printf("newid = %s\n", _newname.toStdString().c_str()); ! I->Batch()->setId(_newname.toStdString()); } } --- 419,424 ---- PlanDefineBatchListItem *I = Item(_batch, _options); if (I) { ! _options->setId(_newname.toStdString()); } } Index: PlanDefineBatch.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanDefineBatch.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PlanDefineBatch.h 21 May 2007 19:42:14 -0000 1.6 --- PlanDefineBatch.h 21 May 2007 19:59:14 -0000 1.7 *************** *** 112,115 **** --- 112,118 ---- protected slots: + + virtual void itemEdited(QTreeWidgetItem *item, int); + virtual void doPlanBatchRegister(CBM::PlanBatch *_batch); virtual void doPlanBatchUnregister(CBM::PlanBatch *_batch); |