fxdeniz / nesync Goto Github PK
View Code? Open in Web Editor NEWLocal file sync & backups
License: GNU General Public License v3.0
Local file sync & backups
License: GNU General Public License v3.0
Currently database dependency created inside of the constructor. This causes name collision for connection in different threads.
More elegant mechanism is needed.
Replace buttons next to lineEdits to inside of lineEdit.
Example available in tutorial here: KDAB youtube channel
When adding row to the table
When adding row to the table
DialogAddNewFile::on_buttonSelectNewFile_clicked()
if possibleTableModelNewAddedFiles::TableItem
Provide a way to user for adding new file into system.
Steps of use case
Open dialog and allow user for selecting file which is about be added into db.
Addition must be done through background task
If addition successful:
If addition failed:
Group added files
When adding row to the table
When adding row to the table
Run clang tools for linting. Messages from these tools were ignored at the beginning. Warnings must be handled comprehensively.
Few warnings I remember:
This happens whenever FileStorageManager::addUnRegisteredFile() is called.
Memory consumption is related with file size.
Problems comes from this statement QString fileHash = this->getHashOf(sourceFile.readAll());
call to sourceFile.readAll()
must be replaced something more efficent.
Steps of use case:
FileMonitoringManager
have to receive paths to files from FileStorageManager
When file event occurred, this event should be listed in table view of File Monitor
Some types of events may require these checks from database.
There are few type of events that can be displayed:
After each event, table view should be refreshed
for example calling FileStorageManager::addNewFile()
on .gitignore
or .sample_file.txt
returns false.
Steps of use case:
All request to back-end must be done through always running background task
File explorer must start root folder opened
File explorer must allow user viewing user content
User must navigate using back and forward buttons
FileMonitoringManager::addTargetsFromPredictionList()
designed to emit some signals, when item from prediction list is not exist on user file system. These signals are:
signalPredictedFileNotFound()
signalPredictedFolderNotFound()
And pseudo code for catching this scenario is here:
QFileInfo info(currentPath);
if(info.isFile()) ---------------> // Check 1
{
if(info.exists())
processFile();
else
emit signalPredictedFileNotFound(currentPath);
}
else if(info.isDir()) ---------------> // Check 2
{
if(info.exists())
processDir();
else
emit signalPredictedFolderNotFound(currentPath);
}
else ---------------> // Else condition
emit signalPredictionTargetNotRecognized(currentPath);
But this logic has an error. That is, we first need to check whether QFileInfo info(currentPath)
exist or not. Then, we need to run Check 1 and Check 2. When QFileInfo info(currentPath)
not exist, Check 1 and Check 2 always fails. And this makes, signalPredictedFileNotFound()
and signalPredictedFolderNotFound()
invalid. Since they are never going to be emitted.
New logic should be:
QFileInfo info(currentPath);
if(info.exist())
{
if(info.isFile()) ---------------> // Check 1
processFile();
else if(info.isDir()) ---------------> // Check 2
processDir();
}
else ---------------> // Else condition
emit signalPredictionTargetNotRecognized(currentPath);
Therefore, these signals are unnecessary:
signalPredictedFileNotFound()
signalPredictedFolderNotFound()
There is a typo in the first line of this function which is QSqlQuery query(this->getTableName());
typo is this->getTableName()
it should be replaced with this->getDb()
This was a very subtle yet critical bug. It went under radar until FileStorageManager
used in multi-threaded context.
I encountered very weird bugs and debug messages such as "Database driver is not loaded". LoL
Underlying problem was that, when FileStorageManager
run in a multi-threaded environment, every connection requires unique name. But this typo caused database dependency to not properly delivered to RowInserter
instance. As a result, QSqlQuery
used fallback mechanism to use default connection. But, there was no default connection.
It was a very critical bug, caused unexplained catastrophic failures in the system.
Now it's solved.
[Insert more coffee here for sleepless nights]
This is needed for making FileMonitoringManager movable inside of QThread objects.
Two statements below
QString fileHash = this->getHashOf(sourceFile.readAll());
and
bool isFileCopied = sourceFile.copy(internalFilePath);
can be run inside QtConcurrent::run() as lambdas
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.