mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-24 04:32:15 -04:00
Do not resize zimId.
If there is no ".zim" at the end, we don't need to remove it.
This commit is contained in:
parent
ce71fe0275
commit
d52dab04ce
@ -229,7 +229,6 @@ bool KiwixApp::isCurrentArticleBookmarked()
|
||||
if (zimId.empty()) {
|
||||
return false;
|
||||
}
|
||||
zimId.resize(zimId.length()-4);
|
||||
auto url = getTabWidget()->currentArticleUrl().toStdString();
|
||||
|
||||
for (auto& bookmark: getLibrary()->getBookmarks()) {
|
||||
|
@ -39,14 +39,12 @@ void SearchButton::on_buttonClicked()
|
||||
auto tabWidget = kiwixApp->getTabWidget();
|
||||
if (kiwixApp->isCurrentArticleBookmarked()) {
|
||||
auto zimid = tabWidget->currentZimId();
|
||||
zimid.resize(zimid.length()-4);
|
||||
library->removeBookmark(
|
||||
zimid, tabWidget->currentArticleUrl()
|
||||
);
|
||||
} else {
|
||||
kiwix::Bookmark bookmark;
|
||||
auto zimid = tabWidget->currentZimId().toStdString();
|
||||
zimid.resize(zimid.length()-4);
|
||||
bookmark.setBookId(zimid);
|
||||
bookmark.setUrl(tabWidget->currentArticleUrl().toStdString());
|
||||
bookmark.setTitle(tabWidget->currentArticleTitle().toStdString());
|
||||
|
Loading…
x
Reference in New Issue
Block a user