public inbox for gentoo-desktop@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-desktop] kde 3.5.10 cups printer description patch
@ 2010-02-27  8:32 A.O.Prokofiev
  0 siblings, 0 replies; only message in thread
From: A.O.Prokofiev @ 2010-02-27  8:32 UTC (permalink / raw
  To: gentoo-desktop

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

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.


[-- Attachment #2: kde-cups.patch --]
[-- Type: text/x-diff, Size: 1566 bytes --]

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")
 		{

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-02-27  9:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-27  8:32 [gentoo-desktop] kde 3.5.10 cups printer description patch A.O.Prokofiev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox