diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2016-01-19 14:16:24 +0000 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2016-01-22 22:37:46 +0000 |
commit | a20a795cb585b75d4d03d671a9a235ca67d3418d (patch) | |
tree | 18bf67e62ee3b73b98c242badd1b825f7f98697f /gui/mainwindow.cpp | |
parent | c4343f12297177d558dc58e2a38921c2ec671f6a (diff) |
gui: Show leaks.
Based on comicfans change, but adapted to invoke `apitrace leaks`.
Issue #416.
v2: Add missing file.
Diffstat (limited to 'gui/mainwindow.cpp')
-rw-r--r-- | gui/mainwindow.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 8bf464a0..129e634d 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -24,6 +24,7 @@ #include "vertexdatainterpreter.h" #include "trace_profiler.hpp" #include "image/image.hpp" +#include "leaktracethread.h" #include <QAction> #include <QApplication> @@ -864,6 +865,27 @@ void MainWindow::showSettings() dialog.exec(); } +void MainWindow::leakTrace() +{ + LeakTraceThread *t=new LeakTraceThread(m_trace->fileName()); + + connect (t,SIGNAL(finished()),this,SLOT(leakTraceFinished())); + + connect (t,SIGNAL(leakTraceErrors(const QList<ApiTraceError> &)), + this,SLOT(slotRetraceErrors(const QList<ApiTraceError>&))); + + t->start(); +} + +void MainWindow::leakTraceFinished(){ + + LeakTraceThread *t = qobject_cast<LeakTraceThread*>(sender()); + + m_ui.errorsDock->setVisible(t->hasError()); + + delete t; +} + void MainWindow::openHelp(const QUrl &url) { QDesktopServices::openUrl(url); @@ -1082,6 +1104,8 @@ void MainWindow::initConnections() this, SLOT(showThumbnails())); connect(m_ui.actionOptions, SIGNAL(triggered()), this, SLOT(showSettings())); + connect(m_ui.actionLeakTrace,SIGNAL(triggered()), + this, SLOT(leakTrace())); connect(m_ui.callView->selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(callItemSelected(const QModelIndex &))); |