Skip to content

Commit

Permalink
#1603 Resolves issue with de-duplicating events to allow call duratio…
Browse files Browse the repository at this point in the history
…n values to display correctly and minimize the quantity of duplicate events.
  • Loading branch information
Dennis Sheirer committed Jul 22, 2023
1 parent c302c4d commit 4a6017a
Showing 1 changed file with 9 additions and 13 deletions.
Expand Up @@ -56,12 +56,16 @@ public T getItem(int index)
*/
public void add(T item)
{
mItems.addFirst(item);
ClearableHistoryModel.this.fireTableRowsInserted(0, 0);
while(mItems.size() > mHistorySize)
if(!mItems.contains(item))
{
mItems.removeLast();
super.fireTableRowsDeleted(mItems.size() - 1, mItems.size() - 1);
mItems.addFirst(item);
fireTableRowsInserted(0, 0);

while(mItems.size() > mHistorySize)
{
mItems.removeLast();
fireTableRowsDeleted(mItems.size() - 1, mItems.size() - 1);
}
}
}

Expand Down Expand Up @@ -100,14 +104,6 @@ public int getHistorySize()
return mHistorySize;
}

/**
* Resets the history size to the default value.
*/
public void resetHistorySize()
{
setHistorySize(DEFAULT_HISTORY_SIZE);
}

/**
* Sets the history size
* @param historySize
Expand Down

0 comments on commit 4a6017a

Please sign in to comment.