Fix Lesson 6 Task 1
This commit is contained in:
parent
1af9c40b2a
commit
0e6e992e05
2 changed files with 3 additions and 3 deletions
|
@ -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");
|
||||||
|
|
|
@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue