summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorZack Rusin <zack@kde.org>2011-09-19 23:44:25 -0400
committerZack Rusin <zack@kde.org>2011-09-19 23:44:25 -0400
commit99f84fa0e278f4ca30577c22ede85c643c6017cc (patch)
tree5b07a52a70feb236b3feec1c0c2ca8d0d70bbd28 /gui
parentc592957de1083b4e32ee58c0ea2e5feaa9085b47 (diff)
If a frame has already been loaded don't do it again.
In particular for searching we kept reloading frames over and over again.
Diffstat (limited to 'gui')
-rw-r--r--gui/traceloader.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/gui/traceloader.cpp b/gui/traceloader.cpp
index 108d220e..487fb1ea 100644
--- a/gui/traceloader.cpp
+++ b/gui/traceloader.cpp
@@ -407,6 +407,11 @@ QVector<ApiTraceCall*>
TraceLoader::fetchFrameContents(ApiTraceFrame *currentFrame)
{
Q_ASSERT(currentFrame);
+
+ if (currentFrame->isLoaded) {
+ return currentFrame->calls();
+ }
+
if (m_parser.supportsOffsets()) {
unsigned frameIdx = currentFrame->number;
int numOfCalls = numberOfCallsInFrame(frameIdx);
@@ -457,13 +462,17 @@ TraceLoader::fetchFrameContents(ApiTraceFrame *currentFrame)
void TraceLoader::findFrameStart(ApiTraceFrame *frame)
{
- loadFrame(frame);
+ if (!frame->isLoaded()) {
+ loadFrame(frame);
+ }
emit foundFrameStart(frame);
}
void TraceLoader::findFrameEnd(ApiTraceFrame *frame)
{
- loadFrame(frame);
+ if (!frame->isLoaded()) {
+ loadFrame(frame);
+ }
emit foundFrameEnd(frame);
}