From kde-commits Thu Oct 24 13:07:31 2013 From: Konstantinos Smanis Date: Thu, 24 Oct 2013 13:07:31 +0000 To: kde-commits Subject: [kcm-grub2] src: *FIXED: Setting the default entry when containing non-ASCII characters. Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=138262006014357 Git commit 224140b28a3db0be745c404f61905f417f51fe4e by Konstantinos Smanis. Committed on 24/10/2013 at 13:03. Pushed by ksmanis into branch 'master'. *FIXED: Setting the default entry when containing non-ASCII characters. Excerpt from GRUB documentation: "GRUB uses UTF-8 internally other than in rendering where some GRUB-specific appropriate representation is used. All text files (including config) are assumed to be encoded in UTF-8." M +4 -4 src/kcm_grub2.cpp http://commits.kde.org/kcm-grub2/224140b28a3db0be745c404f61905f417f51fe4e diff --git a/src/kcm_grub2.cpp b/src/kcm_grub2.cpp index 87c7cc5..2a8fdbf 100644 --- a/src/kcm_grub2.cpp +++ b/src/kcm_grub2.cpp @@ -466,8 +466,8 @@ void KCMGRUB2::save() = Action saveAction("org.kde.kcontrol.kcmgrub2.save"); saveAction.setHelperID("org.kde.kcontrol.kcmgrub2"); - saveAction.addArgument("rawConfigFileContents", configFileContents.toL= ocal8Bit()); - saveAction.addArgument("rawDefaultEntry", !m_entries.isEmpty() ? grubD= efault : m_settings.value("GRUB_DEFAULT").toLocal8Bit()); + saveAction.addArgument("rawConfigFileContents", configFileContents.toU= tf8()); + saveAction.addArgument("rawDefaultEntry", !m_entries.isEmpty() ? grubD= efault.toUtf8() : m_settings.value("GRUB_DEFAULT").toUtf8()); if (ui->kcombobox_language->currentIndex() > 0) { saveAction.addArgument(QLatin1String("LANG"), qgetenv("LANG")); saveAction.addArgument(QLatin1String("LANGUAGE"), m_settings.value= (QLatin1String("LANGUAGE"))); @@ -500,7 +500,7 @@ void KCMGRUB2::save() dialog->setModal(true); dialog->setDefaultButton(KDialog::Ok); dialog->setEscapeButton(KDialog::Ok); - KMessageBox::createKMessageBox(dialog, QMessageBox::Information, i= 18nc("@info", "Successfully saved GRUB settings."), QStringList(), QString(= ), 0, KMessageBox::Notify, reply.data().value("output").toString()); // kra= zy:exclude=3Dqclasses + KMessageBox::createKMessageBox(dialog, QMessageBox::Information, i= 18nc("@info", "Successfully saved GRUB settings."), QStringList(), QString(= ), 0, KMessageBox::Notify, QString::fromUtf8(reply.data().value("output").t= oByteArray())); // krazy:exclude=3Dqclasses load(); } else { KMessageBox::detailedError(this, i18nc("@info", "Failed to save GR= UB settings."), reply.errorDescription()); @@ -1134,7 +1134,7 @@ void KCMGRUB2::processReply(ActionReply &reply) errorMessage =3D i18nc("@info", "The process crashed."); break; default: - errorMessage =3D QString::fromLocal8Bit(reply.data().value(QLatin1= String("output")).toByteArray()); + errorMessage =3D QString::fromUtf8(reply.data().value(QLatin1Strin= g("output")).toByteArray()); break; } reply.addData(QLatin1String("errorMessage"), errorMessage);