logic: Fixed indexing progress file count in status bar and status view (issue #387)

bug id = 387
This commit is contained in:
Eberhard Graether
2017-05-19 14:26:52 +02:00
parent 9088de8105
commit 65b5bd47f6
7 changed files with 19 additions and 10 deletions
+2 -1
View File
@@ -31,7 +31,8 @@ DialogView::IndexingOptions DialogView::startIndexingDialog(
return IndexingOptions();
}
void DialogView::updateIndexingDialog(size_t fileCount, size_t totalFileCount, std::string sourcePath)
void DialogView::updateIndexingDialog(
size_t startedFileCount, size_t finishedFileCount, size_t totalFileCount, std::string sourcePath)
{
}
+2 -1
View File
@@ -41,7 +41,8 @@ public:
virtual IndexingOptions startIndexingDialog(
size_t cleanFileCount, size_t indexFileCount, size_t totalFileCount, IndexingOptions options);
virtual void updateIndexingDialog(size_t fileCount, size_t totalFileCount, std::string sourcePath);
virtual void updateIndexingDialog(
size_t startedFileCount, size_t finishedFileCount, size_t totalFileCount, std::string sourcePath);
virtual void finishedIndexingDialog(
size_t indexedFileCount, size_t totalIndexedFileCount, size_t completedFileCount, size_t totalFileCount,
float time, ErrorCountInfo errorInfo, bool interrupted);
+6 -2
View File
@@ -35,12 +35,14 @@ TaskBuildIndex::TaskBuildIndex(
, m_processCount(processCount)
, m_interrupted(false)
, m_lastCommandCount(0)
, m_indexingFileCount(0)
, m_runningThreadCount(0)
{
}
void TaskBuildIndex::doEnter(std::shared_ptr<Blackboard> blackboard)
{
m_indexingFileCount = 0;
updateIndexingDialog(blackboard, FilePath());
{
@@ -93,6 +95,7 @@ Task::TaskState TaskBuildIndex::doUpdate(std::shared_ptr<Blackboard> blackboard)
std::vector<FilePath> indexingFiles = m_interprocessIndexingStatusManager.getCurrentlyIndexedSourceFilePaths();
for (const FilePath& path : indexingFiles)
{
m_indexingFileCount++;
updateIndexingDialog(blackboard, path);
}
@@ -255,7 +258,8 @@ bool TaskBuildIndex::fetchIntermediateStorages(std::shared_ptr<Blackboard> black
return true;
}
void TaskBuildIndex::updateIndexingDialog(std::shared_ptr<Blackboard> blackboard, const FilePath& sourcePath)
void TaskBuildIndex::updateIndexingDialog(
std::shared_ptr<Blackboard> blackboard, const FilePath& sourcePath)
{
// TODO: factor in unindexed files...
int sourceFileCount = 0;
@@ -269,7 +273,7 @@ void TaskBuildIndex::updateIndexingDialog(std::shared_ptr<Blackboard> blackboard
if (std::shared_ptr<DialogView> dialogView = Application::getInstance()->getDialogView())
{
dialogView->updateIndexingDialog(
indexedSourceFileCount, sourceFileCount, sourcePath.str()
m_indexingFileCount, indexedSourceFileCount, sourceFileCount, sourcePath.str()
);
}
}
+1
View File
@@ -57,6 +57,7 @@ protected:
unsigned int m_processCount;
bool m_interrupted;
size_t m_lastCommandCount;
size_t m_indexingFileCount;
// store as plain pointers to avoid deallocation issues when closing app during indexing
std::vector<std::thread*> m_processThreads;
+1 -1
View File
@@ -29,7 +29,7 @@ void TaskParseWrapper::doEnter(std::shared_ptr<Blackboard> blackboard)
blackboard->get("source_file_count", sourceFileCount);
if (std::shared_ptr<DialogView> dialogView = Application::getInstance()->getDialogView())
{
dialogView->updateIndexingDialog(0, sourceFileCount, "");
dialogView->updateIndexingDialog(0, 0, sourceFileCount, "");
}
m_start = utility::durationStart();
+5 -4
View File
@@ -144,13 +144,14 @@ DialogView::IndexingOptions QtDialogView::startIndexingDialog(
return result;
}
void QtDialogView::updateIndexingDialog(size_t fileCount, size_t totalFileCount, std::string sourcePath)
void QtDialogView::updateIndexingDialog(
size_t startedFileCount, size_t finishedFileCount, size_t totalFileCount, std::string sourcePath)
{
if (sourcePath.size())
{
std::stringstream ss;
ss << "Indexing files: [";
ss << fileCount << "/";
ss << "Indexing file: [";
ss << startedFileCount << "/";
ss << totalFileCount << "] ";
ss << sourcePath;
MessageStatus(ss.str(), false, true).dispatch();
@@ -170,7 +171,7 @@ void QtDialogView::updateIndexingDialog(size_t fileCount, size_t totalFileCount,
if (window && window->getType() == QtIndexingDialog::DIALOG_INDEXING)
{
window->updateIndexingProgress(fileCount, totalFileCount, sourcePath);
window->updateIndexingProgress(finishedFileCount, totalFileCount, sourcePath);
setUIBlocked(true);
}
}
+2 -1
View File
@@ -36,7 +36,8 @@ public:
virtual DialogView::IndexingOptions startIndexingDialog(
size_t cleanFileCount, size_t indexFileCount, size_t totalFileCount, DialogView::IndexingOptions options) override;
virtual void updateIndexingDialog(size_t fileCount, size_t totalFileCount, std::string sourcePath) override;
virtual void updateIndexingDialog(
size_t startedFileCount, size_t finishedFileCount, size_t totalFileCount, std::string sourcePath) override;
virtual void finishedIndexingDialog(
size_t indexedFileCount, size_t totalIndexedFileCount, size_t completedFileCount, size_t totalFileCount,
float time, ErrorCountInfo errorInfo, bool interrupted) override;