forked from qt-creator/qt-creator
Valgrind: Introduce Frame::filePath().
Change-Id: I40d1b7f739ea905bbcca1a388bada3e077b7c137 Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -238,8 +238,8 @@ QString Error::toXml() const
|
||||
stream << " <fn>" << frame.functionName() << "</fn>\n";
|
||||
if (!frame.directory().isEmpty())
|
||||
stream << " <dir>" << frame.directory() << "</dir>\n";
|
||||
if (!frame.file().isEmpty())
|
||||
stream << " <file>" << frame.file() << "</file>\n";
|
||||
if (!frame.fileName().isEmpty())
|
||||
stream << " <file>" << frame.fileName() << "</file>\n";
|
||||
if (frame.line() != -1)
|
||||
stream << " <line>" << frame.line() << "</line>";
|
||||
stream << " </frame>\n";
|
||||
|
||||
@@ -111,16 +111,13 @@ Frame ErrorListModel::Private::findRelevantFrame(const Error &error) const
|
||||
|
||||
QString ErrorListModel::Private::formatAbsoluteFilePath(const Error &error) const
|
||||
{
|
||||
const Frame f = findRelevantFrame(error);
|
||||
if (!f.directory().isEmpty() && !f.file().isEmpty())
|
||||
return f.directory() + QLatin1Char('/') + f.file();
|
||||
return QString();
|
||||
return findRelevantFrame(error).filePath();
|
||||
}
|
||||
|
||||
QString ErrorListModel::Private::formatLocation(const Error &error) const
|
||||
{
|
||||
const Frame frame = findRelevantFrame(error);
|
||||
const QString file = frame.file();
|
||||
const QString file = frame.fileName();
|
||||
if (!frame.functionName().isEmpty())
|
||||
return frame.functionName();
|
||||
if (!file.isEmpty()) {
|
||||
@@ -185,7 +182,7 @@ QVariant ErrorListModel::Private::errorData(int row, int column, int role) const
|
||||
case AbsoluteFilePathRole:
|
||||
return formatAbsoluteFilePath(error);
|
||||
case FileRole:
|
||||
return findRelevantFrame(error).file();
|
||||
return findRelevantFrame(error).fileName();
|
||||
case LineRole: {
|
||||
const qint64 line = findRelevantFrame(error).line();
|
||||
return line > 0 ? line : QVariant();
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
return ip == other.ip
|
||||
&& object == other.object
|
||||
&& functionName == other.functionName
|
||||
&& file == other.file
|
||||
&& fileName == other.fileName
|
||||
&& directory == other.directory
|
||||
&& line == other.line;
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
quint64 ip;
|
||||
QString object;
|
||||
QString functionName;
|
||||
QString file;
|
||||
QString fileName;
|
||||
QString directory;
|
||||
int line;
|
||||
};
|
||||
@@ -126,14 +126,14 @@ void Frame::setFunctionName(const QString &functionName)
|
||||
d->functionName = functionName;
|
||||
}
|
||||
|
||||
QString Frame::file() const
|
||||
QString Frame::fileName() const
|
||||
{
|
||||
return d->file;
|
||||
return d->fileName;
|
||||
}
|
||||
|
||||
void Frame::setFile(const QString &file)
|
||||
void Frame::setFileName(const QString &file)
|
||||
{
|
||||
d->file = file;
|
||||
d->fileName = file;
|
||||
}
|
||||
|
||||
QString Frame::directory() const
|
||||
@@ -146,6 +146,14 @@ void Frame::setDirectory(const QString &directory)
|
||||
d->directory = directory;
|
||||
}
|
||||
|
||||
QString Frame::filePath() const
|
||||
{
|
||||
QString f;
|
||||
if (!directory().isEmpty())
|
||||
f.append(directory()).append(QLatin1Char('/'));
|
||||
return f.append(fileName());
|
||||
}
|
||||
|
||||
int Frame::line() const
|
||||
{
|
||||
return d->line;
|
||||
|
||||
@@ -59,12 +59,14 @@ public:
|
||||
QString functionName() const;
|
||||
void setFunctionName(const QString &functionName);
|
||||
|
||||
QString file() const;
|
||||
void setFile(const QString &file);
|
||||
QString fileName() const;
|
||||
void setFileName(const QString &fileName);
|
||||
|
||||
QString directory() const;
|
||||
void setDirectory(const QString &directory);
|
||||
|
||||
QString filePath() const;
|
||||
|
||||
int line() const;
|
||||
void setLine(int line);
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@ namespace XmlProtocol {
|
||||
QString toolTipForFrame(const Frame &frame)
|
||||
{
|
||||
QString location;
|
||||
if (!frame.file().isEmpty()) {
|
||||
location = frame.directory() + QLatin1Char('/') + frame.file();
|
||||
if (!frame.fileName().isEmpty()) {
|
||||
location = frame.filePath();
|
||||
if (frame.line() > 0)
|
||||
location += QLatin1Char(':') + QString::number(frame.line());
|
||||
}
|
||||
|
||||
@@ -517,7 +517,7 @@ Frame Parser::Private::parseFrame()
|
||||
else if (name == QLatin1String("dir"))
|
||||
frame.setDirectory(blockingReadElementText());
|
||||
else if (name == QLatin1String("file"))
|
||||
frame.setFile( blockingReadElementText());
|
||||
frame.setFileName(blockingReadElementText());
|
||||
else if (name == QLatin1String("line"))
|
||||
frame.setLine(parseInt64(blockingReadElementText(), QLatin1String("error/frame/line")));
|
||||
else if (reader.isStartElement())
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
static QString makeName(const Frame &frame)
|
||||
{
|
||||
const QString d = frame.directory();
|
||||
const QString f = frame.file();
|
||||
const QString f = frame.fileName();
|
||||
const QString fn = frame.functionName();
|
||||
if (!fn.isEmpty())
|
||||
return fn;
|
||||
@@ -123,7 +123,7 @@ QVariant StackModel::data(const QModelIndex &index, int role) const
|
||||
case DirectoryColumn:
|
||||
return frame.directory();
|
||||
case FileColumn:
|
||||
return frame.file();
|
||||
return frame.fileName();
|
||||
case LineColumn:
|
||||
if (frame.line() > 0)
|
||||
return frame.line();
|
||||
@@ -139,7 +139,7 @@ QVariant StackModel::data(const QModelIndex &index, int role) const
|
||||
case FunctionNameRole:
|
||||
return frame.functionName();
|
||||
case FileRole:
|
||||
return frame.file();
|
||||
return frame.fileName();
|
||||
case DirectoryRole:
|
||||
return frame.directory();
|
||||
case LineRole:
|
||||
|
||||
Reference in New Issue
Block a user