MCPcopy Create free account
hub / github.com/SpartanJ/eepp / saveAllProcess

Method saveAllProcess

src/tools/ecode/ecode.cpp:155–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155void App::saveAllProcess() {
156 if ( mTmpDocs.empty() )
157 return;
158
159 mSplitter->forEachEditorStoppable( [this]( UICodeEditor* editor ) {
160 if ( editor->getDocument().isDirty() &&
161 std::find( mTmpDocs.begin(), mTmpDocs.end(), &editor->getDocument() ) !=
162 mTmpDocs.end() ) {
163 if ( editor->getDocument().hasFilepath() ) {
164 editor->save();
165 updateEditorTabTitle( editor );
166 if ( mSplitter->getCurEditor() == editor )
167 updateEditorTitle( editor );
168 mTmpDocs.erase( &editor->getDocument() );
169 } else {
170 UIFileDialog* dialog = saveFileDialog( editor, false );
171 dialog->on( Event::SaveFile, [this, editor]( const Event* ) {
172 updateEditorTabTitle( editor );
173 if ( mSplitter->getCurEditor() == editor )
174 updateEditorTitle( editor );
175 } );
176 dialog->on( Event::OnWindowClose, [this, editor]( const Event* ) {
177 mTmpDocs.erase( &editor->getDocument() );
178 if ( App::instance() && !SceneManager::instance()->isShuttingDown() &&
179 !mTmpDocs.empty() )
180 saveAllProcess();
181 } );
182 return true;
183 }
184 }
185 return false;
186 } );
187}
188
189void App::saveAll() {
190 mTmpDocs.clear();

Callers

nothing calls this directly

Calls 13

findFunction · 0.85
getDocumentMethod · 0.80
hasFilepathMethod · 0.80
getCurEditorMethod · 0.80
emptyMethod · 0.45
isDirtyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
saveMethod · 0.45
eraseMethod · 0.45
onMethod · 0.45

Tested by

no test coverage detected