aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/InstanceManager.cpp6
-rw-r--r--src/LuaRuntimeApi.hpp3
-rw-r--r--src/WindowActionRouter.cpp2
-rw-r--r--src/WindowActionRouter.hpp1
4 files changed, 5 insertions, 7 deletions
diff --git a/src/InstanceManager.cpp b/src/InstanceManager.cpp
index 4fb27f9..3f961ec 100644
--- a/src/InstanceManager.cpp
+++ b/src/InstanceManager.cpp
@@ -34,8 +34,7 @@ void InstanceManager::server_init() {
server = new QLocalServer(this);
is_server_mode = true;
- connect(server, &QLocalServer::newConnection, this,
- &InstanceManager::handle_new_connection);
+ connect(server, &QLocalServer::newConnection, this, &InstanceManager::handle_new_connection);
QLocalServer::removeServer(socket_path);
if (!server->listen(socket_path)) {
@@ -58,8 +57,7 @@ void InstanceManager::handle_new_connection() {
if (client == nullptr)
return;
- connect(client, &QLocalSocket::disconnected, client,
- &QLocalSocket::deleteLater);
+ connect(client, &QLocalSocket::disconnected, client, &QLocalSocket::deleteLater);
client->waitForReadyRead();
while (client->canReadLine()) {
diff --git a/src/LuaRuntimeApi.hpp b/src/LuaRuntimeApi.hpp
index 80e8bc2..4767134 100644
--- a/src/LuaRuntimeApi.hpp
+++ b/src/LuaRuntimeApi.hpp
@@ -4,7 +4,6 @@
#include "LuaRuntime.hpp"
#include "WindowActionRouter.hpp"
-#include "lua.h"
int lua_api_view_set_url(lua_State *state) {
const char *url = lua_tostring(state, 1);
@@ -190,7 +189,7 @@ int lua_event_register(lua_State *state) {
int lua_api_search_set_text(lua_State *state) {
const char *text = lua_tostring(state, 1);
- WebViewId view_id = lua_isnoneornil(state, 1) ? 0 : lua_tointeger(state, 1);
+ WebViewId view_id = lua_isnoneornil(state, 2) ? 0 : lua_tointeger(state, 2);
auto &runtime = LuaRuntime::instance();
emit runtime.search_requested(text, view_id);
return 1;
diff --git a/src/WindowActionRouter.cpp b/src/WindowActionRouter.cpp
index 424dda9..2eabc94 100644
--- a/src/WindowActionRouter.cpp
+++ b/src/WindowActionRouter.cpp
@@ -64,7 +64,7 @@ void WindowActionRouter::initialize(Configuration *config) {
// Search
connect(&runtime, &LuaRuntime::search_requested, this,
[this](const QString &text, WebViewId webview_id) {
- current_search_text = text.trimmed();
+ set_current_search_text(text.trimmed());
find_current_search_text(webview_id, true);
});
connect(&runtime, &LuaRuntime::search_next_requested, this,
diff --git a/src/WindowActionRouter.hpp b/src/WindowActionRouter.hpp
index b749642..c43ee04 100644
--- a/src/WindowActionRouter.hpp
+++ b/src/WindowActionRouter.hpp
@@ -40,6 +40,7 @@ public:
KeyMode fetch_current_mode() const;
DEFINE_GETTER(fetch_current_search_text, current_search_text)
+ DEFINE_SETTER(set_current_search_text, current_search_text)
DELEGATE(&event_queue, dispatch_event, dispatch_event)
DELEGATE(&event_queue, register_event, register_event)