From: Zack Rusin Date: Sun, 17 Apr 2011 06:34:45 +0000 (-0400) Subject: The trace now knows whether is has been edited. X-Git-Tag: 2.0_alpha^2~1050^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ddd2502eeb411d1dae9004cf1636aa3a1b8e755;p=tools%2Fapitrace.git The trace now knows whether is has been edited. --- diff --git a/gui/apitrace.cpp b/gui/apitrace.cpp index ffe9ae8..8bae919 100644 --- a/gui/apitrace.cpp +++ b/gui/apitrace.cpp @@ -204,7 +204,7 @@ void ApiTrace::callReverted(ApiTraceCall *call) emit changed(call); } -bool ApiTrace::isEdited() const +bool ApiTrace::edited() const { return !m_editedCalls.isEmpty(); } diff --git a/gui/apitrace.h b/gui/apitrace.h index 51abe8b..3c27543 100644 --- a/gui/apitrace.h +++ b/gui/apitrace.h @@ -45,7 +45,7 @@ public: void callEdited(ApiTraceCall *call); void callReverted(ApiTraceCall *call); - bool isEdited() const; + bool edited() const; public slots: void setFileName(const QString &name); diff --git a/gui/apitracecall.cpp b/gui/apitracecall.cpp index a43c699..608e482 100644 --- a/gui/apitracecall.cpp +++ b/gui/apitracecall.cpp @@ -648,6 +648,7 @@ ApiTraceEvent::~ApiTraceEvent() void ApiTraceCall::revert() { + setEditedValues(QVariantList()); } ApiTrace * ApiTraceFrame::parentTrace() const diff --git a/gui/apitracemodel.cpp b/gui/apitracemodel.cpp index b41920e..4d28cd3 100644 --- a/gui/apitracemodel.cpp +++ b/gui/apitracemodel.cpp @@ -206,6 +206,8 @@ void ApiTraceModel::setApiTrace(ApiTrace *trace) this, SLOT(invalidateFrames())); connect(m_trace, SIGNAL(framesAdded(int, int)), this, SLOT(appendFrames(int, int))); + connect(m_trace, SIGNAL(changed(ApiTraceCall*)), + this, SLOT(callChanged(ApiTraceCall*))); } const ApiTrace * ApiTraceModel::apiTrace() const @@ -276,4 +278,10 @@ QModelIndex ApiTraceModel::indexForCall(ApiTraceCall *call) const return createIndex(row, 0, call); } +void ApiTraceModel::callChanged(ApiTraceCall *call) +{ + qDebug()<<"Call changed = "<edited(); + qDebug()<<"\ttrace edited = "<parentFrame()->parentTrace()->edited(); +} + #include "apitracemodel.moc" diff --git a/gui/apitracemodel.h b/gui/apitracemodel.h index 7a0394b..752d7b6 100644 --- a/gui/apitracemodel.h +++ b/gui/apitracemodel.h @@ -50,6 +50,7 @@ public: private slots: void invalidateFrames(); void appendFrames(int oldCount, int numAdded); + void callChanged(ApiTraceCall *call); private: ApiTraceEvent *item(const QModelIndex &index) const; diff --git a/gui/argumentseditor.cpp b/gui/argumentseditor.cpp index c6280ed..3ac381e 100644 --- a/gui/argumentseditor.cpp +++ b/gui/argumentseditor.cpp @@ -322,17 +322,23 @@ void ArgumentsEditor::accept() { QStringList argNames = m_call->argNames(); QList originalValues = m_call->arguments(); + QList newValues; + bool changed = false; for (int i = 0; i < argNames.count(); ++i) { - bool changed = false; + bool valChanged = false; QString argName = argNames[i]; QVariant argValue = originalValues[i]; - QVariant editorValue = valueForName(argName, argValue, &changed); + QVariant editorValue = valueForName(argName, argValue, &valChanged); + newValues.append(editorValue); qDebug()<<"Arg = "< - false + true Revert