- Timestamp:
- 12/31/08 18:23:22 (4 years ago)
- Parents:
- 215618cb3db4556e21f4040ae192e01f100fde03
- Children:
- c66abc31de85dace6d89600a4638b1993978f0e4
- git-committer:
- Armin Burgmeier <armin@arbur.net> / 2008-12-31T18:23:22Z+0100
- Files:
-
- 1 modified
-
code/operations/operations.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
code/operations/operations.cpp
r215618c r9a8cd27 44 44 } 45 45 46 Gobby::Operation s::Operation*46 Gobby::OperationNew* 47 47 Gobby::Operations::create_directory(InfcBrowser* browser, 48 48 InfcBrowserIter* parent, … … 56 56 } 57 57 58 Gobby::Operation s::Operation*58 Gobby::OperationNew* 59 59 Gobby::Operations::create_document(InfcBrowser* browser, 60 60 InfcBrowserIter* parent, … … 68 68 } 69 69 70 Gobby::Operation s::Operation*70 Gobby::OperationOpen* 71 71 Gobby::Operations::create_document(InfcBrowser* browser, 72 72 InfcBrowserIter* parent, … … 84 84 } 85 85 86 Gobby::Operation s::Operation*86 Gobby::OperationSave* 87 87 Gobby::Operations::save_document(DocWindow& document, 88 88 Folder& folder, … … 91 91 DocumentInfoStorage::EolStyle eol_style) 92 92 { 93 OperationSave* prev_op = get_save_operation_for_document(document); 94 95 // Cancel previous save operation: 96 if(prev_op != NULL) 97 fail_operation(prev_op); 98 93 99 OperationSave* op = new OperationSave(*this, document, folder, uri, 94 100 encoding, eol_style); 95 101 96 102 m_operations.insert(op); 103 m_signal_begin_save_operation.emit(op); 97 104 return op; 98 105 } 99 106 100 Gobby::Operation s::Operation*107 Gobby::OperationDelete* 101 108 Gobby::Operations::delete_node(InfcBrowser* browser, 102 109 InfcBrowserIter* iter) … … 107 114 } 108 115 109 void Gobby::Operations::remove_operation(Operation* operation) 116 Gobby::OperationSave* 117 Gobby::Operations::get_save_operation_for_document(DocWindow& document) 118 { 119 for(OperationSet::iterator iter = m_operations.begin(); 120 iter != m_operations.end(); ++ iter) 121 { 122 Operation* op = *iter; 123 OperationSave* save_op = dynamic_cast<OperationSave*>(op); 124 if(save_op != NULL) 125 { 126 if(save_op->get_document() == &document) 127 return save_op; 128 } 129 } 130 131 return NULL; 132 } 133 134 void Gobby::Operations::finish_operation(Operation* operation) 110 135 { 111 136 m_operations.erase(operation); 137 operation->signal_finished().emit(true); 112 138 delete operation; 113 139 } 140 141 void Gobby::Operations::fail_operation(Operation* operation) 142 { 143 m_operations.erase(operation); 144 operation->signal_finished().emit(false); 145 delete operation; 146 }
