diff options
author | Zack Rusin <zack@kde.org> | 2011-09-24 13:42:53 -0400 |
---|---|---|
committer | Zack Rusin <zack@kde.org> | 2011-09-24 13:44:07 -0400 |
commit | daf82af9d5f270c87434cc1142f32a6407703781 (patch) | |
tree | 183146fd58efa22d4ab4216f7e5ca6a58312bbef | |
parent | 0f0a598677d6d1c97be830c5fa20d6187480aa52 (diff) |
Make sure we reset the state when loading another trace file
fixes issue #41
-rw-r--r-- | common/trace_parser.cpp | 2 | ||||
-rw-r--r-- | gui/apitrace.cpp | 2 | ||||
-rw-r--r-- | gui/traceloader.cpp | 11 | ||||
-rw-r--r-- | gui/traceloader.h | 1 |
4 files changed, 14 insertions, 2 deletions
diff --git a/common/trace_parser.cpp b/common/trace_parser.cpp index a7285770..2eff0cda 100644 --- a/common/trace_parser.cpp +++ b/common/trace_parser.cpp @@ -148,6 +148,8 @@ void Parser::close(void) { } } bitmasks.clear(); + + next_call_no = 0; } diff --git a/gui/apitrace.cpp b/gui/apitrace.cpp index bc862097..edf98b9e 100644 --- a/gui/apitrace.cpp +++ b/gui/apitrace.cpp @@ -148,10 +148,12 @@ void ApiTrace::setFileName(const QString &name) { if (m_fileName != name) { m_fileName = name; + m_tempFileName = QString(); m_frames.clear(); m_errors.clear(); m_editedCalls.clear(); + m_queuedErrors.clear(); m_needsSaving = false; emit invalidated(); diff --git a/gui/traceloader.cpp b/gui/traceloader.cpp index 0fee815f..cf9b37bb 100644 --- a/gui/traceloader.cpp +++ b/gui/traceloader.cpp @@ -38,6 +38,16 @@ void TraceLoader::loadTrace(const QString &filename) loadHelpFile(); } + if (!m_frameBookmarks.isEmpty()) { + qDeleteAll(m_signatures); + qDeleteAll(m_enumSignatures); + m_signatures.clear(); + m_enumSignatures.clear(); + m_frameBookmarks.clear(); + m_createdFrames.clear(); + m_parser.close(); + } + if (!m_parser.open(filename.toLatin1())) { qDebug() << "error: failed to open " << filename; return; @@ -51,7 +61,6 @@ void TraceLoader::loadTrace(const QString &filename) //Load the entire file into memory parseTrace(); } - emit finishedParsing(); } diff --git a/gui/traceloader.h b/gui/traceloader.h index 4b88ec60..e950b091 100644 --- a/gui/traceloader.h +++ b/gui/traceloader.h @@ -85,7 +85,6 @@ private: private: Trace::Parser m_parser; - QString m_fileName; ApiTrace::FrameMarker m_frameMarker; typedef QMap<int, FrameBookmark> FrameBookmarks; |