~bzoltan/kubuntu-packaging/decouple_cmake_plugin

« back to all changes in this revision

Viewing changes to src/plugins/valgrind/valgrindsettings.h

  • Committer: Timo Jyrinki
  • Date: 2013-11-15 12:25:23 UTC
  • mfrom: (1.1.28)
  • Revision ID: timo.jyrinki@canonical.com-20131115122523-i2kyamsu4gs2mu1m
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#ifndef ANALYZER_INTERNAL_VALGRINDSETTINGS_H
32
32
#define ANALYZER_INTERNAL_VALGRINDSETTINGS_H
33
33
 
34
 
#include <analyzerbase/analyzersettings.h>
35
34
#include "callgrindcostdelegate.h"
 
35
#include <projectexplorer/runconfiguration.h>
36
36
 
37
37
#include <QObject>
38
38
#include <QString>
41
41
namespace Valgrind {
42
42
namespace Internal {
43
43
 
 
44
const char ANALYZER_VALGRIND_SETTINGS[] = "Analyzer.Valgrind.Settings";
 
45
 
44
46
/**
45
47
 * Valgrind settings shared for global and per-project.
46
48
 */
47
 
class ValgrindBaseSettings : public Analyzer::AbstractAnalyzerSubConfig
 
49
class ValgrindBaseSettings : public ProjectExplorer::ISettingsAspect
48
50
{
49
51
    Q_OBJECT
50
52
 
51
53
public:
 
54
    enum SelfModifyingCodeDetection {
 
55
        DetectSmcNo,
 
56
        DetectSmcStackOnly,
 
57
        DetectSmcEverywhere,
 
58
        DetectSmcEverywhereButFile
 
59
    };
 
60
 
 
61
    enum LeakCheckOnFinish {
 
62
        LeakCheckOnFinishNo,
 
63
        LeakCheckOnFinishSummaryOnly,
 
64
        LeakCheckOnFinishYes
 
65
    };
 
66
 
52
67
    ValgrindBaseSettings() {}
53
68
 
54
 
    virtual QVariantMap toMap() const;
55
 
    virtual QVariantMap defaults() const;
56
 
    virtual void fromMap(const QVariantMap &map);
57
 
 
58
 
    virtual Core::Id id() const;
59
 
    virtual QString displayName() const;
 
69
    void toMap(QVariantMap &map) const;
 
70
    void fromMap(const QVariantMap &map);
60
71
 
61
72
signals:
62
73
    void changed(); // sent when multiple values have changed simulatenously (e.g. fromMap)
66
77
 */
67
78
public:
68
79
    QString valgrindExecutable() const;
 
80
    SelfModifyingCodeDetection selfModifyingCodeDetection() const;
69
81
 
70
82
public slots:
71
83
    void setValgrindExecutable(const QString &);
 
84
    void setSelfModifyingCodeDetection(int);
72
85
 
73
86
signals:
74
87
    void valgrindExecutableChanged(const QString &);
 
88
    void selfModifyingCodeDetectionChanged(int);
75
89
 
76
90
private:
77
91
    QString m_valgrindExecutable;
 
92
    SelfModifyingCodeDetection m_selfModifyingCodeDetection;
78
93
 
79
94
 
80
95
/**
82
97
 */
83
98
public:
84
99
    int numCallers() const { return m_numCallers; }
 
100
    LeakCheckOnFinish leakCheckOnFinish() const { return m_leakCheckOnFinish; }
 
101
    bool showReachable() const { return m_showReachable; }
85
102
    bool trackOrigins() const { return m_trackOrigins; }
86
103
    bool filterExternalIssues() const { return m_filterExternalIssues; }
87
104
    QList<int> visibleErrorKinds() const { return m_visibleErrorKinds; }
92
109
 
93
110
public slots:
94
111
    void setNumCallers(int);
 
112
    void setLeakCheckOnFinish(int);
 
113
    void setShowReachable(bool);
95
114
    void setTrackOrigins(bool);
96
115
    void setFilterExternalIssues(bool);
97
116
    void setVisibleErrorKinds(const QList<int> &);
98
117
 
99
118
signals:
100
119
    void numCallersChanged(int);
 
120
    void leakCheckOnFinishChanged(int);
 
121
    void showReachableChanged(bool);
101
122
    void trackOriginsChanged(bool);
102
123
    void filterExternalIssuesChanged(bool);
103
124
    void visibleErrorKindsChanged(const QList<int> &);
106
127
 
107
128
protected:
108
129
    int m_numCallers;
 
130
    LeakCheckOnFinish m_leakCheckOnFinish;
 
131
    bool m_showReachable;
109
132
    bool m_trackOrigins;
110
133
    bool m_filterExternalIssues;
111
134
    QList<int> m_visibleErrorKinds;
167
190
    Q_OBJECT
168
191
 
169
192
public:
170
 
    ValgrindGlobalSettings() {}
 
193
    ValgrindGlobalSettings();
171
194
 
172
195
    QWidget *createConfigWidget(QWidget *parent);
173
 
    QVariantMap toMap() const;
174
 
    QVariantMap defaults() const;
 
196
    void toMap(QVariantMap &map) const;
175
197
    void fromMap(const QVariantMap &map);
176
 
    virtual AbstractAnalyzerSubConfig *clone();
 
198
    ISettingsAspect *create() const { return new ValgrindGlobalSettings; }
 
199
 
177
200
 
178
201
    /*
179
202
     * Global memcheck settings
191
214
    void setLastSuppressionDialogHistory(const QStringList &history);
192
215
    QStringList lastSuppressionDialogHistory() const;
193
216
 
 
217
    void writeSettings() const;
 
218
    void readSettings();
 
219
 
194
220
private:
195
221
    QStringList m_suppressionFiles;
196
222
    QString m_lastSuppressionDirectory;
228
254
    ValgrindProjectSettings() {}
229
255
 
230
256
    QWidget *createConfigWidget(QWidget *parent);
231
 
    QVariantMap toMap() const;
232
 
    QVariantMap defaults() const;
 
257
    void toMap(QVariantMap &map) const;
233
258
    void fromMap(const QVariantMap &map);
234
 
    virtual AbstractAnalyzerSubConfig *clone();
 
259
    ISettingsAspect *create() const { return new ValgrindProjectSettings; }
235
260
 
236
261
    /**
237
262
     * Per-project memcheck settings, saves a diff to the global suppression files list