MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / should_ask_before_closing

Method should_ask_before_closing

src/World.cpp:650–662  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

648}
649
650bool World::should_ask_before_closing() {
651 // If it's a client that didn't save to a file previously, we can ignore asking before quitting (probably don't intend to save anyway)
652 // If it's a server or a client, and the previous statement is false, we should always ask before quitting because the data could be modified by someone on the network
653 // If it's a local file, ask before quitting if we detect any local changes
654 // If on web version, don't ask before closing
655#ifdef __EMSCRIPTEN__
656 return false;
657#else
658 if(netClient || netServer)
659 return !(netClient && filePath.empty());
660 return hasUnsavedLocalChanges;
661#endif
662}
663
664void World::set_has_unsaved_local_changes(bool newHasUnsavedLocalChangesVal) {
665 bool oldHasUnsavedLocalChanges = hasUnsavedLocalChanges;

Callers 2

app_close_requestedMethod · 0.80
top_toolbarMethod · 0.80

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected