New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PVR] Refactor PVR jobs. Get rid of PVRJobs.(h|cpp). #16698
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of things
dac0d9a
to
85b817a
Compare
@Rechi @phunkyfish all requested/suggested changes are in. Please comment or approve. |
85b817a
to
a08ef0a
Compare
jenkins build this please |
std::string m_icon; | ||
|
||
Event(bool bNotifyUser, bool bError, const std::string& label, const std::string& msg, const std::string& icon) | ||
: m_bNotifyUser(bNotifyUser), m_bError(bError), m_label(label), m_msg(msg), m_icon(icon) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: m_bNotifyUser(bNotifyUser), m_bError(bError), m_label(label), m_msg(msg), m_icon(icon) {} | |
: m_bNotifyUser(bNotifyUser) | |
, m_bError(bError) | |
, m_label(label) | |
, m_msg(msg) | |
, m_icon(icon) | |
{ | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. This looks so ugly that I will not accept this coding guideline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I already told you, if you do not like the style submit a PR that changes the docs and clang-format configuration.
public: | ||
CPVRChannelTimeoutJobBase() = delete; | ||
CPVRChannelTimeoutJobBase(PVR::CPVRGUIChannelNavigator& channelNavigator, int iTimeout) | ||
: m_channelNavigator(channelNavigator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: m_channelNavigator(channelNavigator) | |
: m_channelNavigator(channelNavigator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.
{ | ||
public: | ||
CPVRChannelEntryTimeoutJob(PVR::CPVRGUIChannelNavigator& channelNavigator, int iTimeout) | ||
: CPVRChannelTimeoutJobBase(channelNavigator, iTimeout) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: CPVRChannelTimeoutJobBase(channelNavigator, iTimeout) {} | |
: CPVRChannelTimeoutJobBase(channelNavigator, iTimeout) | |
{ | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope.
{ | ||
public: | ||
CPVRChannelInfoTimeoutJob(PVR::CPVRGUIChannelNavigator& channelNavigator, int iTimeout) | ||
: CPVRChannelTimeoutJobBase(channelNavigator, iTimeout) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: CPVRChannelTimeoutJobBase(channelNavigator, iTimeout) {} | |
: CPVRChannelTimeoutJobBase(channelNavigator, iTimeout) | |
{ | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never.
{ | ||
public: | ||
CPVRLambdaJob() = delete; | ||
CPVRLambdaJob(const std::string& type, F&& f) : m_type(type), m_f(std::forward<F>(f)) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CPVRLambdaJob(const std::string& type, F&& f) : m_type(type), m_f(std::forward<F>(f)) {} | |
CPVRLambdaJob(const std::string& type, F&& f) | |
: m_type(type) | |
, m_f(std::forward<F>(f)) | |
{ | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once more, sorry no.
class CPVRManagerJobQueue | ||
{ | ||
public: | ||
CPVRManagerJobQueue() : m_triggerEvent(false) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CPVRManagerJobQueue() : m_triggerEvent(false) {} | |
CPVRManagerJobQueue() | |
: m_triggerEvent(false) | |
{ | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nonono. ;-)
Looks good 😉 |
Refactoring of PVR jobs. Basic ideas: Use lambda jobs to reduce boilerplate code and better encapsulation by reducing visibility of the job implementations.
Runtime-tested on macOS and Android, latest Kodi master.