gui: mainwindow: Improve preview status reporting
Better represent the state of available previews. Only add paths to ui->comboPreviewFiles once
This commit is contained in:
부모
47874b3706
커밋
11b070ed42
@ -806,6 +806,7 @@ void MainWindow::handleSearchResults(const QVector<SearchResult> &results)
|
|||||||
ui->comboPreviewFiles->clear();
|
ui->comboPreviewFiles->clear();
|
||||||
ui->comboPreviewFiles->addItem("All previews");
|
ui->comboPreviewFiles->addItem("All previews");
|
||||||
ui->comboPreviewFiles->setVisible(true);
|
ui->comboPreviewFiles->setVisible(true);
|
||||||
|
ui->lblTotalPreviewPagesCount->setText("");
|
||||||
|
|
||||||
bool hasDeleted = false;
|
bool hasDeleted = false;
|
||||||
QHash<QString, bool> seenMap;
|
QHash<QString, bool> seenMap;
|
||||||
@ -816,7 +817,6 @@ void MainWindow::handleSearchResults(const QVector<SearchResult> &results)
|
|||||||
|
|
||||||
if(!seenMap.contains(absPath))
|
if(!seenMap.contains(absPath))
|
||||||
{
|
{
|
||||||
seenMap[absPath] = true;
|
|
||||||
QString fileName = pathInfo.fileName();
|
QString fileName = pathInfo.fileName();
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem(ui->treeResultsList);
|
QTreeWidgetItem *item = new QTreeWidgetItem(ui->treeResultsList);
|
||||||
|
|
||||||
@ -830,17 +830,18 @@ void MainWindow::handleSearchResults(const QVector<SearchResult> &results)
|
|||||||
bool exists = pathInfo.exists();
|
bool exists = pathInfo.exists();
|
||||||
if(exists)
|
if(exists)
|
||||||
{
|
{
|
||||||
if(!result.wasContentSearch)
|
if(result.wasContentSearch)
|
||||||
{
|
{
|
||||||
continue;
|
if(!pathInfo.suffix().contains("htm")) // hack until we can preview them properly...
|
||||||
}
|
|
||||||
|
|
||||||
if(!pathInfo.suffix().contains("htm")) // hack until we can preview them properly...
|
|
||||||
{
|
|
||||||
if(PreviewGenerator::get(pathInfo) != nullptr)
|
|
||||||
{
|
{
|
||||||
this->previewableSearchResults.append(result);
|
if(PreviewGenerator::get(pathInfo) != nullptr)
|
||||||
ui->comboPreviewFiles->addItem(result.fileData.absPath);
|
{
|
||||||
|
this->previewableSearchResults.append(result);
|
||||||
|
if(!seenMap.contains(result.fileData.absPath))
|
||||||
|
{
|
||||||
|
ui->comboPreviewFiles->addItem(result.fileData.absPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -848,6 +849,7 @@ void MainWindow::handleSearchResults(const QVector<SearchResult> &results)
|
|||||||
{
|
{
|
||||||
hasDeleted = true;
|
hasDeleted = true;
|
||||||
}
|
}
|
||||||
|
seenMap[absPath] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->treeResultsList->resizeColumnToContents(0);
|
ui->treeResultsList->resizeColumnToContents(0);
|
||||||
@ -863,6 +865,7 @@ void MainWindow::handleSearchResults(const QVector<SearchResult> &results)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString statusText = "Results: " + QString::number(results.size()) + " files";
|
QString statusText = "Results: " + QString::number(results.size()) + " files";
|
||||||
|
statusText += ", previewable: " + QString::number(this->previewableSearchResults.count());
|
||||||
if(hasDeleted)
|
if(hasDeleted)
|
||||||
{
|
{
|
||||||
statusText += " WARNING: Some files are inaccessible. No preview available for those. Index may be out of sync";
|
statusText += " WARNING: Some files are inaccessible. No preview available for those. Index may be out of sync";
|
||||||
|
불러오는 중...
Reference in New Issue
Block a user