[haiku-commits] haiku: hrev51313 - in src: preferences/filetypes kits/network/libnetapi

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 28 Jul 2017 21:21:55 +0200 (CEST)

hrev51313 adds 2 changesets to branch 'master'
old head: f806447f522176845dc655d42cbb5df1c72778ea
new head: b6b792f8cbac46da7088d9d27389f841f205ee61
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=b6b792f8cbac+%5Ef806447f5221

----------------------------------------------------------------------------

615ef07db342: libnetapi: missing NULL check.

                             [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]

b6b792f8cbac: Fixed certain labels not being drawn.
  
  BTextControl was created with label as the first argument and NULL
  as the second, while constructor expects control's name to come
  first and then the label. The fix was to simply add a name
  argument before the label and remove the extra NULL.
  
  Fixes #13636.
  
  Signed-off-by: Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>

                                          [ Wiktor <vikkindhart@xxxxxxxxx> ]

----------------------------------------------------------------------------

2 files changed, 14 insertions(+), 10 deletions(-)
.../UrlProtocolAsynchronousListener.cpp          |  4 ++++
.../filetypes/ApplicationTypeWindow.cpp          | 20 ++++++++++----------

############################################################################

Commit:      615ef07db34208339b36616204f8292b12a45ada
URL:         http://cgit.haiku-os.org/haiku/commit/?id=615ef07db342
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Tue Jul 25 19:08:56 2017 UTC

libnetapi: missing NULL check.

----------------------------------------------------------------------------

diff --git a/src/kits/network/libnetapi/UrlProtocolAsynchronousListener.cpp 
b/src/kits/network/libnetapi/UrlProtocolAsynchronousListener.cpp
index 00c7832..710f0cc 100644
--- a/src/kits/network/libnetapi/UrlProtocolAsynchronousListener.cpp
+++ b/src/kits/network/libnetapi/UrlProtocolAsynchronousListener.cpp
@@ -103,6 +103,10 @@ 
BUrlProtocolAsynchronousListener::MessageReceived(BMessage* message)
                                message->FindMessage("url:result", &archive);
                                BUrlResult* result = dynamic_cast<BUrlResult*>(
                                        instantiate_object(&archive));
+                               if (result == NULL) {
+                                       debugger("Failed to unarchive 
BUrlResult");
+                                       result = new BUrlResult();
+                               }
                                HeadersReceived(caller, *result);
                                delete result;
                        }

############################################################################

Revision:    hrev51313
Commit:      b6b792f8cbac46da7088d9d27389f841f205ee61
URL:         http://cgit.haiku-os.org/haiku/commit/?id=b6b792f8cbac
Author:      Wiktor <vikkindhart@xxxxxxxxx>
Date:        Fri Jul 28 08:36:33 2017 UTC
Committer:   Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Commit-Date: Fri Jul 28 19:21:56 2017 UTC

Ticket:      https://dev.haiku-os.org/ticket/13636

Fixed certain labels not being drawn.

BTextControl was created with label as the first argument and NULL
as the second, while constructor expects control's name to come
first and then the label. The fix was to simply add a name
argument before the label and remove the extra NULL.

Fixes #13636.

Signed-off-by: Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/src/preferences/filetypes/ApplicationTypeWindow.cpp 
b/src/preferences/filetypes/ApplicationTypeWindow.cpp
index 865ea5e..f92534c 100644
--- a/src/preferences/filetypes/ApplicationTypeWindow.cpp
+++ b/src/preferences/filetypes/ApplicationTypeWindow.cpp
@@ -330,8 +330,8 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint 
position,
 
        // Signature
 
-       fSignatureControl = new BTextControl(B_TRANSLATE("Signature:"), NULL,
-               new BMessage(kMsgSignatureChanged));
+       fSignatureControl = new BTextControl("signature",
+               B_TRANSLATE("Signature:"), new BMessage(kMsgSignatureChanged));
        fSignatureControl->SetModificationMessage(
                new BMessage(kMsgSignatureChanged));
 
@@ -424,15 +424,15 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint 
position,
        BBox* versionBox = new BBox("versionBox");
        versionBox->SetLabel(B_TRANSLATE("Version info"));
 
-       fMajorVersionControl = new BTextControl(B_TRANSLATE("Version:"),
-               NULL, NULL, new BMessage(kMsgVersionInfoChanged));
+       fMajorVersionControl = new BTextControl("version major",
+               B_TRANSLATE("Version:"), NULL, new 
BMessage(kMsgVersionInfoChanged));
        _MakeNumberTextControl(fMajorVersionControl);
 
-       fMiddleVersionControl = new BTextControl(".", NULL, NULL,
+       fMiddleVersionControl = new BTextControl("version middle", ".", NULL,
                new BMessage(kMsgVersionInfoChanged));
        _MakeNumberTextControl(fMiddleVersionControl);
 
-       fMinorVersionControl = new BTextControl(".", NULL, NULL,
+       fMinorVersionControl = new BTextControl("version minor", ".", NULL,
                new BMessage(kMsgVersionInfoChanged));
        _MakeNumberTextControl(fMinorVersionControl);
 
@@ -453,11 +453,11 @@ ApplicationTypeWindow::ApplicationTypeWindow(BPoint 
position,
                new BMessage(kMsgVersionInfoChanged)));
 
        BMenuField* varietyField = new BMenuField("", fVarietyMenu);
-       fInternalVersionControl = new BTextControl("/", NULL, NULL,
+       fInternalVersionControl = new BTextControl("version internal", "/", 
NULL,
+               new BMessage(kMsgVersionInfoChanged));
+       fShortDescriptionControl = new BTextControl("short description",
+               B_TRANSLATE("Short description:"), NULL,
                new BMessage(kMsgVersionInfoChanged));
-       fShortDescriptionControl =
-               new BTextControl(B_TRANSLATE("Short description:"), NULL, NULL,
-                       new BMessage(kMsgVersionInfoChanged));
 
        // TODO: workaround for a GCC 4.1.0 bug? Or is that really what the 
standard says?
        version_info versionInfo;


Other related posts:

  • » [haiku-commits] haiku: hrev51313 - in src: preferences/filetypes kits/network/libnetapi - pulkomandy