Skip to content

Commit

Permalink
fix error delete traces
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://orchestra.med.harvard.edu/svn/megason/Code/GoFigure2@1921 ef826fda-c0ae-4237-af8e-f8dcbcf7929c
  • Loading branch information
lsouhait committed Dec 11, 2009
1 parent 64bf181 commit 1b0aad8
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions branches/GoFigure2Beta/Code/GUI/lib/QGoPrintDatabase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -309,31 +309,34 @@ void QGoPrintDatabase::DeleteTraces()
VectorValues.push_back(ConvertToString<int>(ID));
iter++;
}
std::vector<std::string> ListBelongingTraces = ListSpecificValuesForOneColumn(
this->m_DatabaseConnector,CollectionOf,CollectionOfID,TraceID,VectorValues);

if (!ListBelongingTraces.empty())
if (!CollectionOf.empty())
{
/** \todo put the collectionid of the belonging traces to 0/null*/
//put the collectionid of the belonging traces to 0:
std::list<int> TracesWithCollectionToBeNull;
std::vector<std::string>::iterator it = ListBelongingTraces.begin();
while (it != ListBelongingTraces.end())
std::vector<std::string> ListBelongingTraces = ListSpecificValuesForOneColumn(
this->m_DatabaseConnector,CollectionOf,CollectionOfID,TraceID,VectorValues);

if (!ListBelongingTraces.empty())
{
std::string ID = *it;
TracesWithCollectionToBeNull.push_back(atoi(ID.c_str()));
it++;
/** \todo put the collectionid of the belonging traces to 0/null*/
//put the collectionid of the belonging traces to 0:
std::list<int> TracesWithCollectionToBeNull;
std::vector<std::string>::iterator it = ListBelongingTraces.begin();
while (it != ListBelongingTraces.end())
{
std::string ID = *it;
TracesWithCollectionToBeNull.push_back(atoi(ID.c_str()));
it++;
}
GoDBCollectionOfTraces* TracesCollectionOf = this->GetCollectionOfTraces(CollectionOf);
TracesCollectionOf->AddSelectedTracesToCollection(TracesWithCollectionToBeNull,0,
this->m_DatabaseConnector);
QTableWidgetChild* TableCollectionOf= this->GetTableWidgetChild(TracesCollectionOf->GetTraceName());
QColor Color(255,255,255,255);
std::string CollectionIDName = TracesCollectionOf->GetCollectionName();
CollectionIDName += "ID";
std::string TraceIDName = TracesCollectionOf->GetTraceName();
TraceIDName += "ID";
TableCollectionOf->UpdateIDs(0,CollectionIDName,Color,TraceIDName,TracesWithCollectionToBeNull);
}
GoDBCollectionOfTraces* TracesCollectionOf = this->GetCollectionOfTraces(CollectionOf);
TracesCollectionOf->AddSelectedTracesToCollection(TracesWithCollectionToBeNull,0,
this->m_DatabaseConnector);
QTableWidgetChild* TableCollectionOf= this->GetTableWidgetChild(TracesCollectionOf->GetTraceName());
QColor Color(255,255,255,255);
std::string CollectionIDName = TracesCollectionOf->GetCollectionName();
CollectionIDName += "ID";
std::string TraceIDName = TracesCollectionOf->GetTraceName();
TraceIDName += "ID";
TableCollectionOf->UpdateIDs(0,CollectionIDName,Color,TraceIDName,TracesWithCollectionToBeNull);
}

//delete traces in the database:
Expand Down

0 comments on commit 1b0aad8

Please sign in to comment.