logic: Fixed intermediate storage fetching starving when indexers are really fast because of other UI updates
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#ifndef MESSAGE_STATUS_H
|
||||
#define MESSAGE_STATUS_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "utility/messaging/Message.h"
|
||||
#include "utility/utilityString.h"
|
||||
|
||||
@@ -9,9 +11,18 @@ class MessageStatus
|
||||
{
|
||||
public:
|
||||
MessageStatus(const std::string& status, bool isError = false, bool showLoader = false)
|
||||
: status(utility::replace(status, "\n", " "))
|
||||
, isError(isError)
|
||||
: isError(isError)
|
||||
, showLoader(showLoader)
|
||||
{
|
||||
m_stati.push_back(utility::replace(status, "\n", " "));
|
||||
|
||||
setSendAsTask(false);
|
||||
}
|
||||
|
||||
MessageStatus(const std::vector<std::string>& stati, bool isError = false, bool showLoader = false)
|
||||
: isError(isError)
|
||||
, showLoader(showLoader)
|
||||
, m_stati(stati)
|
||||
{
|
||||
setSendAsTask(false);
|
||||
}
|
||||
@@ -21,9 +32,32 @@ public:
|
||||
return "MessageStatus";
|
||||
}
|
||||
|
||||
const std::vector<std::string>& stati() const
|
||||
{
|
||||
return m_stati;
|
||||
}
|
||||
|
||||
std::string status() const
|
||||
{
|
||||
if (m_stati.size())
|
||||
{
|
||||
return m_stati[0];
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
virtual void print(std::ostream& os) const
|
||||
{
|
||||
os << status;
|
||||
for (const std::string& status : m_stati)
|
||||
{
|
||||
os << status;
|
||||
|
||||
if (m_stati.size() > 1)
|
||||
{
|
||||
os << " - ";
|
||||
}
|
||||
}
|
||||
|
||||
if (isError)
|
||||
{
|
||||
@@ -36,9 +70,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
const std::string status;
|
||||
const bool isError;
|
||||
const bool showLoader;
|
||||
|
||||
private:
|
||||
std::vector<std::string> m_stati;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_STATUS_H
|
||||
|
||||
Reference in New Issue
Block a user