[-]
[+]
|
Changed |
kcachegrind.changes
|
|
[-]
[+]
|
Changed |
kcachegrind.spec
^
|
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/CMakeLists.txt
^
|
@@ -1,23 +1,16 @@
+cmake_minimum_required(VERSION 2.6)
+
project(kcachegrind)
-# Allow for standalone build outside of KDE's kdesdk module
-if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
- # this is a copy of common stuff from kdesdk's toplevel CMakeLists.txt
- cmake_minimum_required(VERSION 2.6)
- set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
- find_package(KDE4 REQUIRED)
- include(KDE4Defaults)
- include(MacroLibrary)
- include(CheckIncludeFile)
- include(CheckIncludeFileCXX)
- include(CheckLibraryExists)
-
- set( CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS} -DQT_STRICT_ITERATORS )
- add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
- include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} )
-endif ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
+find_package(KDE4 REQUIRED)
+include(KDE4Defaults)
+include(MacroLibrary)
+
+set( CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS} -DQT_STRICT_ITERATORS )
+add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
+include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} )
-set( KCACHEGRIND_VERSION "0.7.1")
+set( KCACHEGRIND_VERSION "0.7.3")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/version.h )
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/ChangeLog
^
|
@@ -1,6 +1,16 @@
-2011/11/14
+2012/11/06: KCachegrind 0.7.3
+ * Last-minute change in 0.7.2 to support loading
+ multiple files on command line broke Load dialog.
+ Release 0.7.3 only fixes this issue.
+
+2012/10/17: KCachegrind 0.7.2
+ * Load multiple files on command line into one window
+ * Support large number of event types (200)
+ * Misc fixes
+
+2011/11/14: KCachegrind 0.7.1
* KCachegrind: use callgrind_control to request a dump.
The old way will not work with Callgrind in VG > 3.7
-2011/9/23
+2011/9/23: KCachegrind 0.7.0
* Compiles without Qt3 support
|
[-]
[+]
|
Added |
kcachegrind-0.7.3.tar.bz2/README-sfrelease
^
|
@@ -0,0 +1,22 @@
+HOWTO for SourceForge Release
+-----------------------------
+
+On master:
+- add important changes to ChangeLog
+
+Bump version independent from KDE releases
+- git checkout sfrelease
+- git merge master
+- bump version in CMakeList.txt
+ and qcachegrind/qcgtoplevel.cpp
+- git commit -a -m "Bump version for SF release"
+- git tag VERSION
+
+Create source package:
+git archive --prefix kcachegrind-VERSION/ VERSION > kcachegrind-VERSION.tar
+gzip kcachegrind-VERSION.tar
+
+Copy to SF:
+scp kcachegrind-VERSION.tar.gz weidendo,kcachegrind@web.sf.net:www
+
+Update WWW
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/cgview/main.cpp
^
|
@@ -66,8 +66,8 @@
bool sortByCount = false;
bool showCalls = false;
QString showEvent;
+ QStringList files;
- TraceData* d = new TraceData(new Logger);
for(int arg = 0; arg<list.count(); arg++) {
if (list[arg] == "-h") showHelp(out);
else if (list[arg] == "-e") sortByExcl = true;
@@ -76,8 +76,10 @@
else if (list[arg] == "-c") sortByCount = true;
else if (list[arg] == "-s") showEvent = list[++arg];
else
- d->load(list[arg]);
+ files << list[arg];
}
+ TraceData* d = new TraceData(new Logger);
+ d->load(files);
EventTypeSet* m = d->eventTypes();
if (m->realCount() == 0) {
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/kcachegrind/kcachegrind.desktop
^
|
@@ -83,7 +83,7 @@
GenericName[fr]=Interface de profilage
GenericName[ga]=Comhéadan ar Phróifíleoir
GenericName[gl]=Interface para o profiler
-GenericName[hu]=Profilozó
+GenericName[hu]=Ábrázoló előtétprogram
GenericName[is]=Myndrænt viðmót á afkastakönnuð
GenericName[it]=Interfaccia a profiler
GenericName[ja]=プロファイラフロントエンド
@@ -134,7 +134,7 @@
Comment[eu]=Errendimendu profil datuen bistaratzea
Comment[fa]=تجسم کارایی گزارش دادهها
Comment[fi]=Visualisointi tehokkuusprofiloinnin tiedoista
-Comment[fr]=Visualisation de données de profilage de performance
+Comment[fr]=Visualise les données de profilage de performances
Comment[ga]=Amharcléiriú ar Shonraí Próifílithe Feidhmíochta
Comment[gl]=Visualización dos datos da análise de rendemento
Comment[hu]=Teljesítményprofil-adatok megjelenítése
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/kcachegrind/main.cpp
^
|
@@ -73,10 +73,10 @@
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
int nbArgs = args->count();
if (nbArgs>0) {
- for(int i = 0; i < nbArgs; i++) {
t = new TopLevel();
t->show();
- t->loadDelayed(args->arg(i));
+ for(int i = 0; i < nbArgs; i++) {
+ t->loadDelayed(args->arg(i));
}
}
else {
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/kcachegrind/toplevel.cpp
^
|
@@ -428,7 +428,7 @@
action = actionCollection()->addAction( "file_add" );
action->setText( i18n( "&Add..." ) );
- connect(action, SIGNAL(triggered(bool) ), SLOT(addTrace()));
+ connect(action, SIGNAL(triggered(bool) ), SLOT(add()));
hint = i18n("<b>Add Profile Data</b>"
"<p>This opens an additional profile data file in the current window.</p>");
action->setWhatsThis( hint );
@@ -481,13 +481,13 @@
"of the program.</p>");
_taDump->setWhatsThis( hint );
- action = KStandardAction::open(this, SLOT(loadTrace()), actionCollection());
+ action = KStandardAction::open(this, SLOT(load()), actionCollection());
hint = i18n("<b>Open Profile Data</b>"
"<p>This opens a profile data file, with possible multiple parts</p>");
action->setToolTip( hint );
action->setWhatsThis( hint );
- _openRecent = KStandardAction::openRecent(this, SLOT(loadTrace(const KUrl&)),
+ _openRecent = KStandardAction::openRecent(this, SLOT(load(const KUrl&)),
actionCollection());
KStandardAction::showStatusbar(this,
@@ -911,11 +911,6 @@
}
-void TopLevel::newTrace()
-{
- // start cachegrind on command...
-}
-
void TopLevel::newWindow()
{
TopLevel* t = new TopLevel();
@@ -923,16 +918,16 @@
}
-void TopLevel::loadTrace()
+void TopLevel::load()
{
KUrl url = KFileDialog::getOpenUrl(KUrl("kfiledialog:///"),
i18n("cachegrind.out* callgrind.out*|Callgrind Profile Data\n*|All Files"),
this,
i18n("Select Callgrind Profile Data"));
- loadTrace(url);
+ load(url);
}
-void TopLevel::loadTrace(const KUrl& url)
+void TopLevel::load(const KUrl& url)
{
if (url.isEmpty()) return;
@@ -943,7 +938,7 @@
_openRecent->addUrl(url);
_openRecent->saveEntries( KConfigGroup( KGlobal::config(), QString() ) );
- loadTrace(tmpFile);
+ load(tmpFile);
KIO::NetAccess::removeTempFile( tmpFile );
} else {
KMessageBox::error(this, i18n("Could not open the file \"%1\". "
@@ -955,7 +950,7 @@
/* if file name is ".": load first file found in current directory, but do
* not show an error message if nothing could be loaded
*/
-void TopLevel::loadTrace(QString file)
+void TopLevel::load(QString file)
{
if (file.isEmpty()) return;
@@ -972,7 +967,6 @@
return;
}
- // this constructor enables progress bar callbacks
bool loaded = openDataFile(file);
if (!loaded && showError)
KMessageBox::error(this, i18n("Could not open the file \"%1\". "
@@ -981,16 +975,16 @@
}
-void TopLevel::addTrace()
+void TopLevel::add()
{
KUrl url = KFileDialog::getOpenUrl(KUrl(),
i18n("cachegrind.out* callgrind.out*|Callgrind Profile Data\n*|All Files"),
this,
i18n("Add Callgrind Profile Data"));
- addTrace(url);
+ add(url);
}
-void TopLevel::addTrace(const KUrl& url)
+void TopLevel::add(const KUrl& url)
{
if (url.isEmpty()) return;
@@ -1000,12 +994,12 @@
_openRecent->addUrl(url);
_openRecent->saveEntries( KGlobal::config()->group( QString() ) );
- addTrace(tmpFile);
+ add(tmpFile);
KIO::NetAccess::removeTempFile( tmpFile );
}
}
-void TopLevel::addTrace(QString file)
+void TopLevel::add(QString file)
{
if (file.isEmpty()) return;
@@ -1017,7 +1011,6 @@
return;
}
- // this constructor enables progress bar callbacks
openDataFile(file);
}
@@ -1025,20 +1018,36 @@
void TopLevel::loadDelayed(QString file)
{
- _loadTraceDelayed = file;
+ _loadFilesDelayed << file;
QTimer::singleShot(0, this, SLOT(loadTraceDelayed()));
}
+void TopLevel::loadDelayed(QStringList files)
+{
+ _loadFilesDelayed << files;
+ QTimer::singleShot(0, this, SLOT(loadTraceDelayed()));
+}
+
void TopLevel::loadTraceDelayed()
{
- if (_loadTraceDelayed.isEmpty()) return;
+ if (_loadFilesDelayed.isEmpty()) return;
- // if URL scheme is missing (URL is relative), this is a local file
- if (KUrl::isRelativeUrl(_loadTraceDelayed))
- loadTrace(_loadTraceDelayed);
- else
- loadTrace(KUrl(_loadTraceDelayed));
- _loadTraceDelayed = QString();
+ if (_loadFilesDelayed.count()>1) {
+ // FIXME: we expect all files to be local and existing
+ TraceData* d = new TraceData(this);
+ d->load(_loadFilesDelayed);
+ setData(d);
+ }
+ else {
+ QString file = _loadFilesDelayed[0];
+
+ // if URL scheme is missing (URL is relative), this is a local file
+ if (KUrl::isRelativeUrl(file))
+ load(file);
+ else
+ load(KUrl(file));
+ }
+ _loadFilesDelayed.clear();
}
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/kcachegrind/toplevel.h
^
|
@@ -95,16 +95,16 @@
virtual void loadFinished(const QString& msg); // msg could be error
public slots:
- void newTrace();
- void loadTrace();
- void loadTrace(const KUrl&);
- void loadTrace(QString);
- void addTrace();
- void addTrace(const KUrl&);
- void addTrace(QString);
+ void load();
+ void load(const KUrl&);
+ void load(QString);
+ void add();
+ void add(const KUrl&);
+ void add(QString);
- // for quick showing the main window...
+ // for quickly showing the main window...
void loadDelayed(QString);
+ void loadDelayed(QStringList);
void reload();
void exportGraph();
@@ -278,7 +278,7 @@
ProfileContext::Type _groupTypeDelayed;
TraceCostItem* _groupDelayed;
CostItem* _traceItemDelayed;
- QString _loadTraceDelayed;
+ QStringList _loadFilesDelayed;
TraceItemView::Direction _directionDelayed;
// for status progress display
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libcore/cachegrindloader.cpp
^
|
@@ -87,6 +87,7 @@
TraceObject* currentObject;
TracePartObject* currentPartObject;
TraceFile* currentFile;
+ TraceFile* currentFunctionFile;
TracePartFile* currentPartFile;
TraceFunction* currentFunction;
TracePartFunction* currentPartFunction;
@@ -661,6 +662,7 @@
currentPartFunction = 0;
currentFunctionSource = 0;
currentFile = 0;
+ currentFunctionFile = 0;
currentPartFile = 0;
currentObject = 0;
currentPartObject = 0;
@@ -782,9 +784,17 @@
case 'f':
- // fl=, fi=, fe=
- if (line.stripPrefix("l=") ||
- line.stripPrefix("i=") ||
+ // fl=
+ if (line.stripPrefix("l=")) {
+
+ setFile(line);
+ // this is the default for new functions
+ currentFunctionFile = currentFile;
+ continue;
+ }
+
+ // fi=, fe=
+ if (line.stripPrefix("i=") ||
line.stripPrefix("e=")) {
setFile(line);
@@ -794,6 +804,8 @@
// fn=
if (line.stripPrefix("n=")) {
+ if (currentFile != currentFunctionFile)
+ currentFile = currentFunctionFile;
setFunction(line);
// on a new function, update status
@@ -1081,12 +1093,14 @@
ensureFunction();
-#if USE_FIXCOST
+
if (!currentFunctionSource ||
- (currentFunctionSource->file() != currentFile))
+ (currentFunctionSource->file() != currentFile)) {
currentFunctionSource = currentFunction->sourceFile(currentFile,
true);
-#else
+ }
+
+#if !USE_FIXCOST
if (hasAddrInfo) {
if (!currentInstr ||
(currentInstr->addr() != currentPos.fromAddr)) {
@@ -1099,7 +1113,7 @@
continue;
}
- currentPartInstr = currentInstr->partInstr(part,
+ currentPartInstr = currentInstr->partInstr(_part,
currentPartFunction);
}
}
@@ -1108,10 +1122,9 @@
if (!currentLine ||
(currentLine->lineno() != currentPos.fromLine)) {
- currentLine = currentFunction->line(currentFile,
- currentPos.fromLine,
- true);
- currentPartLine = currentLine->partLine(part,
+ currentLine = currentFunctionSource->line(currentPos.fromLine,
+ true);
+ currentPartLine = currentLine->partLine(_part,
currentPartFunction);
}
if (hasAddrInfo && currentInstr)
@@ -1145,7 +1158,7 @@
#else
if (hasAddrInfo) {
TracePartInstr* partInstr;
- partInstr = currentInstr->partInstr(part, currentPartFunction);
+ partInstr = currentInstr->partInstr(_part, currentPartFunction);
if (hasLineInfo) {
// we need to set <line> back after reading for the line
@@ -1161,7 +1174,7 @@
if (hasLineInfo) {
TracePartLine* partLine;
- partLine = currentLine->partLine(part, currentPartFunction);
+ partLine = currentLine->partLine(_part, currentPartFunction);
partLine->addCost(mapping, line);
}
#endif
@@ -1193,7 +1206,7 @@
TracePartInstrCall* partInstrCall;
instrCall = calling->instrCall(currentInstr);
- partInstrCall = instrCall->partInstrCall(part, partCalling);
+ partInstrCall = instrCall->partInstrCall(_part, partCalling);
partInstrCall->addCallCount(currentCallCount);
if (hasLineInfo) {
@@ -1216,7 +1229,7 @@
TracePartLineCall* partLineCall;
lineCall = calling->lineCall(currentLine);
- partLineCall = lineCall->partLineCall(part, partCalling);
+ partLineCall = lineCall->partLineCall(_part, partCalling);
partLineCall->addCallCount(currentCallCount);
partLineCall->addCost(mapping, line);
@@ -1260,6 +1273,36 @@
targetSource,
(nextLineType == CondJump),
jumpsExecuted, jumpsFollowed);
+#else
+ if (hasAddrInfo) {
+ TraceInstr* jumpToInstr;
+ TraceInstrJump* instrJump;
+ TracePartInstrJump* partInstrJump;
+
+ jumpToInstr = currentJumpToFunction->instr(targetPos.fromAddr,
+ true);
+ instrJump = currentInstr->instrJump(jumpToInstr,
+ (nextLineType == CondJump));
+ partInstrJump = instrJump->partInstrJump(_part);
+ partInstrJump->addExecutedCount(jumpsExecuted);
+ if (nextLineType == CondJump)
+ partInstrJump->addFollowedCount(jumpsFollowed);
+ }
+
+ if (hasLineInfo) {
+ TraceLine* jumpToLine;
+ TraceLineJump* lineJump;
+ TracePartLineJump* partLineJump;
+
+ jumpToLine = targetSource->line(targetPos.fromLine, true);
+ lineJump = currentLine->lineJump(jumpToLine,
+ (nextLineType == CondJump));
+ partLineJump = lineJump->partLineJump(_part);
+
+ partLineJump->addExecutedCount(jumpsExecuted);
+ if (nextLineType == CondJump)
+ partLineJump->addFollowedCount(jumpsFollowed);
+ }
#endif
if (0) {
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libcore/config.h
^
|
@@ -49,7 +49,7 @@
template<typename T>
inline T value(const QString & key,
const QVariant & defaultValue = QVariant()) const
- { return qVariantValue<T>( value(key, defaultValue) ); }
+ { return qvariant_cast<T>( value(key, defaultValue) ); }
protected:
ConfigGroup();
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libcore/context.cpp
^
|
@@ -16,13 +16,14 @@
Boston, MA 02110-1301, USA.
*/
+#include <QObject>
+
#include "context.h"
//---------------------------------------------------
// ProfileContext
-QHash<QString, ProfileContext*> ProfileContext::_contexts;
-
+ProfileContext* ProfileContext::_contexts = 0;
QString* ProfileContext::_typeName = 0;
QString* ProfileContext::_i18nTypeName = 0;
@@ -34,14 +35,12 @@
ProfileContext* ProfileContext::context(ProfileContext::Type t)
{
- QString key = QString("T%1").arg(t);
- if (_contexts.contains(key))
- return _contexts.value(key);
-
- ProfileContext* c = new ProfileContext(t);
- _contexts.insert(key, c);
-
- return c;
+ if (!_contexts) {
+ _contexts = new ProfileContext[MaxType+1];
+ for(int i=0;i<=MaxType;i++)
+ _contexts[i] = ProfileContext((ProfileContext::Type)i);
+ }
+ return &(_contexts[t]);
}
void ProfileContext::cleanup()
@@ -54,9 +53,10 @@
delete [] _i18nTypeName;
_i18nTypeName = 0;
}
-
- qDeleteAll(_contexts);
- _contexts.clear();
+ if (_contexts) {
+ delete [] _contexts;
+ _contexts = 0;
+ }
}
QString ProfileContext::typeName(ProfileContext::Type t)
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libcore/context.h
^
|
@@ -34,7 +34,7 @@
public:
// RTTI for trace item classes, using type() method
enum Type {
- InvalidType, UnknownType,
+ InvalidType = 0, UnknownType,
PartInstr, Instr,
PartLine, Line,
PartInstrJump, InstrJump,
@@ -50,7 +50,7 @@
Part, Data,
MaxType };
- ProfileContext(ProfileContext::Type);
+ ProfileContext(ProfileContext::Type = InvalidType);
ProfileContext::Type type() { return _type; }
@@ -70,7 +70,7 @@
private:
Type _type;
- static QHash<QString, ProfileContext*> _contexts;
+ static ProfileContext* _contexts;
static QString* _typeName;
static QString* _i18nTypeName;
};
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libcore/costitem.cpp
^
|
@@ -131,40 +131,51 @@
: CostItem(context)
{
_cachedType = 0; // no virtual value cached
-
- ProfileCostArray::clear();
+ _allocCount = 0;
+ _count = 0;
+ _cost = 0;
}
ProfileCostArray::ProfileCostArray()
: CostItem(ProfileContext::context(ProfileContext::UnknownType))
{
_cachedType = 0; // no virtual value cached
-
- ProfileCostArray::clear();
+ _allocCount = 0;
+ _count = 0;
+ _cost = 0;
}
ProfileCostArray::~ProfileCostArray()
-{}
+{
+ if (_cost) delete[] _cost;
+}
void ProfileCostArray::clear()
{
- // simple set usage count to 0
_count = 0;
-
- CostItem::clear();
+ invalidate();
}
+void ProfileCostArray::reserve(int count)
+{
+ if (count <= _allocCount) return;
+ if (_cost) delete[] _cost;
+ _cost = new SubCost[count];
+ _allocCount = count;
+}
void ProfileCostArray::set(EventTypeMapping* mapping, const char* s)
{
if (!mapping) return;
if (!s) {
- if (_count>0) clear();
+ clear();
return;
}
+ reserve(mapping->set()->realCount());
+
while(*s == ' ') s++;
if (mapping->isIdentity()) {
@@ -189,6 +200,7 @@
_cost[i] = 0;
_count = maxIndex;
}
+ Q_ASSERT(_count <= _allocCount);
// a cost change has to be propagated (esp. in subclasses)
invalidate();
}
@@ -196,8 +208,13 @@
void ProfileCostArray::set(EventTypeMapping* mapping, FixString & s)
{
if (!mapping) return;
-
s.stripSpaces();
+ if (s.isEmpty()) {
+ clear();
+ return;
+ }
+
+ reserve(mapping->set()->realCount());
if (mapping->isIdentity()) {
int i = 0;
@@ -221,6 +238,7 @@
_cost[i] = 0;
_count = maxIndex+1;
}
+ Q_ASSERT(_count <= _allocCount);
invalidate();
}
@@ -228,9 +246,9 @@
void ProfileCostArray::addCost(EventTypeMapping* mapping, const char* s)
{
if (!mapping || !s) return;
+ reserve(mapping->set()->realCount());
SubCost v;
-
if (mapping->isIdentity()) {
int i = 0;
while(i<mapping->count()) {
@@ -265,7 +283,7 @@
}
}
- // a cost change has to be propagated (esp. in subclasses)
+ Q_ASSERT(_count <= _allocCount);
invalidate();
#if TRACE_DEBUG
@@ -279,11 +297,11 @@
void ProfileCostArray::addCost(EventTypeMapping* mapping, FixString & s)
{
if (!mapping) return;
-
s.stripSpaces();
+ if (s.isEmpty()) return;
+ reserve(mapping->set()->realCount());
SubCost v;
-
if (mapping->isIdentity()) {
int i = 0;
while(i<mapping->count()) {
@@ -318,6 +336,7 @@
}
}
+ Q_ASSERT(_count <= _allocCount);
invalidate();
#if TRACE_DEBUG
@@ -333,11 +352,11 @@
void ProfileCostArray::maxCost(EventTypeMapping* mapping, FixString & s)
{
if (!mapping) return;
-
s.stripSpaces();
+ if (s.isEmpty()) return;
+ reserve(mapping->set()->realCount());
SubCost v;
-
if (mapping->isIdentity()) {
int i = 0;
while(i<mapping->count()) {
@@ -374,6 +393,7 @@
}
}
+ Q_ASSERT(_count <= _allocCount);
invalidate();
#if TRACE_DEBUG
@@ -388,13 +408,15 @@
void ProfileCostArray::addCost(ProfileCostArray* item)
{
int i;
-
if (!item) return;
// we have to update the other item if needed
// because we access the item costs directly
if (item->_dirty) item->update();
+ // make sure we have enough space allocated
+ reserve(item->_count);
+
if (item->_count < _count) {
for (i = 0; i<item->_count; i++)
_cost[i] += item->_cost[i];
@@ -407,7 +429,7 @@
_count = item->_count;
}
- // a cost change has to be propagated (esp. in subclasses)
+ Q_ASSERT(_count <= _allocCount);
invalidate();
#if TRACE_DEBUG
@@ -429,6 +451,9 @@
// because we access the item costs directly
if (item->_dirty) item->update();
+ // make sure we have enough space allocated
+ reserve(item->_count);
+
if (item->_count < _count) {
for (i = 0; i<item->_count; i++)
if (_cost[i] < item->_cost[i]) _cost[i] = item->_cost[i];
@@ -441,7 +466,7 @@
_count = item->_count;
}
- // a cost change has to be propagated (esp. in subclasses)
+ Q_ASSERT(_count <= _allocCount);
invalidate();
#if TRACE_DEBUG
@@ -453,36 +478,40 @@
#endif
}
-void ProfileCostArray::addCost(int type, SubCost value)
+void ProfileCostArray::addCost(int realIndex, SubCost value)
{
- if (type<0 || type>=MaxRealIndex) return;
- if (type<_count)
- _cost[type] += value;
+ if (realIndex<0 || realIndex>=MaxRealIndex) return;
+
+ reserve(realIndex+1);
+ if (realIndex < _count)
+ _cost[realIndex] += value;
else {
- for(int i=_count;i<type;i++)
+ for(int i=_count;i<realIndex;i++)
_cost[i] = 0;
- _cost[type] = value;
- _count = type+1;
+ _cost[realIndex] = value;
+ _count = realIndex+1;
}
- // a cost change has to be propagated (esp. in subclasses)
+ Q_ASSERT(_count <= _allocCount);
invalidate();
}
-void ProfileCostArray::maxCost(int type, SubCost value)
+void ProfileCostArray::maxCost(int realIndex, SubCost value)
{
- if (type<0 || type>=MaxRealIndex) return;
- if (type<_count) {
- if (value>_cost[type]) _cost[type] = value;
+ if (realIndex<0 || realIndex>=MaxRealIndex) return;
+
+ reserve(realIndex+1);
+ if (realIndex<_count) {
+ if (value>_cost[realIndex]) _cost[realIndex] = value;
}
else {
- for(int i=_count;i<type;i++)
+ for(int i=_count;i<realIndex;i++)
_cost[i] = 0;
- _cost[type] = value;
- _count = type+1;
+ _cost[realIndex] = value;
+ _count = realIndex+1;
}
- // a cost change has to be propagated (esp. in subclasses)
+ Q_ASSERT(_count <= _allocCount);
invalidate();
}
@@ -497,10 +526,12 @@
int maxCount = (item->_count > _count) ? item->_count : _count;
- res._count = maxCount;
+ res.reserve(maxCount);
for (int i=0; i<maxCount;i++)
res._cost[i] = item->subCost(i) - subCost(i);
+ res._count = maxCount;
+ Q_ASSERT(res._count <= res._allocCount);
return res;
}
@@ -549,6 +580,7 @@
return _cost[idx];
}
+
SubCost ProfileCostArray::subCost(EventType* t)
{
if (!t) return 0;
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libcore/costitem.h
^
|
@@ -128,6 +128,12 @@
};
+// The maximal number of subcosts in a ProfileCostArray and
+// event types in a EventSet. Does not really matter for memory
+// consumption as cost for a ProfileCostArray is dynamically
+// allocated depending on used number of event types, and there
+// will be only a low number of objects for EventType{,Set,Mapping}.
+#define MaxRealIndexValue 200
/**
* An array of basic cost metrics for a trace item.
@@ -137,12 +143,11 @@
*/
class ProfileCostArray: public CostItem
{
+ friend class EventType;
public:
/**
- * The maximal number of subcosts a ProfileCostArray can have.
*/
static const int MaxRealIndex;
-#define MaxRealIndexValue 20
static const int InvalidIndex;
@@ -154,6 +159,9 @@
virtual void clear();
+ // reserve space for cost
+ void reserve(int);
+
// set costs according to the mapping order of event types
void set(EventTypeMapping*, const char*);
void set(EventTypeMapping*, FixString&);
@@ -177,11 +185,6 @@
*/
SubCost subCost(EventType*);
- /**
- * Same as above, but only for real types
- */
- SubCost subCost(int);
-
/** Returns a cost attribute converted to a string
* (with space after every 3 digits)
*/
@@ -190,8 +193,13 @@
protected:
virtual void update();
- SubCost _cost[MaxRealIndexValue];
+ private:
+ // Only used by friend class EventType: return subcost by index
+ SubCost subCost(int);
+
+ SubCost* _cost;
int _count; // only _count first indexes of _cost are used
+ int _allocCount; // number of allocated subcost entries
// cache last virtual subcost for faster access
SubCost _cachedCost;
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libcore/eventtype.h
^
|
@@ -176,6 +176,8 @@
bool append(int);
void clear();
+ EventTypeSet* set() { return _set; }
+
/**
* Get number of used indexes
*/
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libcore/stackbrowser.cpp
^
|
@@ -53,6 +53,11 @@
// do not follow calls from cycles
if (f->cycle() == f) return;
+ // event type to use for the "most probable" call stack
+ // we simply take the first real event type
+ if ((_top->data() == 0) ||
+ (_top->data()->eventTypes()->realCount() <1)) return;
+ EventType* e = _top->data()->eventTypes()->realType(0);
int max = 30;
@@ -67,7 +72,7 @@
if (c->called() == _top) continue;
if (c->called()->name().isEmpty()) continue;
- SubCost sc = c->subCost(0); // FIXME
+ SubCost sc = c->subCost(e);
if (sc == 0) continue;
if (sc > most) {
@@ -93,6 +98,12 @@
// do not follow calls from cycles
if (_top->cycle() == _top) return;
+ // event type to use for the "most probable" call stack
+ // we simply take the first real event type
+ if ((_top->data() == 0) ||
+ (_top->data()->eventTypes()->realCount() <1)) return;
+ EventType* e = _top->data()->eventTypes()->realType(0);
+
// try to extend to upper stack frames
while (_top && (max-- >0)) {
TraceCall* call = 0;
@@ -104,7 +115,7 @@
if (c->caller() == _top) continue;
if (c->caller()->name().isEmpty()) continue;
- SubCost sc = c->subCost(0); // FIXME
+ SubCost sc = c->subCost(e);
if (sc == 0) continue;
if (sc > most) {
@@ -213,7 +224,7 @@
// cycles are listed on there own
if (f->cycle() == f) return 0;
- if (_top->cycle() == _top) return false;
+ if (_top->cycle() == _top) return 0;
foreach(TraceCall* c, calls) {
foreach(TraceCall* c2, c->called()->callings()) {
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libcore/tracedata.cpp
^
|
@@ -787,10 +787,12 @@
_calledContexts = 0;
_callingContexts = 0;
+ // To calculate context counts, we just use first real event type (FIXME?)
+ EventType* e = data() ? data()->eventTypes()->realType(0) : 0;
+
// calculate additional cost metrics
foreach(TracePartCall* caller, _partCallers) {
- // FIXME
- if (caller->subCost(0)>0)
+ if (e && (caller->subCost(e) >0))
_calledContexts++;
SubCost c = caller->callCount();
@@ -799,8 +801,7 @@
}
}
foreach(TracePartCall* calling, _partCallings) {
- // FIXME
- if (calling->subCost(0)>0)
+ if (e && (calling->subCost(e)>0))
_callingContexts++;
SubCost c = calling->callCount();
@@ -814,8 +815,7 @@
if (_partLines.count()>0) {
ProfileCostArray::clear();
- TracePartLine* line;
- for (line = _partLines.first(); line; line = _partLines.next())
+ foreach(TracePartLine* line, _partLines)
addCost(line);
}
#else
@@ -1898,7 +1898,7 @@
res = QString();
int d = 0;
for(int i=0;i<_name.length();i++) {
- switch(_name[i].toAscii()) {
+ switch(_name[i].toLatin1()) {
case '<':
if (d<=0) res.append(_name[i]);
d++;
@@ -1952,7 +1952,7 @@
QString rich("<b>");
int d = 0;
for(int i=0;i<_name.length();i++) {
- switch(_name[i].toAscii()) {
+ switch(_name[i].toLatin1()) {
case '&':
rich.append("&");
break;
@@ -2338,17 +2338,18 @@
_callingContexts = 0;
clear();
+ // To calculate context counts, we just use first real event type (FIXME?)
+ EventType* e = data() ? data()->eventTypes()->realType(0) : 0;
+
// context count is NOT the sum of part contexts
foreach(TraceCall *caller, _callers) {
- // FIXME
- if (caller->subCost(0) >0)
+ if (e && (caller->subCost(e) >0))
_calledContexts++;
_calledCount += caller->callCount();
}
foreach(TraceCall* callee, _callings) {
- // FIXME
- if (callee->subCost(0) >0)
+ if (e && (callee->subCost(e) >0))
_callingContexts++;
_callingCount += callee->callCount();
}
@@ -2434,14 +2435,16 @@
* percent of the cost of the function.
* FIXME: Which cost type to use for this heuristic ?!
*/
+ Q_ASSERT((data() != 0) && (data()->eventTypes()->realCount()>0));
+ EventType* e = data()->eventTypes()->realType(0);
SubCost base = 0;
if (_callers.count()>0) {
foreach(TraceCall* caller, _callers)
- if (caller->subCost(0) > base)
- base = caller->subCost(0);
+ if (caller->subCost(e) > base)
+ base = caller->subCost(e);
}
- else base = inclusive()->subCost(0);
+ else base = inclusive()->subCost(e);
SubCost cutLimit = SubCost(base * GlobalConfig::cycleCut());
@@ -2451,7 +2454,7 @@
pNo, qPrintable(prettyName()));
qDebug("%s Cum. %s, Max Caller %s, cut limit %s",
qPrintable(QString().fill(' ', d)),
- qPrintable(inclusive()->subCost(0).pretty()),
+ qPrintable(inclusive()->subCost(e).pretty()),
qPrintable(base.pretty()),
qPrintable(cutLimit.pretty()));
}
@@ -2460,11 +2463,11 @@
TraceFunction* called = callee->called();
// cycle cut heuristic
- if (callee->subCost(0) < cutLimit) {
+ if (callee->subCost(e) < cutLimit) {
if (0) qDebug("%s Cut call to %s (cum. %s)",
qPrintable(QString().fill(' ', d)),
qPrintable(called->prettyName()),
- qPrintable(callee->subCost(0).pretty()));
+ qPrintable(callee->subCost(e).pretty()));
continue;
}
@@ -3068,23 +3071,6 @@
init();
}
-TraceData::TraceData(const QString& base)
- : ProfileCostArray(ProfileContext::context(ProfileContext::Data))
-{
- _logger = 0;
-
- init();
- load(base);
-}
-
-TraceData::TraceData(QIODevice* file, const QString& filename)
- : ProfileCostArray(ProfileContext::context(ProfileContext::Data))
-{
- _logger = 0;
- init();
- load(file, filename);
-}
-
void TraceData::init()
{
_functionCycleCount = 0;
@@ -3135,75 +3121,56 @@
}
/**
- * Two cases:
- * - <base> is a directory: Load first profile data file available
- * - <base> is a file name without part/thread suffixes
+ * Load a list of files.
+ * If only one file is given, it is assumed to be a prefix, and all
+ * existing files with that prefix are loaded.
*
* Returns 0 if nothing found to load
*/
-int TraceData::load(const QString& base)
+int TraceData::load(QStringList files)
{
- bool baseExisting = true;
+ if (files.isEmpty()) return 0;
- _traceName = base;
- QFileInfo finfo(base);
- QString file = finfo.fileName();
- QDir dir = finfo.dir();
-
- if (!finfo.exists()) {
- baseExisting = false;
- }
- else if (finfo.isDir()) {
- // search for first profile data file in directory
- dir = QDir(base);
-
- QStringList prefixList;
- prefixList << "callgrind.out" << "cachegrind.out";
- for ( QStringList::const_iterator it = prefixList.constBegin();
- it != prefixList.constEnd(); ++it ) {
- file = *it;
-
- // search for ".pid"
- QStringList strList = dir.entryList(QStringList() << file+".*", QDir::Files);
- if (strList.count()>0) {
- int l = file.length();
- file = strList.first();
- l++;
- while(file[l] >= '0' && file[l] <= '9') l++;
- file = file.left(l);
- break;
- }
- }
-
- _traceName = dir.path() + '/' + file;
- }
+ _traceName = files[0];
+ if (files.count() == 1) {
+ QFileInfo finfo(_traceName);
+ QString prefix = finfo.fileName();
+ QDir dir = finfo.dir();
+ if (finfo.isDir()) {
+ prefix = "callgrind.out";
+ _traceName += "/callgrind.out";
+ }
- QStringList strList;
- strList += dir.entryList(QStringList() << file+".*" << file+"-*", QDir::Files);
+ files = dir.entryList(QStringList() << prefix + "*", QDir::Files);
+ QStringList::Iterator it = files.begin();
+ for (; it != files.end(); ++it ) {
+ *it = dir.path() + "/" + *it;
+ }
+ }
- baseExisting = QFile::exists(_traceName);
- if (baseExisting)
- strList << file;
+ if (files.isEmpty()) {
+ _traceName += ' ' + QObject::tr("(not found)");
+ return 0;
+ }
- if (strList.count() == 0) {
- _traceName = base + '/' + file + ' ' + QObject::tr("(not found)");
- return 0;
- }
+ QStringList::const_iterator it;
+ int partsLoaded = 0;
+ for (it = files.constBegin(); it != files.constEnd(); ++it ) {
+ QFile file(*it);
+ partsLoaded += internalLoad(&file, *it);
+ }
+ if (partsLoaded == 0) return 0;
- QStringList::const_iterator it;
- int partsLoaded = 0;
- for (it = strList.constBegin(); it != strList.constEnd(); ++it ) {
- QString filename = QString("%1/%2").arg(dir.path()).arg(*it);
- QFile file(filename);
- partsLoaded += internalLoad(&file, filename);
- }
- if (partsLoaded == 0) return 0;
+ qSort(_parts.begin(), _parts.end(), partLessThan);
+ invalidateDynamicCost();
+ updateFunctionCycles();
- qSort(_parts.begin(), _parts.end(), partLessThan);
- invalidateDynamicCost();
- updateFunctionCycles();
+ return partsLoaded;
+}
- return partsLoaded;
+int TraceData::load(QString file)
+{
+ return load(QStringList(file));
}
int TraceData::load(QIODevice* file, const QString& filename)
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libcore/tracedata.h
^
|
@@ -1364,20 +1364,20 @@
{
public:
TraceData(Logger* l = 0);
- TraceData(const QString& base);
- TraceData(QIODevice* file, const QString& filename);
virtual ~TraceData();
virtual TraceData* data() { return this; }
virtual const TraceData* data() const { return this; }
/**
- * Loads a trace file.
+ * Loads profile data files.
+ * If a single file is given, it is assumed to be a prefix.
*
* This adjusts the EventTypeSet according to given cost types.
* Returns the number of parts loaded
*/
- int load(const QString&);
+ int load(QStringList files);
+ int load(QString file);
int load(QIODevice*, const QString&);
/** returns true if something changed. These do NOT
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libviews/callgraphview.cpp
^
|
@@ -1994,6 +1994,7 @@
_renderProcess->kill();
// forget about this process, not interesting any longer
+ _renderProcess->deleteLater();
_renderProcess = 0;
_unparsedOutput = QString();
@@ -2064,6 +2065,10 @@
_unparsedOutput = QString();
+ // display warning if layouting takes > 1s
+ _renderTimer.setSingleShot(true);
+ _renderTimer.start(1000);
+
_renderProcess = new QProcess(this);
connect(_renderProcess, SIGNAL(readyReadStandardOutput()),
this, SLOT(readDotOutput()));
@@ -2071,20 +2076,18 @@
this, SLOT(dotError()));
connect(_renderProcess, SIGNAL(finished(int,QProcess::ExitStatus)),
this, SLOT(dotExited()));
- _renderProcess->start(renderProgram, renderArgs);
+ _renderProcessCmdLine = renderProgram + " " + renderArgs.join(" ");
+ qDebug("CallGraphView::refresh: Starting process %p, '%s'",
+ _renderProcess, qPrintable(_renderProcessCmdLine));
+
+ // _renderProcess can be set to 0 on error after start().
+ // thus, we use a local copy afterwards
+ QProcess* p = _renderProcess;
+ p->start(renderProgram, renderArgs);
_exporter.reset(_data, _activeItem, _eventType, _groupType);
- _exporter.writeDot(_renderProcess);
- _renderProcess->closeWriteChannel();
-
- _renderProcessCmdLine = renderProgram + " " + renderArgs.join(" ");
-
- qDebug("CallGraphView::refresh: Started process %p, '%s'",
- _renderProcess, qPrintable(_renderProcessCmdLine));
-
- // layouting of more than seconds is dubious
- _renderTimer.setSingleShot(true);
- _renderTimer.start(1000);
+ _exporter.writeDot(p);
+ p->closeWriteChannel();
}
void CallGraphView::readDotOutput()
@@ -2093,8 +2096,10 @@
qDebug("CallGraphView::readDotOutput: QProcess %p", p);
// signal from old/uninteresting process?
- if (!_renderProcess) return;
- if (p != _renderProcess) return;
+ if ((_renderProcess == 0) || (p != _renderProcess)) {
+ p->deleteLater();
+ return;
+ }
_unparsedOutput.append(_renderProcess->readAllStandardOutput());
}
@@ -2106,12 +2111,15 @@
p->error(), p);
// signal from old/uninteresting process?
- if (!_renderProcess) return;
- if (p != _renderProcess) return;
+ if ((_renderProcess == 0) || (p != _renderProcess)) {
+ p->deleteLater();
+ return;
+ }
showRenderError(_renderProcess->readAllStandardError());
// not interesting any longer
+ _renderProcess->deleteLater();
_renderProcess = 0;
}
@@ -2120,11 +2128,15 @@
{
QProcess* p = qobject_cast<QProcess*>(sender());
qDebug("CallGraphView::dotExited: QProcess %p", p);
- delete p;
// signal from old/uninteresting process?
- if (!_renderProcess) return;
- if (p != _renderProcess) return;
+ if ((_renderProcess == 0) || (p != _renderProcess)) {
+ p->deleteLater();
+ return;
+ }
+
+ _unparsedOutput.append(_renderProcess->readAllStandardOutput());
+ _renderProcess->deleteLater();
_renderProcess = 0;
QString line, cmd;
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libviews/functionlistmodel.cpp
^
|
@@ -141,7 +141,7 @@
//the skipped items entry
if ( (_topList.count() < _list.count()) && (row == _topList.count()) )
- return createIndex(row, column, 0);
+ return createIndex(row, column);
return createIndex(row, column, (void*)_topList[row]);
}
@@ -302,9 +302,10 @@
void FunctionListModel::computeTopList()
{
+ beginResetModel();
_topList.clear();
if (_filteredList.isEmpty()) {
- reset();
+ endResetModel();
return;
}
@@ -324,7 +325,7 @@
qSort(maxList.begin(), maxList.end(), lessThan);
_topList.append(maxList);
- reset();
+ endResetModel();
}
QString FunctionListModel::getName(TraceFunction *f) const
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libviews/functionselection.cpp
^
|
@@ -34,6 +34,8 @@
#include <QDebug>
#include <QTreeView>
#include <QHeaderView>
+#include <QToolTip>
+#include <QHelpEvent>
#include "traceitemview.h"
#include "stackbrowser.h"
@@ -42,6 +44,47 @@
#include "functionlistmodel.h"
+// custom item delegate for function list
+AutoToolTipDelegate::AutoToolTipDelegate(QObject* parent)
+ : QStyledItemDelegate(parent)
+{}
+
+AutoToolTipDelegate::~AutoToolTipDelegate()
+{}
+
+bool AutoToolTipDelegate::helpEvent(QHelpEvent* e, QAbstractItemView* view,
+ const QStyleOptionViewItem& option,
+ const QModelIndex& index)
+{
+ if (!e || !view)
+ return false;
+
+ if ( e->type() != QEvent::ToolTip )
+ return QStyledItemDelegate::helpEvent(e, view, option, index);
+
+ QRect rect = view->visualRect(index);
+ QSize size = sizeHint(option, index);
+ if ( rect.width() < size.width() ) {
+ QVariant tooltip = index.data(Qt::DisplayRole);
+ if ( tooltip.canConvert<QString>() ) {
+ QToolTip::showText(e->globalPos(), tooltip.toString(), view );
+ return true;
+ }
+ }
+
+ if ( !QStyledItemDelegate::helpEvent( e, view, option, index ) )
+ QToolTip::hideText();
+
+ return true;
+}
+
+
+
+
+//
+// FunctionSelection
+//
+
FunctionSelection::FunctionSelection( TopLevelBase* top,
QWidget* parent)
: QWidget(parent), TraceItemView(0, top)
@@ -80,7 +123,12 @@
QStringList groupHeader;
groupHeader << tr("Self") << tr("Group");
groupList->setHeaderLabels(groupHeader);
+
+#if QT_VERSION >= 0x050000
+ groupList->header()->setSectionsClickable(true);
+#else
groupList->header()->setClickable(true);
+#endif
groupList->header()->setSortIndicatorShown(false);
groupList->header()->stretchLastSection();
groupList->setIconSize(QSize(99,99));
@@ -96,15 +144,22 @@
functionList = new QTreeView(this);
functionList->setRootIsDecorated(false);
functionList->setAllColumnsShowFocus(true);
+ functionList->setAutoScroll(false);
functionList->setContextMenuPolicy(Qt::CustomContextMenu);
functionList->setUniformRowHeights(true);
+#if QT_VERSION >= 0x050000
+ functionList->header()->setSectionsClickable(true);
+ functionList->header()->setSectionResizeMode(QHeaderView::Interactive);
+#else
functionList->header()->setClickable(true);
+ functionList->header()->setResizeMode(QHeaderView::Interactive);
+#endif
functionList->header()->setSortIndicatorShown(false);
functionList->header()->setSortIndicator(0, Qt::DescendingOrder);
- functionList->header()->setResizeMode(QHeaderView::Interactive);
// for columns 3 and 4 (all others get resized)
functionList->header()->setDefaultSectionSize(200);
functionList->setModel(functionListModel);
+ functionList->setItemDelegate(new AutoToolTipDelegate(functionList));
vboxLayout->addWidget(functionList);
// order has to match mapping in groupTypeSelected()
@@ -378,7 +433,12 @@
if (changeType == eventTypeChanged) {
int i;
+
+#if QT_VERSION >= 0x050000
+ groupList->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
+#else
groupList->header()->setResizeMode(0, QHeaderView::ResizeToContents);
+#endif
// need to disable sorting! Otherwise each change of shown cost
// reorders list and changes order returned by topLevelItem()
groupList->setSortingEnabled(false);
@@ -386,7 +446,11 @@
CostListItem* item = (CostListItem*) groupList->topLevelItem(i);
item->setEventType(_eventType);
}
+#if QT_VERSION >= 0x050000
+ groupList->header()->setSectionResizeMode(0, QHeaderView::Interactive);
+#else
groupList->header()->setResizeMode(0, QHeaderView::Interactive);
+#endif
groupList->setSortingEnabled(true);
groupList->header()->setSortIndicatorShown(false);
@@ -606,14 +670,22 @@
items.append(item);
}
+#if QT_VERSION >= 0x050000
+ groupList->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
+#else
groupList->header()->setResizeMode(0, QHeaderView::ResizeToContents);
+#endif
groupList->setSortingEnabled(false);
groupList->addTopLevelItems(items);
groupList->setSortingEnabled(true);
// always reset to cost sorting
groupList->sortByColumn(0, Qt::DescendingOrder);
groupList->header()->setSortIndicatorShown(false);
+#if QT_VERSION >= 0x050000
+ groupList->header()->setSectionResizeMode(0, QHeaderView::Interactive);
+#else
groupList->header()->setResizeMode(0, QHeaderView::Interactive);
+#endif
if (activeItem) {
groupList->scrollToItem(activeItem);
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libviews/functionselection.h
^
|
@@ -26,6 +26,7 @@
#include <QTimer>
#include <QWidget>
#include <QModelIndex>
+#include <QStyledItemDelegate>
#include "tracedata.h"
#include "traceitemview.h"
@@ -108,4 +109,22 @@
Qt::SortOrder _functionListSortOrder;
};
+
+/* Custom item delegate for function list:
+ * show tooltip for function name if truncated.
+ * (thanks to http://www.mimec.org/node/337)
+ */
+class AutoToolTipDelegate : public QStyledItemDelegate
+{
+ Q_OBJECT
+public:
+ AutoToolTipDelegate(QObject* parent = 0);
+ ~AutoToolTipDelegate();
+
+public slots:
+ bool helpEvent( QHelpEvent* e, QAbstractItemView* view,
+ const QStyleOptionViewItem& option,
+ const QModelIndex& index );
+};
+
#endif
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libviews/instritem.h
^
|
@@ -26,7 +26,6 @@
#include <QTreeWidget>
#include <QItemDelegate>
-#include <QColorGroup>
#include "tracedata.h"
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libviews/instrview.cpp
^
|
@@ -113,7 +113,7 @@
pos += 9;
}
if (pos <= start) return false;
- code = QString::fromAscii(buf + start, pos - start - 1);
+ code = QString::fromLatin1(buf + start, pos - start - 1);
// skip whitespace
while(buf[pos]==' ' || buf[pos]=='\t') pos++;
@@ -121,7 +121,7 @@
// check for mnemonic
start = pos;
while(buf[pos] && buf[pos]!=' ' && buf[pos]!='\t') pos++;
- mnemonic = QString::fromAscii(buf + start, pos - start);
+ mnemonic = QString::fromLatin1(buf + start, pos - start);
// skip whitespace
while(buf[pos]==' '|| buf[pos]=='\t') pos++;
@@ -135,9 +135,9 @@
// maximal 50 chars
if (operandsLen > 50)
- operands = QString::fromAscii(buf + pos, 47) + QString("...");
+ operands = QString::fromLatin1(buf + pos, 47) + QString("...");
else
- operands = QString::fromAscii(buf+pos, operandsLen);
+ operands = QString::fromLatin1(buf+pos, operandsLen);
if (0) qDebug("For 0x%s: Code '%s', Mnemonic '%s', Operands '%s'",
qPrintable(addr.toString()), qPrintable(code),
@@ -434,7 +434,11 @@
void InstrView::setColumnWidths()
{
+#if QT_VERSION >= 0x050000
+ header()->setSectionResizeMode(4, QHeaderView::Interactive);
+#else
header()->setResizeMode(4, QHeaderView::Interactive);
+#endif
if (_showHexCode) {
setColumnWidth(4, _lastHexCodeWidth);
}
@@ -502,8 +506,14 @@
setColumnWidth(4, 0); // hex code column
setColumnWidth(5, 50); // command column
setColumnWidth(6, 250); // arg column
+
// reset to automatic sizing to get column width
+#if QT_VERSION >= 0x050000
+ header()->setSectionResizeMode(4, QHeaderView::ResizeToContents);
+#else
header()->setResizeMode(4, QHeaderView::ResizeToContents);
+#endif
+
if (_eventType)
headerItem()->setText(1, _eventType->name());
@@ -547,7 +557,7 @@
tr("Tip: For Callgrind, rerun with option"));
new InstrItem(this, this, 3, tr(" --dump-instr=yes"));
new InstrItem(this, this, 4, tr("To see (conditional) jumps, additionally specify"));
- new InstrItem(this, this, 5, tr(" --trace-jump=yes"));
+ new InstrItem(this, this, 5, tr(" --collect-jumps=yes"));
return;
}
@@ -604,7 +614,11 @@
setColumnWidths();
if (!_eventType2) {
+#if QT_VERSION >= 0x050000
+ header()->setSectionResizeMode(2, QHeaderView::Interactive);
+#else
header()->setResizeMode(2, QHeaderView::Interactive);
+#endif
setColumnWidth(2, 0);
}
@@ -993,9 +1007,15 @@
}
// Resize column 1/2 to contents
+#if QT_VERSION >= 0x050000
+ header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
+ header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
+ header()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
+#else
header()->setResizeMode(0, QHeaderView::ResizeToContents);
header()->setResizeMode(1, QHeaderView::ResizeToContents);
header()->setResizeMode(2, QHeaderView::ResizeToContents);
+#endif
setSortingEnabled(false);
addTopLevelItems(items);
@@ -1006,9 +1026,15 @@
header()->setSortIndicatorShown(false);
// Reallow interactive column size change after resizing to content
+#if QT_VERSION >= 0x050000
+ header()->setSectionResizeMode(0, QHeaderView::Interactive);
+ header()->setSectionResizeMode(1, QHeaderView::Interactive);
+ header()->setSectionResizeMode(2, QHeaderView::Interactive);
+#else
header()->setResizeMode(0, QHeaderView::Interactive);
header()->setResizeMode(1, QHeaderView::Interactive);
header()->setResizeMode(2, QHeaderView::Interactive);
+#endif
if (selected) item = selected;
if (item) first = item;
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libviews/partview.cpp
^
|
@@ -158,9 +158,13 @@
}
if (changeType == eventTypeChanged) {
-
+#if QT_VERSION >= 0x050000
+ header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
+ header()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
+#else
header()->setResizeMode(1, QHeaderView::ResizeToContents);
header()->setResizeMode(2, QHeaderView::ResizeToContents);
+#endif
// need to disable sorting! Otherwise each change of shown cost
// can reorders list and change order returned by topLevelItem()
setSortingEnabled(false);
@@ -168,8 +172,13 @@
PartListItem* item = (PartListItem*) topLevelItem(i);
item->setEventType(_eventType);
}
+#if QT_VERSION >= 0x050000
+ header()->setSectionResizeMode(1, QHeaderView::Interactive);
+ header()->setSectionResizeMode(2, QHeaderView::Interactive);
+#else
header()->setResizeMode(1, QHeaderView::Interactive);
header()->setResizeMode(2, QHeaderView::Interactive);
+#endif
setSortingEnabled(true);
header()->setSortIndicatorShown(false);
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libviews/sourceview.cpp
^
|
@@ -362,7 +362,11 @@
}
if (!_eventType2) {
+#if QT_VERSION >= 0x050000
+ header()->setSectionResizeMode(2, QHeaderView::Interactive);
+#else
header()->setResizeMode(2, QHeaderView::Interactive);
+#endif
setColumnWidth(2, 0);
}
// reset to the original position - this is useful when the view
@@ -872,9 +876,16 @@
file.close();
- // Resize column 1/2 to contents
+ // Resize column 0 (line number) and 1/2 (cost) to contents
+#if QT_VERSION >= 0x050000
+ header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
+ header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
+ header()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
+#else
+ header()->setResizeMode(0, QHeaderView::ResizeToContents);
header()->setResizeMode(1, QHeaderView::ResizeToContents);
header()->setResizeMode(2, QHeaderView::ResizeToContents);
+#endif
setSortingEnabled(false);
addTopLevelItems(items);
@@ -885,8 +896,15 @@
header()->setSortIndicatorShown(false);
// Reallow interactive column size change after resizing to content
+#if QT_VERSION >= 0x050000
+ header()->setSectionResizeMode(0, QHeaderView::Interactive);
+ header()->setSectionResizeMode(1, QHeaderView::Interactive);
+ header()->setSectionResizeMode(2, QHeaderView::Interactive);
+#else
+ header()->setResizeMode(0, QHeaderView::Interactive);
header()->setResizeMode(1, QHeaderView::Interactive);
header()->setResizeMode(2, QHeaderView::Interactive);
+#endif
if (selected) item = selected;
if (item) first = item;
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libviews/stackselection.cpp
^
|
@@ -133,9 +133,15 @@
activeItem = si;
items.prepend(si);
+#if QT_VERSION >= 0x050000
+ _stackList->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
+ _stackList->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
+ _stackList->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
+#else
_stackList->header()->setResizeMode(0, QHeaderView::ResizeToContents);
_stackList->header()->setResizeMode(1, QHeaderView::ResizeToContents);
_stackList->header()->setResizeMode(2, QHeaderView::ResizeToContents);
+#endif
_stackList->addTopLevelItems(items);
if (activeItem) {
@@ -144,9 +150,15 @@
_stackList->scrollToItem(activeItem);
}
+#if QT_VERSION >= 0x050000
+ _stackList->header()->setSectionResizeMode(0, QHeaderView::Interactive);
+ _stackList->header()->setSectionResizeMode(1, QHeaderView::Interactive);
+ _stackList->header()->setSectionResizeMode(2, QHeaderView::Interactive);
+#else
_stackList->header()->setResizeMode(0, QHeaderView::Interactive);
_stackList->header()->setResizeMode(1, QHeaderView::Interactive);
_stackList->header()->setResizeMode(2, QHeaderView::Interactive);
+#endif
if (!_eventType2) {
_stackList->setColumnWidth(1, 0);
@@ -196,8 +208,13 @@
void StackSelection::refresh()
{
+#if QT_VERSION >= 0x050000
+ _stackList->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
+ _stackList->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
+#else
_stackList->header()->setResizeMode(0, QHeaderView::ResizeToContents);
_stackList->header()->setResizeMode(1, QHeaderView::ResizeToContents);
+#endif
// there is no resorting allowed, so this is save
for(int i = 0; i < _stackList->topLevelItemCount(); i++) {
@@ -206,7 +223,11 @@
}
if (!_eventType2) {
+#if QT_VERSION >= 0x050000
+ _stackList->header()->setSectionResizeMode(1, QHeaderView::Interactive);
+#else
_stackList->header()->setResizeMode(1, QHeaderView::Interactive);
+#endif
_stackList->setColumnWidth(1, 0);
}
}
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libviews/tabview.cpp
^
|
@@ -327,15 +327,15 @@
_rightTW = new TabWidget(this, _mainSplitter);
_rightTW->setObjectName("Right");
- connect(_rightTW, SIGNAL(currentChanged(QWidget*)),
- this, SLOT(tabChanged(QWidget*)));
+ connect(_rightTW, SIGNAL(currentChanged(int)),
+ this, SLOT(tabChanged(int)));
connect(_rightTW, SIGNAL(visibleRectChanged(TabWidget*)),
this, SLOT(visibleRectChangedSlot(TabWidget*)));
_topTW = new TabWidget(this, _leftSplitter);
_topTW->setObjectName("Top");
- connect(_topTW, SIGNAL(currentChanged(QWidget*)),
- this, SLOT(tabChanged(QWidget*)));
+ connect(_topTW, SIGNAL(currentChanged(int)),
+ this, SLOT(tabChanged(int)));
connect(_topTW, SIGNAL(visibleRectChanged(TabWidget*)),
this, SLOT(visibleRectChangedSlot(TabWidget*)));
@@ -345,16 +345,16 @@
_leftTW = new TabWidget(this, _bottomSplitter);
_leftTW->setObjectName("Left");
_leftTW->setTabPosition(QTabWidget::South);
- connect(_leftTW, SIGNAL(currentChanged(QWidget*)),
- this, SLOT(tabChanged(QWidget*)));
+ connect(_leftTW, SIGNAL(currentChanged(int)),
+ this, SLOT(tabChanged(int)));
connect(_leftTW, SIGNAL(visibleRectChanged(TabWidget*)),
this, SLOT(visibleRectChangedSlot(TabWidget*)));
_bottomTW = new TabWidget(this, _bottomSplitter);
_bottomTW->setObjectName("Bottom");
_bottomTW->setTabPosition(QTabWidget::South);
- connect(_bottomTW, SIGNAL(currentChanged(QWidget*)),
- this, SLOT(tabChanged(QWidget*)));
+ connect(_bottomTW, SIGNAL(currentChanged(int)),
+ this, SLOT(tabChanged(int)));
connect(_bottomTW, SIGNAL(visibleRectChanged(TabWidget*)),
this, SLOT(visibleRectChangedSlot(TabWidget*)));
@@ -772,8 +772,12 @@
}
-void TabView::tabChanged(QWidget* w)
+void TabView::tabChanged(int i)
{
+ TabWidget* tw = qobject_cast<TabWidget*>(sender());
+ if (!tw) return;
+ QWidget* w = tw->widget(i);
+
foreach(TraceItemView *v, _tabs)
if (v->widget() == w) v->updateView();
}
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/libviews/tabview.h
^
|
@@ -145,7 +145,7 @@
void restoreOptions(const QString& prefix, const QString& postfix);
public slots:
- void tabChanged(QWidget*);
+ void tabChanged(int);
void visibleRectChangedSlot(TabWidget*);
signals:
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/qcachegrind/qcachegrind.desktop
^
|
@@ -8,10 +8,13 @@
Name=QCachegrind
Name[ca]=QCachegrind
Name[ca@valencia]=QCachegrind
+Name[da]=QCachegrind
Name[de]=QCachegrind
Name[el]=QCachegrind
Name[es]=QCachegrind
Name[et]=QCachegrind
+Name[fi]=QCachegrind
+Name[fr]=QCachegrind
Name[ga]=QCachegrind
Name[hu]=QCachegrind
Name[it]=QCachegrind
@@ -23,11 +26,13 @@
Name[pl]=QCachegrind
Name[pt]=QCachegrind
Name[pt_BR]=QCachegrind
+Name[sk]=QCachegrind
Name[sr]=Ку‑кешгринд
Name[sr@ijekavian]=Ку‑кешгринд
Name[sr@ijekavianlatin]=QCacheGrind
Name[sr@latin]=QCacheGrind
Name[sv]=Qcachegrind
+Name[tr]=QCachegrind
Name[uk]=QCachegrind
Name[x-test]=xxQCachegrindxx
Name[zh_CN]=QCachegrind
@@ -52,7 +57,7 @@
GenericName[fr]=Interface de profilage
GenericName[ga]=Comhéadan ar Phróifíleoir
GenericName[gl]=Interface para o profiler
-GenericName[hu]=Profilozó
+GenericName[hu]=Ábrázoló előtétprogram
GenericName[is]=Myndrænt viðmót á afkastakönnuð
GenericName[it]=Interfaccia a profiler
GenericName[ja]=プロファイラフロントエンド
@@ -103,7 +108,7 @@
Comment[eu]=Errendimendu profil datuen bistaratzea
Comment[fa]=تجسم کارایی گزارش دادهها
Comment[fi]=Visualisointi tehokkuusprofiloinnin tiedoista
-Comment[fr]=Visualisation de données de profilage de performance
+Comment[fr]=Visualise les données de profilage de performances
Comment[ga]=Amharcléiriú ar Shonraí Próifílithe Feidhmíochta
Comment[gl]=Visualización dos datos da análise de rendemento
Comment[hu]=Teljesítményprofil-adatok megjelenítése
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/qcachegrind/qcachegrind.pro
^
|
@@ -1,22 +1,25 @@
TEMPLATE = app
+greaterThan(QT_MAJOR_VERSION, 4) {
+ QT += widgets
+}
+
contains(QT_CONFIG, dbus) {
DEFINES += QT_DBUS_SUPPORT
QT += dbus
}
-OBJECTS_DIR = $$OUT_PWD/../.obj
-
include(../libcore/libcore.pri)
include(../libviews/libviews.pri)
-# Do moc handling of code shared with KDE the "KDE way":
-# This generate *.moc files from NHEADERS, which get included from *.cpp
+# needed for $$QMAKE_MOC below to become defined
+load(moc)
+
+# moc handling of code shared with KDE the "KDE way":
+# this generates *.moc files from HEADERS, which get included from *.cpp
new_moc.CONFIG = no_link moc_verify
new_moc.output = ${QMAKE_FILE_BASE}.moc
-new_moc.commands = moc ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_OUT}
-# moc output only depends on file defining the QObject subclass
-new_moc.depend_command = echo ${QMAKE_FILE_NAME}
+new_moc.commands = $$moc_header.commands
new_moc.input = NHEADERS
QMAKE_EXTRA_COMPILERS = new_moc
@@ -44,3 +47,6 @@
sourcesettings.cpp \
qtcolorbutton.cpp \
colorsettings.cpp
+
+# makes headers visible in qt-creator (luckily no double moc handling)
+HEADERS += $$NHEADERS
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/qcachegrind/qcgmain.cpp
^
|
@@ -33,7 +33,6 @@
int main( int argc, char ** argv )
{
QApplication app(argc, argv);
- QCGTopLevel* t;
Loader::initLoaders();
QCoreApplication::setOrganizationName("kcachegrind.sf.net");
@@ -44,18 +43,15 @@
QStringList list = app.arguments();
list.pop_front();
- if (!list.isEmpty()) {
- foreach(const QString& file, list) {
- t = new QCGTopLevel();
- t->show();
- t->loadDelayed( QDir::fromNativeSeparators(file) );
- }
+ QCGTopLevel* t = new QCGTopLevel();
+ t->show();
+ if (list.isEmpty()) {
+ // load files in current dir
+ t->loadDelayed( ".", false);
}
else {
- // load trace in current dir
- t = new QCGTopLevel();
- t->show();
- t->loadDelayed(".", false);
+ foreach(const QString& file, list)
+ t->loadDelayed( QDir::fromNativeSeparators(file) );
}
int res = app.exec();
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/qcachegrind/qcgtoplevel.cpp
^
|
@@ -254,7 +254,7 @@
void QCGTopLevel::recentFilesTriggered(QAction* action)
{
if (action)
- loadTrace(QDir::fromNativeSeparators(action->text()));
+ load(QStringList(QDir::fromNativeSeparators(action->text())));
}
void QCGTopLevel::createDocks()
@@ -332,11 +332,11 @@
_openAction = new QAction(icon, tr("&Open..."), this);
_openAction->setShortcuts(QKeySequence::Open);
_openAction->setStatusTip(tr("Open profile data file"));
- connect(_openAction, SIGNAL(triggered()), this, SLOT(loadTrace()));
+ connect(_openAction, SIGNAL(triggered()), this, SLOT(load()));
_addAction = new QAction(tr( "&Add..." ), this);
_addAction->setStatusTip(tr("Add profile data to current window"));
- connect(_addAction, SIGNAL(triggered(bool)), SLOT(addTrace()));
+ connect(_addAction, SIGNAL(triggered(bool)), SLOT(add()));
_exportAction = new QAction(tr("Export Graph"), this);
_exportAction->setStatusTip(tr("Generate GraphViz file 'callgraph.dot'"));
@@ -611,7 +611,7 @@
void QCGTopLevel::about()
{
QString text, version;
- version = QLatin1String("0.7.1");
+ version = QLatin1String("0.7.3");
text = QString("<h3>QCachegrind %1</h3>").arg(version);
text += tr("<p>QCachegrind is a graphical user interface for analysing "
"profiling data, which helps in the performance optimization "
@@ -752,33 +752,33 @@
}
-void QCGTopLevel::loadTrace()
+void QCGTopLevel::load()
{
- QString file;
- file = QFileDialog::getOpenFileName(this,
+ QStringList files;
+ files = QFileDialog::getOpenFileNames(this,
tr("Open Callgrind Data"),
_lastFile,
tr("Callgrind Files (callgrind.*);;All Files (*)"));
- loadTrace(file);
+ load(files);
}
-void QCGTopLevel::loadTrace(QString file, bool addToRecentFiles)
+void QCGTopLevel::load(QStringList files, bool addToRecentFiles)
{
- if (file.isEmpty()) return;
- _lastFile = file;
+ if (files.isEmpty()) return;
+ _lastFile = files[0];
if (_data && _data->parts().count()>0) {
// In new window
QCGTopLevel* t = new QCGTopLevel();
t->show();
- t->loadDelayed(file, addToRecentFiles);
+ t->loadDelayed(files, addToRecentFiles);
return;
}
// this constructor enables progress bar callbacks
TraceData* d = new TraceData(this);
- int filesLoaded = d->load(file);
+ int filesLoaded = d->load(files);
if (filesLoaded >0)
setData(d);
@@ -789,34 +789,36 @@
ConfigGroup* generalConfig = ConfigStorage::group("GeneralSettings");
recentFiles = generalConfig->value("RecentFiles",
QStringList()).toStringList();
- recentFiles.removeAll(file);
- if (filesLoaded >0)
- recentFiles.prepend(file);
- if (recentFiles.count() >5)
- recentFiles.removeLast();
+ foreach(QString file, files) {
+ recentFiles.removeAll(file);
+ if (filesLoaded >0)
+ recentFiles.prepend(file);
+ if (recentFiles.count() >5)
+ recentFiles.removeLast();
+ }
generalConfig->setValue("RecentFiles", recentFiles);
delete generalConfig;
}
-void QCGTopLevel::addTrace()
+void QCGTopLevel::add()
{
- QString file;
- file = QFileDialog::getOpenFileName(this,
+ QStringList files;
+ files = QFileDialog::getOpenFileNames(this,
tr("Add Callgrind Data"),
_lastFile,
tr("Callgrind Files (callgrind.*);;All Files (*)"));
- addTrace(file);
+ add(files);
}
-void QCGTopLevel::addTrace(QString file)
+void QCGTopLevel::add(QStringList files)
{
- if (file.isEmpty()) return;
- _lastFile = file;
+ if (files.isEmpty()) return;
+ _lastFile = files[0];
if (_data) {
- _data->load(file);
+ _data->load(files);
// GUI update for added data
configChanged();
@@ -825,26 +827,33 @@
// this constructor enables progress bar callbacks
TraceData* d = new TraceData(this);
- int filesLoaded = d->load(file);
+ int filesLoaded = d->load(files);
if (filesLoaded >0)
setData(d);
}
+void QCGTopLevel::loadDelayed(QString file, bool addToRecentFiles)
+{
+ _loadFilesDelayed << file;
+ _addToRecentFiles = addToRecentFiles;
+ QTimer::singleShot(0, this, SLOT(loadFilesDelayed()));
+}
-void QCGTopLevel::loadDelayed(QString file, bool addToRecentFiles)
+void QCGTopLevel::loadDelayed(QStringList files, bool addToRecentFiles)
{
- _loadTraceDelayed = file;
+ _loadFilesDelayed << files;
+
_addToRecentFiles = addToRecentFiles;
- QTimer::singleShot(0, this, SLOT(loadTraceDelayed()));
+ QTimer::singleShot(0, this, SLOT(loadFilesDelayed()));
}
-void QCGTopLevel::loadTraceDelayed()
+void QCGTopLevel::loadFilesDelayed()
{
- if (_loadTraceDelayed.isEmpty()) return;
+ if (_loadFilesDelayed.isEmpty()) return;
- loadTrace(_loadTraceDelayed, _addToRecentFiles);
- _loadTraceDelayed = QString();
+ load(_loadFilesDelayed, _addToRecentFiles);
+ _loadFilesDelayed.clear();
}
@@ -1165,7 +1174,7 @@
_traceItemDelayed = i;
_lastSender = sender();
- qDebug() << "Selected " << (i ? i->prettyName() : "(none)");
+ qDebug() << "Selected " << (i ? i->fullName() : "(none)");
#if TRACE_UPDATES
qDebug("QCGTopLevel::setTraceItemDelayed(%s), sender %s",
@@ -2020,12 +2029,14 @@
void QCGTopLevel::loadError(int line, const QString& msg)
{
- qCritical() << "Loading" << _filename << ":" << line << ": " << msg.toAscii();
+ qCritical() << "Loading" << _filename
+ << ":" << line << ": " << msg;
}
void QCGTopLevel::loadWarning(int line, const QString& msg)
{
- qWarning() << "Loading" << _filename.toAscii() << ":" << line << ": " << msg.toAscii();
+ qWarning() << "Loading" << _filename
+ << ":" << line << ": " << msg;
}
#include "qcgtoplevel.moc"
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/qcachegrind/qcgtoplevel.h
^
|
@@ -85,13 +85,14 @@
virtual void loadFinished(const QString& msg); // msg could be error
public slots:
- void loadTrace();
- void loadTrace(QString, bool addToRecentFiles = true);
- void addTrace();
- void addTrace(QString);
+ 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, bool addToRecentFiles = true);
+ void loadDelayed(QString file, bool addToRecentFiles = true);
+ void loadDelayed(QStringList files, bool addToRecentFiles = true);
void exportGraph();
void newWindow();
@@ -172,7 +173,7 @@
void setGroupTypeDelayed();
void setGroupDelayed();
void setTraceItemDelayed();
- void loadTraceDelayed();
+ void loadFilesDelayed();
void setDirectionDelayed();
// configuration has changed
@@ -253,7 +254,7 @@
ProfileContext::Type _groupTypeDelayed;
TraceCostItem* _groupDelayed;
CostItem* _traceItemDelayed;
- QString _loadTraceDelayed;
+ QStringList _loadFilesDelayed;
bool _addToRecentFiles;
TraceItemView::Direction _directionDelayed;
};
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/qcachegrind/qtcolorbutton.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copied from Qt 4.6.0 sources, directory tools/shared/qtgradienteditor
-** with small modifications to allow compilation with Qt 4.4
+** with small modifications to allow compilation with Qt 4.4 and Qt 5.0
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
@@ -34,11 +34,13 @@
****************************************************************************/
#include "qtcolorbutton.h"
-#include <QtGui/QColorDialog>
-#include <QtGui/QPainter>
-#include <QtCore/QMimeData>
-#include <QtGui/QDragEnterEvent>
-#include <QtGui/QApplication>
+
+#include <QColorDialog>
+#include <QPainter>
+#include <QMimeData>
+#include <QDrag>
+#include <QDragEnterEvent>
+#include <QApplication>
QT_BEGIN_NAMESPACE
|
[-]
[+]
|
Changed |
kcachegrind-0.7.3.tar.bz2/qcachegrind/qtcolorbutton.h
^
|
@@ -35,7 +35,7 @@
#ifndef QTCOLORBUTTON_H
#define QTCOLORBUTTON_H
-#include <QtGui/QToolButton>
+#include <QToolButton>
QT_BEGIN_NAMESPACE
|