analyzer: style and simplification

This commit is contained in:
hjk
2011-05-18 17:05:49 +02:00
parent a130b98509
commit 68504ab8a8
82 changed files with 508 additions and 583 deletions

View File

@@ -45,7 +45,8 @@ namespace Callgrind {
//BEGIN CallModel::Private //BEGIN CallModel::Private
class CallModel::Private { class CallModel::Private
{
public: public:
Private(); Private();
@@ -60,7 +61,6 @@ CallModel::Private::Private()
, m_event(0) , m_event(0)
, m_function(0) , m_function(0)
{ {
} }
//END CallModel::Private //END CallModel::Private
@@ -235,5 +235,5 @@ QVariant CallModel::headerData(int section, Qt::Orientation orientation, int rol
return QVariant(); return QVariant();
} }
} // Callgrind } // namespace Callgrind
} // Valgrind } // namespace Valgrind

View File

@@ -93,7 +93,7 @@ private:
Private *d; Private *d;
}; };
} // Callgrind } // namespace Callgrind
} // Valgrind } // namespace Valgrind
#endif // VALGRIND_CALLGRIND_CALLGRINDCALLMODEL_H #endif // VALGRIND_CALLGRIND_CALLGRINDCALLMODEL_H

View File

@@ -267,5 +267,5 @@ void CallgrindController::cleanupTempFile()
m_tempDataFile.clear(); m_tempDataFile.clear();
} }
} } // namespace Callgrind
} } // namespace Valgrind

View File

@@ -52,7 +52,7 @@ namespace Callgrind {
class VALGRINDSHARED_EXPORT CallgrindController : public QObject class VALGRINDSHARED_EXPORT CallgrindController : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_ENUMS(Option); Q_ENUMS(Option)
public: public:
enum Option { enum Option {
@@ -68,7 +68,7 @@ public:
void run(Valgrind::Callgrind::CallgrindController::Option option); void run(Valgrind::Callgrind::CallgrindController::Option option);
void setValgrindProcess(ValgrindProcess *process); void setValgrindProcess(ValgrindProcess *process);
inline ValgrindProcess *valgrindProcess() { return m_valgrindProc; } ValgrindProcess *valgrindProcess() { return m_valgrindProc; }
/** /**
* Make data file available locally, triggers @c localParseDataAvailable. * Make data file available locally, triggers @c localParseDataAvailable.
@@ -112,7 +112,7 @@ private:
QByteArray m_remoteFile; QByteArray m_remoteFile;
}; };
} } // namespace Callgrind
} } // namespace Valgrind
#endif // CALLGRINDCONTROLLER_H #endif // CALLGRINDCONTROLLER_H

View File

@@ -32,9 +32,9 @@
#include "callgrindcostitem.h" #include "callgrindcostitem.h"
#include <QtCore/QVector>
#include <QtCore/QString> #include <QtCore/QString>
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtCore/QVector>
#include "callgrindparsedata.h" #include "callgrindparsedata.h"
#include "callgrindfunctioncall.h" #include "callgrindfunctioncall.h"
@@ -76,7 +76,6 @@ CostItem::Private::~Private()
CostItem::CostItem(ParseData *data) CostItem::CostItem(ParseData *data)
: d(new Private(data)) : d(new Private(data))
{ {
} }
CostItem::~CostItem() CostItem::~CostItem()
@@ -142,5 +141,5 @@ void CostItem::setDifferingFile(qint64 fileId)
d->m_differingFileId = fileId; d->m_differingFileId = fileId;
} }
} // Callgrind } // namespace Callgrind
} // Valgrind } // namespace Valgrind

View File

@@ -49,7 +49,8 @@ class ParseData;
/** /**
* This class represents the cost(s) at given position(s). * This class represents the cost(s) at given position(s).
*/ */
class VALGRINDSHARED_EXPORT CostItem { class VALGRINDSHARED_EXPORT CostItem
{
public: public:
/// @p data the file data this cost item was parsed in. /// @p data the file data this cost item was parsed in.
/// required for decompression of string data like differing source file information /// required for decompression of string data like differing source file information
@@ -90,13 +91,13 @@ public:
void setDifferingFile(qint64 fileId); void setDifferingFile(qint64 fileId);
private: private:
Q_DISABLE_COPY(CostItem); Q_DISABLE_COPY(CostItem)
class Private; class Private;
Private *d; Private *d;
}; };
} // Callgrind } // namespace Callgrind
} // Valgrind } // namespace Valgrind
#endif // LIBVALGRIND_CALLGRIND_COSTITEM_H #endif // LIBVALGRIND_CALLGRIND_COSTITEM_H

View File

@@ -37,10 +37,10 @@
#include "callgrindparsedata.h" #include "callgrindparsedata.h"
#include "callgrindfunctioncycle.h" #include "callgrindfunctioncycle.h"
#include <QtCore/QDebug>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QtCore/QDebug>
namespace Valgrind { namespace Valgrind {
namespace Callgrind { namespace Callgrind {
namespace Internal { namespace Internal {
@@ -50,7 +50,6 @@ CycleDetection::CycleDetection(ParseData *data)
, m_depth(0) , m_depth(0)
, m_cycle(0) , m_cycle(0)
{ {
} }
QVector<const Function *> CycleDetection::run(const QVector<const Function *> &input) QVector<const Function *> CycleDetection::run(const QVector<const Function *> &input)
@@ -119,6 +118,6 @@ void CycleDetection::tarjanForChildNode(Node *node, Node *childNode)
} }
} }
} } // namespace Internal
} } // namespace Callgrind
} } // namespace Valgrind

View File

@@ -52,7 +52,8 @@ namespace Internal {
* M. McKusick; Proceedings of the SIGPLAN '82 Symposium on Compiler Construction, * M. McKusick; Proceedings of the SIGPLAN '82 Symposium on Compiler Construction,
* SIGPLAN Notices, Vol. 17, No 6, pp. 120-126, June 1982. * SIGPLAN Notices, Vol. 17, No 6, pp. 120-126, June 1982.
*/ */
class CycleDetection { class CycleDetection
{
public: public:
explicit CycleDetection(ParseData *data); explicit CycleDetection(ParseData *data);
QVector<const Function *> run(const QVector<const Function *> &input); QVector<const Function *> run(const QVector<const Function *> &input);
@@ -77,8 +78,9 @@ private:
int m_cycle; int m_cycle;
}; };
} } // namespace Internal
}
} } // namespace Callgrind
} // namespace Valgrind
#endif // LIBVALGRIND_CALLGRINDCYCLEDETECTION_H #endif // LIBVALGRIND_CALLGRINDCYCLEDETECTION_H

View File

@@ -36,13 +36,13 @@
#include "callgrindfunction.h" #include "callgrindfunction.h"
#include "callgrindcostitem.h" #include "callgrindcostitem.h"
#include <QChar> #include <utils/qtcassert.h>
#include <QDebug>
#include <QtCore/QChar>
#include <QtCore/QDebug>
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtCore/QVector> #include <QtCore/QVector>
#include <utils/qtcassert.h>
namespace Valgrind { namespace Valgrind {
namespace Callgrind { namespace Callgrind {
@@ -60,7 +60,8 @@ namespace {
//BEGIN DataModel::Private //BEGIN DataModel::Private
class DataModel::Private { class DataModel::Private
{
public: public:
Private() Private()
: m_data(0) : m_data(0)
@@ -70,10 +71,6 @@ public:
{ {
} }
~Private()
{
}
void updateFunctions(); void updateFunctions();
const ParseData *m_data; const ParseData *m_data;
@@ -110,7 +107,6 @@ void DataModel::Private::updateFunctions()
DataModel::DataModel(QObject *parent) DataModel::DataModel(QObject *parent)
: QAbstractItemModel(parent), d(new Private) : QAbstractItemModel(parent), d(new Private)
{ {
} }
DataModel::~DataModel() DataModel::~DataModel()
@@ -240,7 +236,7 @@ QVariant DataModel::data(const QModelIndex &index, int role) const
else if (role == RelativeParentCostRole || role == RelativeTotalCostRole) { else if (role == RelativeParentCostRole || role == RelativeTotalCostRole) {
if (index.column() == SelfCostColumn) if (index.column() == SelfCostColumn)
return (float)selfCost / totalCost; return (float)selfCost / totalCost;
else if (index.column() == InclusiveCostColumn) if (index.column() == InclusiveCostColumn)
return (float)inclusiveCost / totalCost; return (float)inclusiveCost / totalCost;
} }
else if (role == LineNumberRole) { else if (role == LineNumberRole) {
@@ -257,13 +253,13 @@ QVariant DataModel::data(const QModelIndex &index, int role) const
else if (role == Qt::DisplayRole) { else if (role == Qt::DisplayRole) {
if (index.column() == NameColumn) if (index.column() == NameColumn)
return func->name(); return func->name();
else if (index.column() == LocationColumn) if (index.column() == LocationColumn)
return func->location(); return func->location();
else if (index.column() == CalledColumn) if (index.column() == CalledColumn)
return func->called(); return func->called();
else if (index.column() == SelfCostColumn) if (index.column() == SelfCostColumn)
return selfCost; return selfCost;
else if (index.column() == InclusiveCostColumn) if (index.column() == InclusiveCostColumn)
return inclusiveCost; return inclusiveCost;
} else if (role == Qt::ToolTipRole) { } else if (role == Qt::ToolTipRole) {
if (!d->m_verboseToolTips) if (!d->m_verboseToolTips)
@@ -336,23 +332,22 @@ QVariant DataModel::headerData(int section, Qt::Orientation orientation, int rol
return QVariant(); return QVariant();
const QString prettyCostStr = ParseData::prettyStringForEvent(d->m_data->events().at(d->m_event)); const QString prettyCostStr = ParseData::prettyStringForEvent(d->m_data->events().at(d->m_event));
if (section == SelfCostColumn) { if (section == SelfCostColumn)
return tr("%1 cost spent in a given function excluding costs from called functions.").arg(prettyCostStr); return tr("%1 cost spent in a given function excluding costs from called functions.").arg(prettyCostStr);
} else if (section == InclusiveCostColumn) { if (section == InclusiveCostColumn)
return tr("%1 cost spent in a given function including costs from called functions.").arg(prettyCostStr); return tr("%1 cost spent in a given function including costs from called functions.").arg(prettyCostStr);
}
return QVariant(); return QVariant();
} }
if (section == NameColumn) if (section == NameColumn)
return tr("Function"); return tr("Function");
else if (section == LocationColumn) if (section == LocationColumn)
return tr("Location"); return tr("Location");
else if (section == CalledColumn) if (section == CalledColumn)
return tr("Called"); return tr("Called");
else if (section == SelfCostColumn) if (section == SelfCostColumn)
return tr("Self Cost: %1").arg(d->m_data ? d->m_data->events().value(d->m_event) : QString()); return tr("Self Cost: %1").arg(d->m_data ? d->m_data->events().value(d->m_event) : QString());
else if (section == InclusiveCostColumn) if (section == InclusiveCostColumn)
return tr("Incl. Cost: %1").arg(d->m_data ? d->m_data->events().value(d->m_event) : QString()); return tr("Incl. Cost: %1").arg(d->m_data ? d->m_data->events().value(d->m_event) : QString());
return QVariant(); return QVariant();
@@ -366,5 +361,5 @@ void DataModel::enableCycleDetection(bool enabled)
endResetModel(); endResetModel();
} }
} } // namespace Valgrind
} } // namespace Callgrind

View File

@@ -33,12 +33,12 @@
#ifndef VALGRIND_CALLGRIND_CALLGRINDDATAMODEL_H #ifndef VALGRIND_CALLGRIND_CALLGRINDDATAMODEL_H
#define VALGRIND_CALLGRIND_CALLGRINDDATAMODEL_H #define VALGRIND_CALLGRIND_CALLGRINDDATAMODEL_H
#include <QtCore/QAbstractItemModel>
#include "../valgrind_global.h" #include "../valgrind_global.h"
#include "callgrindabstractmodel.h" #include "callgrindabstractmodel.h"
#include <QtCore/QAbstractItemModel>
namespace Valgrind { namespace Valgrind {
namespace Callgrind { namespace Callgrind {
@@ -101,7 +101,7 @@ private:
Private *d; Private *d;
}; };
} // Callgrind } // namespace Callgrind
} // Valgrind } // namespace Valgrind
#endif // VALGRIND_CALLGRIND_CALLGRINDDATAMODEL_H #endif // VALGRIND_CALLGRIND_CALLGRINDDATAMODEL_H

View File

@@ -37,13 +37,13 @@
#include "callgrindparsedata.h" #include "callgrindparsedata.h"
#include "callgrindfunction_p.h" #include "callgrindfunction_p.h"
#include <utils/qtcassert.h>
#include <QtCore/QString> #include <QtCore/QString>
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QtCore/QFileInfo> #include <QtCore/QFileInfo>
#include <utils/qtcassert.h>
namespace Valgrind { namespace Valgrind {
namespace Callgrind { namespace Callgrind {
@@ -116,13 +116,11 @@ FunctionCall *Function::Private::accumulateCall(const FunctionCall *call, CallTy
Function::Function(const ParseData *data) Function::Function(const ParseData *data)
: d(new Private(data)) : d(new Private(data))
{ {
} }
Function::Function(Function::Private *d) Function::Function(Function::Private *d)
: d(d) : d(d)
{ {
} }
Function::~Function() Function::~Function()
@@ -332,5 +330,5 @@ void Function::finalize()
} }
} }
} // Callgrind } // namespace Callgrind
} // Valgrind } // namespace Valgrind

View File

@@ -50,7 +50,8 @@ class FunctionCall;
class CostItem; class CostItem;
class ParseData; class ParseData;
class VALGRINDSHARED_EXPORT Function { class VALGRINDSHARED_EXPORT Function
{
public: public:
/// @p data the ParseData for the file this function was part of /// @p data the ParseData for the file this function was part of
/// required for the decompression of string data like function name etc. /// required for the decompression of string data like function name etc.
@@ -143,6 +144,7 @@ public:
* for example * for example
*/ */
void finalize(); void finalize();
protected: protected:
class Private; class Private;
Private *d; Private *d;
@@ -153,8 +155,8 @@ private:
Q_DISABLE_COPY(Function) Q_DISABLE_COPY(Function)
}; };
} } // namespace Callgrind
} } // namespace Valgrind
Q_DECLARE_METATYPE(const Valgrind::Callgrind::Function *); Q_DECLARE_METATYPE(const Valgrind::Callgrind::Function *);

