Address cppcheck complaints
This commit is contained in:
@@ -256,7 +256,7 @@ void FileBrowserActivity::loop() {
|
|||||||
|
|
||||||
std::string getFileName(std::string filename) {
|
std::string getFileName(std::string filename) {
|
||||||
if (filename.back() == '/') {
|
if (filename.back() == '/') {
|
||||||
filename = filename.substr(0, filename.length() - 1);
|
filename.pop_back();
|
||||||
if (!UITheme::getInstance().getTheme().showsFileIcons()) {
|
if (!UITheme::getInstance().getTheme().showsFileIcons()) {
|
||||||
return "[" + filename + "]";
|
return "[" + filename + "]";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -466,15 +466,6 @@ void EpubReaderActivity::onReaderMenuConfirm(EpubReaderMenuActivity::MenuAction
|
|||||||
if (KOREADER_STORE.hasCredentials()) {
|
if (KOREADER_STORE.hasCredentials()) {
|
||||||
const int currentPage = section ? section->currentPage : 0;
|
const int currentPage = section ? section->currentPage : 0;
|
||||||
const int totalPages = section ? section->pageCount : 0;
|
const int totalPages = section ? section->pageCount : 0;
|
||||||
// Look up paragraph index from section cache for accurate XPath generation on upload
|
|
||||||
uint16_t paragraphIdx = 0;
|
|
||||||
bool hasParagraphIdx = false;
|
|
||||||
if (section) {
|
|
||||||
if (const auto pIdx = section->getParagraphIndexForPage(currentPage)) {
|
|
||||||
paragraphIdx = *pIdx;
|
|
||||||
hasParagraphIdx = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
startActivityForResult(std::make_unique<KOReaderSyncActivity>(renderer, mappedInput, epub, epub->getPath(),
|
startActivityForResult(std::make_unique<KOReaderSyncActivity>(renderer, mappedInput, epub, epub->getPath(),
|
||||||
currentSpineIndex, currentPage, totalPages),
|
currentSpineIndex, currentPage, totalPages),
|
||||||
[this](const ActivityResult& result) { handleSyncResult(result); });
|
[this](const ActivityResult& result) { handleSyncResult(result); });
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ void drawWeatherIconWithOrientation(const GfxRenderer& renderer, const uint8_t*
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
StrId getWeatherDescriptionStrId(const int wmoCode) {
|
StrId getWeatherDescriptionStrId(const int wmoCode) {
|
||||||
switch (wmoCode) {
|
switch (wmoCode) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -597,8 +596,6 @@ void WeatherActivity::renderDailyForecast(int x, int y, int w, int h) {
|
|||||||
const int extraPx = w % numDays;
|
const int extraPx = w % numDays;
|
||||||
|
|
||||||
int cardX = x;
|
int cardX = x;
|
||||||
int debugMoonX = x + w - 18;
|
|
||||||
int debugMoonYBase = y + 10;
|
|
||||||
|
|
||||||
for (int i = 0; i < numDays; i++) {
|
for (int i = 0; i < numDays; i++) {
|
||||||
const auto& day = weatherData.daily[i];
|
const auto& day = weatherData.daily[i];
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ void BaseTheme::drawList(const GfxRenderer& renderer, Rect rect, int itemCount,
|
|||||||
std::string subtitleText = rowSubtitle(i);
|
std::string subtitleText = rowSubtitle(i);
|
||||||
const auto nl = subtitleText.find('\n');
|
const auto nl = subtitleText.find('\n');
|
||||||
if (nl != std::string::npos) {
|
if (nl != std::string::npos) {
|
||||||
subtitleText = subtitleText.substr(0, nl) + " \u2022 " + subtitleText.substr(nl + 1);
|
subtitleText.replace(nl, 1, " \u2022 ");
|
||||||
}
|
}
|
||||||
auto subtitle = renderer.truncatedText(UI_10_FONT_ID, subtitleText.c_str(), textWidth);
|
auto subtitle = renderer.truncatedText(UI_10_FONT_ID, subtitleText.c_str(), textWidth);
|
||||||
renderer.drawText(UI_10_FONT_ID, rect.x + BaseMetrics::values.contentSidePadding, itemY + 30, subtitle.c_str(),
|
renderer.drawText(UI_10_FONT_ID, rect.x + BaseMetrics::values.contentSidePadding, itemY + 30, subtitle.c_str(),
|
||||||
|
|||||||
Reference in New Issue
Block a user