Unify inconsistent notifyListener() logic

Previously, this function required a `queueEmptied` bool, which I changed
to `queueRunning`.  But I goofed the logic on this bool; it should
always be "is `processing` nullptr."
This commit is contained in:
George Hilliard 2018-10-29 10:52:06 -05:00
parent 5cb42f29e3
commit 4a765cc91f
2 changed files with 7 additions and 8 deletions

View File

@ -229,7 +229,7 @@ void BatchQueue::addEntries (const std::vector<BatchQueueEntry*>& entries, bool
saveBatchQueue (); saveBatchQueue ();
redraw (); redraw ();
notifyListener (true); notifyListener ();
} }
bool BatchQueue::saveBatchQueue () bool BatchQueue::saveBatchQueue ()
@ -387,7 +387,7 @@ bool BatchQueue::loadBatchQueue ()
} }
redraw (); redraw ();
notifyListener (true); notifyListener ();
return !fd.empty (); return !fd.empty ();
} }
@ -460,7 +460,7 @@ void BatchQueue::cancelItems (const std::vector<ThumbBrowserEntryBase*>& items)
saveBatchQueue (); saveBatchQueue ();
redraw (); redraw ();
notifyListener (true); notifyListener ();
} }
void BatchQueue::headItems (const std::vector<ThumbBrowserEntryBase*>& items) void BatchQueue::headItems (const std::vector<ThumbBrowserEntryBase*>& items)
@ -775,8 +775,7 @@ rtengine::ProcessingJob* BatchQueue::imageReady(rtengine::IImagefloat* img)
} }
redraw (); redraw ();
const bool queueRunning = processing; notifyListener ();
notifyListener (queueRunning);
return processing ? processing->job : nullptr; return processing ? processing->job : nullptr;
} }
@ -971,9 +970,9 @@ void BatchQueue::buttonPressed (LWButton* button, int actionCode, void* actionDa
} }
} }
void BatchQueue::notifyListener (bool queueRunning) void BatchQueue::notifyListener ()
{ {
const bool queueRunning = processing;
if (listener) { if (listener) {
NLParams* params = new NLParams; NLParams* params = new NLParams;
params->listener = listener; params->listener = listener;

View File

@ -93,7 +93,7 @@ protected:
Glib::ustring autoCompleteFileName (const Glib::ustring& fileName, const Glib::ustring& format); Glib::ustring autoCompleteFileName (const Glib::ustring& fileName, const Glib::ustring& format);
Glib::ustring getTempFilenameForParams( const Glib::ustring &filename ); Glib::ustring getTempFilenameForParams( const Glib::ustring &filename );
bool saveBatchQueue (); bool saveBatchQueue ();
void notifyListener (bool queueRunning); void notifyListener ();
BatchQueueEntry* processing; // holds the currently processed image BatchQueueEntry* processing; // holds the currently processed image
FileCatalog* fileCatalog; FileCatalog* fileCatalog;