Skip to content

Commit

Permalink
append(qsizetype count, char ch) is not in SailfishOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlich committed Dec 10, 2023
1 parent 2c29d19 commit 82f9bec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions daemon/src/services/simpleweatherservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ void SimpleWeatherService::sendWeather(CurrentWeather *weather)

QByteArray cityNameBytes = weather->city()->name().toLocal8Bit().left(32);
if(cityNameBytes.size() < 32) {
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
cityNameBytes.append(32-cityNameBytes.size(), 0x00);
#else
for (int i = 0; i < (32 - cityNameBytes.size()); i++) {
cityNameBytes.append( '\0' );
}
#endif
}

QByteArray weatherBytes;
Expand Down

0 comments on commit 82f9bec

Please sign in to comment.