Author: axeld Date: 2010-11-13 20:44:03 +0100 (Sat, 13 Nov 2010) New Revision: 39418 Changeset: http://dev.haiku-os.org/changeset/39418 Modified: haiku/trunk/src/libs/icon/message/MessageImporter.cpp Log: * 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. Modified: haiku/trunk/src/libs/icon/message/MessageImporter.cpp =================================================================== --- haiku/trunk/src/libs/icon/message/MessageImporter.cpp 2010-11-13 15:15:35 UTC (rev 39417) +++ haiku/trunk/src/libs/icon/message/MessageImporter.cpp 2010-11-13 19:44:03 UTC (rev 39418) @@ -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 <superstippi@xxxxxx> */ + + #include "MessageImporter.h" #include <new> @@ -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 @@ { } -// destructor + MessageImporter::~MessageImporter() { } -// Import + status_t MessageImporter::Import(Icon* icon, BPositionIO* stream) { @@ -77,11 +80,8 @@ 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 @@ 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 @@ 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 @@ 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 @@ return ret; } -