Skip to content

Commit

Permalink
Remove unused variable warnings
Browse files Browse the repository at this point in the history
Commented out unused variable names in function parameters
Casted unused variable (void) in for-loop
Fixed a signed-unsigned comparison warning
  • Loading branch information
juuz0 committed May 17, 2022
1 parent d9d845e commit 1f8298b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/contentmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ QStringList ContentManager::getBookInfos(QString id, const QStringList &keys)

if (nullptr == b){
for(auto& key:keys) {
(void) key;
values.append("");
}
return values;
Expand Down Expand Up @@ -161,8 +162,10 @@ QStringList ContentManager::updateDownloadInfos(QString id, const QStringList &k
{
QStringList values;
if (!mp_downloader) {
for(auto& key: keys)
for(auto& key: keys) {
(void) key;
values.append("");
}
return values;
}
auto& b = mp_library->getBookById(id);
Expand Down Expand Up @@ -255,7 +258,8 @@ QString ContentManager::downloadBook(const QString &id)
}();
auto downloadPath = KiwixApp::instance()->getSettingsManager()->getDownloadDir();
QStorageInfo storage(downloadPath);
if (book.getSize() > storage.bytesAvailable()) {
auto bytesAvailable = storage.bytesAvailable();
if (bytesAvailable == -1 || book.getSize() > (unsigned) bytesAvailable) {
return "storage_error";
}
auto booksList = mp_library->getBookIds();
Expand Down
2 changes: 1 addition & 1 deletion src/webpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ WebPage::WebPage(QObject *parent) :
action(QWebEnginePage::Reload)->setVisible(false);
}

bool WebPage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame)
bool WebPage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType /*type*/, bool /*isMainFrame*/)
{
if (url.scheme() != "zim") {
QDesktopServices::openUrl(url);
Expand Down

0 comments on commit 1f8298b

Please sign in to comment.