[overlay] clear overlay when file is removed

This commit is contained in:
Timothy Stack 2014-01-16 06:37:02 -08:00
parent 73bde9dee3
commit 9906e949cf
3 changed files with 17 additions and 7 deletions

View File

@ -165,6 +165,7 @@ public:
}
if (lss.text_line_count() == 0) {
this->fos_log_helper.clear();
return 0;
}

View File

@ -44,6 +44,13 @@ class log_data_helper
public:
log_data_helper(logfile_sub_source &lss) : ldh_log_source(lss) { };
void clear() {
this->ldh_file = NULL;
this->ldh_parser.reset();
this->ldh_scanner.reset();
this->ldh_namer.reset();
};
bool parse_line(vis_line_t line, bool allow_middle = false) {
return this->parse_line(this->ldh_log_source.at(line), allow_middle);
}

View File

@ -536,15 +536,17 @@ bool logfile_sub_source::rebuild_index(observer *obs, bool force)
total_lines);
}
if (action_for_prev_line == logfile_filter::INCLUDE) {
while (last_owner->ld_indexing.ld_start <=
if (last_owner != NULL) {
if (action_for_prev_line != logfile_filter::EXCLUDE) {
while (last_owner->ld_indexing.ld_start <=
last_owner->ld_indexing.ld_last) {
this->lss_index.push_back(last_owner->ld_indexing.ld_start);
++last_owner->ld_indexing.ld_start;
this->lss_index.push_back(last_owner->ld_indexing.ld_start);
++last_owner->ld_indexing.ld_start;
}
}
else {
this->lss_filtered_count += 1;
}
}
else if (action_for_prev_line == logfile_filter::EXCLUDE) {
this->lss_filtered_count += 1;
}
for (iter = this->lss_files.begin();