mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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:
parent
3923f54e10
commit
41089b74a9
1 changed files with 1 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue