forked from qt-creator/qt-creator
analyzer: merge valgrind related settings
This mainly reduces the number of tabs in the settings dialog. Change-Id: I62ba5c74585648c8f495602cd4d676d0628de9b5 Reviewed-on: http://codereview.qt.nokia.com/1575 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
@@ -36,30 +36,37 @@
|
||||
#define ANALYZER_INTERNAL_VALGRINDSETTINGS_H
|
||||
|
||||
#include <analyzerbase/analyzersettings.h>
|
||||
#include "callgrindcostdelegate.h"
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
namespace Valgrind {
|
||||
namespace Internal {
|
||||
|
||||
/**
|
||||
* Generic Valgrind settings shared by all tools.
|
||||
* Valgrind settings shared for global and per-project.
|
||||
*/
|
||||
class ValgrindSettings : public Analyzer::AbstractAnalyzerSubConfig
|
||||
class ValgrindBaseSettings : public Analyzer::AbstractAnalyzerSubConfig
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ValgrindSettings() {}
|
||||
ValgrindBaseSettings() {}
|
||||
|
||||
virtual QVariantMap toMap() const;
|
||||
virtual QVariantMap defaults() const;
|
||||
|
||||
QString valgrindExecutable() const;
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
|
||||
virtual QString id() const;
|
||||
virtual QString displayName() const;
|
||||
virtual QWidget *createConfigWidget(QWidget *parent);
|
||||
|
||||
/**
|
||||
* Base valgrind settings
|
||||
*/
|
||||
public:
|
||||
QString valgrindExecutable() const;
|
||||
|
||||
public slots:
|
||||
void setValgrindExecutable(const QString &);
|
||||
@@ -67,11 +74,179 @@ public slots:
|
||||
signals:
|
||||
void valgrindExecutableChanged(const QString &);
|
||||
|
||||
protected:
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
|
||||
private:
|
||||
QString m_valgrindExecutable;
|
||||
|
||||
|
||||
/**
|
||||
* Base memcheck settings
|
||||
*/
|
||||
public:
|
||||
int numCallers() const { return m_numCallers; }
|
||||
bool trackOrigins() const { return m_trackOrigins; }
|
||||
bool filterExternalIssues() const { return m_filterExternalIssues; }
|
||||
QList<int> visibleErrorKinds() const { return m_visibleErrorKinds; }
|
||||
|
||||
virtual QStringList suppressionFiles() const = 0;
|
||||
virtual void addSuppressionFiles(const QStringList &) = 0;
|
||||
virtual void removeSuppressionFiles(const QStringList &) = 0;
|
||||
|
||||
public slots:
|
||||
void setNumCallers(int);
|
||||
void setTrackOrigins(bool);
|
||||
void setFilterExternalIssues(bool);
|
||||
void setVisibleErrorKinds(const QList<int> &);
|
||||
|
||||
signals:
|
||||
void numCallersChanged(int);
|
||||
void trackOriginsChanged(bool);
|
||||
void filterExternalIssuesChanged(bool);
|
||||
void visibleErrorKindsChanged(const QList<int> &);
|
||||
void suppressionFilesRemoved(const QStringList &);
|
||||
void suppressionFilesAdded(const QStringList &);
|
||||
|
||||
protected:
|
||||
int m_numCallers;
|
||||
bool m_trackOrigins;
|
||||
bool m_filterExternalIssues;
|
||||
QList<int> m_visibleErrorKinds;
|
||||
|
||||
/**
|
||||
* Base callgrind settings
|
||||
*/
|
||||
public:
|
||||
bool enableCacheSim() const { return m_enableCacheSim; }
|
||||
bool enableBranchSim() const { return m_enableBranchSim; }
|
||||
bool collectSystime() const { return m_collectSystime; }
|
||||
bool collectBusEvents() const { return m_collectBusEvents; }
|
||||
bool enableEventToolTips() const { return m_enableEventToolTips; }
|
||||
|
||||
/// \return Minimum cost ratio, range [0.0..100.0]
|
||||
double minimumInclusiveCostRatio() const { return m_minimumInclusiveCostRatio; }
|
||||
|
||||
/// \return Minimum cost ratio, range [0.0..100.0]
|
||||
double visualisationMinimumInclusiveCostRatio() const { return m_visualisationMinimumInclusiveCostRatio; }
|
||||
|
||||
public slots:
|
||||
void setEnableCacheSim(bool enable);
|
||||
void setEnableBranchSim(bool enable);
|
||||
void setCollectSystime(bool collect);
|
||||
void setCollectBusEvents(bool collect);
|
||||
void setEnableEventToolTips(bool enable);
|
||||
|
||||
/// \param minimumInclusiveCostRatio Minimum inclusive cost ratio, valid values are [0.0..100.0]
|
||||
void setMinimumInclusiveCostRatio(double minimumInclusiveCostRatio);
|
||||
|
||||
/// \param minimumInclusiveCostRatio Minimum inclusive cost ratio, valid values are [0.0..100.0]
|
||||
void setVisualisationMinimumInclusiveCostRatio(double minimumInclusiveCostRatio);
|
||||
|
||||
signals:
|
||||
void enableCacheSimChanged(bool);
|
||||
void enableBranchSimChanged(bool);
|
||||
void collectSystimeChanged(bool);
|
||||
void collectBusEventsChanged(bool);
|
||||
void enableEventToolTipsChanged(bool);
|
||||
void minimumInclusiveCostRatioChanged(double);
|
||||
void visualisationMinimumInclusiveCostRatioChanged(double);
|
||||
|
||||
private:
|
||||
bool m_enableCacheSim;
|
||||
bool m_collectSystime;
|
||||
bool m_collectBusEvents;
|
||||
bool m_enableBranchSim;
|
||||
bool m_enableEventToolTips;
|
||||
double m_minimumInclusiveCostRatio;
|
||||
double m_visualisationMinimumInclusiveCostRatio;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Global valgrind settings
|
||||
*/
|
||||
class ValgrindGlobalSettings : public ValgrindBaseSettings
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ValgrindGlobalSettings() {}
|
||||
|
||||
QWidget *createConfigWidget(QWidget *parent);
|
||||
QVariantMap toMap() const;
|
||||
QVariantMap defaults() const;
|
||||
bool fromMap(const QVariantMap &map);
|
||||
|
||||
/*
|
||||
* Global memcheck settings
|
||||
*/
|
||||
public:
|
||||
QStringList suppressionFiles() const;
|
||||
// in the global settings we change the internal list directly
|
||||
void addSuppressionFiles(const QStringList &);
|
||||
void removeSuppressionFiles(const QStringList &);
|
||||
|
||||
// internal settings which don't require any UI
|
||||
void setLastSuppressionDialogDirectory(const QString &directory);
|
||||
QString lastSuppressionDialogDirectory() const;
|
||||
|
||||
void setLastSuppressionDialogHistory(const QStringList &history);
|
||||
QStringList lastSuppressionDialogHistory() const;
|
||||
|
||||
private:
|
||||
QStringList m_suppressionFiles;
|
||||
QString m_lastSuppressionDirectory;
|
||||
QStringList m_lastSuppressionHistory;
|
||||
|
||||
|
||||
/**
|
||||
* Global callgrind settings
|
||||
*/
|
||||
public:
|
||||
|
||||
CostDelegate::CostFormat costFormat() const;
|
||||
bool detectCycles() const;
|
||||
|
||||
public slots:
|
||||
void setCostFormat(Valgrind::Internal::CostDelegate::CostFormat format);
|
||||
void setDetectCycles(bool detect);
|
||||
|
||||
private:
|
||||
CostDelegate::CostFormat m_costFormat;
|
||||
bool m_detectCycles;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Per-project valgrind settings.
|
||||
*/
|
||||
class ValgrindProjectSettings : public ValgrindBaseSettings
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ValgrindProjectSettings() {}
|
||||
|
||||
QWidget *createConfigWidget(QWidget *parent);
|
||||
QVariantMap toMap() const;
|
||||
QVariantMap defaults() const;
|
||||
bool fromMap(const QVariantMap &map);
|
||||
|
||||
/**
|
||||
* Per-project memcheck settings, saves a diff to the global suppression files list
|
||||
*/
|
||||
public:
|
||||
QStringList suppressionFiles() const;
|
||||
// in the project-specific settings we store a diff to the global list
|
||||
void addSuppressionFiles(const QStringList &suppressions);
|
||||
void removeSuppressionFiles(const QStringList &suppressions);
|
||||
|
||||
private:
|
||||
QStringList m_disabledGlobalSuppressionFiles;
|
||||
QStringList m_addedSuppressionFiles;
|
||||
|
||||
|
||||
/**
|
||||
* Per-project callgrind settings, saves a diff to the global suppression files list
|
||||
*/
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user