mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
another timeline optimization to avoid unneccessary file object creation when populating the chart from mactime
This commit is contained in:
parent
4a242017e5
commit
b65d810879
@ -698,7 +698,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar,
|
|||||||
return month;
|
return month;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(AbstractFile af, int month, int day) {
|
public void add(long fileId, int month, int day) {
|
||||||
// see if this month is in the list
|
// see if this month is in the list
|
||||||
MonthEpoch monthEpoch = null;
|
MonthEpoch monthEpoch = null;
|
||||||
for (MonthEpoch me : months) {
|
for (MonthEpoch me : months) {
|
||||||
@ -714,7 +714,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add the file the the MonthEpoch object
|
// add the file the the MonthEpoch object
|
||||||
monthEpoch.add(af, day);
|
monthEpoch.add(fileId, day);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -757,7 +757,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar,
|
|||||||
return de;
|
return de;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(AbstractFile af, int day) {
|
public void add(long fileId, int day) {
|
||||||
DayEpoch dayEpoch = null;
|
DayEpoch dayEpoch = null;
|
||||||
for (DayEpoch de : days) {
|
for (DayEpoch de : days) {
|
||||||
if (de.getDayInt() == day) {
|
if (de.getDayInt() == day) {
|
||||||
@ -771,7 +771,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar,
|
|||||||
days.add(dayEpoch);
|
days.add(dayEpoch);
|
||||||
}
|
}
|
||||||
|
|
||||||
dayEpoch.add(af);
|
dayEpoch.add(fileId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -807,8 +807,8 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar,
|
|||||||
return fileIds.size();
|
return fileIds.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(AbstractFile af) {
|
public void add(long fileId) {
|
||||||
fileIds.add(af.getId());
|
fileIds.add(fileId);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Long> getEvents() {
|
List<Long> getEvents() {
|
||||||
@ -901,16 +901,8 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar,
|
|||||||
prevYear = year;
|
prevYear = year;
|
||||||
}
|
}
|
||||||
|
|
||||||
// create and add the file
|
|
||||||
AbstractFile file;
|
|
||||||
try {
|
|
||||||
file = skCase.getAbstractFileById(ObjId);
|
|
||||||
} catch (TskCoreException ex) {
|
|
||||||
logger.log(Level.SEVERE, "Could not find a file with ID " + ObjId, ex);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (ye != null) {
|
if (ye != null) {
|
||||||
ye.add(file, month, day);
|
ye.add(ObjId, month, day);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user