forked from qt-creator/qt-creator
Fix warning: "Don't call QList::front() on temporary"
..using constFirst, instead. [-Wclazy-detaching-temporary] Change-Id: I66bd9c19d56dc5dcc7ee0a1f68f4bfd2a3af7326 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -347,7 +347,7 @@ void StackHandler::saveTaskFile()
|
|||||||
while (!file.isOpen()) {
|
while (!file.isOpen()) {
|
||||||
if (fileDialog.exec() != QDialog::Accepted)
|
if (fileDialog.exec() != QDialog::Accepted)
|
||||||
return;
|
return;
|
||||||
const QString fileName = fileDialog.selectedFiles().front();
|
const QString fileName = fileDialog.selectedFiles().constFirst();
|
||||||
file.setFileName(fileName);
|
file.setFileName(fileName);
|
||||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||||
QString msg = tr("Cannot open \"%1\": %2")
|
QString msg = tr("Cannot open \"%1\": %2")
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ void ItemLibraryResourceView::startDrag(Qt::DropActions /* supportedActions */)
|
|||||||
|
|
||||||
auto fileSystemModel = qobject_cast<CustomFileSystemModel*>(model());
|
auto fileSystemModel = qobject_cast<CustomFileSystemModel*>(model());
|
||||||
Q_ASSERT(fileSystemModel);
|
Q_ASSERT(fileSystemModel);
|
||||||
QFileInfo fileInfo = fileSystemModel->fileInfo(selectedIndexes().front());
|
QFileInfo fileInfo = fileSystemModel->fileInfo(selectedIndexes().constFirst());
|
||||||
QPixmap pixmap(fileInfo.absoluteFilePath());
|
QPixmap pixmap(fileInfo.absoluteFilePath());
|
||||||
if (!pixmap.isNull()) {
|
if (!pixmap.isNull()) {
|
||||||
auto drag = new QDrag(this);
|
auto drag = new QDrag(this);
|
||||||
|
|||||||
@@ -624,7 +624,7 @@ void VcsBaseSubmitEditor::slotInsertNickName()
|
|||||||
|
|
||||||
void VcsBaseSubmitEditor::slotSetFieldNickName(int i)
|
void VcsBaseSubmitEditor::slotSetFieldNickName(int i)
|
||||||
{
|
{
|
||||||
if (SubmitFieldWidget *sfw = d->m_widget->submitFieldWidgets().front()) {
|
if (SubmitFieldWidget *sfw = d->m_widget->submitFieldWidgets().constFirst()) {
|
||||||
const QString nick = promptForNickName();
|
const QString nick = promptForNickName();
|
||||||
if (!nick.isEmpty())
|
if (!nick.isEmpty())
|
||||||
sfw->setFieldValue(i, nick);
|
sfw->setFieldValue(i, nick);
|
||||||
|
|||||||
Reference in New Issue
Block a user