Use copy ctor instead of conversion through QChar*

Versions of Qt < 4.7 do not have a QString constructor from QChar*
without specifying the size of the string. However, since the QString
is copy-on-write, the QString object can be passed to the copy
constructor of the return value directly!
This commit is contained in:
Roland Kaufmann 2012-07-06 12:29:36 +02:00
parent 2c9695e594
commit ec7057eb78

View File

@ -295,7 +295,7 @@ QString RifEclipseOutputFileTools::fileNameByType(const QStringList& fileSet, ec
int reportNumber = -1;
if (ecl_util_get_file_type(fileSet.at(i).toAscii().data(), &formatted, &reportNumber) == fileType)
{
return QString(fileSet.at(i).data());
return fileSet.at(i);
}
}
@ -319,7 +319,7 @@ QStringList RifEclipseOutputFileTools::fileNamesByType(const QStringList& fileSe
int reportNumber = -1;
if (ecl_util_get_file_type(fileSet.at(i).toAscii().data(), &formatted, &reportNumber) == fileType)
{
fileNames.append(QString(fileSet.at(i).data()));
fileNames.append(fileSet.at(i));
}
}