[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kcachegrind/frameworks] /: Merge branch 'master' into frameworks
From:       Josef Weidendorfer <Josef.Weidendorfer () gmx ! de>
Date:       2016-10-24 20:10:42
Message-ID: E1bylZy-0003EM-9s () code ! kde ! org
[Download RAW message or body]

Git commit ab1b865c6ed8df33da9f07dfc8e4e6287e99e878 by Josef Weidendorfer.
Committed on 24/10/2016 at 20:05.
Pushed by weidendo into branch 'frameworks'.

Merge branch 'master' into frameworks

M  +3    -0    libcore/cachegrindloader.cpp
M  +6    -0    libcore/tracedata.cpp
M  +3    -0    libcore/tracedata.h
M  +11   -7    libviews/callgraphview.cpp
M  +22   -3    libviews/callview.cpp
M  +1    -0    libviews/callview.h
M  +5    -0    libviews/coverageview.cpp
M  +9    -6    libviews/functionselection.cpp
M  +7    -3    libviews/instritem.cpp
M  +7    -3    libviews/sourceitem.cpp

http://commits.kde.org/kcachegrind/ab1b865c6ed8df33da9f07dfc8e4e6287e99e878

diff --cc libviews/callgraphview.cpp
index f08ced7,2e0843e..8c659ac
--- a/libviews/callgraphview.cpp
+++ b/libviews/callgraphview.cpp
@@@ -1292,10 -1292,15 +1292,15 @@@ CanvasEdgeLabel::CanvasEdgeLabel(CallGr
  	else
  		setText(1, SubCost(e->cost).pretty());
  
- 	setPosition(0, DrawParams::TopCenter);
- 	SubCost count((e->count < 1.0) ? 1.0 : e->count);
- 	setText(0, QStringLiteral("%1 x").arg(count.pretty()));
- 	setPixmap(0, percentagePixmap(25, 10, (int)(inclP+.5), Qt::blue, true));
+     int pixPos = 1;
+     if (((TraceItemView*)_view)->data()->maxCallCount() > 0) {
+         setPosition(0, DrawParams::TopCenter);
+         SubCost count((e->count < 1.0) ? 1.0 : e->count);
 -        setText(0, QString("%1 x").arg(count.pretty()));
++        setText(0, QStringLiteral("%1 x").arg(count.pretty()));
+         pixPos = 0;
 -        setToolTip(QString("%1 (%2)").arg(text(0)).arg(text(1)));
++        setToolTip(QStringLiteral("%1 (%2)").arg(text(0)).arg(text(1)));
+     }
+     setPixmap(pixPos, percentagePixmap(25, 10, (int)(inclP+.5), Qt::blue, true));
  
  	_percentage = inclP;
  	if (_percentage > 100.0) _percentage = 100.0;
@@@ -1307,11 -1312,9 +1312,10 @@@
  		QPixmap p= loader->loadIcon(icon, KIconLoader::Small, 0,
  		                            KIconLoader::DefaultState, QStringList(), 0,
  		                            true);
--		setPixmap(0, p);
++        // Override percentage pixmap
++		setPixmap(pixPos, p);
  #endif
  	}
- 
- 	setToolTip(QStringLiteral("%1 (%2)").arg(text(0)).arg(text(1)));
  }
  
  void CanvasEdgeLabel::paint(QPainter* p,
diff --cc libviews/callview.cpp
index 524008b,ada1ba7..259a49b
--- a/libviews/callview.cpp
+++ b/libviews/callview.cpp
@@@ -290,11 -290,33 +290,30 @@@ void CallView::refresh(
      // enabling sorting switches on the indicator, but we want it off
      header()->setSortIndicatorShown(false);
      // resize to content now (section size still can be interactively changed)
-     header()->resizeSections(QHeaderView::ResizeToContents);
+     setCostColumnWidths();
+ }
  
-     if (!_eventType2) {
+ void CallView::setCostColumnWidths()
+ {
+     // inclusive cost columns
+     resizeColumnToContents(0);
+     if (_eventType2)
+         resizeColumnToContents(2);
+     else
          setColumnWidth(2, 0);
+ 
+     if (_data->maxCallCount() == 0) {
+         // hide "per call" columns and call count column
+         setColumnWidth(1, 0);
          setColumnWidth(3, 0);
+         setColumnWidth(4, 0);
+     }
+     else {
+         resizeColumnToContents(1);
+         if (_eventType2)
+             resizeColumnToContents(3);
+         else
+             setColumnWidth(3, 0);
+         resizeColumnToContents(4);
      }
  }
 -
--
 -#include "callview.moc"
diff --cc libviews/coverageview.cpp
index b6f4ae1,7add614..56b88f6
--- a/libviews/coverageview.cpp
+++ b/libviews/coverageview.cpp
@@@ -364,5 -364,11 +364,10 @@@ void CoverageView::refresh(
      header()->setSortIndicatorShown(false);
      // resize to content now (section size still can be interactively changed)
      header()->resizeSections(QHeaderView::ResizeToContents);
+ 
+     if (_data->maxCallCount() == 0) {
+         // hide call count
+         setColumnWidth(_showCallers ? 2 : 3, 0);
+     }
  }
  
 -#include "coverageview.moc"
diff --cc libviews/instritem.cpp
index 7e835a6,592be77..167c9da
--- a/libviews/instritem.cpp
+++ b/libviews/instritem.cpp
@@@ -111,10 -111,14 +111,14 @@@ InstrItem::InstrItem(InstrView* iv, QTr
    //       fileno, lineno, _lineCall->call()->called()->prettyName().toAscii());
  
    SubCost cc = _instrCall->callCount();
 -  QString callStr = "  ";
 +  QString callStr = QStringLiteral("  ");
-   if (cc==0)
-     callStr += QObject::tr("Active call to '%1'")
-                .arg(_instrCall->call()->calledName());
+   if (cc==0) {
+       if (((TraceItemView*)_view)->data()->maxCallCount() > 0)
+           callStr += QObject::tr("Active call to '%1'");
+       else
+           callStr += QObject::tr("Call to '%1'");
+       callStr = callStr.arg(_instrCall->call()->calledName());
+   }
    else
      callStr += QObject::tr("%n call(s) to '%2'", "", (uint64)cc)
                 .arg(_instrCall->call()->calledName());
diff --cc libviews/sourceitem.cpp
index eede31a,6972fb0..bca042b
--- a/libviews/sourceitem.cpp
+++ b/libviews/sourceitem.cpp
@@@ -94,10 -94,14 +94,14 @@@ SourceItem::SourceItem(SourceView* sv, 
    //       fileno, lineno, _lineCall->call()->called()->prettyName().toAscii());
  
    SubCost cc = _lineCall->callCount();
 -  QString callStr = "  ";
 +  QString callStr = QStringLiteral("  ");
-   if (cc==0)
-       callStr += QObject::tr("Active call to '%1'")
-           .arg(_lineCall->call()->calledName());
+   if (cc==0) {
+       if (((TraceItemView*)_view)->data()->maxCallCount() > 0)
+           callStr += QObject::tr("Active call to '%1'");
+       else
+           callStr += QObject::tr("Call to '%1'");
+       callStr = callStr.arg(_lineCall->call()->calledName());
+   }
    else
        callStr += QObject::tr("%n call(s) to '%2'", "", (uint64)cc)
            .arg(_lineCall->call()->calledName());
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic