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 24 CleanUpPathCommand::CleanUpPathCommand(VectorPath* path) 25 : PathCommand(path), 26 fOriginalPath() 27 { 28 if (fPath) 29 fOriginalPath = *fPath; 30 } 31 32 // destructor 33 CleanUpPathCommand::~CleanUpPathCommand() 34 { 35 } 36 37 // Perform 38 status_t 39 CleanUpPathCommand::Perform() 40 { 41 fPath->CleanUp(); 42 43 return B_OK; 44 } 45 46 // Undo 47 status_t 48 CleanUpPathCommand::Undo() 49 { 50 *fPath = fOriginalPath; 51 52 return B_OK; 53 } 54 55 // GetName 56 void 57 CleanUpPathCommand::GetName(BString& name) 58 { 59 name << B_TRANSLATE("Clean Up Path"); 60 } 61