Skip to content

Commit

Permalink
Merge pull request #129 from fxdeniz/issue_128
Browse files Browse the repository at this point in the history
Issue 128
  • Loading branch information
fxdeniz authored Jan 28, 2023
2 parents 1298ef8 + e5021fa commit 75c06d8
Show file tree
Hide file tree
Showing 89 changed files with 1,340 additions and 8,140 deletions.
9 changes: 7 additions & 2 deletions Backend/FileMonitorSubSystem/FileMonitoringManager.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "FileMonitoringManager.h"

#include "FileStorageSubSystem/FileStorageManager.h"
#include "Utility/JsonDtoFormat.h"

#include <QDir>
#include <QDebug>
Expand Down Expand Up @@ -140,8 +141,10 @@ void FileMonitoringManager::slotOnAddEventDetected(const QString &fileName, cons
if(info.isDir())
{
bool isFolderMonitored = database->isFolderExist(currentPath);

auto fsm = FileStorageManager::instance();
bool isFolderPersists = fsm->isFolderExistByUserFolderPath(currentPath);
QJsonObject folderJson = fsm->getFolderJsonByUserPath(currentPath);
bool isFolderPersists = folderJson[JsonKeys::IsExist].toBool();

efsw::WatchID watchId = fileWatcher.addWatch(currentPath.toStdString(), &fileSystemEventListener, false);

Expand All @@ -163,8 +166,10 @@ void FileMonitoringManager::slotOnAddEventDetected(const QString &fileName, cons
else if(info.isFile() && !info.isHidden()) // Only accept real files
{
auto status = FileSystemEventDb::ItemStatus::Undefined;

auto fsm = FileStorageManager::instance();
bool isFilePersists = fsm->isFileExistByUserFilePath(currentPath);
QJsonObject fileJson = fsm->getFileJsonByUserPath(currentPath);
bool isFilePersists = fileJson[JsonKeys::IsExist].toBool();

if(isFilePersists)
status = FileSystemEventDb::ItemStatus::Updated;
Expand Down
Loading

0 comments on commit 75c06d8

Please sign in to comment.