src: clazy compiler warnings
get rid of most clazy warnings (https://github.com/KDE/clazy) * range loop use refs * qcolor ctor with ints * missing Q_OBJECT macro * use .constfirst instead of .first enabled ccache for unix systems for fasterr recompiling * if ccache is in path we use it now
This commit is contained in:
@@ -19,7 +19,7 @@ void CombinedPathDetector::addDetector(std::shared_ptr<PathDetector> detector)
|
||||
std::vector<std::string> CombinedPathDetector::getWorkingDetectorNames()
|
||||
{
|
||||
std::vector<std::string> names;
|
||||
for (std::shared_ptr<PathDetector> detector: m_detectors)
|
||||
for (const std::shared_ptr<PathDetector>& detector: m_detectors)
|
||||
{
|
||||
if (detector->isWorking())
|
||||
{
|
||||
@@ -31,7 +31,7 @@ std::vector<std::string> CombinedPathDetector::getWorkingDetectorNames()
|
||||
|
||||
std::vector<FilePath> CombinedPathDetector::getPaths() const
|
||||
{
|
||||
for (std::shared_ptr<PathDetector> detector: m_detectors)
|
||||
for (const std::shared_ptr<PathDetector>& detector: m_detectors)
|
||||
{
|
||||
std::vector<FilePath> detectedPaths = detector->getPaths();
|
||||
if (!detectedPaths.empty())
|
||||
@@ -44,7 +44,7 @@ std::vector<FilePath> CombinedPathDetector::getPaths() const
|
||||
|
||||
std::vector<FilePath> CombinedPathDetector::getPaths(std::string detectorName) const
|
||||
{
|
||||
for (std::shared_ptr<PathDetector> detector: m_detectors)
|
||||
for (const std::shared_ptr<PathDetector>& detector: m_detectors)
|
||||
{
|
||||
if (detector->getName() == detectorName)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace utility
|
||||
|
||||
if (!standardHeaders.empty())
|
||||
{
|
||||
for (std::string s : utility::splitToVector(standardHeaders, '\n'))
|
||||
for (const std::string& s : utility::splitToVector(standardHeaders, '\n'))
|
||||
{
|
||||
paths.push_back(utility::trim(s));
|
||||
}
|
||||
|
||||
@@ -5,12 +5,11 @@
|
||||
#include "utility/utilityString.h"
|
||||
|
||||
#ifdef __x86_64__
|
||||
const std::string arch = "amd64";
|
||||
const char jvmLibPathRelativeToJavaExecutable[] = "/../lib/amd64/server/libjvm.so";
|
||||
#else
|
||||
const std::string arch = "i386";
|
||||
const char jvmLibPathRelativeToJavaExecutable[] = "/../lib/i386/server/libjvm.so";
|
||||
#endif
|
||||
|
||||
const std::string jvmLibPathRelativeToJavaExecutable = "/../lib/" + arch + "/server/libjvm.so";
|
||||
|
||||
JavaPathDetectorLinux::JavaPathDetectorLinux(const std::string javaVersion)
|
||||
: JavaPathDetector("Java " + javaVersion + " for Linux", javaVersion)
|
||||
@@ -109,7 +108,7 @@ std::vector<FilePath> JavaPathDetectorLinux::getPaths() const
|
||||
paths.push_back(FilePath("/usr/lib/jvm/default/bin/java"));
|
||||
paths.push_back(FilePath("/usr/lib/jvm/java-openjdk/bin/java"));
|
||||
|
||||
for ( FilePath path : paths )
|
||||
for (const FilePath& path : paths )
|
||||
{
|
||||
if (checkVersion(path))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user