1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-25 12:13:00 +01:00

Fix clang compilation on windows by making m_globalVariables no longer a reference

Fix clang-tidy and clazy warnings
This commit is contained in:
Elias Steurer 2020-03-25 21:30:04 +01:00
parent 0658d3f8c8
commit db94ca2a1e
9 changed files with 12 additions and 13 deletions

View File

@ -34,7 +34,6 @@ Create::Create(const shared_ptr<GlobalVariables>& globalVariables, QObject* pare
*/
Create::Create()
: QObject(nullptr)
, m_globalVariables(nullptr)
{
qRegisterMetaType<CreateImportVideo::ImportVideoState>("CreateImportVideo::ImportVideoState");
qRegisterMetaType<Create::VideoCodec>("Create::VideoCodec");
@ -95,7 +94,7 @@ void Create::createWidget(const QString& localStoragePath, const QString& title,
}
QJsonArray tagsJsonArray;
for (QString tmp : tags) {
for (const QString& tmp : tags) {
tagsJsonArray.append(tmp);
}
obj.insert("tags", tagsJsonArray);
@ -169,7 +168,7 @@ void Create::createHTMLWallpaper(
fileMainHTML.close();
QJsonArray tagsJsonArray;
for (QString tmp : tags) {
for (const QString& tmp : tags) {
tagsJsonArray.append(tmp);
}
obj.insert("tags", tagsJsonArray);
@ -323,7 +322,7 @@ void Create::saveWallpaper(QString title, QString description, QString filePath,
obj.insert("type", "videoWallpaper");
QJsonArray tagsJsonArray;
for (QString tmp : tags) {
for (const QString &tmp : tags) {
tagsJsonArray.append(tmp);
}
obj.insert("tags", tagsJsonArray);

View File

@ -129,7 +129,7 @@ private:
CreateImportVideo* m_createImportVideo { nullptr };
QThread* m_createImportVideoThread { nullptr };
const shared_ptr<GlobalVariables>& m_globalVariables;
const shared_ptr<GlobalVariables> m_globalVariables;
float m_progress { 0.0F };
QString m_workingDir;

View File

@ -90,7 +90,7 @@ void CreateImportVideo::process()
return;
}
for (const auto codec : m_codecs) {
for (const auto& codec : qAsConst(m_codecs)) {
if (!createWallpaperVideo(codec) || QThread::currentThread()->isInterruptionRequested()) {
emit abortAndCleanup();
return;

View File

@ -217,7 +217,7 @@ bool ScreenPlayManager::removeWallpaperAt(int at)
*/
void ScreenPlayManager::requestProjectSettingsListModelAt(const int index)
{
for (const shared_ptr<ScreenPlayWallpaper>& uPtrWallpaper : m_screenPlayWallpapers) {
for (const shared_ptr<ScreenPlayWallpaper>& uPtrWallpaper : qAsConst(m_screenPlayWallpapers)) {
if (!uPtrWallpaper->screenNumber().empty() && uPtrWallpaper->screenNumber()[0] == index) {
emit projectSettingsListModelFound(
uPtrWallpaper->projectSettingsListModel().get(),
@ -247,7 +247,7 @@ void ScreenPlayManager::setWallpaperValue(const int index, const QString& key, c
*/
void ScreenPlayManager::setAllWallpaperValue(const QString& key, const QString& value)
{
for (const shared_ptr<ScreenPlayWallpaper>& uPtrWallpaper : m_screenPlayWallpapers) {
for (const shared_ptr<ScreenPlayWallpaper>& uPtrWallpaper : qAsConst(m_screenPlayWallpapers)) {
m_sdkconnector->setWallpaperValue(uPtrWallpaper->appID(), key, value);
}
}

View File

@ -39,7 +39,7 @@ ScreenPlayWallpaper::ScreenPlayWallpaper(
QString tmpScreenNumber;
if (m_screenNumber.length() > 1) {
for (const int number : m_screenNumber) {
for (const int number : qAsConst(m_screenNumber)) {
// IMPORTANT: NO TRAILING COMMA!
if (number == m_screenNumber.back()) {
tmpScreenNumber += QString::number(number);

View File

@ -99,7 +99,7 @@ void SDKConnector::closeAllWidgets()
*/
void SDKConnector::closeWallpapersAt(int at)
{
for (const shared_ptr<SDKConnection>& refSDKConnection : m_clients) {
for (const shared_ptr<SDKConnection>& refSDKConnection : qAsConst(m_clients)) {
refSDKConnection->close();
if (!refSDKConnection->monitor().empty()) {
if (refSDKConnection->monitor().at(0) == at) {

View File

@ -129,7 +129,7 @@ public slots:
"htmlWidget",
"standaloneWidget"
};
for (QString type : types) {
for (const QString &type : types) {
if (msg.contains(type)) {
m_type = type;
}

View File

@ -171,7 +171,7 @@ bool Util::writeJsonObjectToFile(const QString& absoluteFilePath, const QJsonObj
QString Util::toString(const QStringList& list)
{
QString out;
for (auto string : list) {
for (const auto &string : list) {
out += " " + string;
}
return out;

View File

@ -88,7 +88,7 @@ void Storage::reset()
void Storage::loadStorageDevices()
{
beginInsertRows(QModelIndex(), 0, rowCount());
for (auto storage : QStorageInfo::mountedVolumes()) {
for (const auto &storage : QStorageInfo::mountedVolumes()) {
m_storageInfoList.append(storage);
}
endInsertRows();