[Kde-print-devel] [Bug 114402] Slashes in the printer name lead to unwanted tree leaves.
Michael Goffioul
kdeprint_bugs at swing.be
Mon Oct 17 13:06:23 CEST 2005
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=114402
------- Additional Comments From kdeprint_bugs swing be 2005-10-17 13:06 -------
The fix proposed is not the correct one because it would completely disable the usefulness of the TreeComboBox class. As the class name tells it, this class is a combobox with a treeview instead of a listbox. This is used in kdeprint to be able to show printers and instances (pseudo-printers) in a nice tree view where the instances are children of the real printer. The fix proposed completely disabled this.
The problem here is that the printer name uses a slash (which is used in KMPrinter::name() to separate the printer and the instance name) and this is not forseen in the simple handling in KPrintDialog.
A direct fix is to set the 3rd argument of "insertItem()" depending on the virtualness of the printer, that is KMPrinter::isVirtual(). Indeed, if the printer is not virtual, then it should be a top-level item.
OTOH, a problem still exists if this "My B/W printer" printer has an instance defined on it. Here, the code could probably easily adapted by making smart use of the KMPrinter available functions: printerName(), instanceName(), isVirtual()... For example, TreeComboBox::insertItem() could accept a string list (instead of a string that it has to decompose itself) and KPrintDialog could directly give as list {mPrinter->printerName(), mPrinter->instanceName()}.
Michael.
More information about the Kde-print-devel
mailing list