Skip to content

Commit

Permalink
Merge pull request #146 from fxdeniz/issue_145
Browse files Browse the repository at this point in the history
Issue 145
  • Loading branch information
fxdeniz authored Sep 7, 2023
2 parents b9e9dcb + 54e0fe5 commit 7d93897
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 9 deletions.
35 changes: 34 additions & 1 deletion Backend/FileMonitorSubSystem/FileSystemEventDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ QStringList FileSystemEventDb::getMonitoredFolderPathList() const
return result;
}

QStringList FileSystemEventDb::getActiveRootFolderList() const
QStringList FileSystemEventDb::getMonitoredRootFolderList() const
{
QStringList result;
QString columnName = "result_column";
Expand Down Expand Up @@ -599,6 +599,39 @@ QStringList FileSystemEventDb::getActiveRootFolderList() const
return result;
}

QStringList FileSystemEventDb::getMissingRootFolderList() const
{
QStringList result;
QString columnName = "result_column";

QString queryTemplate = " SELECT f1.folder_path AS %1"
" FROM Folder f1 "
" WHERE f1.parent_folder_path IN ("
" SELECT f2.folder_path "
" FROM Folder f2 "
" WHERE f2.efsw_id IS NULL AND f2.status = :1"
" )"
" AND f1.efsw_id IS NULL"
" AND f1.status = :2 ;" ;

queryTemplate = queryTemplate.arg(columnName);

QSqlQuery query(database);
query.prepare(queryTemplate);
query.bindValue(":1", FileSystemEventDb::ItemStatus::Monitored);
query.bindValue(":2", FileSystemEventDb::ItemStatus::Missing);
query.exec();

while(query.next())
{
QSqlRecord record = query.record();
QString item = record.value(columnName).toString();
result.append(item);
}

return result;
}

QStringList FileSystemEventDb::getDirectChildFolderListOfFolder(const QString pathToFolder) const
{
QStringList result;
Expand Down
3 changes: 2 additions & 1 deletion Backend/FileMonitorSubSystem/FileSystemEventDb.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class FileSystemEventDb
QString getOldNameOfFolder(const QString &pathToFolder) const;
QString getOldNameOfFile(const QString &pathToFile) const;
QStringList getMonitoredFolderPathList() const;
QStringList getActiveRootFolderList() const;
QStringList getMonitoredRootFolderList() const;
QStringList getMissingRootFolderList() const;
QStringList getDirectChildFolderListOfFolder(const QString pathToFolder) const;
QStringList getDirectChildFileListOfFolder(const QString &pathToFolder) const;
QStringList getEventfulFileListOfFolder(const QString &pathToFolder) const;
Expand Down
3 changes: 2 additions & 1 deletion Gui/DataModels/TabFileMonitor/TreeModelFileMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ int Model::rowCount(const QModelIndex &parent) const

void Model::setupModelData()
{
QStringList rootFolders = fsEventDb->getActiveRootFolderList();
QStringList rootFolders = fsEventDb->getMonitoredRootFolderList();
rootFolders.append(fsEventDb->getMissingRootFolderList());

for(const QString &currentRootFolderPath : rootFolders)
{
Expand Down
2 changes: 1 addition & 1 deletion Gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void MainWindow::on_menuAction_DebugFileMonitor_triggered()
void MainWindow::on_menuAction_AboutApp_triggered()
{
QString title = tr("About NeSync");
QString message = tr("<center><h1>NeSync 1.8.0 [Pre-Alpha]</h1><center/>"
QString message = tr("<center><h1>NeSync 1.8.1 [Pre-Alpha]</h1><center/>"
"<hr>"
"Thanks for using NeSync.<br>"
"This is a <b>pre-alpha version</b>, <b>DO NOT USE</b> for critical things.<br>"
Expand Down
2 changes: 1 addition & 1 deletion Installer/nsis_script.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Unicode True
!define APP_NAME "NeSync"
!define COMP_NAME "Deniz Yilmazok (github.com/fxdeniz)"
!define WEB_SITE "github.com/fxdeniz/NeSync"
!define VERSION "1.8.0.0"
!define VERSION "1.8.1.0"
!define COPYRIGHT "2023 - Deniz Yilmazok, GPLv3"
!define DESCRIPTION "NeSync Installer"
!define INSTALLER_NAME "${BIN_SOURCE_DIR}\nesync_${VERSION}_win64_setup.exe"
Expand Down
8 changes: 4 additions & 4 deletions Resources/res_win.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
IDI_ICON1 ICON "app_icon.ico"

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,8,0,0
PRODUCTVERSION 1,8,0,0
FILEVERSION 1,8,1,0
PRODUCTVERSION 1,8,1,0
FILEFLAGS 0x0L
FILEFLAGSMASK 0x3fL
FILEOS 0x00040004L
Expand All @@ -17,12 +17,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Deniz Yilmazok (github.com/fxdeniz)"
VALUE "FileDescription", "NeSync - Local file sync & backups"
VALUE "FileVersion", "1.8.0.0"
VALUE "FileVersion", "1.8.1.0"
VALUE "LegalCopyright", "2023 - Deniz Yilmazok, GPLv3"
VALUE "InternalName", "NeSync"
VALUE "OriginalFilename", "NeSync.exe"
VALUE "ProductName", "NeSync"
VALUE "ProductVersion", "1.8.0.0"
VALUE "ProductVersion", "1.8.1.0"
END
END
BLOCK "VarFileInfo"
Expand Down

0 comments on commit 7d93897

Please sign in to comment.