From b15f7f0ed5c57af20889f9d39a96f243df93b459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 13 Nov 2010 19:44:03 +0000 Subject: [PATCH] * Removed the output if unarchiving the message failed - since this is used in a translator as well, this might just be expected. * Minor style cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39418 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/libs/icon/message/MessageImporter.cpp | 34 +++++++++++------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/libs/icon/message/MessageImporter.cpp b/src/libs/icon/message/MessageImporter.cpp index 018b733f0e..403b2ccc1d 100644 --- a/src/libs/icon/message/MessageImporter.cpp +++ b/src/libs/icon/message/MessageImporter.cpp @@ -1,10 +1,12 @@ /* - * Copyright 2006-2007, Haiku. All rights reserved. + * Copyright 2006-2010, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus */ + + #include "MessageImporter.h" #include @@ -23,9 +25,10 @@ #include "StyleContainer.h" #include "VectorPath.h" + using std::nothrow; -// constructor + MessageImporter::MessageImporter() #ifdef ICON_O_MATIC : Importer() @@ -33,12 +36,12 @@ MessageImporter::MessageImporter() { } -// destructor + MessageImporter::~MessageImporter() { } -// Import + status_t MessageImporter::Import(Icon* icon, BPositionIO* stream) { @@ -77,11 +80,8 @@ MessageImporter::Import(Icon* icon, BPositionIO* stream) BMessage archive; ret = archive.Unflatten(stream); - if (ret < B_OK) { - printf("MessageImporter::Import() - " - "error unflattening icon archive: %s\n", strerror(ret)); + if (ret != B_OK) return ret; - } // paths PathContainer* paths = icon->Paths(); @@ -112,12 +112,13 @@ MessageImporter::Import(Icon* icon, BPositionIO* stream) return B_OK; } + // #pragma mark - -// _ImportPaths + status_t MessageImporter::_ImportPaths(const BMessage* archive, - PathContainer* paths) const + PathContainer* paths) const { BMessage allPaths; status_t ret = archive->FindMessage("paths", &allPaths); @@ -139,10 +140,10 @@ MessageImporter::_ImportPaths(const BMessage* archive, return ret; } -// _ImportStyles + status_t MessageImporter::_ImportStyles(const BMessage* archive, - StyleContainer* styles) const + StyleContainer* styles) const { BMessage allStyles; status_t ret = archive->FindMessage("styles", &allStyles); @@ -164,12 +165,10 @@ MessageImporter::_ImportStyles(const BMessage* archive, return ret; } -// _ImportShapes + status_t -MessageImporter::_ImportShapes(const BMessage* archive, - PathContainer* paths, - StyleContainer* styles, - ShapeContainer* shapes) const +MessageImporter::_ImportShapes(const BMessage* archive, PathContainer* paths, + StyleContainer* styles, ShapeContainer* shapes) const { BMessage allShapes; status_t ret = archive->FindMessage("shapes", &allShapes); @@ -233,4 +232,3 @@ MessageImporter::_ImportShapes(const BMessage* archive, return ret; } -