summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorZack Rusin <zack@kde.org>2011-09-24 13:42:53 -0400
committerZack Rusin <zack@kde.org>2011-09-24 13:44:07 -0400
commitdaf82af9d5f270c87434cc1142f32a6407703781 (patch)
tree183146fd58efa22d4ab4216f7e5ca6a58312bbef /gui
parent0f0a598677d6d1c97be830c5fa20d6187480aa52 (diff)
Make sure we reset the state when loading another trace file
fixes issue #41
Diffstat (limited to 'gui')
-rw-r--r--gui/apitrace.cpp2
-rw-r--r--gui/traceloader.cpp11
-rw-r--r--gui/traceloader.h1
3 files changed, 12 insertions, 2 deletions
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;