Commit 01fe91f5 authored by Rolf Eike Beer's avatar Rolf Eike Beer
Browse files

replace usage of QString::toAscii() with QString::toLatin1()

parent 65514177
......@@ -122,7 +122,7 @@ void KgpgEditor::openDocumentFile(const QUrl &url, const QString &encoding)
if(!downloadJob->error())
{
QTextStream t(downloadJob->data());
t.setCodec(encoding.toAscii());
t.setCodec(encoding.toLatin1());
m_editor->setPlainText(t.readAll());
m_docname = url;
m_textchanged = false;
......@@ -285,7 +285,7 @@ bool KgpgEditor::slotFileSave()
if (filn.isEmpty())
return slotFileSaveAs();
QTextCodec *cod = QTextCodec::codecForName(m_textencoding.toAscii());
QTextCodec *cod = QTextCodec::codecForName(m_textencoding.toLatin1());
if (cod == Q_NULLPTR) {
KMessageBox::sorry(this, i18n("The document could not been saved, as the selected codec is not supported."));
......@@ -597,7 +597,7 @@ void KgpgEditor::slotSelectAll()
void KgpgEditor::slotSetCharset()
{
if (!m_encodingaction->isChecked())
m_editor->setPlainText(QString::fromUtf8(m_editor->toPlainText().toAscii()));
m_editor->setPlainText(QString::fromUtf8(m_editor->toPlainText().toLatin1()));
else
{
if (checkEncoding(QTextCodec::codecForLocale()))
......
......@@ -177,7 +177,7 @@ KGpgSearchResultModelPrivate::urlDecode(const QString &line)
if (!line.contains(QLatin1Char( '%' )))
return line;
QByteArray tmp(line.toAscii());
QByteArray tmp(line.toLatin1());
const QRegExp hex( QLatin1String( "[A-F0-9]{2}" )); // URL-encoding uses only uppercase
int pos = -1; // avoid error if '%' is URL-encoded
......
......@@ -52,7 +52,7 @@ KGpgAddUid::nextLine(const QString &line)
} else if (line.contains(QLatin1String( "keygen.name" ))) {
write(m_name.toUtf8());
} else if (line.contains(QLatin1String( "keygen.email" ))) {
write(m_email.toAscii());
write(m_email.toLatin1());
} else if (line.contains(QLatin1String( "keygen.comment" ))) {
write(m_comment.toUtf8());
} else {
......
......@@ -170,7 +170,7 @@ KGpgExport::nextLine(const QString &line)
{
// key exporting does not send any messages
m_data.append(line.toAscii() + '\n');
m_data.append(line.toLatin1() + '\n');
if (m_outputmode != 2)
setSuccess(TS_MSG_SEQUENCE);
......
......@@ -96,7 +96,7 @@ KGpgGenerateKey::postStart()
if (!m_email.isEmpty()) {
keymessage.append("\nName-Email: ");
keymessage.append(m_email.toAscii());
keymessage.append(m_email.toLatin1());
}
if (!m_comment.isEmpty()) {
......@@ -125,7 +125,7 @@ KGpgGenerateKey::postStart()
usage << QLatin1String("encrypt");
if (m_capabilities & KgpgCore::SKT_SIGNATURE)
usage << QLatin1String("sign");
keymessage.append(usage.join(QLatin1String(" ")).toAscii());
keymessage.append(usage.join(QLatin1String(" ")).toLatin1());
}
keymessage.append("\nPassphrase: ");
......
......@@ -67,7 +67,7 @@ KGpgTextOrFileTransaction::setText(const QString &text)
const QString charset = QLatin1String("Charset: ");
if (text.mid(begin, charset.length()) == charset) {
QString cs = text.mid(begin + charset.length(), nextlf - begin - charset.length());
if (!getProcess()->setCodec(cs.toAscii()))
if (!getProcess()->setCodec(cs.toLatin1()))
qCDebug(KGPG_LOG_GENERAL) << "unsupported charset found in header" << cs;
break;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment