1/*
2 * Copyright 2006, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Stephan A��mus <superstippi@gmx.de>
7 */
8
9#include "CleanUpPathCommand.h"
10
11#include <stdio.h>
12
13#include <Catalog.h>
14#include <Locale.h>
15
16#include "VectorPath.h"
17
18
19#undef B_TRANSLATION_CONTEXT
20#define B_TRANSLATION_CONTEXT "Icon-O-Matic-CleanUpPathCmd"
21
22
23// constructor
24CleanUpPathCommand::CleanUpPathCommand(VectorPath* path)
25	: PathCommand(path),
26	  fOriginalPath()
27{
28	if (fPath)
29		fOriginalPath = *fPath;
30}
31
32// destructor
33CleanUpPathCommand::~CleanUpPathCommand()
34{
35}
36
37// Perform
38status_t
39CleanUpPathCommand::Perform()
40{
41	fPath->CleanUp();
42
43	return B_OK;
44}
45
46// Undo
47status_t
48CleanUpPathCommand::Undo()
49{
50	*fPath = fOriginalPath;
51
52	return B_OK;
53}
54
55// GetName
56void
57CleanUpPathCommand::GetName(BString& name)
58{
59	name << B_TRANSLATE("Clean up path");
60}
61