diff --git a/src/apps/icon-o-matic/document/savers/NativeSaver.cpp b/src/apps/icon-o-matic/document/savers/NativeSaver.cpp index 8fdce21130..fff193fd1e 100644 --- a/src/apps/icon-o-matic/document/savers/NativeSaver.cpp +++ b/src/apps/icon-o-matic/document/savers/NativeSaver.cpp @@ -1,34 +1,48 @@ /* - * Copyright 2007, Haiku. All rights reserved. - * Distributed under the terms of the MIT License. - * - * Authors: - * Stephan Aßmus + * Copyright 2007, 2011, Stephan Aßmus . + * All rights reserved. Distributed under the terms of the MIT License. */ + + #include "NativeSaver.h" +#include +#include + #include "FlatIconFormat.h" #include "MessageExporter.h" -// constructor + NativeSaver::NativeSaver(const entry_ref& ref) - : fAttrSaver(ref, kVectorAttrNodeName), - fFileSaver(new MessageExporter(), ref) + : + SimpleFileSaver(new MessageExporter(), ref), + fAttrSaver(ref, kVectorAttrNodeName) { } -// destructor + NativeSaver::~NativeSaver() { } -// Save + status_t NativeSaver::Save(Document* document) { - status_t ret = fFileSaver.Save(document); - if (ret < B_OK) + status_t ret = SimpleFileSaver::Save(document); + if (ret != B_OK) { + fprintf(stderr, "Error saving icon: %s\n", strerror(ret)); return ret; - return fAttrSaver.Save(document); + } + + WaitForExportThread(); + + ret = fAttrSaver.Save(document); + if (ret != B_OK) { + fprintf(stderr, "Error saving icon attribute: %s\n", strerror(ret)); + return ret; + } + + return B_OK; } diff --git a/src/apps/icon-o-matic/document/savers/NativeSaver.h b/src/apps/icon-o-matic/document/savers/NativeSaver.h index c7a21db7ad..0a2e1eef4e 100644 --- a/src/apps/icon-o-matic/document/savers/NativeSaver.h +++ b/src/apps/icon-o-matic/document/savers/NativeSaver.h @@ -1,17 +1,16 @@ /* - * Copyright 2007, Haiku. All rights reserved. - * Distributed under the terms of the MIT License. - * - * Authors: - * Stephan Aßmus + * Copyright 2007, 2011, Stephan Aßmus . + * All rights reserved. Distributed under the terms of the MIT License. */ #ifndef NATIVE_SAVER_H #define NATIVE_SAVER_H + #include "AttributeSaver.h" #include "SimpleFileSaver.h" -class NativeSaver : public DocumentSaver { + +class NativeSaver : public SimpleFileSaver { public: NativeSaver(const entry_ref& ref); virtual ~NativeSaver(); @@ -20,7 +19,7 @@ class NativeSaver : public DocumentSaver { protected: AttributeSaver fAttrSaver; - SimpleFileSaver fFileSaver; }; + #endif // NATIVE_SAVER_H