Skip to content

Commit d6a117f

Browse files
committed
Fix warnings part 3
1 parent a80ae89 commit d6a117f

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ if(ENABLE_TRANSLATIONS)
4343
TS_FILES ${TS_FILES}
4444
SOURCES ${PROJECT_SOURCES}
4545
QM_FILES_OUTPUT_VARIABLE QM_FILES
46+
INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/include
4647
LUPDATE_OPTIONS -no-obsolete -locations none
4748
)
4849
set(CALL_LUPDATE TRUE)

src/mainwindow.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,15 @@ void MainWindow::onNextButtonClicked()
156156
{
157157
qsizetype currentIndex = buttonGroup->buttons().indexOf(buttonGroup->checkedButton());
158158
qsizetype nextIndex = (currentIndex + 1) % buttonGroup->buttons().size();
159-
buttonGroup->buttons().at(nextIndex)->click();
159+
buttonGroup->buttons().at(static_cast<int>(nextIndex))->click();
160160
updateNavigationButtons(nextIndex);
161161
}
162162

163163
void MainWindow::onPrevButtonClicked()
164164
{
165165
qsizetype currentIndex = buttonGroup->buttons().indexOf(buttonGroup->checkedButton());
166166
qsizetype prevIndex = (currentIndex - 1 + buttonGroup->buttons().size()) % buttonGroup->buttons().size();
167-
buttonGroup->buttons().at(prevIndex)->click();
167+
buttonGroup->buttons().at(static_cast<int>(prevIndex))->click();
168168
updateNavigationButtons(prevIndex);
169169
}
170170

@@ -363,7 +363,7 @@ void MainWindow::updateUI(const QString &currentDeviceName)
363363

364364
connect(button, &QPushButton::clicked, this, [=]() {
365365
updateWindow();
366-
disksGroup->actions().at(buttonIndex)->setChecked(true);
366+
disksGroup->actions().at(static_cast<int>(buttonIndex))->setChecked(true);
367367
gridView->highlightDisk(buttonIndex);
368368
gridView->setActiveIndex(buttonIndex);
369369
});
@@ -742,7 +742,7 @@ void MainWindow::populateWindow(const QJsonObject &localObj, const QString &heal
742742
} else if (stringValue.startsWith("Warning Comp. Temp. Threshold")) {
743743
qsizetype pos = stringValue.indexOf(':');
744744
if (pos != -1) {
745-
QString thresholdStr = stringValue.mid(pos + 1).trimmed();
745+
QString thresholdStr = stringValue.mid(static_cast<int>(pos + 1)).trimmed();
746746
int temperature = thresholdStr.section(' ', 0, 0).toInt();
747747
if (temperature > 0) {
748748
warningTemperature = temperature;
@@ -751,7 +751,7 @@ void MainWindow::populateWindow(const QJsonObject &localObj, const QString &heal
751751
} else if (stringValue.startsWith("Critical Comp. Temp. Threshold")) {
752752
qsizetype pos = stringValue.indexOf(':');
753753
if (pos != -1) {
754-
QString thresholdStr = stringValue.mid(pos + 1).trimmed();
754+
QString thresholdStr = stringValue.mid(static_cast<int>(pos + 1)).trimmed();
755755
int temperature = thresholdStr.section(' ', 0, 0).toInt();
756756
if (temperature > 0) {
757757
criticalTemperature = temperature;
@@ -1157,7 +1157,7 @@ void MainWindow::addSmartAttributesTable(const QJsonArray &attributes)
11571157

11581158
qsizetype spaceIndex = rawHEX.indexOf(' ');
11591159
if (spaceIndex != -1) {
1160-
rawHEX = rawHEX.left(spaceIndex);
1160+
rawHEX = rawHEX.left(static_cast<int>(spaceIndex));
11611161
}
11621162

11631163
if (rawHEX.startsWith("0x") && rawHEX.length() == 14) {

0 commit comments

Comments
 (0)