Skip to content

Commit

Permalink
Improved speed when loading DLT files, when plugins and filters are d…
Browse files Browse the repository at this point in the history
…isabled.

Signed-off-by: Alexander Wenzel <[email protected]>
  • Loading branch information
alexmucde committed Aug 3, 2023
1 parent 2c71372 commit f8ce869
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/dltfileindexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ void DltFileIndexer::run()
currentRun = 1;

// index
if(mode == modeIndexAndFilter)
if(mode == modeIndex || mode == modeIndexAndFilter)
{
for(int num=0;num < dltFile->getNumberOfFiles();num++)
{
Expand Down
2 changes: 1 addition & 1 deletion src/dltfileindexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class DltFileIndexer : public QThread
// destructor
~DltFileIndexer();

typedef enum { modeNone, modeIndexAndFilter, modeFilter, modeDefaultFilter } IndexingMode;
typedef enum { modeNone, modeIndex, modeIndexAndFilter, modeFilter, modeDefaultFilter } IndexingMode;

// create main index
bool index(int num);
Expand Down
17 changes: 16 additions & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1794,6 +1794,12 @@ void MainWindow::reloadLogFileFinishIndex()
this->update(); // force update
restoreSelection();

if(( dltIndexer->getMode() == DltFileIndexer::modeIndex))
{
// hide progress bar when finished
statusProgressBar->reset();
statusProgressBar->hide();
}
}

void MainWindow::reloadLogFileFinishFilter()
Expand Down Expand Up @@ -1900,7 +1906,16 @@ void MainWindow::reloadLogFile(bool update, bool multithreaded)
}
else // no update
{
dltIndexer->setMode(DltFileIndexer::modeIndexAndFilter);
if(QDltSettingsManager::getInstance()->value("startup/filtersEnabled", true).toBool() || pluginsEnabled == true)
{
//qDebug() << "indexer with filter" << __LINE__;
dltIndexer->setMode(DltFileIndexer::modeIndexAndFilter);
}
else
{
dltIndexer->setMode(DltFileIndexer::modeIndex);
}

clearSelection();
}

Expand Down

0 comments on commit f8ce869

Please sign in to comment.