[haiku-commits] r39818 - haiku/trunk/src/add-ons/print/transports/hp_jetdirect

  • From: michael.w.pfeiffer@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 12 Dec 2010 09:06:19 +0100 (CET)

Author: laplace
Date: 2010-12-12 09:06:19 +0100 (Sun, 12 Dec 2010)
New Revision: 39818
Changeset: http://dev.haiku-os.org/changeset/39818
Ticket: http://dev.haiku-os.org/ticket/6973

Modified:
   
haiku/trunk/src/add-ons/print/transports/hp_jetdirect/HPJetDirectTransport.cpp
Log:
* Bug fix: The configuration dialog was never opened, because it could
  read the attribute "transport_address" created and set to an empty
  string by the print_server when the printer was created. 
  fEndpoint used an empty host name to connect to and then failed.
  Not sure why this caused a crash after closing the error dialog.
  Maybe something went wrong in the destructor using an invalid fEndpoint?
  Cures the symptoms of ticket #6973.


Modified: 
haiku/trunk/src/add-ons/print/transports/hp_jetdirect/HPJetDirectTransport.cpp
===================================================================
--- 
haiku/trunk/src/add-ons/print/transports/hp_jetdirect/HPJetDirectTransport.cpp  
    2010-12-11 20:13:15 UTC (rev 39817)
+++ 
haiku/trunk/src/add-ons/print/transports/hp_jetdirect/HPJetDirectTransport.cpp  
    2010-12-12 08:06:19 UTC (rev 39818)
@@ -29,7 +29,8 @@
 {
        BString address;
 
-       if (printer->ReadAttrString("transport_address", &address) < 0) {
+       if (printer->ReadAttrString("transport_address", &address) < 0
+               || address.Length() == 0) {
                SetupWindow *setup = new SetupWindow(printer);
                if (setup->Go() == B_ERROR)
                        return;


Other related posts:

  • » [haiku-commits] r39818 - haiku/trunk/src/add-ons/print/transports/hp_jetdirect - michael . w . pfeiffer