Skip to content

Commit

Permalink
Merge pull request #858 from kiwix/fix_compilation
Browse files Browse the repository at this point in the history
Fix compilation after removing of wrapping in libkiwix
  • Loading branch information
kelson42 committed Jul 8, 2022
2 parents 8649da5 + 847b4b4 commit f1aafc1
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/contentmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ void ContentManager::updateLibrary() {
try {
emit(pendingRequest(true));
m_remoteLibraryManager.doUpdate(m_currentLanguage, m_categoryFilter);
} catch (runtime_error&) {}
} catch (std::runtime_error&) {}
}

#define CATALOG_URL "library.kiwix.org"
Expand Down
6 changes: 3 additions & 3 deletions src/kiwixapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ KiwixApp::KiwixApp(int& argc, char *argv[])
{
try {
m_translation.setTranslation(QLocale());
} catch (exception& e) {
} catch (std::exception& e) {
QMessageBox::critical(nullptr, "Translation error", e.what());
return;
}
Expand All @@ -60,7 +60,7 @@ void KiwixApp::init()
{
try {
mp_downloader = new kiwix::Downloader();
} catch (exception& e) {
} catch (std::exception& e) {
QMessageBox::critical(nullptr, gt("error-downloader-window-title"),
gt("error-downloader-launch-message") + "<br><br>" + e.what());
}
Expand Down Expand Up @@ -236,7 +236,7 @@ void KiwixApp::openRandomUrl(bool newTab)
if (zimId.isEmpty()) {
return;
}

try {
auto archive = m_library.getArchive(zimId);
auto entry = archive->getRandomEntry();
Expand Down
1 change: 1 addition & 0 deletions src/kiwixapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <kiwix/name_mapper.h>

#include <mutex>
#include <iostream>


class KiwixApp : public QtSingleApplication
Expand Down
2 changes: 0 additions & 2 deletions src/library.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#include <kiwix/book.h>
#include <kiwix/library.h>
#include <kiwix/reader.h>
#include <kiwix/searcher.h>
#include <zim/archive.h>
#include <zim/search.h>
#include <qstring.h>
Expand Down
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <QCommandLineParser>
#include <iostream>
#include <sstream>
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
#include <QWebEngineUrlScheme>
#endif
Expand Down
1 change: 1 addition & 0 deletions src/readinglistbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "ui_readinglistbar.h"
#include "kiwixapp.h"
#include "zim/error.h"
#include "zim/item.h"

#include <QListWidgetItem>

Expand Down
3 changes: 2 additions & 1 deletion src/urlschemehandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <kiwix/name_mapper.h>
#include <zim/search.h>
#include <zim/entry.h>
#include <zim/item.h>
#include <zim/error.h>


Expand Down Expand Up @@ -125,7 +126,7 @@ UrlSchemeHandler::handleSearchRequest(QWebEngineUrlRequestJob* request)
std::shared_ptr<zim::Search> search;
try {
auto searcher = app->getLibrary()->getSearcher(bookId);
search = make_shared<zim::Search>(searcher->search(searchQuery));
search = std::make_shared<zim::Search>(searcher->search(searchQuery));
} catch(...) {
request->fail(QWebEngineUrlRequestJob::UrlInvalid);
return;
Expand Down
1 change: 1 addition & 0 deletions src/webview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <QWebEngineHistory>
#include <QVBoxLayout>
#include <zim/error.h>
#include <zim/item.h>

void WebViewBackMenu::showEvent(QShowEvent *)
{
Expand Down
1 change: 0 additions & 1 deletion src/webview.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <QWheelEvent>
#include <QMenu>

#include <kiwix/reader.h>
#include "findinpagebar.h"

class QWebEngineHistoryItem;
Expand Down
4 changes: 2 additions & 2 deletions src/zimview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ZimView::ZimView(TabBar *tabBar, QWidget *parent)
return;
auto zoomFactor = mp_webView->zoomFactor();
zoomFactor += 0.1;
zoomFactor = max(min(zoomFactor, 5.0), 0.25);
zoomFactor = std::max(std::min(zoomFactor, 5.0), 0.25);
mp_webView->setZoomFactor(zoomFactor);
auto key = mp_webView->zimId() + "/zoomFactor";
KiwixApp::instance()->getSettingsManager()->setSettings(key, zoomFactor);
Expand All @@ -35,7 +35,7 @@ ZimView::ZimView(TabBar *tabBar, QWidget *parent)
return;
auto zoomFactor = mp_webView->zoomFactor();
zoomFactor -= 0.1;
zoomFactor = max(min(zoomFactor, 5.0), 0.25);
zoomFactor = std::max(std::min(zoomFactor, 5.0), 0.25);
mp_webView->setZoomFactor(zoomFactor);
auto key = mp_webView->zimId() + "/zoomFactor";
KiwixApp::instance()->getSettingsManager()->setSettings(key, zoomFactor);
Expand Down

0 comments on commit f1aafc1

Please sign in to comment.