mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-02 11:59:58 +00:00
Fix compilation when ENABLE_UI is disabled and UIContext isn't defined
This commit is contained in:
parent
693a5777e7
commit
e61888fc92
@ -380,16 +380,15 @@ namespace {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct CloseAllDocs {
|
struct CloseAllDocs {
|
||||||
CloseAllDocs() { }
|
Context* m_ctx;
|
||||||
|
CloseAllDocs(Context* ctx) : m_ctx(ctx) { }
|
||||||
~CloseAllDocs() {
|
~CloseAllDocs() {
|
||||||
auto ctx = UIContext::instance();
|
|
||||||
|
|
||||||
std::vector<Doc*> docs;
|
std::vector<Doc*> docs;
|
||||||
#ifdef ENABLE_UI
|
#ifdef ENABLE_UI
|
||||||
for (Doc* doc : ctx->getAndRemoveAllClosedDocs())
|
for (Doc* doc : static_cast<UIContext*>(m_ctx)->getAndRemoveAllClosedDocs())
|
||||||
docs.push_back(doc);
|
docs.push_back(doc);
|
||||||
#endif
|
#endif
|
||||||
for (Doc* doc : ctx->documents())
|
for (Doc* doc : m_ctx->documents())
|
||||||
docs.push_back(doc);
|
docs.push_back(doc);
|
||||||
for (Doc* doc : docs) {
|
for (Doc* doc : docs) {
|
||||||
// First we close the document. In this way we receive recent
|
// First we close the document. In this way we receive recent
|
||||||
@ -416,7 +415,7 @@ void App::run()
|
|||||||
#ifdef ENABLE_UI
|
#ifdef ENABLE_UI
|
||||||
CloseMainWindow closeMainWindow(m_mainWindow);
|
CloseMainWindow closeMainWindow(m_mainWindow);
|
||||||
#endif
|
#endif
|
||||||
CloseAllDocs closeAllDocsAtExit;
|
CloseAllDocs closeAllDocsAtExit(context());
|
||||||
|
|
||||||
#ifdef ENABLE_UI
|
#ifdef ENABLE_UI
|
||||||
// Run the GUI
|
// Run the GUI
|
||||||
|
Loading…
Reference in New Issue
Block a user