Fix Lesson 6 Task 1

This commit is contained in:
Stanislav Mykhailenko 2024-07-29 23:48:07 +03:00
parent 1af9c40b2a
commit 0e6e992e05
GPG key ID: 1E95E66A9C9D6A36
2 changed files with 3 additions and 3 deletions

View file

@ -26,12 +26,12 @@ void Client::sendFile()
QFileInfo fi(m_fileName); QFileInfo fi(m_fileName);
if (file.open(QIODevice::ReadOnly)) { if (file.open(QIODevice::ReadOnly)) {
m_socket->write((fi.fileName() + '\n').toLocal8Bit()); m_socket->write((fi.fileName() + '\n').toUtf8());
QTextStream in(&file); QTextStream in(&file);
while (!in.atEnd()) while (!in.atEnd())
m_socket->write((in.readLine() + '\n').toLocal8Bit()); m_socket->write((in.readLine() + '\n').toUtf8());
} }
ui->l_status->setText("File sent"); ui->l_status->setText("File sent");

View file

@ -58,7 +58,7 @@ void Server::messageFromClient()
QFile file(fileName); QFile file(fileName);
if (file.open(QIODevice::Append)) { if (file.open(QIODevice::Append)) {
for (int line = 0; line < lines.size(); ++ line) { for (int line = 0; line < lines.size(); ++ line) {
file.write((lines[line] + '\n').toLocal8Bit()); file.write((lines[line] + '\n').toUtf8());
} }
} }