summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Rusin <zack@kde.org>2011-09-21 00:37:55 -0400
committerZack Rusin <zack@kde.org>2011-09-21 00:37:55 -0400
commitee2073911c1f76715427ef0c031bea7b8483ea97 (patch)
treed4b8eab35d4ea1d70958da6e6322110a93eae11a
parent59b795591cdadef26fd3d9b54c5fdc519d83c41d (diff)
Remove unused files.
-rw-r--r--gui/loaderthread.cpp122
-rw-r--r--gui/loaderthread.h34
2 files changed, 0 insertions, 156 deletions
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 <QFile>
-#include <QHash>
-#include <QUrl>
-
-#include <QDebug>
-
-#define FRAMES_TO_CACHE 100
-
-static ApiTraceCall *
-apiCallFromTraceCall(const Trace::Call *call,
- const QHash<QString, QUrl> &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<ApiTraceFrame*> frames;
- ApiTraceFrame *currentFrame = 0;
- int frameCount = 0;
-
- QHash<QString, QUrl> 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 = "<<function<<", url = "<<url.toString();
- helpHash.insert(function, url);
- }
- } else {
- qWarning() << "Couldn't open reference file "
- << file.fileName();
- }
- file.close();
-
- Trace::Parser p;
- QVector<ApiTraceCall*> 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 <QThread>
-#include <QList>
-
-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<ApiTraceFrame*> &frames);
-
-protected:
- virtual void run();
-
-private:
- QString m_fileName;
- ApiTrace::FrameMarker m_frameMarker;
- ApiTrace *m_trace;
-};
-
-#endif