summaryrefslogtreecommitdiffstats
path: root/src/run.rs
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2019-05-29 23:06:38 -0400
committerJiayi Zhao <jeff.no.zhao@gmail.com>2019-05-29 23:07:27 -0400
commit5980d762dba38b003dbe54506cdd58ee85f97c8c (patch)
tree28e07e112586b73e1de426f7ae34c8c2afc68fdb /src/run.rs
parent5d8525a9cc8a61e8e66a92f66132ad11ce112ff7 (diff)
move hostname and username out of Context and into a static global
Diffstat (limited to 'src/run.rs')
-rw-r--r--src/run.rs28
1 files changed, 4 insertions, 24 deletions
diff --git a/src/run.rs b/src/run.rs
index 2757230..ef8a499 100644
--- a/src/run.rs
+++ b/src/run.rs
@@ -66,24 +66,14 @@ fn join_thread(
let dirty_tab = &mut context.tabs[tab_src];
dirty_tab.reload_contents(&context.config_t.sort_option)?;
if tab_src == context.curr_tab_index {
- dirty_tab.refresh(
- view,
- &context.config_t,
- &context.username,
- &context.hostname,
- );
+ dirty_tab.refresh(view, &context.config_t);
}
}
if tab_dest != tab_src && tab_dest < context.tabs.len() {
let dirty_tab = &mut context.tabs[tab_dest];
dirty_tab.reload_contents(&context.config_t.sort_option)?;
if tab_dest == context.curr_tab_index {
- dirty_tab.refresh(
- view,
- &context.config_t,
- &context.username,
- &context.hostname,
- );
+ dirty_tab.refresh(view, &context.config_t);
}
}
}
@@ -117,12 +107,7 @@ fn process_threads(context: &mut JoshutoContext, view: &JoshutoView) -> Result<(
fn resize_handler(context: &mut JoshutoContext, view: &JoshutoView) {
ui::redraw_tab_view(&view.tab_win, &context);
let curr_tab = &mut context.tabs[context.curr_tab_index];
- curr_tab.refresh(
- view,
- &context.config_t,
- &context.username,
- &context.hostname,
- );
+ curr_tab.refresh(view, &context.config_t);
ncurses::doupdate();
}
@@ -133,12 +118,7 @@ fn init_context(context: &mut JoshutoContext, view: &JoshutoView) {
context.tabs.push(tab);
context.curr_tab_index = context.tabs.len() - 1;
let curr_tab = &mut context.tabs[context.curr_tab_index];
- curr_tab.refresh(
- view,
- &context.config_t,
- &context.username,
- &context.hostname,
- );
+ curr_tab.refresh(view, &context.config_t);
ui::redraw_tab_view(&view.tab_win, &context);
ncurses::doupdate();
}