Cleanup: don't use QByteArray::data() to create copy

QByteArray::data() provides access to the underlying data
for direct manipulation. Thus, the construct
	csv = fileNamePtr.data();
found in MainWindow::importTxtFiles() suggests that modifications
to csv also affect fileNamePtr. This is *not* the case, because
csv itself is a QByteArray. It is therefore constructed from
the data.

Replace this treacherous construct by a simple assignment.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-09-29 21:48:59 +02:00 committed by Dirk Hohndel
parent 3923f54e10
commit 41089b74a9

View file

@ -1752,8 +1752,7 @@ void MainWindow::importTxtFiles(const QStringList fileNames)
QByteArray fileNamePtr, csv;
for (int i = 0; i < fileNames.size(); ++i) {
fileNamePtr = QFile::encodeName(fileNames.at(i));
csv = fileNamePtr.data();
csv = fileNamePtr = QFile::encodeName(fileNames.at(i));
csv.replace(csv.size() - 3, 3, "csv");
QFileInfo check_file(csv);