[prev in list] [next in list] [prev in thread] [next in thread]
List: gentoo-desktop
Subject: [gentoo-desktop] kde 3.5.10 cups printer description patch
From: "A.O.Prokofiev" <alexpro () itp ! ac ! ru>
Date: 2010-02-27 8:32:01
Message-ID: 201002271132.02085.alexpro () itp ! ac ! ru
[Download RAW message or body]
Hello,
There is a minor problem when using CUPS as a print system:
printer description and location fields are stored as UTF8 in CUPS,
while kde thinks it's in local encoding.
Thus, when having 8-bit locale and printer description in national language,
those strings are shown as garbage in print dialog.
Attached patch solves this problem.
--
With regards, A.Prokofiev.
["kde-cups.patch" (text/x-diff)]
diff -ur 1/kdeprint/cups/ipprequest.cpp 2/kdeprint/cups/ipprequest.cpp
--- kdeprint/cups/ipprequest.cpp 2007-01-15 14:34:19.000000000 +0300
+++ kdeprint/cups/ipprequest.cpp 2007-05-08 14:37:01.000000000 +0400
@@ -260,7 +260,7 @@
ipp_attribute_t *attr = ippFindAttribute(request_, name.latin1(), (ipp_tag_t)type);
if (attr)
{
- value = QString::fromLocal8Bit(attr->values[0].string.text);
+ value = QString::fromUtf8(attr->values[0].string.text);
return true;
}
else return false;
@@ -274,7 +274,7 @@
if (attr)
{
for (int i=0;i<attr->num_values;i++)
- values.append(QString::fromLocal8Bit(attr->values[i].string.text));
+ values.append(QString::fromUtf8(attr->values[i].string.text));
return true;
}
else return false;
diff -ur 1/kdeprint/cups/kmcupsmanager.cpp 2/kdeprint/cups/kmcupsmanager.cpp
--- kdeprint/cups/kmcupsmanager.cpp 2007-01-15 14:34:19.000000000 +0300
+++ kdeprint/cups/kmcupsmanager.cpp 2007-05-08 14:37:36.000000000 +0400
@@ -482,7 +482,7 @@
QString attrname(attr->name);
if (attrname == "printer-name")
{
- QString value = QString::fromLocal8Bit(attr->values[0].string.text);
+ QString value = QString::fromUtf8(attr->values[0].string.text);
printer->setName(value);
printer->setPrinterName(value);
}
@@ -512,7 +512,7 @@
}
else if (attrname == "printer-location")
{
- printer->setLocation(QString::fromLocal8Bit(attr->values[0].string.text));
+ printer->setLocation(QString::fromUtf8(attr->values[0].string.text));
}
else if (attrname == "printer-is-accepting-jobs")
{
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic