diff options
author | Zack Rusin <zack@kde.org> | 2011-09-18 19:40:47 -0400 |
---|---|---|
committer | Zack Rusin <zack@kde.org> | 2011-09-18 19:40:47 -0400 |
commit | 1a9f7af32205d900c88fef0b544546eb0d7c84ee (patch) | |
tree | a68a0c3e6ab1f27d827eae2528877f299247bcd0 /gui | |
parent | 353f0535f43b54d04cc9c8080790ffac606e5b0b (diff) |
Delete loadertest and cleanup some of the new api.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/apitrace.cpp | 37 | ||||
-rw-r--r-- | gui/apitrace.h | 6 | ||||
-rw-r--r-- | gui/apitracecall.cpp | 2 | ||||
-rw-r--r-- | gui/apitracecall.h | 2 | ||||
-rw-r--r-- | gui/apitracemodel.cpp | 6 | ||||
-rw-r--r-- | gui/mainwindow.cpp | 12 | ||||
-rw-r--r-- | gui/traceloader.cpp | 8 |
7 files changed, 36 insertions, 37 deletions
diff --git a/gui/apitrace.cpp b/gui/apitrace.cpp index 6f101cd9..ca5098d3 100644 --- a/gui/apitrace.cpp +++ b/gui/apitrace.cpp @@ -152,7 +152,6 @@ void ApiTrace::setFileName(const QString &name) m_needsSaving = false; emit invalidated(); -// m_loader->loadTrace(m_fileName); emit loadTrace(m_fileName); } } @@ -190,7 +189,7 @@ ApiTraceCall * ApiTrace::callWithIndex(int idx) const ApiTraceState ApiTrace::defaultState() const { ApiTraceFrame *frame = frameAt(0); - if (!frame || !frame->loaded() || frame->isEmpty()) + if (!frame || !frame->isLoaded() || frame->isEmpty()) return ApiTraceState(); ApiTraceCall *firstCall = frame->calls().first(); @@ -264,14 +263,14 @@ bool ApiTrace::hasErrors() const void ApiTrace::loadFrame(ApiTraceFrame *frame) { - Q_ASSERT(!frame->loaded()); + Q_ASSERT(!frame->isLoaded()); emit requestFrame(frame); } void ApiTrace::finishedParsing() { ApiTraceFrame *firstFrame = m_frames[0]; - if (firstFrame && !firstFrame->loaded()) { + if (firstFrame && !firstFrame->isLoaded()) { loadFrame(firstFrame); } } @@ -319,10 +318,10 @@ void ApiTrace::findNext(ApiTraceFrame *frame, ApiTraceCall *foundCall = 0; int frameIdx = m_frames.indexOf(frame); - if (frame->loaded()) { + if (frame->isLoaded()) { foundCall = frame->findNextCall(from, str, sensitivity); if (foundCall) { - emit findResult(SearchFound, foundCall); + emit findResult(SearchResult_Found, foundCall); return; } @@ -333,18 +332,18 @@ void ApiTrace::findNext(ApiTraceFrame *frame, for (int i = frameIdx; i < m_frames.count(); ++i) { ApiTraceFrame *frame = m_frames[i]; - if (!frame->loaded()) { + if (!frame->isLoaded()) { emit loaderSearchNext(i, str, sensitivity); return; } else { ApiTraceCall *call = frame->findNextCall(0, str, sensitivity); if (call) { - emit findResult(SearchFound, call); + emit findResult(SearchResult_Found, call); return; } } } - emit findResult(SearchWrapped, 0); + emit findResult(SearchResult_Wrapped, 0); } void ApiTrace::findPrev(ApiTraceFrame *frame, @@ -355,10 +354,10 @@ void ApiTrace::findPrev(ApiTraceFrame *frame, ApiTraceCall *foundCall = 0; int frameIdx = m_frames.indexOf(frame); - if (frame->loaded()) { + if (frame->isLoaded()) { foundCall = frame->findPrevCall(from, str, sensitivity); if (foundCall) { - emit findResult(SearchFound, foundCall); + emit findResult(SearchResult_Found, foundCall); return; } @@ -369,18 +368,18 @@ void ApiTrace::findPrev(ApiTraceFrame *frame, for (int i = frameIdx; i >= 0; --i) { ApiTraceFrame *frame = m_frames[i]; - if (!frame->loaded()) { + if (!frame->isLoaded()) { emit loaderSearchPrev(i, str, sensitivity); return; } else { ApiTraceCall *call = frame->findPrevCall(0, str, sensitivity); if (call) { - emit findResult(SearchFound, call); + emit findResult(SearchResult_Found, call); return; } } } - emit findResult(SearchWrapped, 0); + emit findResult(SearchResult_Wrapped, 0); } void ApiTrace::loaderSearchResult(ApiTrace::SearchResult result, @@ -393,7 +392,7 @@ void ApiTrace::loaderSearchResult(ApiTrace::SearchResult result, void ApiTrace::findFrameStart(ApiTraceFrame *frame) { - if (frame->loaded()) { + if (frame->isLoaded()) { emit foundFrameStart(frame); } else { emit loaderFindFrameStart(frame); @@ -402,7 +401,7 @@ void ApiTrace::findFrameStart(ApiTraceFrame *frame) void ApiTrace::findFrameEnd(ApiTraceFrame *frame) { - if (frame->loaded()) { + if (frame->isLoaded()) { emit foundFrameEnd(frame); } else { emit loaderFindFrameEnd(frame); @@ -422,7 +421,7 @@ void ApiTrace::findCallIndex(int index) frame = m_frames[frameIdx]; if (frame) { - if (frame->loaded()) { + if (frame->isLoaded()) { ApiTraceCall *call = frame->callWithIndex(index); emit foundCallIndex(call); } else { @@ -437,7 +436,7 @@ int ApiTrace::callInFrame(int callIdx) const for (int frameIdx = 0; frameIdx <= m_frames.size(); ++frameIdx) { const ApiTraceFrame *frame = m_frames[frameIdx]; - unsigned numCallsInFrame = frame->loaded() + unsigned numCallsInFrame = frame->isLoaded() ? frame->numChildren() : frame->numChildrenToLoad(); unsigned firstCall = numCalls; @@ -461,7 +460,7 @@ void ApiTrace::setCallError(const ApiTraceError &error) } frame = m_frames[frameIdx]; - if (frame->loaded()) { + if (frame->isLoaded()) { ApiTraceCall *call = frame->callWithIndex(error.callIndex); call->setError(error.message); if (call->hasError()) { diff --git a/gui/apitrace.h b/gui/apitrace.h index c5a2975f..bf90d17d 100644 --- a/gui/apitrace.h +++ b/gui/apitrace.h @@ -21,9 +21,9 @@ public: FrameMarker_Clear }; enum SearchResult { - SearchNotFound, - SearchFound, - SearchWrapped + SearchResult_NotFound, + SearchResult_Found, + SearchResult_Wrapped }; static bool isCallAFrameMarker(const ApiTraceCall *call, diff --git a/gui/apitracecall.cpp b/gui/apitracecall.cpp index 9a6a32e9..67fc9559 100644 --- a/gui/apitracecall.cpp +++ b/gui/apitracecall.cpp @@ -1061,7 +1061,7 @@ void ApiTraceFrame::setCalls(const QVector<ApiTraceCall*> &calls, m_staticText = 0; } -bool ApiTraceFrame::loaded() const +bool ApiTraceFrame::isLoaded() const { return m_loaded; } diff --git a/gui/apitracecall.h b/gui/apitracecall.h index 15dca132..12b0216a 100644 --- a/gui/apitracecall.h +++ b/gui/apitracecall.h @@ -330,7 +330,7 @@ public: int binaryDataSize() const; - bool loaded() const; + bool isLoaded() const; void setLoaded(bool l); void setLastCallIndex(unsigned index); diff --git a/gui/apitracemodel.cpp b/gui/apitracemodel.cpp index 96a9888e..7303ae1c 100644 --- a/gui/apitracemodel.cpp +++ b/gui/apitracemodel.cpp @@ -91,7 +91,7 @@ QVariant ApiTraceModel::data(const QModelIndex &index, int role) const } } - int numCalls = frame->loaded() + int numCalls = frame->isLoaded() ? frame->numChildren() : frame->numChildrenToLoad(); @@ -350,7 +350,7 @@ bool ApiTraceModel::canFetchMore(const QModelIndex &parent) const ApiTraceEvent *event = item(parent); if (event && event->type() == ApiTraceEvent::Frame) { ApiTraceFrame *frame = static_cast<ApiTraceFrame*>(event); - return !frame->loaded() && !m_loadingFrames.contains(frame); + return !frame->isLoaded() && !m_loadingFrames.contains(frame); } else return false; } else { @@ -366,7 +366,7 @@ void ApiTraceModel::fetchMore(const QModelIndex &parent) ApiTraceFrame *frame = static_cast<ApiTraceFrame*>(event); QModelIndex index = createIndex(frame->number, 0, frame); - Q_ASSERT(!frame->loaded()); + Q_ASSERT(!frame->isLoaded()); m_loadingFrames.insert(frame); m_trace->loadFrame(frame); diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 2974f312..3382faeb 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -875,7 +875,7 @@ void MainWindow::fillState(bool nonDefaults) m_trace->frameAt(0); if (!firstFrame) return; - if (!firstFrame->loaded()) { + if (!firstFrame->isLoaded()) { m_trace->loadFrame(firstFrame); return; } @@ -1080,16 +1080,16 @@ void MainWindow::slotSearchResult(ApiTrace::SearchResult result, ApiTraceCall *call) { switch (result) { - case ApiTrace::SearchNotFound: + case ApiTrace::SearchResult_NotFound: m_searchWidget->setFound(false); break; - case ApiTrace::SearchFound: { + case ApiTrace::SearchResult_Found: { QModelIndex index = m_proxyModel->indexForCall(call); m_ui.callView->setCurrentIndex(index); m_searchWidget->setFound(true); } break; - case ApiTrace::SearchWrapped: + case ApiTrace::SearchResult_Wrapped: m_searchWidget->setFound(false); break; } @@ -1151,7 +1151,7 @@ ApiTraceCall * MainWindow::currentCall() const void MainWindow::slotFoundFrameStart(ApiTraceFrame *frame) { - Q_ASSERT(frame->loaded()); + Q_ASSERT(frame->isLoaded()); if (!frame || frame->isEmpty()) { return; } @@ -1173,7 +1173,7 @@ void MainWindow::slotFoundFrameStart(ApiTraceFrame *frame) void MainWindow::slotFoundFrameEnd(ApiTraceFrame *frame) { - Q_ASSERT(frame->loaded()); + Q_ASSERT(frame->isLoaded()); if (!frame || frame->isEmpty()) { return; } diff --git a/gui/traceloader.cpp b/gui/traceloader.cpp index 9480f459..108d220e 100644 --- a/gui/traceloader.cpp +++ b/gui/traceloader.cpp @@ -291,7 +291,7 @@ void TraceLoader::searchNext(int startFrame, fetchFrameContents(frame); for (int i = 0; i < calls.count(); ++i) { if (calls[i]->index() == call->no) { - emit searchResult(ApiTrace::SearchFound, calls[i]); + emit searchResult(ApiTrace::SearchResult_Found, calls[i]); break; } } @@ -302,7 +302,7 @@ void TraceLoader::searchNext(int startFrame, delete call; } } - emit searchResult(ApiTrace::SearchNotFound, 0); + emit searchResult(ApiTrace::SearchResult_NotFound, 0); } void TraceLoader::searchPrev(int startFrame, @@ -346,7 +346,7 @@ void TraceLoader::searchPrev(int startFrame, } } } - emit searchResult(ApiTrace::SearchNotFound, 0); + emit searchResult(ApiTrace::SearchResult_NotFound, 0); } bool TraceLoader::searchCallsBackwards(const QList<Trace::Call*> &calls, @@ -362,7 +362,7 @@ bool TraceLoader::searchCallsBackwards(const QList<Trace::Call*> &calls, fetchFrameContents(frame); for (int i = 0; i < apiCalls.count(); ++i) { if (apiCalls[i]->index() == call->no) { - emit searchResult(ApiTrace::SearchFound, apiCalls[i]); + emit searchResult(ApiTrace::SearchResult_Found, apiCalls[i]); break; } } |