diff --git a/Makefile b/Makefile index c829152..6c43513 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,11 @@ korai: #----------------------------------------------------- # BUILDING KORAI #----------------------------------------------------- - mkdir -p build & g++ src/main.cpp `pkg-config gtkmm-3.0 --libs --cflags` `pkg-config webkit2gtk-4.0 --libs --cflags` `pkg-config vte-2.91 --libs --cflags` -DDOWNLOAD -larchive -O3 -std=c++17 -o build/korai + mkdir -p build & g++ src/main.cpp `pkg-config gtkmm-3.0 --libs --cflags` `pkg-config webkit2gtk-4.0 --libs --cflags` `pkg-config vte-2.91 --libs --cflags` -DDOWNLOAD -larchive -pthread -O3 -std=c++17 -o build/korai korai-nodownload: #----------------------------------------------------- # BUILDING KORAI-NODOWNLOAD #----------------------------------------------------- - mkdir -p build & g++ src/main.cpp `pkg-config gtkmm-3.0 --libs --cflags` `pkg-config webkit2gtk-4.0 --libs --cflags` -larchive -O3 -std=c++17 -o build/korai-nodownload + mkdir -p build & g++ src/main.cpp `pkg-config gtkmm-3.0 --libs --cflags` `pkg-config webkit2gtk-4.0 --libs --cflags` -larchive -pthread -O3 -std=c++17 -o build/korai-nodownload \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 19a6b04..a1a5539 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,6 +22,7 @@ #include "strnatcmp.hpp" #include "zipextract.hpp" #include "comp.hpp" +#include #ifdef DOWNLOAD #include @@ -299,7 +300,8 @@ void next_chapter(WebKitWebView * webView, Gtk::HeaderBar * titleBar) titleBar->set_subtitle(getMangaName() + " - " + getChapterName()); gtk_widget_grab_focus(GTK_WIDGET(webView)); } - save(); + std::thread t(save); + t.detach(); } else if(position == -2) { @@ -339,7 +341,8 @@ void previous_chapter(WebKitWebView * webView, Gtk::HeaderBar * titleBar) titleBar->set_subtitle(getMangaName() + " - " + getChapterName()); gtk_widget_grab_focus(GTK_WIDGET(webView)); } - save(); + std::thread t(save); + t.detach(); } else if (position == -2) { @@ -384,7 +387,8 @@ void open(WebKitWebView * webview, Gtk::HeaderBar * titlebar) open_chapter(webview); titlebar->set_subtitle(getMangaName() + " - " + getChapterName()); gtk_widget_grab_focus(GTK_WIDGET(webview)); - save(); + std::thread t(save); + t.detach(); break; } } @@ -452,7 +456,8 @@ void delete_manga(WebKitWebView * webview, Gtk::HeaderBar * headbar, Gtk::Popove load_homepage(webview); } } - save(); + std::thread t(save); + t.detach(); } } @@ -467,7 +472,8 @@ void close_manga(WebKitWebView * webView, Gtk::HeaderBar * headbar, Gtk::Popover position = -1; headbar->set_subtitle(""); - save(); + std::thread t(save); + t.detach(); load_homepage(webView); menu->hide();