From 77c4841ede7e39dbca160683b8cc313416f6fc78 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Wed, 27 Jan 2016 22:53:58 +0100 Subject: [PATCH] some bugfixes for the new multi query scanning --- filter_search_frame.lua | 1 - post_frame.lua | 1 - scan.lua | 13 ++++++++----- scan_util.lua | 8 -------- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/filter_search_frame.lua b/filter_search_frame.lua index 63a4042..b155ef7 100644 --- a/filter_search_frame.lua +++ b/filter_search_frame.lua @@ -745,7 +745,6 @@ function public.start_search() Aux.scan.start{ queries = { query }, - page = AuxFilterSearchFrameFiltersAllPagesCheckButton:GetChecked() and 0 or AuxFilterSearchFrameFiltersPageEditBox:GetNumber(), on_submit_query = function() current_page = nil end, diff --git a/post_frame.lua b/post_frame.lua index 8253751..cb65079 100644 --- a/post_frame.lua +++ b/post_frame.lua @@ -650,7 +650,6 @@ function private.refresh_entries() Aux.scan.start{ queries = { query }, - page = 0, on_page_loaded = function(page, total_pages) private.status_bar:update_status(100 * (page + 1) / total_pages, 100 * (page + 1) / total_pages) -- TODO private.status_bar:set_text(format('Scanning (Page %d / %d)', page + 1, total_pages)) diff --git a/scan.lua b/scan.lua index 24a7572..18f1fa7 100644 --- a/scan.lua +++ b/scan.lua @@ -44,10 +44,11 @@ function public.abort(k) end function on_abort() - if state and state.params and state.params.on_abort then - state.params.on_abort() + local on_abort = Aux.util.safe_index{state, 'params', 'on_abort' } + state = nil + if on_abort then + return on_abort() end - state = nil end function wait_for_results(k) @@ -119,8 +120,10 @@ function private.scan() state.page = current_query().start_page return private.process_query() else - if state.params.on_complete then - return state.params.on_complete() + local on_complete = state.params.on_complete + state = nil + if on_complete then + return on_complete() end end end diff --git a/scan_util.lua b/scan_util.lua index ba5653c..010232c 100644 --- a/scan_util.lua +++ b/scan_util.lua @@ -40,14 +40,6 @@ function m.find(test, query, page, status_bar, on_failure, on_success) status_bar:set_text('Auction not found') on_failure() end, - next_page = function() - if getn(pages) == 1 then - status_bar:update_status(50, 50) - end - local page = pages[1] - tremove(pages, 1) - return page - end, } end) end \ No newline at end of file