Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
86b50c57
Commit
86b50c57
authored
May 10, 2011
by
Friedemann Kleint
Browse files
Analyzer: String constant and include cleanup.
parent
ddf4b613
Changes
12
Hide whitespace changes
Inline
Side-by-side
src/plugins/callgrind/callgrindcostdelegate.cpp
View file @
86b50c57
...
...
@@ -40,9 +40,9 @@
#include <utils/qtcassert.h>
#include <QPainter>
#include <Q
Debug
>
#include <Q
Application
>
#include <
QtGui/
QPainter>
#include <Q
tGui/QApplication
>
#include <Q
tCore/QDebug
>
using
namespace
Valgrind
::
Callgrind
;
...
...
src/plugins/callgrind/callgrindnamedelegate.cpp
View file @
86b50c57
...
...
@@ -34,8 +34,8 @@
#include "callgrindhelper.h"
#include <QApplication>
#include <QPainter>
#include <
QtGui/
QApplication>
#include <
QtGui/
QPainter>
namespace
Callgrind
{
namespace
Internal
{
...
...
src/plugins/callgrind/callgrindplugin.cpp
View file @
86b50c57
...
...
@@ -37,8 +37,8 @@
#include <analyzerbase/analyzermanager.h>
#include <QStringList>
#include <QtPlugin>
#include <
QtCore/
QStringList>
#include <
QtCore/
QtPlugin>
using
namespace
Analyzer
;
using
namespace
Callgrind
;
...
...
src/plugins/callgrind/callgrindsettings.cpp
View file @
86b50c57
...
...
@@ -34,20 +34,20 @@
#include "callgrindconfigwidget.h"
#include <QDebug>
#include <
QtCore/
QDebug>
using
namespace
Analyzer
;
using
namespace
Callgrind
::
Internal
;
using
namespace
Callgrind
;
static
const
QLatin1String
callgrindEnableCacheSimC
(
"Analyzer.Valgrind.Callgrind.EnableCacheSim"
)
;
static
const
QLatin1String
callgrindEnableBranchSimC
(
"Analyzer.Valgrind.Callgrind.EnableBranchSim"
)
;
static
const
QLatin1String
callgrindCollectSystimeC
(
"Analyzer.Valgrind.Callgrind.CollectSystime"
)
;
static
const
QLatin1String
callgrindCollectBusEventsC
(
"Analyzer.Valgrind.Callgrind.CollectBusEvents"
)
;
static
const
char
callgrindEnableCacheSimC
[]
=
"Analyzer.Valgrind.Callgrind.EnableCacheSim"
;
static
const
char
callgrindEnableBranchSimC
[]
=
"Analyzer.Valgrind.Callgrind.EnableBranchSim"
;
static
const
char
callgrindCollectSystimeC
[]
=
"Analyzer.Valgrind.Callgrind.CollectSystime"
;
static
const
char
callgrindCollectBusEventsC
[]
=
"Analyzer.Valgrind.Callgrind.CollectBusEvents"
;
static
const
QLatin1String
callgrindCycleDetectionC
(
"Analyzer.Valgrind.Callgrind.CycleDetection"
)
;
static
const
QLatin1String
callgrindCostFormatC
(
"Analyzer.Valgrind.Callgrind.CostFormat"
)
;
static
const
QLatin1String
callgrindMinimumCostRatioC
(
"Analyzer.Valgrind.Callgrind.MinimumCostRatio"
)
;
static
const
char
callgrindCycleDetectionC
[]
=
"Analyzer.Valgrind.Callgrind.CycleDetection"
;
static
const
char
callgrindCostFormatC
[]
=
"Analyzer.Valgrind.Callgrind.CostFormat"
;
static
const
char
callgrindMinimumCostRatioC
[]
=
"Analyzer.Valgrind.Callgrind.MinimumCostRatio"
;
AbstractCallgrindSettings
::
AbstractCallgrindSettings
(
QObject
*
parent
)
:
AbstractAnalyzerSubConfig
(
parent
)
...
...
@@ -99,36 +99,36 @@ void AbstractCallgrindSettings::setCollectBusEvents(bool collect)
QVariantMap
AbstractCallgrindSettings
::
defaults
()
const
{
QVariantMap
map
;
map
.
insert
(
callgrindEnableCacheSimC
,
false
);
map
.
insert
(
callgrindEnableBranchSimC
,
false
);
map
.
insert
(
callgrindCollectSystimeC
,
false
);
map
.
insert
(
callgrindCollectBusEventsC
,
false
);
map
.
insert
(
QLatin1String
(
callgrindEnableCacheSimC
)
,
false
);
map
.
insert
(
QLatin1String
(
callgrindEnableBranchSimC
)
,
false
);
map
.
insert
(
QLatin1String
(
callgrindCollectSystimeC
)
,
false
);
map
.
insert
(
QLatin1String
(
callgrindCollectBusEventsC
)
,
false
);
return
map
;
}
bool
AbstractCallgrindSettings
::
fromMap
(
const
QVariantMap
&
map
)
{
setIfPresent
(
map
,
callgrindEnableCacheSimC
,
&
m_enableCacheSim
);
setIfPresent
(
map
,
callgrindEnableBranchSimC
,
&
m_enableBranchSim
);
setIfPresent
(
map
,
callgrindCollectSystimeC
,
&
m_collectSystime
);
setIfPresent
(
map
,
callgrindCollectBusEventsC
,
&
m_collectBusEvents
);
setIfPresent
(
map
,
QLatin1String
(
callgrindEnableCacheSimC
)
,
&
m_enableCacheSim
);
setIfPresent
(
map
,
QLatin1String
(
callgrindEnableBranchSimC
)
,
&
m_enableBranchSim
);
setIfPresent
(
map
,
QLatin1String
(
callgrindCollectSystimeC
)
,
&
m_collectSystime
);
setIfPresent
(
map
,
QLatin1String
(
callgrindCollectBusEventsC
)
,
&
m_collectBusEvents
);
return
true
;
}
QVariantMap
AbstractCallgrindSettings
::
toMap
()
const
{
QVariantMap
map
;
map
.
insert
(
callgrindEnableCacheSimC
,
m_enableCacheSim
);
map
.
insert
(
callgrindEnableBranchSimC
,
m_enableBranchSim
);
map
.
insert
(
callgrindCollectSystimeC
,
m_collectSystime
);
map
.
insert
(
callgrindCollectBusEventsC
,
m_collectBusEvents
);
map
.
insert
(
QLatin1String
(
callgrindEnableCacheSimC
)
,
m_enableCacheSim
);
map
.
insert
(
QLatin1String
(
callgrindEnableBranchSimC
)
,
m_enableBranchSim
);
map
.
insert
(
QLatin1String
(
callgrindCollectSystimeC
)
,
m_collectSystime
);
map
.
insert
(
QLatin1String
(
callgrindCollectBusEventsC
)
,
m_collectBusEvents
);
return
map
;
}
QString
AbstractCallgrindSettings
::
id
()
const
{
return
"Analyzer.Valgrind.Settings.Callgrind"
;
return
QLatin1String
(
"Analyzer.Valgrind.Settings.Callgrind"
)
;
}
QString
AbstractCallgrindSettings
::
displayName
()
const
...
...
@@ -156,9 +156,9 @@ CallgrindGlobalSettings::~CallgrindGlobalSettings()
QVariantMap
CallgrindGlobalSettings
::
defaults
()
const
{
QVariantMap
map
=
AbstractCallgrindSettings
::
defaults
();
map
.
insert
(
callgrindCostFormatC
,
CostDelegate
::
FormatRelative
);
map
.
insert
(
callgrindCycleDetectionC
,
true
);
map
.
insert
(
callgrindMinimumCostRatioC
,
0.0001
);
map
.
insert
(
QLatin1String
(
callgrindCostFormatC
)
,
CostDelegate
::
FormatRelative
);
map
.
insert
(
QLatin1String
(
callgrindCycleDetectionC
)
,
true
);
map
.
insert
(
QLatin1String
(
callgrindMinimumCostRatioC
)
,
0.0001
);
return
map
;
}
...
...
@@ -166,20 +166,20 @@ bool CallgrindGlobalSettings::fromMap(const QVariantMap &map)
{
AbstractCallgrindSettings
::
fromMap
(
map
);
// special code as the default one does not cope with the enum properly
if
(
map
.
contains
(
callgrindCostFormatC
))
{
m_costFormat
=
static_cast
<
CostDelegate
::
CostFormat
>
(
map
.
value
(
callgrindCostFormatC
).
toInt
());
if
(
map
.
contains
(
QLatin1String
(
callgrindCostFormatC
))
)
{
m_costFormat
=
static_cast
<
CostDelegate
::
CostFormat
>
(
map
.
value
(
QLatin1String
(
callgrindCostFormatC
)
)
.
toInt
());
}
setIfPresent
(
map
,
callgrindCycleDetectionC
,
&
m_detectCycles
);
setIfPresent
(
map
,
callgrindMinimumCostRatioC
,
&
m_minimumInclusiveCostRatio
);
setIfPresent
(
map
,
QLatin1String
(
callgrindCycleDetectionC
)
,
&
m_detectCycles
);
setIfPresent
(
map
,
QLatin1String
(
callgrindMinimumCostRatioC
)
,
&
m_minimumInclusiveCostRatio
);
return
true
;
}
QVariantMap
CallgrindGlobalSettings
::
toMap
()
const
{
QVariantMap
map
=
AbstractCallgrindSettings
::
toMap
();
map
.
insert
(
callgrindCostFormatC
,
m_costFormat
);
map
.
insert
(
callgrindCycleDetectionC
,
m_detectCycles
);
map
.
insert
(
callgrindMinimumCostRatioC
,
m_minimumInclusiveCostRatio
);
map
.
insert
(
QLatin1String
(
callgrindCostFormatC
)
,
m_costFormat
);
map
.
insert
(
QLatin1String
(
callgrindCycleDetectionC
)
,
m_detectCycles
);
map
.
insert
(
QLatin1String
(
callgrindMinimumCostRatioC
)
,
m_minimumInclusiveCostRatio
);
return
map
;
}
...
...
src/plugins/callgrind/callgrindsettings.h
View file @
86b50c57
...
...
@@ -35,7 +35,7 @@
#include <analyzerbase/analyzersettings.h>
#include <QString>
#include <
QtCore/
QString>
#include "callgrindcostdelegate.h"
namespace
Callgrind
{
...
...
src/plugins/callgrind/callgrindtextmark.cpp
View file @
86b50c57
...
...
@@ -37,8 +37,8 @@
#include <valgrind/callgrind/callgrinddatamodel.h>
#include <valgrind/callgrind/callgrindfunction.h>
#include <QDebug>
#include <QPainter>
#include <
QtCore/
QDebug>
#include <
QtGui/
QPainter>
#include <utils/qtcassert.h>
...
...
src/plugins/callgrind/callgrindtool.h
View file @
86b50c57
...
...
@@ -35,7 +35,7 @@
#include <analyzerbase/ianalyzertool.h>
#include <QVector>
#include <
QtCore/
QVector>
QT_BEGIN_NAMESPACE
class
QCheckBox
;
...
...
src/plugins/callgrind/callgrindvisualisation.cpp
View file @
86b50c57
...
...
@@ -40,17 +40,17 @@
#include <valgrind/callgrind/callgrindproxymodel.h>
#include <utils/qtcassert.h>
#include <Q
Abstra
ctItem
Model
>
#include <Q
Debug
>
#include <QGraphics
Rec
tItem>
#include <Q
GraphicsSc
en
e
>
#include <Q
GraphicsSimpleTextItem
>
#include <Q
MouseEvent
>
#include <Q
StaticText
>
#include <Q
StyleOptionGraphicsItem
>
#include <Q
Pair
>
#include <Q
PersistentModelIndex
>
#include <Q
LinkedList
>
#include <Q
tGui/QGraphicsRe
ctItem>
#include <Q
tGui/QGraphicsScene
>
#include <
QtGui/
QGraphics
SimpleTex
tItem>
#include <Q
tGui/QMouseEv
en
t
>
#include <Q
tGui/QStaticText
>
#include <Q
tGui/QStyleOptionGraphicsItem
>
#include <Q
tCore/QPair
>
#include <Q
tCore/QPersistentModelIndex
>
#include <Q
tCore/QLinkedList
>
#include <Q
tCore/QAbstractItemModel
>
#include <Q
tCore/QDebug
>
#define VISUALISATION_DEBUG 0
// Margin from hardcoded value in:
...
...
src/plugins/callgrind/callgrindvisualisation.h
View file @
86b50c57
...
...
@@ -33,7 +33,7 @@
#ifndef CALLGRINDVISUALISATION_H
#define CALLGRINDVISUALISATION_H
#include <QGraphicsView>
#include <
QtGui/
QGraphicsView>
QT_BEGIN_NAMESPACE
class
QAbstractItemModel
;
...
...
src/plugins/callgrind/callgrindwidgethandler.cpp
View file @
86b50c57
...
...
@@ -72,8 +72,8 @@
#include <QtGui/QVBoxLayout>
#include <QtGui/QMenu>
#include <QtGui/QActionGroup>
#include <QSortFilterProxyModel>
#include <QComboBox>
#include <
QtGui/
QSortFilterProxyModel>
#include <
QtGui/
QComboBox>
using
namespace
Valgrind
::
Callgrind
;
...
...
src/plugins/callgrind/callgrindwidgethandler.h
View file @
86b50c57
...
...
@@ -33,7 +33,7 @@
#ifndef CALLGRINDWIDGETHANDLER_H
#define CALLGRINDWIDGETHANDLER_H
#include <QObject>
#include <
QtCore/
QObject>
#include "callgrindcostdelegate.h"
...
...
src/plugins/memcheck/memchecksettings.cpp
View file @
86b50c57
...
...
@@ -44,16 +44,16 @@ using namespace Memcheck;
using
namespace
Memcheck
::
Internal
;
static
const
QLatin1String
numCallersC
(
"Analyzer.Valgrind.NumCallers"
)
;
static
const
QLatin1String
trackOriginsC
(
"Analyzer.Valgrind.TrackOrigins"
)
;
static
const
QLatin1String
suppressionFilesC
(
"Analyzer.Valgrind.SupressionFiles"
)
;
static
const
QLatin1String
removedSuppressionFilesC
(
"Analyzer.Valgrind.RemovedSupressionFiles"
)
;
static
const
QLatin1String
addedSuppressionFilesC
(
"Analyzer.Valgrind.AddedSupressionFiles"
)
;
static
const
QLatin1String
filterExternalIssuesC
(
"Analyzer.Valgrind.FilterExternalIssues"
)
;
static
const
QLatin1String
visibleErrorKindsC
(
"Analyzer.Valgrind.VisibleErrorKinds"
)
;
static
const
char
numCallersC
[]
=
"Analyzer.Valgrind.NumCallers"
;
static
const
char
trackOriginsC
[]
=
"Analyzer.Valgrind.TrackOrigins"
;
static
const
char
suppressionFilesC
[]
=
"Analyzer.Valgrind.SupressionFiles"
;
static
const
char
removedSuppressionFilesC
[]
=
"Analyzer.Valgrind.RemovedSup
p
ressionFiles"
;
static
const
char
addedSuppressionFilesC
[]
=
"Analyzer.Valgrind.AddedSup
p
ressionFiles"
;
static
const
char
filterExternalIssuesC
[]
=
"Analyzer.Valgrind.FilterExternalIssues"
;
static
const
char
visibleErrorKindsC
[]
=
"Analyzer.Valgrind.VisibleErrorKinds"
;
static
const
QLatin1String
lastSuppressionDirectoryC
(
"Analyzer.Valgrind.LastSuppressionDirectory"
)
;
static
const
QLatin1String
lastSuppressionHistoryC
(
"Analyzer.Valgrind.LastSuppressionHistory"
)
;
static
const
char
lastSuppressionDirectoryC
[]
=
"Analyzer.Valgrind.LastSuppressionDirectory"
;
static
const
char
lastSuppressionHistoryC
[]
=
"Analyzer.Valgrind.LastSuppressionHistory"
;
AbstractMemcheckSettings
::
AbstractMemcheckSettings
(
QObject
*
parent
)
:
AbstractAnalyzerSubConfig
(
parent
)
...
...
@@ -68,28 +68,28 @@ AbstractMemcheckSettings::~AbstractMemcheckSettings()
QVariantMap
AbstractMemcheckSettings
::
defaults
()
const
{
QVariantMap
map
;
map
.
insert
(
numCallersC
,
25
);
map
.
insert
(
trackOriginsC
,
true
);
map
.
insert
(
filterExternalIssuesC
,
true
);
map
.
insert
(
QLatin1String
(
numCallersC
)
,
25
);
map
.
insert
(
QLatin1String
(
trackOriginsC
)
,
true
);
map
.
insert
(
QLatin1String
(
filterExternalIssuesC
)
,
true
);
QVariantList
defaultErrorKinds
;
for
(
int
i
=
0
;
i
<
Valgrind
::
XmlProtocol
::
MemcheckErrorKindCount
;
++
i
)
defaultErrorKinds
<<
i
;
map
.
insert
(
visibleErrorKindsC
,
defaultErrorKinds
);
map
.
insert
(
QLatin1String
(
visibleErrorKindsC
)
,
defaultErrorKinds
);
return
map
;
}
bool
AbstractMemcheckSettings
::
fromMap
(
const
QVariantMap
&
map
)
{
setIfPresent
(
map
,
numCallersC
,
&
m_numCallers
);
setIfPresent
(
map
,
trackOriginsC
,
&
m_trackOrigins
);
setIfPresent
(
map
,
filterExternalIssuesC
,
&
m_filterExternalIssues
);
setIfPresent
(
map
,
QLatin1String
(
numCallersC
)
,
&
m_numCallers
);
setIfPresent
(
map
,
QLatin1String
(
trackOriginsC
)
,
&
m_trackOrigins
);
setIfPresent
(
map
,
QLatin1String
(
filterExternalIssuesC
)
,
&
m_filterExternalIssues
);
// if we get more of these try a template specialization of setIfPresent for lists...
if
(
map
.
contains
(
visibleErrorKindsC
))
{
if
(
map
.
contains
(
QLatin1String
(
visibleErrorKindsC
))
)
{
m_visibleErrorKinds
.
clear
();
foreach
(
const
QVariant
&
val
,
map
.
value
(
visibleErrorKindsC
).
toList
())
foreach
(
const
QVariant
&
val
,
map
.
value
(
QLatin1String
(
visibleErrorKindsC
)
)
.
toList
())
m_visibleErrorKinds
<<
val
.
toInt
();
}
...
...
@@ -99,14 +99,14 @@ bool AbstractMemcheckSettings::fromMap(const QVariantMap &map)
QVariantMap
AbstractMemcheckSettings
::
toMap
()
const
{
QVariantMap
map
;
map
.
insert
(
numCallersC
,
m_numCallers
);
map
.
insert
(
trackOriginsC
,
m_trackOrigins
);
map
.
insert
(
filterExternalIssuesC
,
m_filterExternalIssues
);
map
.
insert
(
QLatin1String
(
numCallersC
)
,
m_numCallers
);
map
.
insert
(
QLatin1String
(
trackOriginsC
)
,
m_trackOrigins
);
map
.
insert
(
QLatin1String
(
filterExternalIssuesC
)
,
m_filterExternalIssues
);
QVariantList
errorKinds
;
foreach
(
int
i
,
m_visibleErrorKinds
)
errorKinds
<<
i
;
map
.
insert
(
visibleErrorKindsC
,
errorKinds
);
map
.
insert
(
QLatin1String
(
visibleErrorKindsC
)
,
errorKinds
);
return
map
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment