From bd56579c7d9de94c17287adefa118290e6b7ba33 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Fri, 23 Feb 2018 23:49:48 +0000 Subject: New upstream version 1.4.0.3 --- DebugModel.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'DebugModel.cpp') diff --git a/DebugModel.cpp b/DebugModel.cpp index 2a7b173..5afa3ba 100644 --- a/DebugModel.cpp +++ b/DebugModel.cpp @@ -31,7 +31,7 @@ QVariant DebugModel::data( const QModelIndex& index, int role ) const int row,column; row=index.row(); column=index.column(); - if(index.parent()!=QModelIndex() || row < 0 || row >= list.count() || column < 0 || column >= COLUMN_COUNT) + if(index.parent()!=QModelIndex() || row < 0 || row >= (int)list.size() || column < 0 || column >= COLUMN_COUNT) return QVariant(); const DebugItem& item = list.at(row); @@ -45,16 +45,16 @@ QVariant DebugModel::data( const QModelIndex& index, int role ) const return item.time; break; case 1: - return item.file; + return QString::fromStdString(item.file); break; case 2: - return item.function; + return QString::fromStdString(item.function); break; case 3: - return item.location; + return QString::fromStdString(item.location); break; case 4: - return item.text; + return QString::fromStdString(item.text); break; default: return QVariant(); @@ -89,7 +89,7 @@ QVariant DebugModel::data( const QModelIndex& index, int role ) const int DebugModel::rowCount( const QModelIndex& parent ) const { - return parent == QModelIndex() ? list.count() : 0; + return parent == QModelIndex() ? list.size() : 0; } QVariant DebugModel::headerData( int section, Qt::Orientation orientation, int role ) const @@ -117,16 +117,16 @@ bool DebugModel::setData( const QModelIndex&, const QVariant&, int) return false; } -void DebugModel::addDebugInformation(const int &time,const DebugLevel_custom &level,const QString& function,const QString& text,const QString &file,const int& ligne,const QString& location) +void DebugModel::addDebugInformation(const int &time, const DebugLevel_custom &level, const std::string &function, const std::string &text, const std::string &file, const unsigned int& ligne, const std::string &location) { DebugItem item; item.time=time; item.level=level; item.function=function; item.text=text; - item.file=QStringLiteral("%1:%2").arg(file).arg(ligne); + item.file=file+":"+std::to_string(ligne); item.location=location; - list << item; + list.push_back(item); if(!displayed) { displayed=true; -- cgit v1.2.3