Polish and fix qmlvideofx example
Change-Id: I30f6d7d2af784ba018a659a16aceb4876a4b1be6 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -43,27 +43,27 @@
|
||||
|
||||
namespace PerformanceMonitor {
|
||||
|
||||
bool parseArgument(const QString &arg, State &state)
|
||||
{
|
||||
bool result = false;
|
||||
if ("-log-perf" == arg) {
|
||||
state.logging = true;
|
||||
state.valid = true;
|
||||
result = true;
|
||||
} else if ("-no-log-perf" == arg) {
|
||||
state.logging = false;
|
||||
state.valid = true;
|
||||
result = true;
|
||||
} else if ("-show-perf" == arg) {
|
||||
state.visible = true;
|
||||
state.valid = true;
|
||||
result = true;
|
||||
} else if ("-hide-perf" == arg) {
|
||||
state.visible = false;
|
||||
state.valid = true;
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
bool State::parseArgument(const QByteArray &arg)
|
||||
{
|
||||
bool result = false;
|
||||
if (arg == "-log-perf") {
|
||||
logging = true;
|
||||
valid = true;
|
||||
result = true;
|
||||
} else if (arg == "-no-log-perf") {
|
||||
logging = false;
|
||||
valid = true;
|
||||
result = true;
|
||||
} else if (arg == "-show-perf") {
|
||||
visible = true;
|
||||
valid = true;
|
||||
result = true;
|
||||
} else if (arg == "-hide-perf") {
|
||||
visible = false;
|
||||
valid = true;
|
||||
result = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace PerformanceMonitor
|
||||
|
||||
@@ -42,24 +42,27 @@
|
||||
#ifndef PERFORMANCEMONITOR_H
|
||||
#define PERFORMANCEMONITOR_H
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QByteArray>
|
||||
|
||||
namespace PerformanceMonitor {
|
||||
struct State {
|
||||
bool valid;
|
||||
bool logging;
|
||||
bool visible;
|
||||
|
||||
State() : valid(true), logging(false), visible(true) { }
|
||||
State(bool l, bool v) : valid(true), logging(l), visible(v) { }
|
||||
bool operator==(const State &other) const
|
||||
{ return logging == other.logging && visible == other.visible; }
|
||||
bool operator!=(const State &other) const
|
||||
{ return logging != other.logging || visible != other.visible; }
|
||||
};
|
||||
struct State
|
||||
{
|
||||
State() : valid(true), logging(false), visible(true) { }
|
||||
State(bool l, bool v) : valid(true), logging(l), visible(v) { }
|
||||
bool operator==(const State &other) const
|
||||
{ return logging == other.logging && visible == other.visible; }
|
||||
bool operator!=(const State &other) const
|
||||
{ return logging != other.logging || visible != other.visible; }
|
||||
|
||||
bool parseArgument(const QString &arg, State &state);
|
||||
}
|
||||
bool parseArgument(const QByteArray &arg);
|
||||
|
||||
bool valid;
|
||||
bool logging;
|
||||
bool visible;
|
||||
};
|
||||
|
||||
} // namespace PerformanceMonitor
|
||||
|
||||
#endif // PERFORMANCEMONITOR_H
|
||||
|
||||
|
||||
Reference in New Issue
Block a user