Исправлен webkit

pull/3/head
Igor Belitskiy 2 years ago
parent 696928b924
commit 98e6024390

@ -8,22 +8,28 @@ include_directories(${GTK_INCLUDE_DIRS})
link_directories(${GTK_LIBRARY_DIRS})
add_definitions(${GTK_CFLAGS_OTHER})
option(WEBKIT_FOUND "" ON)
find_library(WEBKIT_LIBRARIES_FOUND webkit2gtk-4.0 webkit2gtk-web-extension-4.0)
if(WEBKIT_FOUND)
option(WEBKIT_FOUND "No" OFF)
find_library(WEBKIT_LIBRARIES_FOUND webkit2gtk-4.0 webkit2gtk-web-extension-4.0)
if(WEBKIT_LIBRARIES_FOUND)
option(WEBKIT_FOUND "Yes" ON)
PKG_CHECK_MODULES(WEBKIT REQUIRED webkit2gtk-4.0 webkit2gtk-web-extension-4.0)
include_directories(${WEBKIT_INCLUDE_DIRS})
link_directories(${WEBKIT_LIBRARY_DIRS})
add_definitions(${WEBKIT_CFLAGS_OTHER})
endif()
configure_file(ubl-settings-diskquota.h.in ubl-settings-diskquota-cm.h)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \
-O2 -pipe -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection -g")
set(SOURCE_FILES
ubl-settings-diskquota-cm.h
ubl-settings-diskquota.h
ubl-settings-diskquota.cc
ubconfig_quotas.h
@ -53,6 +59,7 @@ set(LIBRARIES
pthread)
add_executable(ubl-settings-diskquota ${SOURCE_FILES})
target_link_libraries(ubl-settings-diskquota PUBLIC ${WEBKIT_LIBRARIES} ${LIBRARIES})
target_include_directories(ubl-settings-diskquota PUBLIC
"${PROJECT_BINARY_DIR}"

@ -43,13 +43,9 @@ void MainWindow::settings() {
obj_quotas_sys.set_map_gui(map_gui_cfg);
obj_quotas_ubconfig.set_map_gui(map_gui_cfg);
#ifdef WEBKIT_FOUND
void *handle=NULL;
handle = dlopen("libwebkit2gtk-4.0.so", RTLD_LAZY);
if (handle) {
one = WEBKIT_WEB_VIEW( webkit_web_view_new() );
three = Glib::wrap(GTK_WIDGET(one));
wndWeb->add(*three);
}
#endif
if (geteuid() == 0) {
this->load_system_cfg();
@ -462,11 +458,7 @@ void MainWindow::get_builder() {
builder->get_widget("btnFilterUsers", btnFilterUsers);
builder->get_widget("btnFilterGroups", btnFilterGroups);
#ifdef WEBKIT_FOUND
void *handle=NULL;
handle = dlopen("libwebkit2gtk-4.0.so", RTLD_LAZY);
if (handle) {
builder->get_widget("wndWeb", wndWeb);
}
#endif
builder->get_widget("lblHeadeWndWeb", lblHeadeWndWeb);
builder->get_widget("lblwebHeaderName", lblwebHeaderName);
@ -690,15 +682,8 @@ void MainWindow::synopsis_show() {
void MainWindow::open_browser() {
#ifdef WEBKIT_FOUND
void *handle=NULL;
handle = dlopen("libwebkit2gtk-4.0.so", RTLD_LAZY);
if (handle) {
webkit_web_view_load_uri(one, link_doc);
wndWeb->show_all();
}
else {
this->template_open_browser();
}
#else
this->template_open_browser();
#endif
@ -791,13 +776,6 @@ void MainWindow::info_warning_error(int mess) {
}
MainWindow::~MainWindow() {
#ifdef WEBKIT_FOUND
void *handle=NULL;
handle = dlopen("libwebkit2gtk-4.0.so", RTLD_LAZY);
if (handle) {
free(one);
}
#endif
}
void help() {

@ -10,6 +10,7 @@
#include "system_quotas.h"
#include "ubconfig_quotas.h"
#include <dlfcn.h>
#include "ubl-settings-diskquota-cm.h"
#ifdef WEBKIT_FOUND
#include <webkit2/webkit2.h>
#endif

@ -0,0 +1 @@
#cmakedefine WEBKIT_FOUND
Loading…
Cancel
Save