* 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
This commit is contained in:
Axel Dörfler 2010-11-13 19:44:03 +00:00
parent 1a5bb78d9e
commit b15f7f0ed5

View File

@ -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. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Stephan Aßmus <superstippi@gmx.de> * Stephan Aßmus <superstippi@gmx.de>
*/ */
#include "MessageImporter.h" #include "MessageImporter.h"
#include <new> #include <new>
@ -23,9 +25,10 @@
#include "StyleContainer.h" #include "StyleContainer.h"
#include "VectorPath.h" #include "VectorPath.h"
using std::nothrow; using std::nothrow;
// constructor
MessageImporter::MessageImporter() MessageImporter::MessageImporter()
#ifdef ICON_O_MATIC #ifdef ICON_O_MATIC
: Importer() : Importer()
@ -33,12 +36,12 @@ MessageImporter::MessageImporter()
{ {
} }
// destructor
MessageImporter::~MessageImporter() MessageImporter::~MessageImporter()
{ {
} }
// Import
status_t status_t
MessageImporter::Import(Icon* icon, BPositionIO* stream) MessageImporter::Import(Icon* icon, BPositionIO* stream)
{ {
@ -77,11 +80,8 @@ MessageImporter::Import(Icon* icon, BPositionIO* stream)
BMessage archive; BMessage archive;
ret = archive.Unflatten(stream); ret = archive.Unflatten(stream);
if (ret < B_OK) { if (ret != B_OK)
printf("MessageImporter::Import() - "
"error unflattening icon archive: %s\n", strerror(ret));
return ret; return ret;
}
// paths // paths
PathContainer* paths = icon->Paths(); PathContainer* paths = icon->Paths();
@ -112,12 +112,13 @@ MessageImporter::Import(Icon* icon, BPositionIO* stream)
return B_OK; return B_OK;
} }
// #pragma mark - // #pragma mark -
// _ImportPaths
status_t status_t
MessageImporter::_ImportPaths(const BMessage* archive, MessageImporter::_ImportPaths(const BMessage* archive,
PathContainer* paths) const PathContainer* paths) const
{ {
BMessage allPaths; BMessage allPaths;
status_t ret = archive->FindMessage("paths", &allPaths); status_t ret = archive->FindMessage("paths", &allPaths);
@ -139,10 +140,10 @@ MessageImporter::_ImportPaths(const BMessage* archive,
return ret; return ret;
} }
// _ImportStyles
status_t status_t
MessageImporter::_ImportStyles(const BMessage* archive, MessageImporter::_ImportStyles(const BMessage* archive,
StyleContainer* styles) const StyleContainer* styles) const
{ {
BMessage allStyles; BMessage allStyles;
status_t ret = archive->FindMessage("styles", &allStyles); status_t ret = archive->FindMessage("styles", &allStyles);
@ -164,12 +165,10 @@ MessageImporter::_ImportStyles(const BMessage* archive,
return ret; return ret;
} }
// _ImportShapes
status_t status_t
MessageImporter::_ImportShapes(const BMessage* archive, MessageImporter::_ImportShapes(const BMessage* archive, PathContainer* paths,
PathContainer* paths, StyleContainer* styles, ShapeContainer* shapes) const
StyleContainer* styles,
ShapeContainer* shapes) const
{ {
BMessage allShapes; BMessage allShapes;
status_t ret = archive->FindMessage("shapes", &allShapes); status_t ret = archive->FindMessage("shapes", &allShapes);
@ -233,4 +232,3 @@ MessageImporter::_ImportShapes(const BMessage* archive,
return ret; return ret;
} }