mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-18 01:54:25 -05:00
Replaced deprecated QTextStream::setCodec by QTextStream::setEncoding
This commit is contained in:
parent
47916ee8c0
commit
6652d7f4f8
7 changed files with 30 additions and 0 deletions
|
|
@ -352,7 +352,11 @@ void HomePage::saveCert()
|
||||||
//Todo: move save to file to p3Peers::SaveCertificateToFile
|
//Todo: move save to file to p3Peers::SaveCertificateToFile
|
||||||
|
|
||||||
QTextStream ts(&file);
|
QTextStream ts(&file);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
|
||||||
|
ts.setEncoding(QStringConverter::Utf8);
|
||||||
|
#else
|
||||||
ts.setCodec(QTextCodec::codecForName("UTF-8"));
|
ts.setCodec(QTextCodec::codecForName("UTF-8"));
|
||||||
|
#endif
|
||||||
ts << ui->retroshareid->text();
|
ts << ui->retroshareid->text();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1763,7 +1763,11 @@ bool ChatWidget::fileSave()
|
||||||
if (!file.open(QFile::WriteOnly))
|
if (!file.open(QFile::WriteOnly))
|
||||||
return false;
|
return false;
|
||||||
QTextStream ts(&file);
|
QTextStream ts(&file);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
|
||||||
|
ts.setEncoding(QStringConverter::Utf8);
|
||||||
|
#else
|
||||||
ts.setCodec(QTextCodec::codecForName("UTF-8"));
|
ts.setCodec(QTextCodec::codecForName("UTF-8"));
|
||||||
|
#endif
|
||||||
ts << ui->textBrowser->document()->toPlainText();
|
ts << ui->textBrowser->document()->toPlainText();
|
||||||
ui->textBrowser->document()->setModified(false);
|
ui->textBrowser->document()->setModified(false);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -1419,7 +1419,11 @@ bool NewFriendList::exportFriendlist(QString &fileName)
|
||||||
root.appendChild(groups);
|
root.appendChild(groups);
|
||||||
|
|
||||||
QTextStream ts(&file);
|
QTextStream ts(&file);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
|
||||||
|
ts.setEncoding(QStringConverter::Utf8);
|
||||||
|
#else
|
||||||
ts.setCodec("UTF-8");
|
ts.setCodec("UTF-8");
|
||||||
|
#endif
|
||||||
ts << doc.toString();
|
ts << doc.toString();
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -311,7 +311,11 @@ bool RsCollection::save(const QString& fileName) const
|
||||||
xml_doc.appendChild(root);
|
xml_doc.appendChild(root);
|
||||||
|
|
||||||
QTextStream stream(&file) ;
|
QTextStream stream(&file) ;
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
|
||||||
|
stream.setEncoding(QStringConverter::Utf8);
|
||||||
|
#else
|
||||||
stream.setCodec("UTF-8") ;
|
stream.setCodec("UTF-8") ;
|
||||||
|
#endif
|
||||||
|
|
||||||
stream << xml_doc.toString() ;
|
stream << xml_doc.toString() ;
|
||||||
file.close();
|
file.close();
|
||||||
|
|
|
||||||
|
|
@ -2403,8 +2403,13 @@ bool MessageComposer::fileSave()
|
||||||
if (!file.open(QFile::WriteOnly))
|
if (!file.open(QFile::WriteOnly))
|
||||||
return false;
|
return false;
|
||||||
QTextStream ts(&file);
|
QTextStream ts(&file);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
|
||||||
|
ts.setEncoding(QStringConverter::Utf8);
|
||||||
|
ts << ui.msgText->document()->toHtml();
|
||||||
|
#else
|
||||||
ts.setCodec(QTextCodec::codecForName("UTF-8"));
|
ts.setCodec(QTextCodec::codecForName("UTF-8"));
|
||||||
ts << ui.msgText->document()->toHtml("UTF-8");
|
ts << ui.msgText->document()->toHtml("UTF-8");
|
||||||
|
#endif
|
||||||
std::cerr << "Setting modified 002 = false" << std::endl;
|
std::cerr << "Setting modified 002 = false" << std::endl;
|
||||||
ui.msgText->document()->setModified(false);
|
ui.msgText->document()->setModified(false);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -802,8 +802,13 @@ void MessageWidget::saveAs()
|
||||||
if (!file.open(QFile::WriteOnly))
|
if (!file.open(QFile::WriteOnly))
|
||||||
return;
|
return;
|
||||||
QTextStream ts(&file);
|
QTextStream ts(&file);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
|
||||||
|
ts.setEncoding(QStringConverter::Utf8);
|
||||||
|
ts << ui.msgText->document()->toHtml();
|
||||||
|
#else
|
||||||
ts.setCodec(QTextCodec::codecForName("UTF-8"));
|
ts.setCodec(QTextCodec::codecForName("UTF-8"));
|
||||||
ts << ui.msgText->document()->toHtml("UTF-8");
|
ts << ui.msgText->document()->toHtml("UTF-8");
|
||||||
|
#endif
|
||||||
ui.msgText->document()->setModified(false);
|
ui.msgText->document()->setModified(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,11 @@ bool CryptoPage::fileSave()
|
||||||
if (!file.open(QFile::WriteOnly))
|
if (!file.open(QFile::WriteOnly))
|
||||||
return false;
|
return false;
|
||||||
QTextStream ts(&file);
|
QTextStream ts(&file);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
|
||||||
|
ts.setEncoding(QStringConverter::Utf8);
|
||||||
|
#else
|
||||||
ts.setCodec(QTextCodec::codecForName("UTF-8"));
|
ts.setCodec(QTextCodec::codecForName("UTF-8"));
|
||||||
|
#endif
|
||||||
ts << ui.certplainTextEdit->document()->toPlainText();
|
ts << ui.certplainTextEdit->document()->toPlainText();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue