1
0
Fork 0

GUI: slight performance improvements with useless QString allocations

This commit is contained in:
mrexodia 2017-04-20 10:55:06 +02:00
parent 81fd6116b7
commit 09c80658ec
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
15 changed files with 19 additions and 19 deletions

View File

@ -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();
}
/************************************************************************************

View File

@ -665,7 +665,7 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
}
break;
}
return "";
return QString();
}
/************************************************************************************

View File

@ -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)

View File

@ -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;

View File

@ -37,7 +37,7 @@ public:
{
if(argText.length())
return QString("%1: %2").arg(argName).arg(argText);
return "";
return QString();
}
public slots:

View File

@ -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

View File

@ -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);
}

View File

@ -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;

View File

@ -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);

View File

@ -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();
}
}

View File

@ -191,7 +191,7 @@ QString MHTabWidget::getNativeName(int index)
if(window)
return window->mNativeName;
else
return "";
return QString();
}
}

View File

@ -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;

View File

@ -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)

View File

@ -87,7 +87,7 @@ QString MRUList::getEntry(int index)
if(index < mMRUList.size())
return mMRUList.at(index);
return "";
return QString();
}
void MRUList::openFileSlot()

View File

@ -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();
}
}