Commit 7ac29cda authored by Josef Weidendorfer's avatar Josef Weidendorfer
Browse files

qcachegrind: whitespace-only changes

for consistent coding style: indent 4 spaces, no tabs
parent 3d1b8aa5
......@@ -37,13 +37,13 @@ void showHelp(QTextStream& out, bool fullHelp = true)
out << "Type 'cgview -h' for help." << endl;
else
out << "Usage: cgview [options] <file> ...\n\n"
"Options:\n"
" -h Show this help text\n"
" -e Sort list according to exclusive cost\n"
" -s <ev> Sort and show counters for event <ev>\n"
" -c Sort by call count\n"
" -b Show butterfly (callers and callees)\n"
" -n Do not detect recursive cycles" << endl;
"Options:\n"
" -h Show this help text\n"
" -e Sort list according to exclusive cost\n"
" -s <ev> Sort and show counters for event <ev>\n"
" -c Sort by call count\n"
" -b Show butterfly (callers and callees)\n"
" -n Do not detect recursive cycles" << endl;
exit(1);
}
......@@ -84,7 +84,7 @@ int main(int argc, char** argv)
EventTypeSet* m = d->eventTypes();
if (m->realCount() == 0) {
out << "Error: No event types found." << endl;
return 1;
return 1;
}
out << "\nTotals for event types:\n";
......@@ -92,7 +92,7 @@ int main(int argc, char** argv)
QString p;
EventType* et;
for (int i=0;i<m->realCount();i++) {
et = m->realType(i);
et = m->realType(i);
out.setFieldWidth(14);
out.setFieldAlignment(QTextStream::AlignRight);
out << d->subCost(et).pretty();
......@@ -100,13 +100,13 @@ int main(int argc, char** argv)
out << " " << et->longName() << " (" << et->name() << ")\n";
}
for (int i=0;i<m->derivedCount();i++) {
et = m->derivedType(i);
et = m->derivedType(i);
out.setFieldWidth(14);
out.setFieldAlignment(QTextStream::AlignRight);
out << d->subCost(et).pretty();
out.setFieldWidth(0);
out << " " << et->longName() <<
" (" << et->name() << " = " << et->formula() << ")\n";
" (" << et->name() << " = " << et->formula() << ")\n";
}
out << endl;
......@@ -121,7 +121,7 @@ int main(int argc, char** argv)
}
Q_ASSERT( et!=0 );
out << "Sorted by: " << (sortByExcl ? "Exclusive ":"Inclusive ")
<< et->longName() << " (" << et->name() << ")" << endl;
<< et->longName() << " (" << et->name() << ")" << endl;
QList<TraceFunction*> flist;
HighestCostList hc;
......@@ -149,7 +149,7 @@ int main(int argc, char** argv)
out.setFieldAlignment(QTextStream::AlignRight);
for(int i=0; i<hc.realCount(); i++) {
f = (TraceFunction*)hc[i];
f = (TraceFunction*)hc[i];
if (showCalls) {
if (i>0) out << endl;
......
......@@ -34,25 +34,25 @@
//
static void insertColorItems(QTreeWidget* w, ProfileContext::Type type,
QStringList items)
QStringList items)
{
items.sort();
foreach(QString s, items) {
ConfigColorSetting* cs = GlobalGUIConfig::groupColorSetting(type, s);
QTreeWidgetItem* i = new QTreeWidgetItem(w);
i->setText(0, ProfileContext::i18nTypeName(type));
i->setData(0, Qt::UserRole, QVariant::fromValue((void*)cs));
i->setIcon(1, QIcon(colorPixmap(20,10, cs->color())));
i->setText(1, cs->automatic() ? QObject::tr("(auto)") : QString());
i->setData(1, Qt::UserRole, cs->color());
i->setText(2, s);
QTreeWidgetItem* i = new QTreeWidgetItem(w);
i->setText(0, ProfileContext::i18nTypeName(type));
i->setData(0, Qt::UserRole, QVariant::fromValue((void*)cs));
i->setIcon(1, QIcon(colorPixmap(20,10, cs->color())));
i->setText(1, cs->automatic() ? QObject::tr("(auto)") : QString());
i->setData(1, Qt::UserRole, cs->color());
i->setText(2, s);
}
}
ColorSettings::ColorSettings(TraceData* data, QWidget* parent)
: ConfigPage(parent,
QObject::tr("Group Colors"),
QObject::tr("Color Settings for Function Groups"))
QObject::tr("Group Colors"),
QObject::tr("Color Settings for Function Groups"))
{
ui.setupUi(this);
......@@ -60,30 +60,30 @@ ColorSettings::ColorSettings(TraceData* data, QWidget* parent)
ui.colorList->setSortingEnabled(false);
QStringList items;
if (data) {
TraceObjectMap::Iterator oit = data->objectMap().begin();
for(; oit != data->objectMap().end(); ++oit)
items << (*oit).prettyName();
TraceObjectMap::Iterator oit = data->objectMap().begin();
for(; oit != data->objectMap().end(); ++oit)
items << (*oit).prettyName();
}
if (!items.contains(TraceObject::prettyEmptyName()))
items << TraceObject::prettyEmptyName();
items << TraceObject::prettyEmptyName();
insertColorItems(ui.colorList, ProfileContext::Object, items);
items.clear();
if (data) {
TraceFileMap::Iterator fit = data->fileMap().begin();
for(; fit != data->fileMap().end(); ++fit)
items << (*fit).prettyName();
TraceFileMap::Iterator fit = data->fileMap().begin();
for(; fit != data->fileMap().end(); ++fit)
items << (*fit).prettyName();
}
if (!items.contains(TraceFile::prettyEmptyName()))
items << TraceFile::prettyEmptyName();
items << TraceFile::prettyEmptyName();
insertColorItems(ui.colorList, ProfileContext::File, items);
items.clear();
if (data) {
TraceClassMap::Iterator cit = data->classMap().begin();
for(; cit != data->classMap().end(); ++cit)
items << (*cit).prettyName();
TraceClassMap::Iterator cit = data->classMap().begin();
for(; cit != data->classMap().end(); ++cit)
items << (*cit).prettyName();
}
if (!items.contains(TraceClass::prettyEmptyName()))
items << TraceClass::prettyEmptyName();
items << TraceClass::prettyEmptyName();
insertColorItems(ui.colorList, ProfileContext::Class, items);
ui.colorList->setSortingEnabled(true);
......@@ -92,13 +92,13 @@ ColorSettings::ColorSettings(TraceData* data, QWidget* parent)
ui.colorList->resizeColumnToContents(2);
connect(ui.resetButton, &QAbstractButton::clicked,
this, &ColorSettings::resetClicked);
this, &ColorSettings::resetClicked);
connect(ui.colorList,
&QTreeWidget::currentItemChanged,
this,
&ColorSettings::colorListItemChanged);
&QTreeWidget::currentItemChanged,
this,
&ColorSettings::colorListItemChanged);
connect(ui.colorButton, &QtColorButton::colorChanged,
this, &ColorSettings::colorChanged);
this, &ColorSettings::colorChanged);
_current = 0;
update();
......@@ -119,9 +119,9 @@ void ColorSettings::activate(QString s)
void ColorSettings::update()
{
if (!_current) {
ui.resetButton->setEnabled(false);
ui.colorButton->setEnabled(false);
return;
ui.resetButton->setEnabled(false);
ui.colorButton->setEnabled(false);
return;
}
ui.resetButton->setEnabled(true);
ui.colorButton->setEnabled(true);
......@@ -145,7 +145,7 @@ void ColorSettings::resetClicked()
void ColorSettings::colorListItemChanged(QTreeWidgetItem* current,
QTreeWidgetItem*)
QTreeWidgetItem*)
{
_current = current;
update();
......@@ -171,12 +171,12 @@ void ColorSettings::accept()
ConfigColorSetting* cs;
QColor c;
for(int i = 0; i< ui.colorList->topLevelItemCount(); i++) {
item = ui.colorList->topLevelItem(i);
cs = (ConfigColorSetting*) item->data(0, Qt::UserRole).value<void*>();
c = item->data(1, Qt::UserRole).value<QColor>();
if (cs->color() == c) continue;
item = ui.colorList->topLevelItem(i);
cs = (ConfigColorSetting*) item->data(0, Qt::UserRole).value<void*>();
c = item->data(1, Qt::UserRole).value<QColor>();
if (cs->color() == c) continue;
cs->setColor(c);
cs->setColor(c);
}
}
......@@ -156,11 +156,11 @@ void ConfigDialog::accept()
_clearTimer.start(5000);
}
activate(QStringLiteral("%1/%2").arg(p->title(), errorItem));
return;
}
return;
}
foreach(p, _pages)
p->accept();
p->accept();
QDialog::accept();
}
......
......@@ -30,7 +30,7 @@
//
ConfigPage::ConfigPage(QWidget* parent, QString title, QString longTitle)
: QWidget(parent)
: QWidget(parent)
{
_title = title;
if (longTitle.isEmpty())
......
......@@ -32,7 +32,7 @@
//
QCGConfigGroup::QCGConfigGroup(QSettings* settings, QString prefix,
bool readOnly)
bool readOnly)
{
_settings = settings;
_prefix = prefix;
......@@ -43,19 +43,19 @@ QCGConfigGroup::~QCGConfigGroup()
{}
void QCGConfigGroup::setValue(const QString& key, const QVariant& value,
const QVariant& defaultValue)
const QVariant& defaultValue)
{
if ((_settings == 0) || _readOnly) return;
QString fullKey = QStringLiteral("%1/%2").arg(_prefix).arg(key);
if (value == defaultValue)
_settings->remove(fullKey);
_settings->remove(fullKey);
else
_settings->setValue(fullKey, value);
_settings->setValue(fullKey, value);
}
QVariant QCGConfigGroup::value(const QString& key,
const QVariant& defaultValue) const
const QVariant& defaultValue) const
{
if (_settings == 0) return defaultValue;
......@@ -80,18 +80,18 @@ QCGConfigStorage::~QCGConfigStorage()
}
ConfigGroup* QCGConfigStorage::getGroup(const QString& group,
const QString& optSuffix)
const QString& optSuffix)
{
// for writing
if (optSuffix.isEmpty())
return new QCGConfigGroup(_settings, group, false);
return new QCGConfigGroup(_settings, group, false);
// for reading
QStringList gList = _settings->childGroups();
if (gList.contains(group+optSuffix))
return new QCGConfigGroup(_settings, group + optSuffix, true);
return new QCGConfigGroup(_settings, group + optSuffix, true);
else if (gList.contains(group))
return new QCGConfigGroup(_settings, group, true);
return new QCGConfigGroup(_settings, group, true);
// requested group does not exist, return only default values
return new QCGConfigGroup(0, QString::null, true);
......
......@@ -36,7 +36,7 @@ public:
~QCGConfigGroup();
void setValue(const QString& key, const QVariant& value,
const QVariant& defaultValue = QVariant());
const QVariant& defaultValue = QVariant());
QVariant value(const QString& key, const QVariant& defaultValue) const;
private:
......@@ -51,14 +51,14 @@ private:
class QCGConfigStorage : public ConfigStorage
{
public:
QCGConfigStorage();
~QCGConfigStorage();
QCGConfigStorage();
~QCGConfigStorage();
private:
ConfigGroup* getGroup(const QString& group,
const QString& optSuffix);
ConfigGroup* getGroup(const QString& group,
const QString& optSuffix);
QSettings* _settings;
QSettings* _settings;
};
#endif // QCGCONFIG_H
This diff is collapsed.
......@@ -50,219 +50,219 @@ class TraceFunction;
class QCGTopLevel : public QMainWindow, public Logger, public TopLevelBase
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "io.github.qcachegrind")
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "io.github.qcachegrind")
public:
QCGTopLevel();
~QCGTopLevel();
QCGTopLevel();
~QCGTopLevel();
TraceData* data() { return _data; }
void setData(TraceData*);
TraceData* data() { return _data; }
void setData(TraceData*);
void createActions();
void createDocks();
void createMenu();
void createToolbar();
void createActions();
void createDocks();
void createMenu();
void createToolbar();
void closeEvent(QCloseEvent*);
void closeEvent(QCloseEvent*);
ProfileContext::Type groupType() { return _groupType; }
EventType* eventType() { return _eventType; }
EventType* eventType2() { return _eventType2; }
TracePartList activeParts() { return _activeParts; }
TracePartList hiddenParts() { return _hiddenParts; }
ProfileContext::Type groupType() { return _groupType; }
EventType* eventType() { return _eventType; }
EventType* eventType2() { return _eventType2; }
TracePartList activeParts() { return _activeParts; }
TracePartList hiddenParts() { return _hiddenParts; }
/* convenience functions for often used context menu items */
void addEventTypeMenu(QMenu*,bool);
void addGoMenu(QMenu*);
/* convenience functions for often used context menu items */
void addEventTypeMenu(QMenu*,bool);
void addGoMenu(QMenu*);
// Logger overwrites: notifications for file loading
virtual void loadStart(const QString& filename);
virtual void loadProgress(int progress); // 0 - 100
virtual void loadWarning(int line, const QString& msg);
virtual void loadError(int line, const QString& msg);
virtual void loadFinished(const QString& msg); // msg could be error
// Logger overwrites: notifications for file loading
virtual void loadStart(const QString& filename);
virtual void loadProgress(int progress); // 0 - 100
virtual void loadWarning(int line, const QString& msg);
virtual void loadError(int line, const QString& msg);
virtual void loadFinished(const QString& msg); // msg could be error
public slots:
void load();
void load(QStringList files, bool addToRecentFiles = true);
void add();
void add(QStringList files);
// shows the main window before loading to see loading progress
void loadDelayed(QString file, bool addToRecentFiles = true);
void loadDelayed(QStringList files, bool addToRecentFiles = true);
void exportGraph();
void newWindow();
void configure(QString page = QString::null);
void about();
// layouts
void layoutDuplicate();
void layoutRemove();
void layoutNext();
void layoutPrevious();
void layoutSave();
void layoutRestore();
void updateLayoutActions();
void updateStatusBar();
void eventTypeSelected(const QString&);
void eventType2Selected(const QString&);
void groupTypeSelected(int);
void toggleSplitted();
void toggleSplitDirection();
void togglePartDock();
void toggleStackDock();
void toggleFunctionDock();
void functionVisibilityChanged(bool);
void togglePercentage();
void setPercentage(bool);
void setAbsoluteCost();
void setRelativeCost();
void toggleHideTemplates();
void toggleExpanded();
void toggleCycles();
void recentFilesMenuAboutToShow();
void recentFilesTriggered(QAction*);
void sidebarMenuAboutToShow();
void forwardAboutToShow();
void forwardTriggered(QAction*);
void backAboutToShow();
void backTriggered(QAction*);
void upAboutToShow();
void upTriggered(QAction*);
void primaryAboutToShow();
void secondaryAboutToShow();
void groupingAboutToShow();
bool setEventType(EventType*);
bool setEventType2(EventType*);
bool setEventType(QString);
bool setEventType2(QString);
bool setEventType(QAction*);
bool setEventType2(QAction*);
bool setGroupType(ProfileContext::Type);
bool setGroupType(QString);
bool setGroup(TraceCostItem*);
bool setGroup(QString);
bool setFunction(TraceFunction*);
bool setFunction(QString);
void activePartsChangedSlot(const TracePartList& list);
void partsHideSelectedSlot();
void partsUnhideAllSlot();
/* These go back to mainloop first by using a timer.
void load();
void load(QStringList files, bool addToRecentFiles = true);
void add();
void add(QStringList files);
// shows the main window before loading to see loading progress
void loadDelayed(QString file, bool addToRecentFiles = true);
void loadDelayed(QStringList files, bool addToRecentFiles = true);
void exportGraph();
void newWindow();
void configure(QString page = QString::null);
void about();
// layouts
void layoutDuplicate();
void layoutRemove();
void layoutNext();
void layoutPrevious();
void layoutSave();
void layoutRestore();
void updateLayoutActions();
void updateStatusBar();
void eventTypeSelected(const QString&);
void eventType2Selected(const QString&);
void groupTypeSelected(int);
void toggleSplitted();
void toggleSplitDirection();
void togglePartDock();
void toggleStackDock();
void toggleFunctionDock();
void functionVisibilityChanged(bool);
void togglePercentage();
void setPercentage(bool);
void setAbsoluteCost();
void setRelativeCost();
void toggleHideTemplates();
void toggleExpanded();
void toggleCycles();
void recentFilesMenuAboutToShow();
void recentFilesTriggered(QAction*);
void sidebarMenuAboutToShow();
void forwardAboutToShow();
void forwardTriggered(QAction*);
void backAboutToShow();
void backTriggered(QAction*);
void upAboutToShow();
void upTriggered(QAction*);
void primaryAboutToShow();
void secondaryAboutToShow();
void groupingAboutToShow();
bool setEventType(EventType*);
bool setEventType2(EventType*);
bool setEventType(QString);
bool setEventType2(QString);
bool setEventType(QAction*);
bool setEventType2(QAction*);
bool setGroupType(ProfileContext::Type);
bool setGroupType(QString);
bool setGroup(TraceCostItem*);
bool setGroup(QString);
bool setFunction(TraceFunction*);
bool setFunction(QString);
void activePartsChangedSlot(const TracePartList& list);
void partsHideSelectedSlot();
void partsUnhideAllSlot();
/* These go back to mainloop first by using a timer.
* So they can be called from event handlers that
* are not allowed to delete list entries.
*/
void setEventTypeDelayed(EventType*);
void setEventType2Delayed(EventType*);
void setGroupTypeDelayed(ProfileContext::Type);
void setGroupDelayed(TraceCostItem*);
void setTraceItemDelayed(CostItem*);
void partsHideSelectedSlotDelayed();
void partsUnhideAllSlotDelayed();
void goBack();
void goForward();
void goUp();
void setDirectionDelayed(TraceItemView::Direction);
/* SingleShot Slots (without parameters) for the delayed versions */
void setEventTypeDelayed();
void setEventType2Delayed();
void setGroupTypeDelayed();
void setGroupDelayed();
void setTraceItemDelayed();
void loadFilesDelayed();
void setDirectionDelayed();
// configuration has changed
void configChanged();
//void refresh();
// progress in status bar, empty message disables progress display
void showStatus(const QString& msg, int progress);
void showMessage(const QString&, int msec);
void setEventTypeDelayed(EventType*);
void setEventType2Delayed(EventType*);
void setGroupTypeDelayed(ProfileContext::Type);
void setGroupDelayed(TraceCostItem*);
void setTraceItemDelayed(CostItem*);
void partsHideSelectedSlotDelayed();
void partsUnhideAllSlotDelayed();
void goBack();
void goForward();
void goUp();
void setDirectionDelayed(TraceItemView::Direction);
/* SingleShot Slots (without parameters) for the delayed versions */
void setEventTypeDelayed();
void setEventType2Delayed();
void setGroupTypeDelayed();
void setGroupDelayed();
void setTraceItemDelayed();
void loadFilesDelayed();
void setDirectionDelayed();
// configuration has changed
void configChanged();
//void refresh();
// progress in status bar, empty message disables progress display
void showStatus(const QString& msg, int progress);
void showMessage(const QString&, int msec);
private:
void resetState();
void createLayoutActions();
void createMiscActions();
void setupMainWidget(MainWidget*);
void setupPartSelection(PartSelection*);
void updateEventTypeMenu(QMenu* m, bool secondary);
void restoreCurrentState(const QString& postfix);
void saveCurrentState(const QString& postfix);
void saveTraceSettings();
QString traceKey();
void restoreTraceTypes();
void restoreTraceSettings();
QStatusBar* _statusbar;
QLabel* _statusLabel;
QString _progressMsg;
QTime _progressStart;
QProgressBar* _progressBar;
MultiView