View File

@@ -44,7 +44,8 @@
namespace Valgrind { namespace Valgrind {
namespace Callgrind { namespace Callgrind {
class Function::Private { class Function::Private
{
public: public:
Private(const ParseData *data); Private(const ParseData *data);
~Private(); ~Private();
@@ -75,7 +76,7 @@ public:
quint64 m_called; quint64 m_called;
}; };
} } // namespace Callgrind
} } // namespace Valgrind
#endif // LIBVALGRIND_CALLGRINDFUNCTION_P_H #endif // LIBVALGRIND_CALLGRINDFUNCTION_P_H

View File

@@ -34,15 +34,16 @@
#include "callgrindfunction.h" #include "callgrindfunction.h"
#include <QtCore/QVector>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QtCore/QVector>
namespace Valgrind { namespace Valgrind {
namespace Callgrind { namespace Callgrind {
//BEGIN FunctionCall::Private //BEGIN FunctionCall::Private
class FunctionCall::Private { class FunctionCall::Private
{
public: public:
explicit Private(); explicit Private();
@@ -60,7 +61,6 @@ FunctionCall::Private::Private()
, m_calls(0) , m_calls(0)
, m_totalInclusiveCost(0) , m_totalInclusiveCost(0)
{ {
} }
//BEGIN FunctionCall //BEGIN FunctionCall
@@ -68,7 +68,6 @@ FunctionCall::Private::Private()
FunctionCall::FunctionCall() FunctionCall::FunctionCall()
: d(new Private) : d(new Private)
{ {
} }
FunctionCall::~FunctionCall() FunctionCall::~FunctionCall()
@@ -137,6 +136,5 @@ void FunctionCall::setCosts(const QVector<quint64> &costs)
d->m_costs = costs; d->m_costs = costs;
} }
} // namespace Callgrind
} // Callgrind } // namespace Valgrind
} // Valgrind

View File

@@ -49,7 +49,8 @@ class Function;
/** /**
* This represents a function call. * This represents a function call.
*/ */
class VALGRINDSHARED_EXPORT FunctionCall { class VALGRINDSHARED_EXPORT FunctionCall
{
public: public:
explicit FunctionCall(); explicit FunctionCall();
~FunctionCall(); ~FunctionCall();
@@ -89,8 +90,8 @@ private:
Private *d; Private *d;
}; };
} // Callgrind } // namespace Callgrind
} // Valgrind } // namespace Valgrind
Q_DECLARE_METATYPE(const Valgrind::Callgrind::FunctionCall *); Q_DECLARE_METATYPE(const Valgrind::Callgrind::FunctionCall *);

View File

@@ -44,7 +44,8 @@ namespace Callgrind {
//BEGIN FunctionCycle::Private //BEGIN FunctionCycle::Private
class FunctionCycle::Private : public Function::Private { class FunctionCycle::Private : public Function::Private
{
public: public:
Private(const ParseData *data); Private(const ParseData *data);
QVector<const Function *> m_functions; QVector<const Function *> m_functions;
@@ -53,7 +54,6 @@ public:
FunctionCycle::Private::Private(const ParseData *data) FunctionCycle::Private::Private(const ParseData *data)
: Function::Private(data) : Function::Private(data)
{ {
} }
#define CYCLE_D static_cast<FunctionCycle::Private *>(this->d) #define CYCLE_D static_cast<FunctionCycle::Private *>(this->d)
@@ -114,5 +114,5 @@ QVector<const Function *> FunctionCycle::functions() const
return CYCLE_D->m_functions; return CYCLE_D->m_functions;
} }
} } // namespace Callgrind
} } // namespace Valgrind

View File

@@ -46,7 +46,8 @@ namespace Callgrind {
* excluding calees inside the cycle * excluding calees inside the cycle
* inclusive cost of a function cycle: sum of inclusive cost of callees of the cycle (see above) * inclusive cost of a function cycle: sum of inclusive cost of callees of the cycle (see above)
*/ */
class VALGRINDSHARED_EXPORT FunctionCycle : public Function { class VALGRINDSHARED_EXPORT FunctionCycle : public Function
{
public: public:
explicit FunctionCycle(const ParseData *data); explicit FunctionCycle(const ParseData *data);
virtual ~FunctionCycle(); virtual ~FunctionCycle();
@@ -61,8 +62,7 @@ private:
class Private; class Private;
}; };
} } // namespace Callgrind
} } // namespace Valgrind
#endif // LIBVALGRIND_CALLGRINDFUNCTIONCYCLE_H #endif // LIBVALGRIND_CALLGRINDFUNCTIONCYCLE_H

View File

@@ -372,5 +372,5 @@ void ParseData::addCompressedFunction(const QString &function, qint64 &id)
d->addCompressedString(d->m_functionCompression, function, id); d->addCompressedString(d->m_functionCompression, function, id);
} }
} // Callgrind } // namespace Callgrind
} // Valgrind } // namespace Valgrind

View File

@@ -49,7 +49,8 @@ class Function;
/** /**
* Represents all the information extracted from a callgrind data file. * Represents all the information extracted from a callgrind data file.
*/ */
class VALGRINDSHARED_EXPORT ParseData { class VALGRINDSHARED_EXPORT ParseData
{
public: public:
explicit ParseData(); explicit ParseData();
~ParseData(); ~ParseData();
@@ -133,12 +134,13 @@ public:
QString stringForFunctionCompression(qint64 id) const; QString stringForFunctionCompression(qint64 id) const;
/// @p id if it is -1, an uncompressed string is assumed and it will be compressed internally /// @p id if it is -1, an uncompressed string is assumed and it will be compressed internally
void addCompressedFunction(const QString &function, qint64 &id); void addCompressedFunction(const QString &function, qint64 &id);
private: private:
class Private; class Private;
Private *d; Private *d;
}; };
} } // namespace Callgrind
} } // namespace Valgrind
#endif // LIBVALGRIND_CALLGRIND_PARSEDATA_P_H #endif // LIBVALGRIND_CALLGRIND_PARSEDATA_P_H

View File

@@ -675,6 +675,5 @@ ParseData *Parser::takeData()
return data; return data;
} }
} //Callgrind } //Callgrind
} //Valgrind } //Valgrind

View File

@@ -55,8 +55,10 @@ class ParseData;
* the rest is assumed to be zero." * the rest is assumed to be zero."
* *
*/ */
class VALGRINDSHARED_EXPORT Parser : public QObject { class VALGRINDSHARED_EXPORT Parser : public QObject
{
Q_OBJECT Q_OBJECT
public: public:
explicit Parser(QObject *parent = 0); explicit Parser(QObject *parent = 0);
~Parser(); ~Parser();

View File

@@ -41,7 +41,8 @@
#include <QDebug> #include <QDebug>
using namespace Valgrind::Callgrind; namespace Valgrind {
namespace Callgrind {
DataProxyModel::DataProxyModel(QObject *parent) DataProxyModel::DataProxyModel(QObject *parent)
: QSortFilterProxyModel(parent) : QSortFilterProxyModel(parent)
@@ -163,3 +164,6 @@ bool DataProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_
return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent); return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent);
} }
} // namespace Callgrind
} // namespace Valgrind

View File

@@ -33,10 +33,10 @@
#ifndef VALGRIND_CALLGRIND_CALLGRINDPROXYMODEL_H #ifndef VALGRIND_CALLGRIND_CALLGRINDPROXYMODEL_H
#define VALGRIND_CALLGRIND_CALLGRINDPROXYMODEL_H #define VALGRIND_CALLGRIND_CALLGRINDPROXYMODEL_H
#include <QSortFilterProxyModel>
#include "../valgrind_global.h" #include "../valgrind_global.h"
#include <QSortFilterProxyModel>
namespace Valgrind { namespace Valgrind {
namespace Callgrind { namespace Callgrind {
@@ -85,7 +85,7 @@ private:
double m_minimumInclusiveCostRatio; double m_minimumInclusiveCostRatio;
}; };
} } // namespace Callgrind
} } // namespace Valgrind
#endif // VALGRIND_CALLGRIND_CALLGRINDPROXYMODEL_H #endif // VALGRIND_CALLGRIND_CALLGRINDPROXYMODEL_H

View File

@@ -31,14 +31,14 @@
**************************************************************************/ **************************************************************************/
#include "callgrindrunner.h" #include "callgrindrunner.h"
#include "callgrindparser.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QtCore/QFile> #include <QtCore/QFile>
#include "callgrindparser.h" namespace Valgrind {
namespace Callgrind {
using namespace Valgrind::Callgrind;
CallgrindRunner::CallgrindRunner(QObject *parent) CallgrindRunner::CallgrindRunner(QObject *parent)
: ValgrindRunner(parent) : ValgrindRunner(parent)
@@ -131,3 +131,6 @@ void CallgrindRunner::controllerFinished(CallgrindController::Option option)
break; // do nothing break; // do nothing
} }
} }
} // namespace Callgrind
} // namespace Valgrind

View File

@@ -32,8 +32,8 @@
#include "callgrindstackbrowser.h" #include "callgrindstackbrowser.h"
using namespace Valgrind::Callgrind; namespace Valgrind {
namespace Callgrind {
StackBrowser::StackBrowser(QObject *parent) StackBrowser::StackBrowser(QObject *parent)
: QObject(parent) : QObject(parent)
@@ -73,3 +73,6 @@ void StackBrowser::goBack()
m_stack.pop(); m_stack.pop();
emit currentChanged(); emit currentChanged();
} }
} // namespace Callgrind
} // namespace Valgrind

View File

@@ -66,7 +66,7 @@ private:
QStack<const Function *> m_stack; QStack<const Function *> m_stack;
}; };
} } // namespace Callgrind
} } // namespace Valgrind
#endif // CALLGRINDSTACKBROWSER_H #endif // CALLGRINDSTACKBROWSER_H

View File

@@ -34,24 +34,25 @@
#include "memcheckrunner.h" #include "memcheckrunner.h"
#include <xmlprotocol/threadedparser.h>
#include <xmlprotocol/error.h> #include <xmlprotocol/error.h>
#include <xmlprotocol/status.h> #include <xmlprotocol/status.h>
#include <xmlprotocol/threadedparser.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QtNetwork/QNetworkInterface>
#include <QtNetwork/QTcpServer> #include <QtNetwork/QTcpServer>
#include <QtNetwork/QTcpSocket> #include <QtNetwork/QTcpSocket>
#include <QtNetwork/QNetworkInterface>
#include <QtCore/QEventLoop> #include <QtCore/QEventLoop>
#include <QtGui/QDialog>
#include <QtGui/QApplication> #include <QtGui/QApplication>
#include <QtGui/QVBoxLayout> #include <QtGui/QDialog>
#include <QtGui/QDialogButtonBox>
#include <QtGui/QLabel> #include <QtGui/QLabel>
#include <QtGui/QListWidget> #include <QtGui/QListWidget>
#include <QtGui/QDialogButtonBox> #include <QtGui/QVBoxLayout>
using namespace Valgrind::Memcheck; namespace Valgrind {
namespace Memcheck {
class MemcheckRunner::Private class MemcheckRunner::Private
{ {
@@ -228,3 +229,6 @@ void MemcheckRunner::readLogSocket()
{ {
emit logMessageReceived(d->logSocket->readAll()); emit logMessageReceived(d->logSocket->readAll());
} }
} // namespace Memcheck
} // namespace Valgrind

View File

@@ -38,15 +38,8 @@
#include <valgrind/valgrind_global.h> #include <valgrind/valgrind_global.h>
#include <valgrind/valgrindrunner.h> #include <valgrind/valgrindrunner.h>
QT_BEGIN_NAMESPACE
class QProcessEnvironment;
QT_END_NAMESPACE
namespace Utils {
class Environment;
}
namespace Valgrind { namespace Valgrind {
namespace XmlProtocol{ namespace XmlProtocol{
class ThreadedParser; class ThreadedParser;
} }
@@ -73,16 +66,15 @@ private slots:
void xmlSocketConnected(); void xmlSocketConnected();
void logSocketConnected(); void logSocketConnected();
void readLogSocket(); void readLogSocket();
private: private:
QString tool() const; QString tool() const;
Q_DISABLE_COPY(MemcheckRunner);
class Private; class Private;
Private *d; Private *d;
}; };
} } // namespace Memcheck
} // namespace Valgrind
}
#endif // VALGRIND_PROTOCOL_MEMCHECKRUNNER_H #endif // VALGRIND_PROTOCOL_MEMCHECKRUNNER_H

View File

@@ -35,7 +35,7 @@
#ifndef VALGRIND_GLOBAL_H #ifndef VALGRIND_GLOBAL_H
#define VALGRIND_GLOBAL_H #define VALGRIND_GLOBAL_H
#include <QtCore/qglobal.h> #include <QtCore/QtGlobal>
#if defined(VALGRIND_LIBRARY) #if defined(VALGRIND_LIBRARY)
# define VALGRINDSHARED_EXPORT Q_DECL_EXPORT # define VALGRINDSHARED_EXPORT Q_DECL_EXPORT

View File

@@ -45,12 +45,6 @@ namespace Valgrind {
ValgrindProcess::ValgrindProcess(QObject *parent) ValgrindProcess::ValgrindProcess(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
}
ValgrindProcess::~ValgrindProcess()
{
} }
//////////////////////// ////////////////////////
@@ -70,11 +64,6 @@ LocalValgrindProcess::LocalValgrindProcess(QObject *parent)
this, SLOT(readyReadStandardOutput())); this, SLOT(readyReadStandardOutput()));
} }
LocalValgrindProcess::~LocalValgrindProcess()
{
}
void LocalValgrindProcess::setProcessChannelMode(QProcess::ProcessChannelMode mode) void LocalValgrindProcess::setProcessChannelMode(QProcess::ProcessChannelMode mode)
{ {
m_process.setProcessChannelMode(mode); m_process.setProcessChannelMode(mode);
@@ -157,9 +146,7 @@ RemoteValgrindProcess::RemoteValgrindProcess(const Utils::SshConnectionParameter
, m_params(sshParams) , m_params(sshParams)
, m_error(QProcess::UnknownError) , m_error(QProcess::UnknownError)
, m_pid(0) , m_pid(0)
{ {}
}
RemoteValgrindProcess::RemoteValgrindProcess(const Utils::SshConnection::Ptr &connection, QObject *parent) RemoteValgrindProcess::RemoteValgrindProcess(const Utils::SshConnection::Ptr &connection, QObject *parent)
: ValgrindProcess(parent) : ValgrindProcess(parent)
@@ -167,14 +154,7 @@ RemoteValgrindProcess::RemoteValgrindProcess(const Utils::SshConnection::Ptr &co
, m_connection(connection) , m_connection(connection)
, m_error(QProcess::UnknownError) , m_error(QProcess::UnknownError)
, m_pid(0) , m_pid(0)
{ {}
}
RemoteValgrindProcess::~RemoteValgrindProcess()
{
}
bool RemoteValgrindProcess::isRunning() const bool RemoteValgrindProcess::isRunning() const
{ {
@@ -368,4 +348,4 @@ Q_PID RemoteValgrindProcess::pid() const
return m_pid; return m_pid;
} }
} } // namespace Valgrind

View File

@@ -35,12 +35,12 @@
#ifndef VALGRIND_RUNNER_P_H #ifndef VALGRIND_RUNNER_P_H
#define VALGRIND_RUNNER_P_H #define VALGRIND_RUNNER_P_H
#include "valgrind_global.h"
#include <utils/qtcprocess.h> #include <utils/qtcprocess.h>
#include <utils/ssh/sshremoteprocess.h> #include <utils/ssh/sshremoteprocess.h>
#include <utils/ssh/sshconnection.h> #include <utils/ssh/sshconnection.h>
#include "valgrind_global.h"
namespace Valgrind { namespace Valgrind {
/** /**
@@ -49,9 +49,9 @@ namespace Valgrind {
class VALGRINDSHARED_EXPORT ValgrindProcess : public QObject class VALGRINDSHARED_EXPORT ValgrindProcess : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ValgrindProcess(QObject *parent = 0); explicit ValgrindProcess(QObject *parent = 0);
virtual ~ValgrindProcess();
virtual bool isRunning() const = 0; virtual bool isRunning() const = 0;
@@ -86,7 +86,6 @@ class VALGRINDSHARED_EXPORT LocalValgrindProcess : public ValgrindProcess
public: public:
explicit LocalValgrindProcess(QObject *parent = 0); explicit LocalValgrindProcess(QObject *parent = 0);
virtual ~LocalValgrindProcess();
virtual bool isRunning() const; virtual bool isRunning() const;
@@ -125,7 +124,6 @@ public:
QObject *parent = 0); QObject *parent = 0);
explicit RemoteValgrindProcess(const Utils::SshConnection::Ptr &connection, explicit RemoteValgrindProcess(const Utils::SshConnection::Ptr &connection,
QObject *parent = 0); QObject *parent = 0);
virtual ~RemoteValgrindProcess();
virtual bool isRunning() const; virtual bool isRunning() const;
@@ -167,6 +165,6 @@ private:
Utils::SshRemoteProcess::Ptr m_findPID; Utils::SshRemoteProcess::Ptr m_findPID;
}; };
} } // namespace Valgrind
#endif // VALGRIND_RUNNER_P_H #endif // VALGRIND_RUNNER_P_H

View File

@@ -43,7 +43,7 @@
#include <QtCore/QEventLoop> #include <QtCore/QEventLoop>
using namespace Valgrind; namespace Valgrind {
class ValgrindRunner::Private class ValgrindRunner::Private
{ {
@@ -256,3 +256,5 @@ ValgrindProcess *ValgrindRunner::valgrindProcess() const
{ {
return d->process; return d->process;
} }
} // namespace Valgrind

View File

@@ -39,10 +39,6 @@
#include "valgrind_global.h" #include "valgrind_global.h"
QT_BEGIN_NAMESPACE
class QProcessEnvironment;
QT_END_NAMESPACE
namespace Utils { namespace Utils {
class Environment; class Environment;
class SshConnectionParameters; class SshConnectionParameters;
@@ -101,11 +97,10 @@ protected slots:
virtual void processFinished(int, QProcess::ExitStatus); virtual void processFinished(int, QProcess::ExitStatus);
private: private:
Q_DISABLE_COPY(ValgrindRunner);
class Private; class Private;
Private *d; Private *d;
}; };
} } // namespace Valgrind
#endif // VALGRIND_RUNNER_H #endif // VALGRIND_RUNNER_H

View File

@@ -40,8 +40,8 @@
#include <algorithm> #include <algorithm>
using namespace Valgrind; namespace Valgrind {
using namespace Valgrind::XmlProtocol; namespace XmlProtocol {
class AnnounceThread::Private : public QSharedData class AnnounceThread::Private : public QSharedData
{ {
@@ -106,3 +106,6 @@ void AnnounceThread::setStack(const QVector<Frame> &stack)
{ {
d->stack = stack; d->stack = stack;
} }
} // namespace XmlProtocol
} // namespace Valgrind

View File

@@ -68,7 +68,7 @@ private:
QSharedDataPointer<Private> d; QSharedDataPointer<Private> d;
}; };
} } // namespace XmlProtocol
} } // namespace Valgrind
#endif // LIBVALGRIND_PROTOCOL_ANNOUNCETHREAD_H #endif // LIBVALGRIND_PROTOCOL_ANNOUNCETHREAD_H

View File

@@ -44,10 +44,11 @@
#include <QtCore/QtAlgorithms> #include <QtCore/QtAlgorithms>
using namespace Valgrind; namespace Valgrind {
using namespace Valgrind::XmlProtocol; namespace XmlProtocol {
class Error::Private : public QSharedData { class Error::Private : public QSharedData
{
public: public:
explicit Private() : explicit Private() :
unique(0), unique(0),
@@ -260,3 +261,6 @@ QString Error::toXml() const
return xml; return xml;
} }
} // namespace XmlProtocol
} // namespace Valgrind

View File

@@ -55,7 +55,8 @@ class Suppression;
/** /**
* Error kinds, specific to memcheck * Error kinds, specific to memcheck
*/ */
enum MemcheckErrorKind { enum MemcheckErrorKind
{
InvalidFree, InvalidFree,
MismatchedFree, MismatchedFree,
InvalidRead, InvalidRead,
@@ -74,14 +75,16 @@ enum MemcheckErrorKind {
MemcheckErrorKindCount MemcheckErrorKindCount
}; };
enum PtrcheckErrorKind { enum PtrcheckErrorKind
{
SorG, SorG,
Heap, Heap,
Arith, Arith,
SysParam SysParam
}; };
enum HelgrindErrorKind { enum HelgrindErrorKind
{
Race, Race,
UnlockUnlocked, UnlockUnlocked,
UnlockForeign, UnlockForeign,
@@ -91,9 +94,9 @@ enum HelgrindErrorKind {
Misc Misc
}; };
class VALGRINDSHARED_EXPORT Error { class VALGRINDSHARED_EXPORT Error
{
public: public:
Error(); Error();
~Error(); ~Error();
@@ -146,4 +149,4 @@ private:
Q_DECLARE_METATYPE(Valgrind::XmlProtocol::Error) Q_DECLARE_METATYPE(Valgrind::XmlProtocol::Error)
#endif #endif // LIBVALGRIND_PROTOCOL_ERROR_H

View File

@@ -37,13 +37,14 @@
#include "frame.h" #include "frame.h"
#include "stack.h" #include "stack.h"
#include "modelhelpers.h" #include "modelhelpers.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QtCore/QVector> #include <QtCore/QVector>
using namespace Valgrind; namespace Valgrind {
using namespace Valgrind::XmlProtocol; namespace XmlProtocol {
class ErrorListModel::Private class ErrorListModel::Private
{ {
@@ -54,7 +55,6 @@ public:
Frame findRelevantFrame(const Error &error) const; Frame findRelevantFrame(const Error &error) const;
QString formatAbsoluteFilePath(const Error &error) const; QString formatAbsoluteFilePath(const Error &error) const;
QString formatLocation(const Error &error) const; QString formatLocation(const Error &error) const;
}; };
ErrorListModel::ErrorListModel(QObject *parent) ErrorListModel::ErrorListModel(QObject *parent)
@@ -96,7 +96,6 @@ QModelIndex ErrorListModel::parent(const QModelIndex &child) const
{ {
QTC_ASSERT(!child.isValid() || child.model() == this, return QModelIndex()); QTC_ASSERT(!child.isValid() || child.model() == this, return QModelIndex());
return QModelIndex(); return QModelIndex();
} }
Frame ErrorListModel::Private::findRelevantFrame(const Error &error) const Frame ErrorListModel::Private::findRelevantFrame(const Error &error) const
@@ -110,7 +109,6 @@ Frame ErrorListModel::Private::findRelevantFrame(const Error &error) const
const QVector<Frame> frames = stack.frames(); const QVector<Frame> frames = stack.frames();
if (!frames.isEmpty()) if (!frames.isEmpty())
return frames.first(); return frames.first();
else
return Frame(); return Frame();
} }
@@ -119,7 +117,6 @@ QString ErrorListModel::Private::formatAbsoluteFilePath(const Error &error) cons
const Frame f = findRelevantFrame(error); const Frame f = findRelevantFrame(error);
if (!f.directory().isEmpty() && !f.file().isEmpty()) if (!f.directory().isEmpty() && !f.file().isEmpty())
return QString(f.directory() + QDir::separator() + f.file()); return QString(f.directory() + QDir::separator() + f.file());
else
return QString(); return QString();
} }
@@ -133,7 +130,6 @@ QString ErrorListModel::Private::formatLocation(const Error &error) const
const qint64 line = frame.line(); const qint64 line = frame.line();
if (line > 0) if (line > 0)
return QString::fromLatin1("%1:%2").arg(file, QString::number(frame.line())); return QString::fromLatin1("%1:%2").arg(file, QString::number(frame.line()));
else
return file; return file;
} }
return frame.object(); return frame.object();
@@ -290,7 +286,6 @@ Error ErrorListModel::error(const QModelIndex &index) const
const int r = index.row(); const int r = index.row();
if (r < 0 || r >= d->errors.size()) if (r < 0 || r >= d->errors.size())
return Error(); return Error();
else
return d->errors[r]; return d->errors[r];
} }
@@ -300,3 +295,6 @@ void ErrorListModel::clear()
d->errors.clear(); d->errors.clear();
endResetModel(); endResetModel();
} }
} // namespace XmlProtocol
} // namespace Valgrind

View File

@@ -106,7 +106,7 @@ private:
Private *const d; Private *const d;
}; };
} } // namespace XmlProtocol
} } // namespace Valgrind
#endif // LIBVALGRIND_PROTOCOL_ERRORLISTMODEL_H #endif // LIBVALGRIND_PROTOCOL_ERRORLISTMODEL_H

View File

@@ -37,10 +37,11 @@
#include <QtCore/QString> #include <QtCore/QString>
#include <QtCore/QtAlgorithms> #include <QtCore/QtAlgorithms>
using namespace Valgrind; namespace Valgrind {
using namespace Valgrind::XmlProtocol; namespace XmlProtocol {
class Frame::Private : public QSharedData { class Frame::Private : public QSharedData
{
public: public:
explicit Private() : explicit Private() :
ip(0), line( -1 ) ip(0), line( -1 )
@@ -158,3 +159,6 @@ void Frame::setLine(int line)
{ {
d->line = line; d->line = line;
} }
} // namespace XmlProtocol
} // namespace Valgrind

View File

@@ -84,5 +84,5 @@ QString toolTipForFrame(const Frame &frame)
return html; return html;
} }
} } // namespace XmlProtocol
} } // namespace Valgrind

View File

@@ -35,14 +35,12 @@
#ifndef LIBVALGRIND_PROTOCOL_MODELHELPERS_H #ifndef LIBVALGRIND_PROTOCOL_MODELHELPERS_H
#define LIBVALGRIND_PROTOCOL_MODELHELPERS_H #define LIBVALGRIND_PROTOCOL_MODELHELPERS_H
#include <QtCore/QtGlobal> #include "../valgrind_global.h"
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QString; class QString;
QT_END_NAMESPACE QT_END_NAMESPACE
#include "../valgrind_global.h"
namespace Valgrind { namespace Valgrind {
namespace XmlProtocol { namespace XmlProtocol {
@@ -50,7 +48,7 @@ class Frame;
VALGRINDSHARED_EXPORT QString toolTipForFrame(const Frame &frame); VALGRINDSHARED_EXPORT QString toolTipForFrame(const Frame &frame);
} } // namespace XmlProtocol
} } // namespace Valgrind
#endif // LIBVALGRIND_PROTOCOL_MODELHELPERS_H #endif // LIBVALGRIND_PROTOCOL_MODELHELPERS_H

View File

@@ -49,39 +49,25 @@
#include <QtCore/QThread> #include <QtCore/QThread>
#include <QtCore/QXmlStreamReader> #include <QtCore/QXmlStreamReader>
using namespace Valgrind;
using namespace Valgrind::XmlProtocol;
namespace { namespace {
class Exception {
class ParserException
{
public: public:
explicit Exception(const QString &msg) explicit ParserException(const QString &message)
: m_message(msg) : m_message(message)
{ {}
}
~Exception() throw() {} ~ParserException() throw() {}
QString message() const QString message() const { return m_message; }
{
return m_message;
}
private: private:
QString m_message; QString m_message;
}; };
class ParserException : public Exception { struct XWhat
public:
explicit ParserException(const QString &message)
: Exception(message)
{ {
}
~ParserException() throw() {}
};
struct XWhat {
XWhat() : leakedblocks(0), leakedbytes(0), hthreadid(-1) {} XWhat() : leakedblocks(0), leakedbytes(0), hthreadid(-1) {}
QString text; QString text;
qint64 leakedblocks; qint64 leakedblocks;
@@ -89,12 +75,10 @@ namespace {
qint64 hthreadid; qint64 hthreadid;
}; };
struct XauxWhat { struct XauxWhat
XauxWhat() : line(-1), hthreadid(-1) {}
void clear()
{ {
*this = XauxWhat(); XauxWhat() : line(-1), hthreadid(-1) {}
} void clear() { *this = XauxWhat(); }
QString text; QString text;
QString file; QString file;
@@ -102,20 +86,24 @@ namespace {
qint64 line; qint64 line;
qint64 hthreadid; qint64 hthreadid;
}; };
}
class Parser::Private { } // namespace anon
namespace Valgrind {
namespace XmlProtocol {
class Parser::Private
{
Parser *const q; Parser *const q;
public: public:
explicit Private(Parser *qq); explicit Private(Parser *qq);
void parse(QIODevice *device); void parse(QIODevice *device);
void parse_error(); void parse_error();
QVector<Frame> parse_stack(); QVector<Frame> parseStack();
Suppression parse_suppression(); Suppression parseSuppression();
SuppressionFrame parse_suppFrame(); SuppressionFrame parseSuppressionFrame();
Frame parse_frame(); Frame parse_frame();
void parse_status(); void parse_status();
void parse_errorcounts(); void parse_errorcounts();
@@ -458,7 +446,7 @@ void Parser::Private::parse_error()
else if (reader.name() == QLatin1String("kind")) //TODO this is memcheck-specific: else if (reader.name() == QLatin1String("kind")) //TODO this is memcheck-specific:
e.setKind(parseErrorKind(blockingReadElementText())); e.setKind(parseErrorKind(blockingReadElementText()));
else if (reader.name() == QLatin1String("suppression")) else if (reader.name() == QLatin1String("suppression"))
e.setSuppression(parse_suppression()); e.setSuppression(parseSuppression());
else if (reader.name() == QLatin1String("xwhat")) { else if (reader.name() == QLatin1String("xwhat")) {
const XWhat xw = parseXWhat(); const XWhat xw = parseXWhat();
e.setWhat(xw.text); e.setWhat(xw.text);
@@ -489,7 +477,7 @@ void Parser::Private::parse_error()
lastAuxWhat = 0; lastAuxWhat = 0;
} }
else if (reader.name() == QLatin1String("stack")) { else if (reader.name() == QLatin1String("stack")) {
frames.push_back(parse_stack()); frames.push_back(parseStack());
} }
else if (reader.isStartElement()) else if (reader.isStartElement())
reader.skipCurrentElement(); reader.skipCurrentElement();
@@ -552,7 +540,7 @@ void Parser::Private::parse_announcethread()
if (reader.name() == QLatin1String("hthreadid")) if (reader.name() == QLatin1String("hthreadid"))
at.setHelgrindThreadId(parseInt64(blockingReadElementText(), QLatin1String("announcethread/hthreadid"))); at.setHelgrindThreadId(parseInt64(blockingReadElementText(), QLatin1String("announcethread/hthreadid")));
else if (reader.name() == QLatin1String("stack")) else if (reader.name() == QLatin1String("stack"))
at.setStack(parse_stack()); at.setStack(parseStack());
else if (reader.isStartElement()) else if (reader.isStartElement())
reader.skipCurrentElement(); reader.skipCurrentElement();
} }
@@ -645,7 +633,7 @@ void Parser::Private::parse_status()
emit q->status(s); emit q->status(s);
} }
QVector<Frame> Parser::Private::parse_stack() QVector<Frame> Parser::Private::parseStack()
{ {
QVector<Frame> frames; QVector<Frame> frames;
while (notAtEnd()) { while (notAtEnd()) {
@@ -661,7 +649,7 @@ QVector<Frame> Parser::Private::parse_stack()
return frames; return frames;
} }
SuppressionFrame Parser::Private::parse_suppFrame() SuppressionFrame Parser::Private::parseSuppressionFrame()
{ {
SuppressionFrame frame; SuppressionFrame frame;
@@ -682,10 +670,10 @@ SuppressionFrame Parser::Private::parse_suppFrame()
return frame; return frame;
} }
Suppression Parser::Private::parse_suppression() Suppression Parser::Private::parseSuppression()
{ {
Suppression supp; Suppression supp;
QVector<SuppressionFrame> frames; SuppressionFrames frames;
while (notAtEnd()) { while (notAtEnd()) {
blockingReadNext(); blockingReadNext();
if (reader.isEndElement()) if (reader.isEndElement())
@@ -700,7 +688,7 @@ Suppression Parser::Private::parse_suppression()
else if (reader.name() == QLatin1String("rawtext")) else if (reader.name() == QLatin1String("rawtext"))
supp.setRawText(blockingReadElementText()); supp.setRawText(blockingReadElementText());
else if (reader.name() == QLatin1String("sframe")) else if (reader.name() == QLatin1String("sframe"))
frames.push_back(parse_suppFrame()); frames.push_back(parseSuppressionFrame());
} }
} }
@@ -760,3 +748,6 @@ void Parser::parse(QIODevice *device)
{ {
d->parse(device); d->parse(device);
} }
} // namespace XmlParser
} // namespace Valgrind

View File

@@ -44,7 +44,6 @@ class QIODevice;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Valgrind { namespace Valgrind {
namespace XmlProtocol { namespace XmlProtocol {
class AnnounceThread; class AnnounceThread;
@@ -54,8 +53,10 @@ class Status;
/** /**
* Parser for the Valgrind Output XML Protocol 4 * Parser for the Valgrind Output XML Protocol 4
*/ */
class VALGRINDSHARED_EXPORT Parser : public QObject { class VALGRINDSHARED_EXPORT Parser : public QObject
{
Q_OBJECT Q_OBJECT
public: public:
enum Tool { enum Tool {
Unknown, Unknown,
@@ -82,8 +83,6 @@ Q_SIGNALS:
void finished(); void finished();
private: private:
Q_DISABLE_COPY(Parser)
class Private; class Private;
Private *const d; Private *const d;
}; };

View File

@@ -41,8 +41,8 @@
#include <algorithm> #include <algorithm>
using namespace Valgrind; namespace Valgrind {
using namespace Valgrind::XmlProtocol; namespace XmlProtocol {
class Stack::Private : public QSharedData class Stack::Private : public QSharedData
{ {
@@ -156,3 +156,6 @@ void Stack::setHelgrindThreadId(qint64 id)
{ {
d->hthreadid = id; d->hthreadid = id;
} }
} // namespace XmlProtocol
} // namespace Valgrind

View File

@@ -48,7 +48,8 @@ namespace XmlProtocol {
class Frame; class Frame;
class VALGRINDSHARED_EXPORT Stack { class VALGRINDSHARED_EXPORT Stack
{
public: public:
Stack(); Stack();
Stack(const Stack &other); Stack(const Stack &other);
@@ -82,7 +83,7 @@ private:
QSharedDataPointer<Private> d; QSharedDataPointer<Private> d;
}; };
} } // namespace XmlProtocol
} } // namespace Stack
#endif // LIBVALGRIND_PROTOCOL_STACK_H #endif // LIBVALGRIND_PROTOCOL_STACK_H

View File

@@ -43,8 +43,8 @@
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QtCore/QVector> #include <QtCore/QVector>
using namespace Valgrind; namespace Valgrind {
using namespace Valgrind::XmlProtocol; namespace XmlProtocol {
class StackModel::Private class StackModel::Private
{ {
@@ -70,7 +70,6 @@ static QString makeName(const Frame &frame)
if (!d.isEmpty() && !f.isEmpty()) if (!d.isEmpty() && !f.isEmpty())
return frame.line() > 0 ? QString::fromLatin1("%1%2%3:%4").arg(d, QDir::separator(), f, QString::number(frame.line())) return frame.line() > 0 ? QString::fromLatin1("%1%2%3:%4").arg(d, QDir::separator(), f, QString::number(frame.line()))
: QString::fromLatin1("%1%2%3").arg(d, QDir::separator(), f); : QString::fromLatin1("%1%2%3").arg(d, QDir::separator(), f);
else
return frame.object(); return frame.object();
} }
@@ -187,7 +186,7 @@ QModelIndex StackModel::index(int row, int column, const QModelIndex &parent) co
if (parent.isValid()) { if (parent.isValid()) {
QTC_ASSERT(parent.model() == this, return QModelIndex()); QTC_ASSERT(parent.model() == this, return QModelIndex());
return createIndex(row, column, parent.row()); return createIndex(row, column, parent.row());
} else }
return createIndex(row, column, -1); return createIndex(row, column, -1);
} }
@@ -197,7 +196,6 @@ QModelIndex StackModel::parent(const QModelIndex &child) const
if (child.internalId() == -1) if (child.internalId() == -1)
return QModelIndex(); return QModelIndex();
else
return createIndex(child.internalId(), 0, -1); return createIndex(child.internalId(), 0, -1);
} }
@@ -212,11 +210,11 @@ int StackModel::rowCount(const QModelIndex &parent) const
if (!gp.isValid()) if (!gp.isValid())
return d->stack(parent.row()).frames().size(); return d->stack(parent.row()).frames().size();
else
return 0; return 0;
} }
int StackModel::columnCount(const QModelIndex &parent) const { int StackModel::columnCount(const QModelIndex &parent) const
{
QTC_ASSERT(!parent.isValid() || parent.model() == this, return 0); QTC_ASSERT(!parent.isValid() || parent.model() == this, return 0);
return ColumnCount; return ColumnCount;
} }
@@ -235,3 +233,6 @@ void StackModel::clear()
d->error = Error(); d->error = Error();
endResetModel(); endResetModel();
} }
} // namespace XmlProtocol
} // namespace Valgrind

View File

@@ -87,7 +87,7 @@ private:
Private *const d; Private *const d;
}; };
} } // namespace XmlProtocol
} } // namespace Valgrind
#endif // LIBVALGRIND_PROTOCOL_STACKMODEL_H #endif // LIBVALGRIND_PROTOCOL_STACKMODEL_H

View File

@@ -37,8 +37,8 @@
#include <QtCore/QSharedData> #include <QtCore/QSharedData>
#include <QtCore/QString> #include <QtCore/QString>
using namespace Valgrind; namespace Valgrind {
using namespace Valgrind::XmlProtocol; namespace XmlProtocol {
class Status::Private : public QSharedData class Status::Private : public QSharedData
{ {
@@ -102,3 +102,6 @@ QString Status::time() const
{ {
return d->time; return d->time;
} }
} // namespace XmlProtocol
} // namespace Valgrind

View File

@@ -40,10 +40,6 @@
#include <QtCore/QMetaType> #include <QtCore/QMetaType>
#include <QtCore/QSharedDataPointer> #include <QtCore/QSharedDataPointer>
QT_BEGIN_NAMESPACE
class QString;
QT_END_NAMESPACE
namespace Valgrind { namespace Valgrind {
namespace XmlProtocol { namespace XmlProtocol {

View File

@@ -129,7 +129,7 @@ public:
QString kind; QString kind;
QString auxkind; QString auxkind;
QString rawText; QString rawText;
QVector<SuppressionFrame> frames; SuppressionFrames frames;
}; };
Suppression::Suppression() Suppression::Suppression()
@@ -216,13 +216,13 @@ QString Suppression::rawText() const
return d->rawText; return d->rawText;
} }
void Suppression::setFrames(const QVector<SuppressionFrame> &frames) void Suppression::setFrames(const SuppressionFrames &frames)
{ {
d->isNull = false; d->isNull = false;
d->frames = frames; d->frames = frames;
} }
QVector<SuppressionFrame> Suppression::frames() const SuppressionFrames Suppression::frames() const
{ {
return d->frames; return d->frames;
} }
@@ -236,9 +236,8 @@ QString Suppression::toString() const
stream << "{\n"; stream << "{\n";
stream << indent << d->name << '\n'; stream << indent << d->name << '\n';
stream << indent << d->kind << '\n'; stream << indent << d->kind << '\n';
foreach (const SuppressionFrame &frame, d->frames) { foreach (const SuppressionFrame &frame, d->frames)
stream << indent << frame.toString() << '\n'; stream << indent << frame.toString() << '\n';
}
stream << "}\n"; stream << "}\n";
return ret; return ret;
} }

View File

@@ -47,7 +47,8 @@ QT_END_NAMESPACE
namespace Valgrind { namespace Valgrind {
namespace XmlProtocol { namespace XmlProtocol {
class VALGRINDSHARED_EXPORT SuppressionFrame { class VALGRINDSHARED_EXPORT SuppressionFrame
{
public: public:
SuppressionFrame(); SuppressionFrame();
SuppressionFrame(const SuppressionFrame &other); SuppressionFrame(const SuppressionFrame &other);
@@ -73,12 +74,16 @@ private:
QSharedDataPointer<Private> d; QSharedDataPointer<Private> d;
}; };
class VALGRINDSHARED_EXPORT Suppression { typedef QVector<SuppressionFrame> SuppressionFrames;
class VALGRINDSHARED_EXPORT Suppression
{
public: public:
Suppression(); Suppression();
Suppression(const Suppression &other); Suppression(const Suppression &other);
~Suppression(); ~Suppression();
Suppression &operator=(const Suppression &other); Suppression &operator=(const Suppression &other);
void swap(Suppression &other); void swap(Suppression &other);
bool operator==(const Suppression &other) const; bool operator==(const Suppression &other) const;
@@ -96,8 +101,8 @@ public:
QString rawText() const; QString rawText() const;
void setRawText(const QString &text); void setRawText(const QString &text);
QVector<SuppressionFrame> frames() const; SuppressionFrames frames() const;
void setFrames(const QVector<SuppressionFrame> &frames); void setFrames(const SuppressionFrames &frames);
QString toString() const; QString toString() const;

View File

@@ -44,21 +44,15 @@
#include <QtCore/QThread> #include <QtCore/QThread>
#include <QtCore/QSharedPointer> #include <QtCore/QSharedPointer>
using namespace Valgrind;
using namespace Valgrind::XmlProtocol;
namespace { namespace {
class Thread : public QThread { class Thread : public QThread
public:
Thread()
: QThread()
, parser(0)
, device(0)
{ {
} public:
Thread() : parser(0) , device(0) {}
void run() { void run()
{
QTC_ASSERT(QThread::currentThread() == this, return); QTC_ASSERT(QThread::currentThread() == this, return);
parser->parse(device); parser->parse(device);
delete parser; delete parser;
@@ -67,10 +61,16 @@ public:
device = 0; device = 0;
} }
XmlProtocol::Parser *parser; Valgrind::XmlProtocol::Parser *parser;
QIODevice *device; QIODevice *device;
}; };
}
} // namespace anon
namespace Valgrind {
namespace XmlProtocol {
class ThreadedParser::Private class ThreadedParser::Private
{ {
public: public:
@@ -146,7 +146,11 @@ void ThreadedParser::slotInternalError(const QString &errorString)
d->errorString = errorString; d->errorString = errorString;
emit internalError(errorString); emit internalError(errorString);
} }
bool ThreadedParser::waitForFinished() bool ThreadedParser::waitForFinished()
{ {
return d->parserThread ? d->parserThread.data()->wait() : true; return d->parserThread ? d->parserThread.data()->wait() : true;
} }
} // namespace XmlProtocol
} // namespace Valgrind

View File

@@ -52,8 +52,10 @@ class Status;
/** /**
* ThreadedParser for the Valgrind Output XmlProtocol 4 * ThreadedParser for the Valgrind Output XmlProtocol 4
*/ */
class VALGRINDSHARED_EXPORT ThreadedParser : public QObject { class VALGRINDSHARED_EXPORT ThreadedParser : public QObject
{
Q_OBJECT Q_OBJECT
public: public:
explicit ThreadedParser(QObject *parent = 0); explicit ThreadedParser(QObject *parent = 0);
~ThreadedParser(); ~ThreadedParser();
@@ -81,8 +83,6 @@ Q_SIGNALS:
void finished(); void finished();
private: private:
Q_DISABLE_COPY(ThreadedParser)
class Private; class Private;
Private *const d; Private *const d;
}; };

View File

@@ -46,6 +46,7 @@ namespace Internal {
class AnalyzerOptionsPage : public Core::IOptionsPage class AnalyzerOptionsPage : public Core::IOptionsPage
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit AnalyzerOptionsPage(AbstractAnalyzerSubConfig *config, QObject *parent = 0); explicit AnalyzerOptionsPage(AbstractAnalyzerSubConfig *config, QObject *parent = 0);
@@ -64,7 +65,6 @@ private:
AbstractAnalyzerSubConfig *m_config; AbstractAnalyzerSubConfig *m_config;
}; };
} // namespace Internal } // namespace Internal
} // namespace Analyzer } // namespace Analyzer

View File

@@ -43,7 +43,7 @@
#include <QtGui/QGroupBox> #include <QtGui/QGroupBox>
#include <QtGui/QVBoxLayout> #include <QtGui/QVBoxLayout>
using namespace Analyzer; namespace Analyzer {
AnalyzerRunConfigWidget::AnalyzerRunConfigWidget() AnalyzerRunConfigWidget::AnalyzerRunConfigWidget()
: m_detailsWidget(new Utils::DetailsWidget(this)) : m_detailsWidget(new Utils::DetailsWidget(this))
@@ -79,9 +79,10 @@ void AnalyzerRunConfigWidget::setRunConfiguration(ProjectExplorer::RunConfigurat
// add group boxes for each sub config // add group boxes for each sub config
QLayout *layout = m_detailsWidget->widget()->layout(); QLayout *layout = m_detailsWidget->widget()->layout();
foreach (AbstractAnalyzerSubConfig *config, settings->subConfigs()) { foreach (AbstractAnalyzerSubConfig *config, settings->subConfigs()) {
QGroupBox *box = new QGroupBox(config->displayName()); (void) new QGroupBox(config->displayName());
Q_UNUSED(box)
QWidget *widget = config->createConfigWidget(this); QWidget *widget = config->createConfigWidget(this);
layout->addWidget(widget); layout->addWidget(widget);
} }
} }
} // namespace Analyzer

View File

@@ -46,19 +46,16 @@ class AbstractCallgrindSettings;
class CallgrindConfigWidget : public QWidget class CallgrindConfigWidget : public QWidget
{ {
Q_OBJECT
public: public:
CallgrindConfigWidget(AbstractCallgrindSettings *settings, QWidget *parent); CallgrindConfigWidget(AbstractCallgrindSettings *settings, QWidget *parent);
virtual ~CallgrindConfigWidget(); virtual ~CallgrindConfigWidget();
private: private:
Ui::CallgrindConfigWidget *m_ui; Ui::CallgrindConfigWidget *m_ui;
AbstractCallgrindSettings *m_settings; AbstractCallgrindSettings *m_settings;
}; };
} } // namespace Internal
} } // namespace Callgrind
#endif // ANALYZER_INTERNAL_CALLGRINDCONFIGWIDGET_H #endif // ANALYZER_INTERNAL_CALLGRINDCONFIGWIDGET_H

View File

@@ -33,12 +33,4 @@
#ifndef CALLGRINDCONSTANTS_H #ifndef CALLGRINDCONSTANTS_H
#define CALLGRINDCONSTANTS_H #define CALLGRINDCONSTANTS_H
namespace Callgrind {
namespace Constants {
const char * const A_SHOWCOSTSOFFUNCTION = "Analyzer.Callgrind.ShowCostsOfFunction";
}
}
#endif // CALLGRINDCONSTANTS_H #endif // CALLGRINDCONSTANTS_H

View File

