diff --git a/src/activities/home/HomeActivity.cpp b/src/activities/home/HomeActivity.cpp index 77d3ae84..18efa82b 100644 --- a/src/activities/home/HomeActivity.cpp +++ b/src/activities/home/HomeActivity.cpp @@ -162,19 +162,24 @@ void HomeActivity::loadRecentBooksData() { int recentCount = std::min(static_cast(recentBooks.size()), maxRecentBooks); for (int i = 0; i < recentCount; i++) { - const std::string& bookPath = recentBooks[i]; + const RecentBook& recentBook = recentBooks[i]; + const std::string& bookPath = recentBook.path; CachedBookInfo info; info.path = bookPath; // Store the full path - // Extract title from path - info.title = bookPath; - size_t lastSlash = info.title.find_last_of('/'); - if (lastSlash != std::string::npos) { - info.title = info.title.substr(lastSlash + 1); - } - size_t lastDot = info.title.find_last_of('.'); - if (lastDot != std::string::npos) { - info.title = info.title.substr(0, lastDot); + // Use title from RecentBook if available, otherwise extract from path + if (!recentBook.title.empty()) { + info.title = recentBook.title; + } else { + info.title = bookPath; + size_t lastSlash = info.title.find_last_of('/'); + if (lastSlash != std::string::npos) { + info.title = info.title.substr(lastSlash + 1); + } + size_t lastDot = info.title.find_last_of('.'); + if (lastDot != std::string::npos) { + info.title = info.title.substr(0, lastDot); + } } if (StringUtils::checkFileExtension(bookPath, ".epub")) { diff --git a/src/activities/settings/SettingsActivity.cpp b/src/activities/settings/SettingsActivity.cpp index a5400ad3..c4361bb9 100644 --- a/src/activities/settings/SettingsActivity.cpp +++ b/src/activities/settings/SettingsActivity.cpp @@ -122,7 +122,6 @@ void updateContextForSetting(ThemeEngine::ThemeContext& ctx, const std::string& } } } // namespace ->>>>>>> e6b3ecc (feat: Enhance ThemeEngine and apply new theming to SettingsActivity) void SettingsActivity::taskTrampoline(void *param) { auto *self = static_cast(param);