GUI: slight performance improvements with useless QString allocations
This commit is contained in:
parent
81fd6116b7
commit
09c80658ec
|
@ -1075,7 +1075,7 @@ QString AbstractTableView::getColTitle(int index)
|
|||
{
|
||||
if(mColumnList.size() > 0 && index >= 0 && index < mColumnList.size())
|
||||
return mColumnList[index].title;
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
|
|
|
@ -665,7 +665,7 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
|
|||
}
|
||||
break;
|
||||
}
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
|
|
|
@ -589,7 +589,7 @@ QString HexDump::paintContent(QPainter* painter, dsint rowBase, int rowOffset, i
|
|||
getColumnRichText(col, wRva, richText);
|
||||
RichTextPainter::paintRichText(painter, x, y, w, h, 4, richText, mFontMetrics);
|
||||
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
|
||||
void HexDump::printSelected(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
|
|
|
@ -67,7 +67,7 @@ void CPUArgumentWidget::disassembledAtSlot(dsint, dsint cip, bool, dsint)
|
|||
static QString stringFormatInline(const QString & format)
|
||||
{
|
||||
if(!DbgFunctions()->StringFormatInline)
|
||||
return "";
|
||||
return QString();
|
||||
char result[MAX_SETTING_SIZE] = "";
|
||||
if(DbgFunctions()->StringFormatInline(format.toUtf8().constData(), MAX_SETTING_SIZE, result))
|
||||
return result;
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
{
|
||||
if(argText.length())
|
||||
return QString("%1: %2").arg(argName).arg(argText);
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
|
||||
public slots:
|
||||
|
|
|
@ -330,7 +330,7 @@ QString CPUDump::paintContent(QPainter* painter, dsint rowBase, int rowOffset, i
|
|||
if(background.alpha())
|
||||
painter->fillRect(QRect(x, y, w, h), QBrush(background)); //fill background color
|
||||
painter->drawText(QRect(x + 4, y, w - 4, h), Qt::AlignVCenter | Qt::AlignLeft, makeAddrText(cur_addr));
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
return HexDump::paintContent(painter, rowBase, rowOffset, col, x, y, w, h);
|
||||
}
|
||||
|
@ -382,7 +382,7 @@ static QString getTooltipForVa(duint va, int depth)
|
|||
{
|
||||
duint ptr = 0;
|
||||
if(!DbgMemRead(va, &ptr, sizeof(duint)))
|
||||
return "";
|
||||
return QString();
|
||||
|
||||
QString tooltip;
|
||||
/* TODO: if this is enabled, make sure the context menu items also work
|
||||
|
|
|
@ -54,7 +54,7 @@ void CPUInfoBox::setInfoLine(int line, QString text)
|
|||
QString CPUInfoBox::getInfoLine(int line)
|
||||
{
|
||||
if(line < 0 || line > 2)
|
||||
return "";
|
||||
return QString();
|
||||
|
||||
return getCellContent(line, 0);
|
||||
}
|
||||
|
|
|
@ -1692,7 +1692,7 @@ void MainWindow::updateFavouriteTools()
|
|||
static QString stringFormatInline(const QString & format)
|
||||
{
|
||||
if(!DbgFunctions()->StringFormatInline)
|
||||
return "";
|
||||
return QString();
|
||||
char result[MAX_SETTING_SIZE] = "";
|
||||
if(DbgFunctions()->StringFormatInline(format.toUtf8().constData(), MAX_SETTING_SIZE, result))
|
||||
return result;
|
||||
|
|
|
@ -299,7 +299,7 @@ QString MemoryMapView::paintContent(QPainter* painter, dsint rowBase, int rowOff
|
|||
painter->fillRect(QRect(x, y, w - 1, h), QBrush(backgroundColor));
|
||||
painter->setPen(color);
|
||||
painter->drawText(QRect(x + 4, y, getColumnWidth(col) - 4, getRowHeight()), Qt::AlignVCenter | Qt::AlignLeft, wStr);
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
else if(col == 2) //info
|
||||
{
|
||||
|
@ -308,7 +308,7 @@ QString MemoryMapView::paintContent(QPainter* painter, dsint rowBase, int rowOff
|
|||
{
|
||||
painter->setPen(ConfigColor("MemoryMapSectionTextColor"));
|
||||
painter->drawText(QRect(x + 4, y, getColumnWidth(col) - 4, getRowHeight()), Qt::AlignVCenter | Qt::AlignLeft, wStr);
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
else if(col == 4) //CPROT
|
||||
|
@ -318,7 +318,7 @@ QString MemoryMapView::paintContent(QPainter* painter, dsint rowBase, int rowOff
|
|||
{
|
||||
painter->setPen(ConfigColor("MemoryMapSectionTextColor"));
|
||||
painter->drawText(QRect(x + 4, y, getColumnWidth(col) - 4, getRowHeight()), Qt::AlignVCenter | Qt::AlignLeft, wStr);
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
return StdTable::paintContent(painter, rowBase, rowOffset, col, x, y, w, h);
|
||||
|
|
|
@ -1601,7 +1601,7 @@ QString RegistersView::helpRegister(REGISTER_NAME reg)
|
|||
return tr("The TEB of the current thread can be accessed as an offset of segment register FS (x86).\nThe TEB can be used to get a lot of information on the process without calling Win32 API.");
|
||||
#endif //_WIN64
|
||||
default:
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@ QString MHTabWidget::getNativeName(int index)
|
|||
if(window)
|
||||
return window->mNativeName;
|
||||
else
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ QString WatchView::paintContent(QPainter* painter, dsint rowBase, int rowOffset,
|
|||
painter->fillRect(QRect(x, y, w, h), mWatchTriggeredBackgroundColor);
|
||||
painter->setPen(mWatchTriggeredColor); //white text
|
||||
painter->drawText(QRect(x + 4, y, w - 4, h), Qt::AlignVCenter | Qt::AlignLeft, ret);
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
else
|
||||
return ret;
|
||||
|
|
|
@ -1056,7 +1056,7 @@ QString Configuration::shortcutFromConfig(const QString id)
|
|||
{
|
||||
return QString(setting);
|
||||
}
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
|
||||
bool Configuration::shortcutToConfig(const QString id, const QKeySequence shortcut)
|
||||
|
|
|
@ -87,7 +87,7 @@ QString MRUList::getEntry(int index)
|
|||
if(index < mMRUList.size())
|
||||
return mMRUList.at(index);
|
||||
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
|
||||
void MRUList::openFileSlot()
|
||||
|
|
|
@ -51,10 +51,10 @@ QString MenuBuilder::getText(size_t id) const
|
|||
if(container.builder->_containers.size() == 1)
|
||||
return container.builder->getText(0); // recursively get the text inside the menu builder
|
||||
else
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
default: // separator
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue