From kde-commits Tue Nov 22 20:34:48 2016 From: Christian Ehrlicher Date: Tue, 22 Nov 2016 20:34:48 +0000 To: kde-commits Subject: [kcachegrind] /: CLazy warnings-- Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=147984689723128 Git commit e714dc5d0bbc52fefeeda0e892e9bd1c0611df07 by Christian Ehrlicher. Committed on 22/11/2016 at 20:33. Pushed by chehrlic into branch 'master'. CLazy warnings-- REVIEW: 129429 M +0 -1 cgview/main.cpp M +1 -0 kcachegrind/configdlg.h M +1 -1 kcachegrind/toplevel.cpp M +0 -1 libcore/tracedata.h M +1 -1 libviews/callgraphview.cpp M +0 -1 libviews/callgraphview.h M +0 -1 libviews/eventtypeitem.cpp M +0 -1 libviews/eventtypeview.cpp M +0 -2 libviews/globalguiconfig.cpp M +1 -0 libviews/instritem.h M +1 -0 libviews/sourceitem.h M +1 -1 qcachegrind/colorsettings.cpp M +1 -0 qcachegrind/configpage.h M +1 -0 qcachegrind/generalsettings.h M +1 -3 qcachegrind/qcgtoplevel.cpp http://commits.kde.org/kcachegrind/e714dc5d0bbc52fefeeda0e892e9bd1c0611df07 diff --git a/cgview/main.cpp b/cgview/main.cpp index 2f9d683..798ad96 100644 --- a/cgview/main.cpp +++ b/cgview/main.cpp @@ -89,7 +89,6 @@ int main(int argc, char** argv) = out << "\nTotals for event types:\n"; = - QString p; EventType* et; for (int i=3D0;irealCount();i++) { et =3D m->realType(i); diff --git a/kcachegrind/configdlg.h b/kcachegrind/configdlg.h index a0db398..f2ff6c1 100644 --- a/kcachegrind/configdlg.h +++ b/kcachegrind/configdlg.h @@ -31,6 +31,7 @@ class ConfigColorSetting; = class ConfigDlgBase : public QDialog, public Ui::ConfigDlgBase { + Q_OBJECT public: ConfigDlgBase( QWidget *parent ) : QDialog( parent ) { setupUi( this ); diff --git a/kcachegrind/toplevel.cpp b/kcachegrind/toplevel.cpp index c4eaae2..74fe1b7 100644 --- a/kcachegrind/toplevel.cpp +++ b/kcachegrind/toplevel.cpp @@ -2072,7 +2072,7 @@ void TopLevel::ccReadOutput() if (!_ccProcess) return; if (p !=3D _ccProcess) return; = - _ccOutput.append(_ccProcess->readAllStandardOutput()); + _ccOutput.append(QString(_ccProcess->readAllStandardOutput())); } = void TopLevel::ccError(QProcess::ProcessError e) diff --git a/libcore/tracedata.h b/libcore/tracedata.h index b52f24f..c10a2e0 100644 --- a/libcore/tracedata.h +++ b/libcore/tracedata.h @@ -693,7 +693,6 @@ public: bool operator<(const TracePart&) const; = private: - QIODevice* _file; QString _name; QString _descr; QString _trigger; diff --git a/libviews/callgraphview.cpp b/libviews/callgraphview.cpp index 6c5411c..3d6b5ba 100644 --- a/libviews/callgraphview.cpp +++ b/libviews/callgraphview.cpp @@ -2257,7 +2257,7 @@ void CallGraphView::dotExited() = if (cmd =3D=3D QLatin1String("node")) { // x, y are centered in node - QString nodeName, label, nodeX, nodeY, nodeWidth, nodeHeight; + QString nodeName, nodeX, nodeY, nodeWidth, nodeHeight; double x, y, width, height; lineStream >> nodeName >> nodeX >> nodeY >> nodeWidth >> nodeHeight; diff --git a/libviews/callgraphview.h b/libviews/callgraphview.h index 079af18..6eb3b31 100644 --- a/libviews/callgraphview.h +++ b/libviews/callgraphview.h @@ -358,7 +358,6 @@ private: ProfileContext::Type _groupType; QTemporaryFile* _tmpFile; double _realFuncLimit, _realCallLimit; - int _maxDepth; bool _graphCreated; = GraphOptions* _go; diff --git a/libviews/eventtypeitem.cpp b/libviews/eventtypeitem.cpp index 371a26c..238fb74 100644 --- a/libviews/eventtypeitem.cpp +++ b/libviews/eventtypeitem.cpp @@ -47,7 +47,6 @@ EventTypeItem::EventTypeItem(TraceCostItem* costItem, setText(0, ct->longName()); setText(3, ct->name()); setText(5, ct->parsedFormula()); - QString formula =3D ct->formula(); if (!ct->isReal()) { setText(4, QStringLiteral("=3D")); // we have a virtual type: allow editing diff --git a/libviews/eventtypeview.cpp b/libviews/eventtypeview.cpp index 7085120..c7f46be 100644 --- a/libviews/eventtypeview.cpp +++ b/libviews/eventtypeview.cpp @@ -276,7 +276,6 @@ void EventTypeView::refresh() QTreeWidgetItem* item =3D 0; QTreeWidgetItem* selected =3D 0; QList items; - QString sumStr, pureStr; = EventTypeSet* m =3D _data->eventTypes(); for (int i=3D0; irealCount();i++) { diff --git a/libviews/globalguiconfig.cpp b/libviews/globalguiconfig.cpp index 7a5d66b..485e1db 100644 --- a/libviews/globalguiconfig.cpp +++ b/libviews/globalguiconfig.cpp @@ -170,8 +170,6 @@ void GlobalGUIConfig::readOptions() = ConfigColorSetting* GlobalGUIConfig::groupColorSetting(CostItem* cost) { - QString n; - if (!cost) return colorSetting(QStringLiteral("default")); = diff --git a/libviews/instritem.h b/libviews/instritem.h index 70a1492..5475b72 100644 --- a/libviews/instritem.h +++ b/libviews/instritem.h @@ -84,6 +84,7 @@ private: = class InstrItemDelegate : public QItemDelegate { + Q_OBJECT public: explicit InstrItemDelegate(InstrView *parent); void paint(QPainter *painter, const QStyleOptionViewItem &option, diff --git a/libviews/sourceitem.h b/libviews/sourceitem.h index 57f2f10..14b26ec 100644 --- a/libviews/sourceitem.h +++ b/libviews/sourceitem.h @@ -83,6 +83,7 @@ private: = class SourceItemDelegate : public QItemDelegate { + Q_OBJECT public: explicit SourceItemDelegate(SourceView *parent); void paint(QPainter *painter, const QStyleOptionViewItem &option, diff --git a/qcachegrind/colorsettings.cpp b/qcachegrind/colorsettings.cpp index 2042794..77e8453 100644 --- a/qcachegrind/colorsettings.cpp +++ b/qcachegrind/colorsettings.cpp @@ -37,7 +37,7 @@ static void insertColorItems(QTreeWidget* w, ProfileConte= xt::Type type, QStringList items) { items.sort(); - foreach(QString s, items) { + foreach(const QString &s, items) { ConfigColorSetting* cs =3D GlobalGUIConfig::groupColorSetting(type= , s); QTreeWidgetItem* i =3D new QTreeWidgetItem(w); i->setText(0, ProfileContext::i18nTypeName(type)); diff --git a/qcachegrind/configpage.h b/qcachegrind/configpage.h index 0b65b42..475757e 100644 --- a/qcachegrind/configpage.h +++ b/qcachegrind/configpage.h @@ -29,6 +29,7 @@ = class ConfigPage: public QWidget { + Q_OBJECT public: ConfigPage(QWidget* parent, QString title, QString longTitle =3D QStri= ng()); virtual ~ConfigPage() {} diff --git a/qcachegrind/generalsettings.h b/qcachegrind/generalsettings.h index 6174cd2..7346ca8 100644 --- a/qcachegrind/generalsettings.h +++ b/qcachegrind/generalsettings.h @@ -28,6 +28,7 @@ = class GeneralSettings: public ConfigPage { + Q_OBJECT public: explicit GeneralSettings(QWidget* parent); virtual ~GeneralSettings() {} diff --git a/qcachegrind/qcgtoplevel.cpp b/qcachegrind/qcgtoplevel.cpp index 1ca55bc..9d3e195 100644 --- a/qcachegrind/qcgtoplevel.cpp +++ b/qcachegrind/qcgtoplevel.cpp @@ -826,7 +826,7 @@ void QCGTopLevel::load(QStringList files, bool addToRec= entFiles) ConfigGroup* generalConfig =3D ConfigStorage::group(QStringLiteral("Ge= neralSettings")); recentFiles =3D generalConfig->value(QStringLiteral("RecentFiles"), QStringList()).toStringList(); - foreach(QString file, files) { + foreach(const QString& file, files) { recentFiles.removeAll(file); if (filesLoaded >0) recentFiles.prepend(file); @@ -975,8 +975,6 @@ bool QCGTopLevel::setEventType2(EventType* ct) if (_eventType2 =3D=3D ct) return false; _eventType2 =3D ct; = - QString longName =3D ct ? ct->longName() : tr("(Hidden)"); - _partSelection->setEventType2(_eventType2); _stackSelection->setEventType2(_eventType2); _functionSelection->setEventType2(_eventType2);