Address cppcheck complaints
This commit is contained in:
@@ -256,7 +256,7 @@ void FileBrowserActivity::loop() {
|
||||
|
||||
std::string getFileName(std::string filename) {
|
||||
if (filename.back() == '/') {
|
||||
filename = filename.substr(0, filename.length() - 1);
|
||||
filename.pop_back();
|
||||
if (!UITheme::getInstance().getTheme().showsFileIcons()) {
|
||||
return "[" + filename + "]";
|
||||
}
|
||||
|
||||
@@ -466,15 +466,6 @@ void EpubReaderActivity::onReaderMenuConfirm(EpubReaderMenuActivity::MenuAction
|
||||
if (KOREADER_STORE.hasCredentials()) {
|
||||
const int currentPage = section ? section->currentPage : 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(),
|
||||
currentSpineIndex, currentPage, totalPages),
|
||||
[this](const ActivityResult& result) { handleSyncResult(result); });
|
||||
|
||||
@@ -41,7 +41,6 @@ void drawWeatherIconWithOrientation(const GfxRenderer& renderer, const uint8_t*
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
StrId getWeatherDescriptionStrId(const int wmoCode) {
|
||||
switch (wmoCode) {
|
||||
case 0:
|
||||
@@ -597,8 +596,6 @@ void WeatherActivity::renderDailyForecast(int x, int y, int w, int h) {
|
||||
const int extraPx = w % numDays;
|
||||
|
||||
int cardX = x;
|
||||
int debugMoonX = x + w - 18;
|
||||
int debugMoonYBase = y + 10;
|
||||
|
||||
for (int i = 0; i < numDays; 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);
|
||||
const auto nl = subtitleText.find('\n');
|
||||
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);
|
||||
renderer.drawText(UI_10_FONT_ID, rect.x + BaseMetrics::values.contentSidePadding, itemY + 30, subtitle.c_str(),
|
||||
|
||||
Reference in New Issue
Block a user