From ee2073911c1f76715427ef0c031bea7b8483ea97 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Wed, 21 Sep 2011 00:37:55 -0400 Subject: Remove unused files. --- gui/loaderthread.cpp | 122 --------------------------------------------------- gui/loaderthread.h | 34 -------------- 2 files changed, 156 deletions(-) delete mode 100644 gui/loaderthread.cpp delete mode 100644 gui/loaderthread.h diff --git a/gui/loaderthread.cpp b/gui/loaderthread.cpp deleted file mode 100644 index 10a787b..0000000 --- a/gui/loaderthread.cpp +++ /dev/null @@ -1,122 +0,0 @@ -#include "loaderthread.h" - -#include "trace_parser.hpp" - -#include -#include -#include - -#include - -#define FRAMES_TO_CACHE 100 - -static ApiTraceCall * -apiCallFromTraceCall(const Trace::Call *call, - const QHash &helpHash, - ApiTraceFrame *frame) -{ - ApiTraceCall *apiCall = new ApiTraceCall(frame, call); - - apiCall->setHelpUrl(helpHash.value(apiCall->name())); - - return apiCall; -} - -LoaderThread::LoaderThread(ApiTrace *parent) - : QThread(parent), - m_frameMarker(ApiTrace::FrameMarker_SwapBuffers), - m_trace(parent) -{ -} - -void LoaderThread::run() -{ - QList frames; - ApiTraceFrame *currentFrame = 0; - int frameCount = 0; - - QHash helpHash; - - - QFile file(":/resources/glreference.tsv"); - if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { - QString line; - while (!file.atEnd()) { - line = file.readLine(); - QString function = line.section('\t', 0, 0).trimmed(); - QUrl url = QUrl(line.section('\t', 1, 1).trimmed()); - //qDebug()<<"function = "< calls; - quint64 binaryDataSize = 0; - if (p.open(m_fileName.toLatin1().constData())) { - Trace::Call *call = p.parse_call(); - while (call) { - //std::cout << *call; - if (!currentFrame) { - currentFrame = new ApiTraceFrame(m_trace); - currentFrame->number = frameCount; - ++frameCount; - } - ApiTraceCall *apiCall = - apiCallFromTraceCall(call, helpHash, currentFrame); - calls.append(apiCall); - if (apiCall->hasBinaryData()) { - QByteArray data = - apiCall->arguments()[apiCall->binaryDataIndex()].toByteArray(); - binaryDataSize += data.size(); - } - if (ApiTrace::isCallAFrameMarker(apiCall, - m_frameMarker)) { - calls.squeeze(); - currentFrame->setCalls(calls, binaryDataSize); - calls.clear(); - frames.append(currentFrame); - currentFrame = 0; - binaryDataSize = 0; - if (frames.count() >= FRAMES_TO_CACHE) { - emit parsedFrames(frames); - frames.clear(); - } - } - delete call; - call = p.parse_call(); - } - } - if (currentFrame) { - calls.squeeze(); - currentFrame->setCalls(calls, binaryDataSize); - frames.append(currentFrame); - currentFrame = 0; - } - if (frames.count()) { - emit parsedFrames(frames); - } -} - -void LoaderThread::loadFile(const QString &fileName) -{ - m_fileName = fileName; - start(); -} - -ApiTrace::FrameMarker LoaderThread::frameMarker() const -{ - return m_frameMarker; -} - -void LoaderThread::setFrameMarker(ApiTrace::FrameMarker marker) -{ - Q_ASSERT(!isRunning()); - m_frameMarker = marker; -} - -#include "loaderthread.moc" diff --git a/gui/loaderthread.h b/gui/loaderthread.h deleted file mode 100644 index c847c73..0000000 --- a/gui/loaderthread.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef LOADERTHREAD_H -#define LOADERTHREAD_H - -#include "apitrace.h" -#include -#include - -class ApiTraceCall; -class ApiTraceFrame; - -class LoaderThread : public QThread -{ - Q_OBJECT -public: - LoaderThread(ApiTrace *parent); - - ApiTrace::FrameMarker frameMarker() const; - void setFrameMarker(ApiTrace::FrameMarker marker); -public slots: - void loadFile(const QString &fileName); - -signals: - void parsedFrames(const QList &frames); - -protected: - virtual void run(); - -private: - QString m_fileName; - ApiTrace::FrameMarker m_frameMarker; - ApiTrace *m_trace; -}; - -#endif -- cgit v1.2.3