@@ -40,9 +40,8 @@
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QtGui/QPainter>
#include <QtGui/QApplication> #include <QtGui/QApplication>
#include <QtCore/QDebug> #include <QtGui/QPainter>
using namespace Valgrind::Callgrind; using namespace Valgrind::Callgrind;
@@ -65,8 +64,7 @@ public:
CostDelegate::Private::Private() CostDelegate::Private::Private()
: m_model(0) : m_model(0)
, m_format(CostDelegate::FormatAbsolute) , m_format(CostDelegate::FormatAbsolute)
{ {}
}
int CostDelegate::Private::toNativeRole(CostDelegate::CostFormat format) int CostDelegate::Private::toNativeRole(CostDelegate::CostFormat format)
{ {

View File

@@ -40,8 +40,6 @@ namespace Internal {
class CostDelegate : public QStyledItemDelegate class CostDelegate : public QStyledItemDelegate
{ {
Q_OBJECT
public: public:
explicit CostDelegate(QObject *parent = 0); explicit CostDelegate(QObject *parent = 0);
virtual ~CostDelegate(); virtual ~CostDelegate();

View File

@@ -50,10 +50,10 @@ namespace Internal {
//BEGIN CostView::Private //BEGIN CostView::Private
class CostView::Private { class CostView::Private
{
public: public:
explicit Private(CostView *qq); explicit Private(CostView *qq);
~Private();
CostDelegate *m_costDelegate; CostDelegate *m_costDelegate;
NameDelegate *m_nameDelegate; NameDelegate *m_nameDelegate;
@@ -62,12 +62,7 @@ public:
CostView::Private::Private(CostView *qq) CostView::Private::Private(CostView *qq)
: m_costDelegate(new CostDelegate(qq)) : m_costDelegate(new CostDelegate(qq))
, m_nameDelegate(new NameDelegate(qq)) , m_nameDelegate(new NameDelegate(qq))
{ {}
}
CostView::Private::~Private()
{
}
//END CostView::Private //END CostView::Private
@@ -109,21 +104,21 @@ void CostView::setModel(QAbstractItemModel *model)
headerView->setStretchLastSection(false); headerView->setStretchLastSection(false);
if (qobject_cast<CallModel *>(model)) { if (qobject_cast<CallModel *>(model)) {
setItemDelegateForColumn(CallModel::CostColumn, d->m_costDelegate);
headerView->setResizeMode(CallModel::CostColumn, QHeaderView::ResizeToContents);
headerView->setResizeMode(CallModel::CallsColumn, QHeaderView::ResizeToContents);
headerView->setResizeMode(CallModel::CalleeColumn, QHeaderView::Stretch); headerView->setResizeMode(CallModel::CalleeColumn, QHeaderView::Stretch);
setItemDelegateForColumn(CallModel::CalleeColumn, d->m_nameDelegate);
headerView->setResizeMode(CallModel::CallerColumn, QHeaderView::Stretch); headerView->setResizeMode(CallModel::CallerColumn, QHeaderView::Stretch);
headerView->setResizeMode(CallModel::CallsColumn, QHeaderView::ResizeToContents);
headerView->setResizeMode(CallModel::CostColumn, QHeaderView::ResizeToContents);
setItemDelegateForColumn(CallModel::CalleeColumn, d->m_nameDelegate);
setItemDelegateForColumn(CallModel::CallerColumn, d->m_nameDelegate); setItemDelegateForColumn(CallModel::CallerColumn, d->m_nameDelegate);
setItemDelegateForColumn(CallModel::CostColumn, d->m_costDelegate);
} else if (qobject_cast<DataModel *>(model)) { } else if (qobject_cast<DataModel *>(model)) {
setItemDelegateForColumn(DataModel::SelfCostColumn, d->m_costDelegate); headerView->setResizeMode(DataModel::InclusiveCostColumn, QHeaderView::ResizeToContents);
headerView->setResizeMode(DataModel::LocationColumn, QHeaderView::Stretch);
headerView->setResizeMode(DataModel::NameColumn, QHeaderView::Stretch);
headerView->setResizeMode(DataModel::SelfCostColumn, QHeaderView::ResizeToContents); headerView->setResizeMode(DataModel::SelfCostColumn, QHeaderView::ResizeToContents);
setItemDelegateForColumn(DataModel::InclusiveCostColumn, d->m_costDelegate); setItemDelegateForColumn(DataModel::InclusiveCostColumn, d->m_costDelegate);
headerView->setResizeMode(DataModel::InclusiveCostColumn, QHeaderView::ResizeToContents);
setItemDelegateForColumn(DataModel::NameColumn, d->m_nameDelegate); setItemDelegateForColumn(DataModel::NameColumn, d->m_nameDelegate);
headerView->setResizeMode(DataModel::NameColumn, QHeaderView::Stretch); setItemDelegateForColumn(DataModel::SelfCostColumn, d->m_costDelegate);
headerView->setResizeMode(DataModel::LocationColumn, QHeaderView::Stretch);
} }
d->m_costDelegate->setModel(model); d->m_costDelegate->setModel(model);

View File

@@ -37,8 +37,6 @@
#include <QtCore/QDebug> #include <QtCore/QDebug>
using namespace Analyzer; using namespace Analyzer;
using namespace Callgrind::Internal;
using namespace Callgrind;
static const char callgrindEnableCacheSimC[] = "Analyzer.Valgrind.Callgrind.EnableCacheSim"; static const char callgrindEnableCacheSimC[] = "Analyzer.Valgrind.Callgrind.EnableCacheSim";
static const char callgrindEnableBranchSimC[] = "Analyzer.Valgrind.Callgrind.EnableBranchSim"; static const char callgrindEnableBranchSimC[] = "Analyzer.Valgrind.Callgrind.EnableBranchSim";
@@ -51,10 +49,12 @@ static const char callgrindVisualisationMinimumCostRatioC[] = "Analyzer.Valgrind
static const char callgrindCycleDetectionC[] = "Analyzer.Valgrind.Callgrind.CycleDetection"; static const char callgrindCycleDetectionC[] = "Analyzer.Valgrind.Callgrind.CycleDetection";
static const char callgrindCostFormatC[] = "Analyzer.Valgrind.Callgrind.CostFormat"; static const char callgrindCostFormatC[] = "Analyzer.Valgrind.Callgrind.CostFormat";
namespace Callgrind {
namespace Internal {
AbstractCallgrindSettings::AbstractCallgrindSettings(QObject *parent) AbstractCallgrindSettings::AbstractCallgrindSettings(QObject *parent)
: AbstractAnalyzerSubConfig(parent) : AbstractAnalyzerSubConfig(parent)
{ {
} }
void AbstractCallgrindSettings::setEnableCacheSim(bool enable) void AbstractCallgrindSettings::setEnableCacheSim(bool enable)
@@ -181,12 +181,6 @@ QWidget *AbstractCallgrindSettings::createConfigWidget(QWidget *parent)
CallgrindGlobalSettings::CallgrindGlobalSettings(QObject *parent) CallgrindGlobalSettings::CallgrindGlobalSettings(QObject *parent)
: AbstractCallgrindSettings(parent) : AbstractCallgrindSettings(parent)
{ {
}
CallgrindGlobalSettings::~CallgrindGlobalSettings()
{
} }
QVariantMap CallgrindGlobalSettings::defaults() const QVariantMap CallgrindGlobalSettings::defaults() const
@@ -241,10 +235,7 @@ void CallgrindGlobalSettings::setDetectCycles(bool detect)
CallgrindProjectSettings::CallgrindProjectSettings(QObject *parent) CallgrindProjectSettings::CallgrindProjectSettings(QObject *parent)
: AbstractCallgrindSettings(parent) : AbstractCallgrindSettings(parent)
{ {
} }
CallgrindProjectSettings::~CallgrindProjectSettings() } // namespace Internal
{ } // namespace Callgrind
}

View File

@@ -33,10 +33,11 @@
#ifndef ANALYZER_INTERNAL_CALLGRINDSETTINGS_H #ifndef ANALYZER_INTERNAL_CALLGRINDSETTINGS_H
#define ANALYZER_INTERNAL_CALLGRINDSETTINGS_H #define ANALYZER_INTERNAL_CALLGRINDSETTINGS_H
#include "callgrindcostdelegate.h"
#include <analyzerbase/analyzersettings.h> #include <analyzerbase/analyzersettings.h>
#include <QtCore/QString> #include <QtCore/QString>
#include "callgrindcostdelegate.h"
namespace Callgrind { namespace Callgrind {
namespace Internal { namespace Internal {
@@ -51,17 +52,17 @@ class AbstractCallgrindSettings : public Analyzer::AbstractAnalyzerSubConfig
public: public:
AbstractCallgrindSettings(QObject *parent = 0); AbstractCallgrindSettings(QObject *parent = 0);
inline bool enableCacheSim() const { return m_enableCacheSim; } bool enableCacheSim() const { return m_enableCacheSim; }
inline bool enableBranchSim() const { return m_enableBranchSim; } bool enableBranchSim() const { return m_enableBranchSim; }
inline bool collectSystime() const { return m_collectSystime; } bool collectSystime() const { return m_collectSystime; }
inline bool collectBusEvents() const { return m_collectBusEvents; } bool collectBusEvents() const { return m_collectBusEvents; }
inline bool enableEventToolTips() const { return m_enableEventToolTips; } bool enableEventToolTips() const { return m_enableEventToolTips; }
/// \return Minimum cost ratio, range [0.0..100.0] /// \return Minimum cost ratio, range [0.0..100.0]
inline double minimumInclusiveCostRatio() const { return m_minimumInclusiveCostRatio; } double minimumInclusiveCostRatio() const { return m_minimumInclusiveCostRatio; }
/// \return Minimum cost ratio, range [0.0..100.0] /// \return Minimum cost ratio, range [0.0..100.0]
inline double visualisationMinimumInclusiveCostRatio() const { return m_visualisationMinimumInclusiveCostRatio; } double visualisationMinimumInclusiveCostRatio() const { return m_visualisationMinimumInclusiveCostRatio; }
// abstract virtual methods from base class // abstract virtual methods from base class
virtual bool fromMap(const QVariantMap &map); virtual bool fromMap(const QVariantMap &map);
@@ -72,7 +73,7 @@ public:
virtual QString displayName() const; virtual QString displayName() const;
virtual QWidget *createConfigWidget(QWidget *parent); virtual QWidget *createConfigWidget(QWidget *parent);
public Q_SLOTS: public slots:
void setEnableCacheSim(bool enable); void setEnableCacheSim(bool enable);
void setEnableBranchSim(bool enable); void setEnableBranchSim(bool enable);
void setCollectSystime(bool collect); void setCollectSystime(bool collect);
@@ -85,7 +86,7 @@ public Q_SLOTS:
/// \param minimumInclusiveCostRatio Minimum inclusive cost ratio, valid values are [0.0..100.0] /// \param minimumInclusiveCostRatio Minimum inclusive cost ratio, valid values are [0.0..100.0]
void setVisualisationMinimumInclusiveCostRatio(double minimumInclusiveCostRatio); void setVisualisationMinimumInclusiveCostRatio(double minimumInclusiveCostRatio);
Q_SIGNALS: signals:
void enableCacheSimChanged(bool); void enableCacheSimChanged(bool);
void enableBranchSimChanged(bool); void enableBranchSimChanged(bool);
void collectSystimeChanged(bool); void collectSystimeChanged(bool);
@@ -116,7 +117,6 @@ class CallgrindGlobalSettings : public AbstractCallgrindSettings
public: public:
CallgrindGlobalSettings(QObject *parent = 0); CallgrindGlobalSettings(QObject *parent = 0);
virtual ~CallgrindGlobalSettings();
virtual bool fromMap(const QVariantMap &map); virtual bool fromMap(const QVariantMap &map);
virtual QVariantMap defaults() const; virtual QVariantMap defaults() const;
@@ -145,10 +145,9 @@ class CallgrindProjectSettings : public AbstractCallgrindSettings
public: public:
CallgrindProjectSettings(QObject *parent = 0); CallgrindProjectSettings(QObject *parent = 0);
virtual ~CallgrindProjectSettings();
}; };
} } // namespace Internal
} } // namespace Callgrind
#endif // ANALYZER_INTERNAL_CALLGRINDSETTINGS_H #endif // ANALYZER_INTERNAL_CALLGRINDSETTINGS_H

View File

@@ -53,10 +53,6 @@ CallgrindTextMark::CallgrindTextMark(const QPersistentModelIndex &index,
setPriority(TextEditor::ITextMark::HighPriority); setPriority(TextEditor::ITextMark::HighPriority);
} }
CallgrindTextMark::~CallgrindTextMark()
{
}
void CallgrindTextMark::paint(QPainter *painter, const QRect &paintRect) const void CallgrindTextMark::paint(QPainter *painter, const QRect &paintRect) const
{ {
if (!m_modelIndex.isValid()) if (!m_modelIndex.isValid())

View File

@@ -37,9 +37,6 @@
#include <QtCore/QPersistentModelIndex> #include <QtCore/QPersistentModelIndex>
QT_BEGIN_NAMESPACE
QT_END_NAMESPACE
namespace Valgrind { namespace Valgrind {
namespace Callgrind { namespace Callgrind {
class Function; class Function;
@@ -62,7 +59,6 @@ public:
*/ */
explicit CallgrindTextMark(const QPersistentModelIndex &index, explicit CallgrindTextMark(const QPersistentModelIndex &index,
const QString &fileName, int lineNumber); const QString &fileName, int lineNumber);
virtual ~CallgrindTextMark();
const Valgrind::Callgrind::Function *function() const; const Valgrind::Callgrind::Function *function() const;

View File

@@ -212,7 +212,7 @@ void CallgrindTool::extensionsInitialized()
action = new QAction(tr("Profile Costs of this Function and its Callees"), this); action = new QAction(tr("Profile Costs of this Function and its Callees"), this);
action->setIcon(QIcon(Analyzer::Constants::ANALYZER_CONTROL_START_ICON)); action->setIcon(QIcon(Analyzer::Constants::ANALYZER_CONTROL_START_ICON));
connect(action, SIGNAL(triggered()), SLOT(handleShowCostsOfFunction())); connect(action, SIGNAL(triggered()), SLOT(handleShowCostsOfFunction()));
cmd = actionManager->registerAction(action, Callgrind::Constants::A_SHOWCOSTSOFFUNCTION, cmd = actionManager->registerAction(action, "Analyzer.Callgrind.ShowCostsOfFunction",
analyzerContext); analyzerContext);
editorContextMenu->addAction(cmd); editorContextMenu->addAction(cmd);
cmd->setAttribute(Core::Command::CA_Hide); cmd->setAttribute(Core::Command::CA_Hide);

View File

@@ -62,7 +62,6 @@ namespace Internal {
class CallgrindEngine; class CallgrindEngine;
class CallgrindWidgetHandler; class CallgrindWidgetHandler;
class CallgrindOutputPaneAdapter;
class CallgrindTextMark; class CallgrindTextMark;
class CallgrindTool : public Analyzer::IAnalyzerTool class CallgrindTool : public Analyzer::IAnalyzerTool

View File

@@ -333,22 +333,22 @@ void Visualisation::setMinimumInclusiveCostRatio(double ratio)
d->m_model->setMinimumInclusiveCostRatio(ratio); d->m_model->setMinimumInclusiveCostRatio(ratio);
} }
void Visualisation::setModel(DataModel *model) void Visualisation::setModel(QAbstractItemModel *model)
{ {
QTC_ASSERT(!d->m_model->sourceModel() && model, return); // only set once! QTC_ASSERT(!d->m_model->sourceModel() && model, return); // only set once!
d->m_model->setSourceModel(model); d->m_model->setSourceModel(model);
connect(model, connect(model,
SIGNAL(columnsInserted(const QModelIndex&, int, int)), SIGNAL(columnsInserted(QModelIndex,int,int)),
SLOT(populateScene())); SLOT(populateScene()));
connect(model, connect(model,
SIGNAL(columnsMoved(const QModelIndex&, int, int, const QModelIndex&, int)), SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)),
SLOT(populateScene())); SLOT(populateScene()));
connect(model, connect(model,
SIGNAL(columnsRemoved(const QModelIndex&, int, int)), SIGNAL(columnsRemoved(QModelIndex,int,int)),
SLOT(populateScene())); SLOT(populateScene()));
connect(model, connect(model,
SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
SLOT(populateScene())); SLOT(populateScene()));
connect(model, connect(model,
SIGNAL(headerDataChanged(Qt::Orientation,int,int)), SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
@@ -356,13 +356,13 @@ void Visualisation::setModel(DataModel *model)
connect(model, SIGNAL(layoutChanged()), SLOT(populateScene())); connect(model, SIGNAL(layoutChanged()), SLOT(populateScene()));
connect(model, SIGNAL(modelReset()), SLOT(populateScene())); connect(model, SIGNAL(modelReset()), SLOT(populateScene()));
connect(model, connect(model,
SIGNAL(rowsInserted(const QModelIndex&, int, int)), SIGNAL(rowsInserted(QModelIndex,int,int)),
SLOT(populateScene())); SLOT(populateScene()));
connect(model, connect(model,
SIGNAL(rowsMoved(const QModelIndex&, int, int, const QModelIndex&, int)), SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
SLOT(populateScene())); SLOT(populateScene()));
connect(model, connect(model,
SIGNAL(rowsRemoved(const QModelIndex&, int, int)), SIGNAL(rowsRemoved(QModelIndex,int,int)),
SLOT(populateScene())); SLOT(populateScene()));
populateScene(); populateScene();
@@ -392,8 +392,7 @@ void Visualisation::populateScene()
typedef QPair<QModelIndex, qreal> Pair; typedef QPair<QModelIndex, qreal> Pair;
QLinkedList<Pair> costs; QLinkedList<Pair> costs;
for (int row=0; row < d->m_model->rowCount(); ++row) for (int row = 0; row < d->m_model->rowCount(); ++row) {
{
const QModelIndex index = d->m_model->index(row, DataModel::InclusiveCostColumn); const QModelIndex index = d->m_model->index(row, DataModel::InclusiveCostColumn);
bool ok = false; bool ok = false;
@@ -407,9 +406,9 @@ void Visualisation::populateScene()
// item showing the current filter function // item showing the current filter function
QString text; QString text;
if (d->m_model->filterFunction()) if (d->m_model->filterFunction()) {
text = d->m_model->filterFunction()->name(); text = d->m_model->filterFunction()->name();
else { } else {
const float ratioPercent = d->m_model->minimumInclusiveCostRatio() * 100; const float ratioPercent = d->m_model->minimumInclusiveCostRatio() * 100;
QString ratioPercentString = QString::number(ratioPercent); QString ratioPercentString = QString::number(ratioPercent);
ratioPercentString.append(QLocale::system().percent()); ratioPercentString.append(QLocale::system().percent());
@@ -431,8 +430,7 @@ void Visualisation::populateScene()
// add the canvas elements to the scene // add the canvas elements to the scene
qreal used = sceneHeight * 0.1; qreal used = sceneHeight * 0.1;
foreach (const Pair &cost, costs) foreach (const Pair &cost, costs) {
{
const QModelIndex &index = cost.first; const QModelIndex &index = cost.first;
const QString text = index.data().toString(); const QString text = index.data().toString();
@@ -468,6 +466,5 @@ void Visualisation::resizeEvent(QResizeEvent *event)
QGraphicsView::resizeEvent(event); QGraphicsView::resizeEvent(event);
} }
} // Internal } // Internal
} // Callgrind } // Callgrind

View File

@@ -43,7 +43,6 @@ QT_END_NAMESPACE
namespace Valgrind { namespace Valgrind {
namespace Callgrind { namespace Callgrind {
class Function; class Function;
class DataModel;
} }
} }
@@ -58,7 +57,7 @@ public:
explicit Visualisation(QWidget *parent = 0); explicit Visualisation(QWidget *parent = 0);
virtual ~Visualisation(); virtual ~Visualisation();
void setModel(Valgrind::Callgrind::DataModel *model); void setModel(QAbstractItemModel *model);
const Valgrind::Callgrind::Function *functionForItem(QGraphicsItem *item) const; const Valgrind::Callgrind::Function *functionForItem(QGraphicsItem *item) const;
QGraphicsItem *itemForFunction(const Valgrind::Callgrind::Function *function) const; QGraphicsItem *itemForFunction(const Valgrind::Callgrind::Function *function) const;

View File

@@ -543,5 +543,5 @@ void CallgrindWidgetHandler::updateEventCombo()
m_eventCombo->addItem(ParseData::prettyStringForEvent(event)); m_eventCombo->addItem(ParseData::prettyStringForEvent(event));
} }
} } // namespace Internal
} } // namespace Callgrind

View File

@@ -61,7 +61,6 @@ class CallModel;
namespace Callgrind { namespace Callgrind {
namespace Internal { namespace Internal {
class CallgrindEngine;
class Visualisation; class Visualisation;
class CostView; class CostView;

View File

@@ -44,7 +44,8 @@
#include <QtGui/QFileDialog> #include <QtGui/QFileDialog>
#include <QtCore/QDebug> #include <QtCore/QDebug>
using namespace Memcheck::Internal; namespace Memcheck {
namespace Internal {
MemcheckConfigWidget::MemcheckConfigWidget(AbstractMemcheckSettings *settings, QWidget *parent) MemcheckConfigWidget::MemcheckConfigWidget(AbstractMemcheckSettings *settings, QWidget *parent)
: QWidget(parent), : QWidget(parent),
@@ -176,3 +177,6 @@ void MemcheckConfigWidget::slotSuppressionSelectionChanged()
{ {
m_ui->removeSuppression->setEnabled(m_ui->suppressionList->selectionModel()->hasSelection()); m_ui->removeSuppression->setEnabled(m_ui->suppressionList->selectionModel()->hasSelection());
} }
} // namespace Internal
} // namespace Memcheck

View File

@@ -32,7 +32,6 @@
** **
**************************************************************************/ **************************************************************************/
#ifndef ANALYZER_INTERNAL_MEMCHECKCONFIGWIDGET_H #ifndef ANALYZER_INTERNAL_MEMCHECKCONFIGWIDGET_H
#define ANALYZER_INTERNAL_MEMCHECKCONFIGWIDGET_H #define ANALYZER_INTERNAL_MEMCHECKCONFIGWIDGET_H
@@ -75,7 +74,7 @@ private:
Ui::MemcheckConfigWidget *m_ui; Ui::MemcheckConfigWidget *m_ui;
}; };
} } // namespace Internal
} } // namespace Memcheck
#endif // ANALYZER_INTERNAL_MEMCHECKCONFIGWIDGET_H #endif // ANALYZER_INTERNAL_MEMCHECKCONFIGWIDGET_H

View File

@@ -44,17 +44,17 @@
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
using namespace Analyzer; using namespace Analyzer;
using namespace Memcheck;
using namespace Valgrind::XmlProtocol; using namespace Valgrind::XmlProtocol;
using namespace Memcheck::Internal; namespace Memcheck {
namespace Internal {
MemcheckEngine::MemcheckEngine(const Analyzer::AnalyzerStartParameters &sp, MemcheckEngine::MemcheckEngine(const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration) ProjectExplorer::RunConfiguration *runConfiguration)
: ValgrindEngine(sp, runConfiguration) : ValgrindEngine(sp, runConfiguration)
{ {
connect(&m_parser, SIGNAL(error(const Valgrind::XmlProtocol::Error &)), connect(&m_parser, SIGNAL(error(Valgrind::XmlProtocol::Error)),
SIGNAL(parserError(const Valgrind::XmlProtocol::Error &))); SIGNAL(parserError(Valgrind::XmlProtocol::Error)));
connect(&m_parser, SIGNAL(suppressionCount(QString,qint64)), connect(&m_parser, SIGNAL(suppressionCount(QString,qint64)),
SIGNAL(suppressionCount(QString,qint64))); SIGNAL(suppressionCount(QString,qint64)));
connect(&m_parser, SIGNAL(internalError(QString)), connect(&m_parser, SIGNAL(internalError(QString)),
@@ -143,3 +143,6 @@ void MemcheckEngine::receiveLogMessage(const QByteArray &b)
emit taskToBeAdded(ProjectExplorer::Task::Error, error, file, line); emit taskToBeAdded(ProjectExplorer::Task::Error, error, file, line);
} }
} // namespace Internal
} // namespace Memcheck

View File

@@ -67,10 +67,11 @@
#include <QtGui/QApplication> #include <QtGui/QApplication>
#include <QtGui/QMenu> #include <QtGui/QMenu>
using namespace Memcheck;
using namespace Memcheck::Internal;
using namespace Valgrind::XmlProtocol; using namespace Valgrind::XmlProtocol;
namespace Memcheck {
namespace Internal {
MemcheckErrorDelegate::MemcheckErrorDelegate(QListView *parent) MemcheckErrorDelegate::MemcheckErrorDelegate(QListView *parent)
: QStyledItemDelegate(parent), : QStyledItemDelegate(parent),
m_detailsWidget(0) m_detailsWidget(0)
@@ -79,10 +80,6 @@ MemcheckErrorDelegate::MemcheckErrorDelegate(QListView *parent)
SLOT(verticalScrolled())); SLOT(verticalScrolled()));
} }
MemcheckErrorDelegate::~MemcheckErrorDelegate()
{
}
QSize MemcheckErrorDelegate::sizeHint(const QStyleOptionViewItem &opt, const QModelIndex &index) const QSize MemcheckErrorDelegate::sizeHint(const QStyleOptionViewItem &opt, const QModelIndex &index) const
{ {
const QListView *view = qobject_cast<const QListView *>(parent()); const QListView *view = qobject_cast<const QListView *>(parent());
@@ -152,9 +149,8 @@ static QString makeFrameName(const Frame &frame, const QString &relativeTo,
if (!fn.isEmpty()) if (!fn.isEmpty())
return QCoreApplication::translate("Memcheck::Internal", "%1 in %2").arg(Qt::escape(fn), path); return QCoreApplication::translate("Memcheck::Internal", "%1 in %2").arg(Qt::escape(fn), path);
else if (!path.isEmpty()) if (!path.isEmpty())
return path; return path;
else
return QString("0x%1").arg(frame.instructionPointer(), 0, 16); return QString("0x%1").arg(frame.instructionPointer(), 0, 16);
} }
@@ -179,7 +175,7 @@ QString errorLocation(const QModelIndex &index, const Error &error,
while (!model && proxy) { while (!model && proxy) {
model = qobject_cast<const ErrorListModel *>(proxy->sourceModel()); model = qobject_cast<const ErrorListModel *>(proxy->sourceModel());
proxy = qobject_cast<const QAbstractProxyModel *>(proxy->sourceModel()); proxy = qobject_cast<const QAbstractProxyModel *>(proxy->sourceModel());
}; }
QTC_ASSERT(model, return QString()); QTC_ASSERT(model, return QString());
return QCoreApplication::translate("Memcheck::Internal", "in %1"). return QCoreApplication::translate("Memcheck::Internal", "in %1").
@@ -476,7 +472,6 @@ QString MemcheckErrorView::defaultSuppressionFile() const
void MemcheckErrorView::settingsChanged(Analyzer::AnalyzerSettings *settings) void MemcheckErrorView::settingsChanged(Analyzer::AnalyzerSettings *settings)
{ {
QTC_ASSERT(settings, return); QTC_ASSERT(settings, return);
m_settings = settings; m_settings = settings;
} }
@@ -486,7 +481,6 @@ void MemcheckErrorView::contextMenuEvent(QContextMenuEvent *e)
if (indizes.isEmpty()) if (indizes.isEmpty())
return; return;
QList<Error> errors; QList<Error> errors;
foreach (const QModelIndex &index, indizes) { foreach (const QModelIndex &index, indizes) {
Error error = model()->data(index, ErrorListModel::ErrorRole).value<Error>(); Error error = model()->data(index, ErrorListModel::ErrorRole).value<Error>();
@@ -513,3 +507,6 @@ void MemcheckErrorView::suppressError()
delete dialog; delete dialog;
} }
} }
} // namespace Internal
} // namespace Memcheck

View File

@@ -39,13 +39,7 @@
#include <QtGui/QStyledItemDelegate> #include <QtGui/QStyledItemDelegate>
#include <QtGui/QLabel> #include <QtGui/QLabel>
QT_BEGIN_NAMESPACE namespace Analyzer {
class QListView;
class QVBoxLayout;
QT_END_NAMESPACE
namespace Analyzer
{
class AnalyzerSettings; class AnalyzerSettings;
} }
@@ -63,8 +57,7 @@ class MemcheckErrorDelegate : public QStyledItemDelegate
public: public:
/// This delegate can only work on one view at a time, parent. parent will also be the parent /// This delegate can only work on one view at a time, parent. parent will also be the parent
/// in the QObject parent-child system. /// in the QObject parent-child system.
MemcheckErrorDelegate(QListView *parent); explicit MemcheckErrorDelegate(QListView *parent);
virtual ~MemcheckErrorDelegate();
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, virtual void paint(QPainter *painter, const QStyleOptionViewItem &option,

View File

@@ -40,9 +40,6 @@
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
using namespace Analyzer; using namespace Analyzer;
using namespace Memcheck;
using namespace Memcheck::Internal;
static const char numCallersC[] = "Analyzer.Valgrind.NumCallers"; static const char numCallersC[] = "Analyzer.Valgrind.NumCallers";
static const char trackOriginsC[] = "Analyzer.Valgrind.TrackOrigins"; static const char trackOriginsC[] = "Analyzer.Valgrind.TrackOrigins";
@@ -55,16 +52,14 @@ static const char visibleErrorKindsC[] = "Analyzer.Valgrind.VisibleErrorKinds";
static const char lastSuppressionDirectoryC[] = "Analyzer.Valgrind.LastSuppressionDirectory"; static const char lastSuppressionDirectoryC[] = "Analyzer.Valgrind.LastSuppressionDirectory";
static const char lastSuppressionHistoryC[] = "Analyzer.Valgrind.LastSuppressionHistory"; static const char lastSuppressionHistoryC[] = "Analyzer.Valgrind.LastSuppressionHistory";
namespace Memcheck {
namespace Internal {
AbstractMemcheckSettings::AbstractMemcheckSettings(QObject *parent) AbstractMemcheckSettings::AbstractMemcheckSettings(QObject *parent)
: AbstractAnalyzerSubConfig(parent) : AbstractAnalyzerSubConfig(parent)
{ {
} }
AbstractMemcheckSettings::~AbstractMemcheckSettings()
{
}
QVariantMap AbstractMemcheckSettings::defaults() const QVariantMap AbstractMemcheckSettings::defaults() const
{ {
QVariantMap map; QVariantMap map;
@@ -163,10 +158,6 @@ MemcheckGlobalSettings::MemcheckGlobalSettings(QObject *parent)
{ {
} }
MemcheckGlobalSettings::~MemcheckGlobalSettings()
{
}
QStringList MemcheckGlobalSettings::suppressionFiles() const QStringList MemcheckGlobalSettings::suppressionFiles() const
{ {
return m_suppressionFiles; return m_suppressionFiles;
@@ -244,10 +235,6 @@ MemcheckProjectSettings::MemcheckProjectSettings(QObject *parent)
{ {
} }
MemcheckProjectSettings::~MemcheckProjectSettings()
{
}
QVariantMap MemcheckProjectSettings::defaults() const QVariantMap MemcheckProjectSettings::defaults() const
{ {
QVariantMap ret = AbstractMemcheckSettings::defaults(); QVariantMap ret = AbstractMemcheckSettings::defaults();
@@ -302,3 +289,6 @@ QStringList MemcheckProjectSettings::suppressionFiles() const
ret.append(m_addedSuppressionFiles); ret.append(m_addedSuppressionFiles);
return ret; return ret;
} }
} // namespace Internal
} // namespace Memcheck

View File

@@ -46,9 +46,9 @@ namespace Internal {
class AbstractMemcheckSettings : public Analyzer::AbstractAnalyzerSubConfig class AbstractMemcheckSettings : public Analyzer::AbstractAnalyzerSubConfig
{ {
Q_OBJECT Q_OBJECT
public: public:
AbstractMemcheckSettings(QObject *parent); AbstractMemcheckSettings(QObject *parent);
virtual ~AbstractMemcheckSettings();
virtual bool fromMap(const QVariantMap &map); virtual bool fromMap(const QVariantMap &map);
@@ -95,10 +95,8 @@ protected:
*/ */
class MemcheckGlobalSettings : public AbstractMemcheckSettings class MemcheckGlobalSettings : public AbstractMemcheckSettings
{ {
Q_OBJECT
public: public:
MemcheckGlobalSettings(QObject *parent); MemcheckGlobalSettings(QObject *parent);
virtual ~MemcheckGlobalSettings();
QStringList suppressionFiles() const; QStringList suppressionFiles() const;
// in the global settings we change the internal list directly // in the global settings we change the internal list directly
@@ -129,10 +127,8 @@ private:
*/ */
class MemcheckProjectSettings : public AbstractMemcheckSettings class MemcheckProjectSettings : public AbstractMemcheckSettings
{ {
Q_OBJECT
public: public:
MemcheckProjectSettings(QObject *parent); MemcheckProjectSettings(QObject *parent);
virtual ~MemcheckProjectSettings();
QStringList suppressionFiles() const; QStringList suppressionFiles() const;
// in the project-specific settings we store a diff to the global list // in the project-specific settings we store a diff to the global list
@@ -150,7 +146,7 @@ private:
QStringList m_addedSuppressionFiles; QStringList m_addedSuppressionFiles;
}; };
} } // namespace Internal
} } // namespace Memcheck
#endif // ANALYZER_INTERNAL_MEMCHECKSETTINGS_H #endif // ANALYZER_INTERNAL_MEMCHECKSETTINGS_H

View File

@@ -32,7 +32,6 @@
** **
**************************************************************************/ **************************************************************************/
#include "suppressiondialog.h" #include "suppressiondialog.h"
#include "ui_suppressiondialog.h" #include "ui_suppressiondialog.h"
@@ -57,12 +56,10 @@
#include <valgrind/xmlprotocol/frame.h> #include <valgrind/xmlprotocol/frame.h>
using namespace Analyzer; using namespace Analyzer;
using namespace Memcheck;
using namespace Valgrind::XmlProtocol; using namespace Valgrind::XmlProtocol;
using namespace Memcheck::Internal;
namespace { namespace {
QString suppressionText(const Error &error) QString suppressionText(const Error &error)
{ {
Suppression sup(error.suppression()); Suppression sup(error.suppression());
@@ -95,13 +92,13 @@ QString suppressionText(const Error &error)
/// @p error input error, which might get hidden when it has the same stack /// @p error input error, which might get hidden when it has the same stack
/// @p suppressed the error that got suppressed already /// @p suppressed the error that got suppressed already
static inline bool equalSuppression(const Error &error, const Error &suppressed) static bool equalSuppression(const Error &error, const Error &suppressed)
{ {
if (error.kind() != suppressed.kind() || error.suppression().isNull()) if (error.kind() != suppressed.kind() || error.suppression().isNull())
return false; return false;
const QVector< SuppressionFrame > errorFrames = error.suppression().frames(); const SuppressionFrames errorFrames = error.suppression().frames();
const QVector< SuppressionFrame > suppressedFrames = suppressed.suppression().frames(); const SuppressionFrames suppressedFrames = suppressed.suppression().frames();
// limit to 23 frames, see: https://bugs.kde.org/show_bug.cgi?id=255822 // limit to 23 frames, see: https://bugs.kde.org/show_bug.cgi?id=255822
if (qMin(23, suppressedFrames.size()) > errorFrames.size()) if (qMin(23, suppressedFrames.size()) > errorFrames.size())
@@ -127,7 +124,10 @@ bool sortIndizesReverse(const QModelIndex &l, const QModelIndex &r)
return l.row() > r.row(); return l.row() > r.row();
} }
} } // namespace anoe
namespace Memcheck {
namespace Internal {
SuppressionDialog::SuppressionDialog(MemcheckErrorView *view, QWidget *parent, Qt::WindowFlags f) SuppressionDialog::SuppressionDialog(MemcheckErrorView *view, QWidget *parent, Qt::WindowFlags f)
: QDialog(parent, f), : QDialog(parent, f),
@@ -241,17 +241,19 @@ void SuppressionDialog::accept()
void SuppressionDialog::reject() void SuppressionDialog::reject()
{ {
if (m_cleanupIfCanceled) { if (m_cleanupIfCanceled)
QFile::remove(m_view->defaultSuppressionFile()); QFile::remove(m_view->defaultSuppressionFile());
}
QDialog::reject(); QDialog::reject();
} }
void SuppressionDialog::validate() void SuppressionDialog::validate()
{ {
bool valid = m_ui->fileChooser->isValid() && bool valid = m_ui->fileChooser->isValid()
!m_ui->suppressionEdit->toPlainText().trimmed().isEmpty(); && !m_ui->suppressionEdit->toPlainText().trimmed().isEmpty();
m_ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(valid); m_ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(valid);
} }
} // namespace Internal
} // namespace Memcheck

View File

@@ -32,7 +32,6 @@
** **
**************************************************************************/ **************************************************************************/
#ifndef ANALYZER_VALGRIND_INTERNAL_SUPPRESSIONDIALOG_H #ifndef ANALYZER_VALGRIND_INTERNAL_SUPPRESSIONDIALOG_H
#define ANALYZER_VALGRIND_INTERNAL_SUPPRESSIONDIALOG_H #define ANALYZER_VALGRIND_INTERNAL_SUPPRESSIONDIALOG_H
@@ -40,8 +39,7 @@
#include <valgrind/xmlprotocol/error.h> #include <valgrind/xmlprotocol/error.h>
namespace Analyzer namespace Analyzer {
{
class AnalyzerSettings; class AnalyzerSettings;
} }
@@ -77,7 +75,7 @@ private:
QList<Valgrind::XmlProtocol::Error> m_errors; QList<Valgrind::XmlProtocol::Error> m_errors;
}; };
} } // namespace Internal
} } // namespace Memcheck
#endif // ANALYZER_VALGRIND_INTERNAL_SUPPRESSIONDIALOG_H #endif // ANALYZER_VALGRIND_INTERNAL_SUPPRESSIONDIALOG_H

View File

@@ -63,7 +63,7 @@ signals:
void runControlCreated(Analyzer::AnalyzerRunControl *); void runControlCreated(Analyzer::AnalyzerRunControl *);
}; };
} } // namespace Internal
} } // namespace QmlProfiler
#endif // QMLPROJECTANALYZERRUNCONTROLFACTORY_H #endif // QMLPROJECTANALYZERRUNCONTROLFACTORY_H

View File

@@ -34,19 +34,12 @@
#ifndef TRACEWINDOW_H #ifndef TRACEWINDOW_H
#define TRACEWINDOW_H #define TRACEWINDOW_H
#include <QtCore/qpointer.h>
#include <QtGui/qwidget.h>
#include <qmljsdebugclient/qdeclarativedebugclient_p.h> #include <qmljsdebugclient/qdeclarativedebugclient_p.h>
#include <QtCore/QPointer>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QTabWidget;
class QSlider;
class QGroupBox;
class QLabel;
class QSpinBox;
class QPushButton;
class QDeclarativeView; class QDeclarativeView;
QT_END_NAMESPACE QT_END_NAMESPACE
@@ -60,6 +53,7 @@ class TracePlugin;
class TraceWindow : public QWidget class TraceWindow : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
TraceWindow(QWidget *parent = 0); TraceWindow(QWidget *parent = 0);
~TraceWindow(); ~TraceWindow();