mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Const correctness, override keyword, a bunch of stuff..
This commit is contained in:
@@ -10,13 +10,13 @@
|
||||
|
||||
namespace FileUtils {
|
||||
|
||||
QString getBaseName(QString sourceFile)
|
||||
QString getBaseName(const QString& sourceFile)
|
||||
{
|
||||
QFileInfo fi(sourceFile);
|
||||
return fi.fileName();
|
||||
}
|
||||
|
||||
QString getDirName(QString sourceFile)
|
||||
QString getDirName(const QString& sourceFile)
|
||||
{
|
||||
QFileInfo fi(sourceFile);
|
||||
return fi.path();
|
||||
|
@@ -114,7 +114,7 @@ Logger::LogLevel Logger::getLogLevel(const QString & name)
|
||||
return static_cast<Logger::LogLevel>(int(GLOBAL_MIN_LOG_LEVEL));
|
||||
}
|
||||
|
||||
Logger* log = Logger::getInstance(name);
|
||||
const Logger* log = Logger::getInstance(name);
|
||||
return log->getMinLevel();
|
||||
}
|
||||
|
||||
|
@@ -13,7 +13,7 @@ NetOrigin::NetOrigin(QObject* parent, Logger* log)
|
||||
NetOrigin::instance = this;
|
||||
}
|
||||
|
||||
bool NetOrigin::accessAllowed(const QHostAddress& address, const QHostAddress& local)
|
||||
bool NetOrigin::accessAllowed(const QHostAddress& address, const QHostAddress& local) const
|
||||
{
|
||||
if(_internetAccessAllowed)
|
||||
return true;
|
||||
@@ -29,7 +29,7 @@ bool NetOrigin::accessAllowed(const QHostAddress& address, const QHostAddress& l
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NetOrigin::isLocalAddress(const QHostAddress& address, const QHostAddress& local)
|
||||
bool NetOrigin::isLocalAddress(const QHostAddress& address, const QHostAddress& local) const
|
||||
{
|
||||
if(address.protocol() == QAbstractSocket::IPv4Protocol)
|
||||
{
|
||||
|
@@ -6,7 +6,7 @@ namespace Process {
|
||||
|
||||
void restartHyperion(bool asNewProcess){}
|
||||
|
||||
QByteArray command_exec(QString /*cmd*/, QByteArray /*data*/)
|
||||
QByteArray command_exec(const QString& /*cmd*/, const QByteArray& /*data*/)
|
||||
{
|
||||
return QSTRING_CSTR(QString());
|
||||
}
|
||||
@@ -48,7 +48,7 @@ void restartHyperion(bool asNewProcess)
|
||||
QCoreApplication::quit();
|
||||
}
|
||||
|
||||
QByteArray command_exec(QString cmd, QByteArray data)
|
||||
QByteArray command_exec(const QString& cmd, const QByteArray& data)
|
||||
{
|
||||
char buffer[128];
|
||||
QString result;
|
||||
|
@@ -43,7 +43,7 @@ void Profiler::initLogger()
|
||||
_logger = Logger::getInstance("PROFILER", Logger::DEBUG);
|
||||
}
|
||||
|
||||
void Profiler::TimerStart(const QString timerName, const char* sourceFile, const char* func, unsigned int line)
|
||||
void Profiler::TimerStart(const QString& timerName, const char* sourceFile, const char* func, unsigned int line)
|
||||
{
|
||||
std::pair<std::map<QString,StopWatchItem>::iterator,bool> ret;
|
||||
Profiler::initLogger();
|
||||
@@ -71,7 +71,7 @@ void Profiler::TimerStart(const QString timerName, const char* sourceFile, const
|
||||
}
|
||||
|
||||
|
||||
void Profiler::TimerGetTime(const QString timerName, const char* sourceFile, const char* func, unsigned int line)
|
||||
void Profiler::TimerGetTime(const QString& timerName, const char* sourceFile, const char* func, unsigned int line)
|
||||
{
|
||||
std::map<QString,StopWatchItem>::iterator ret = GlobalProfilerMap.find(timerName);
|
||||
Profiler::initLogger();
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace RGBW {
|
||||
|
||||
WhiteAlgorithm stringToWhiteAlgorithm(QString str)
|
||||
WhiteAlgorithm stringToWhiteAlgorithm(const QString& str)
|
||||
{
|
||||
if (str == "subtract_minimum") return WhiteAlgorithm::SUBTRACT_MINIMUM;
|
||||
if (str == "sub_min_warm_adjust") return WhiteAlgorithm::SUB_MIN_WARM_ADJUST;
|
||||
|
@@ -166,7 +166,7 @@ void QJsonSchemaChecker::setMessage(const QString & message)
|
||||
_messages.append(_currentPath.join("") +": "+message);
|
||||
}
|
||||
|
||||
const QStringList & QJsonSchemaChecker::getMessages() const
|
||||
QStringList QJsonSchemaChecker::getMessages() const
|
||||
{
|
||||
return _messages;
|
||||
}
|
||||
|
Reference in New Issue
Block a user