Commit 64a2fa2a authored by Alessandro Portale's avatar Alessandro Portale
Browse files

Use QLatin1String and QLatin1Char

parent 1181765a
......@@ -48,7 +48,7 @@ SearchResultTreeItemDelegate::SearchResultTreeItemDelegate(QObject *parent)
void SearchResultTreeItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
if (index.model()->data(index, ItemDataRoles::TypeRole).toString().compare("file") == 0) {
if (index.model()->data(index, ItemDataRoles::TypeRole).toString().compare(QLatin1String("file")) == 0) {
QItemDelegate::paint(painter, option, index);
} else {
painter->save();
......@@ -92,7 +92,7 @@ int SearchResultTreeItemDelegate::drawLineNumber(QPainter *painter, const QStyle
int lineNumber = index.model()->data(index, ItemDataRoles::ResultLineNumberRole).toInt();
int lineNumberDigits = (int)floor(log10((double)lineNumber)) + 1;
int minimumLineNumberDigits = qMax((int)m_minimumLineNumberDigits, lineNumberDigits);
int fontWidth = painter->fontMetrics().width(QString(minimumLineNumberDigits, '0'));
int fontWidth = painter->fontMetrics().width(QString(minimumLineNumberDigits, QLatin1Char('0')));
int lineNumberAreaWidth = lineNumberAreaHorizontalPadding + fontWidth + lineNumberAreaHorizontalPadding;
QRect lineNumberAreaRect(option.rect);
lineNumberAreaRect.setWidth(lineNumberAreaWidth);
......
......@@ -48,7 +48,7 @@ SearchResultTreeModel::SearchResultTreeModel(QObject *parent)
, m_showReplaceUI(false)
{
m_rootItem = new SearchResultTreeItem;
m_textEditorFont = QFont("Courier");
m_textEditorFont = QFont(QLatin1String("Courier"));
}
SearchResultTreeModel::~SearchResultTreeModel()
......@@ -212,7 +212,7 @@ QVariant SearchResultTreeModel::data(const SearchResultTextRow *row, int role) c
result = row->searchTermLength();
break;
case ItemDataRoles::TypeRole:
result = "row";
result = QLatin1String("row");
break;
case ItemDataRoles::FileNameRole:
{
......
......@@ -77,7 +77,7 @@ void SearchResultTreeView::appendResultLines(const QList<Find::SearchResultItem>
void SearchResultTreeView::emitJumpToSearchResult(const QModelIndex &index)
{
if (model()->data(index, ItemDataRoles::TypeRole).toString().compare("row") != 0)
if (model()->data(index, ItemDataRoles::TypeRole).toString().compare(QLatin1String("row")) != 0)
return;
int position = model()->data(index, ItemDataRoles::ResultIndexRole).toInt();
......
......@@ -113,7 +113,7 @@ SearchResultWindow::SearchResultWindow() : d(new SearchResultWindowPrivate)
d->m_expandCollapseToolButton = new QToolButton(d->m_widget);
d->m_expandCollapseToolButton->setAutoRaise(true);
d->m_expandCollapseToolButton->setCheckable(true);
d->m_expandCollapseToolButton->setIcon(QIcon(":/find/images/expand.png"));
d->m_expandCollapseToolButton->setIcon(QIcon(QLatin1String(":/find/images/expand.png")));
d->m_expandCollapseToolButton->setToolTip(tr("Expand All"));
d->m_replaceLabel = new QLabel(tr("Replace with:"), d->m_widget);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment