Remove vestigial code
This commit is contained in:
parent
8534fa4988
commit
eb7790ff8f
4 changed files with 10 additions and 27 deletions
22
src/app.rs
22
src/app.rs
|
|
@ -462,9 +462,6 @@ impl App {
|
|||
}
|
||||
|
||||
fn format_log_entries(&mut self) {
|
||||
use chrono::{DateTime, Local, Timelike};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
if self.log_view_frames.is_empty() {
|
||||
self.log_view_content = vec!["No log entries for this period.".to_string()];
|
||||
return;
|
||||
|
|
@ -829,20 +826,16 @@ impl App {
|
|||
|
||||
fn jump_to_previous_project(&mut self) {
|
||||
// Find the previous project and jump to its first entry
|
||||
let mut current_date = String::new();
|
||||
let mut current_project = String::new();
|
||||
let mut selected_project = String::new();
|
||||
let mut selected_date = String::new();
|
||||
let mut _selected_project = String::new();
|
||||
let mut frame_count = 0;
|
||||
let mut previous_project_first_entry = None;
|
||||
let mut last_different_project_entry = None;
|
||||
|
||||
// Find which project we're currently in
|
||||
for line in &self.log_view_content.clone() {
|
||||
if !line.starts_with('\t') && !line.is_empty() && !line.starts_with(" ") {
|
||||
current_date = line.clone();
|
||||
} else if line.starts_with(" ") && !line.starts_with("\t") {
|
||||
if !current_project.is_empty() && current_project != selected_project {
|
||||
if line.starts_with(" ") && !line.starts_with("\t") {
|
||||
if !current_project.is_empty() && current_project != _selected_project {
|
||||
last_different_project_entry = previous_project_first_entry;
|
||||
}
|
||||
current_project = line.clone();
|
||||
|
|
@ -851,8 +844,7 @@ impl App {
|
|||
|
||||
if self.is_entry_line(line) {
|
||||
if frame_count == self.log_view_selected {
|
||||
selected_project = current_project.clone();
|
||||
selected_date = current_date.clone();
|
||||
_selected_project = current_project.clone();
|
||||
// Jump to the last different project we saw
|
||||
if let Some(entry) = last_different_project_entry {
|
||||
self.log_view_selected = entry;
|
||||
|
|
@ -920,7 +912,7 @@ impl App {
|
|||
fn jump_to_previous_day(&mut self) {
|
||||
// Find the previous day and jump to its first entry
|
||||
let mut current_date = String::new();
|
||||
let mut selected_date = String::new();
|
||||
let mut _selected_date = String::new();
|
||||
let mut frame_count = 0;
|
||||
let mut last_different_day_entry = None;
|
||||
let mut previous_day_first_entry = None;
|
||||
|
|
@ -928,7 +920,7 @@ impl App {
|
|||
// Find which day we're currently in
|
||||
for line in &self.log_view_content.clone() {
|
||||
if !line.starts_with('\t') && !line.is_empty() && !line.starts_with(" ") {
|
||||
if !current_date.is_empty() && current_date != selected_date {
|
||||
if !current_date.is_empty() && current_date != _selected_date {
|
||||
last_different_day_entry = previous_day_first_entry;
|
||||
}
|
||||
current_date = line.clone();
|
||||
|
|
@ -937,7 +929,7 @@ impl App {
|
|||
|
||||
if self.is_entry_line(line) {
|
||||
if frame_count == self.log_view_selected {
|
||||
selected_date = current_date.clone();
|
||||
_selected_date = current_date.clone();
|
||||
// Jump to the last different day we saw
|
||||
if let Some(entry) = last_different_day_entry {
|
||||
self.log_view_selected = entry;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue