Got rid of unjustified code

This commit is contained in:
Veloman Yunkan 2024-05-30 14:01:04 +04:00 committed by Kelson
parent 04a6d6c05a
commit a7fb85b8b0

View File

@ -553,22 +553,12 @@ void ContentManager::updateDownload(QString bookId, const DownloadInfo& download
}
}
namespace
{
std::shared_ptr<RowNode> getSharedPointer(RowNode* ptr)
{
return std::static_pointer_cast<RowNode>(ptr->shared_from_this());
}
} // unnamed namespace
void ContentManager::downloadBook(const QString &id, QModelIndex index)
{
try
{
downloadBook(id);
auto node = getSharedPointer(static_cast<RowNode*>(index.internalPointer()));
const auto node = static_cast<RowNode*>(index.internalPointer());
node->setDownloadState(DownloadManager::getDownloadState(id));
}
catch ( const ContentManagerError& err )