some work on the grid layout and items

This commit is contained in:
Crylia
2024-06-08 19:00:34 +02:00
parent b1cfa155f9
commit 09987eed01
13 changed files with 290 additions and 36 deletions

View File

@@ -4,12 +4,19 @@
#include <iostream>
FileController::FileController( ) {
m_fmWorker = std::make_shared<FileMonitor>(QString("/home/crylia/Dokumente"),
#ifdef _WIN32
m_fmWorker = std::make_shared<FileMonitor>(std::filesystem::path(std::getenv("USERPROFILE")),
std::chrono::milliseconds(1000));
#else
m_fmWorker = std::make_shared<FileMonitor>(std::filesystem::path("/home/crylia/Dokumente"),
std::chrono::milliseconds(1000));
#endif
m_fmWorker->moveToThread(&m_fsThread);
connect(this, &FileController::operate, m_fmWorker.get( ), &FileMonitor::start);
connect(m_fmWorker.get( ), &FileMonitor::update, this, &FileController::update);
connect(m_fmWorker.get( ), &FileMonitor::newPathEntered, this, &FileController::emitNewPath);
m_fsThread.start( );
@@ -21,6 +28,11 @@ FileController::~FileController( ) {
m_fsThread.wait( );
}
void FileController::update(const QString path, const FileEvent event) {
std::cout << path.toStdString( ) << std::endl;
void FileController::update(const std::filesystem::path path, const FileEvent event) {
std::cout << path.string( ) << std::endl;
}
void FileController::emitNewPath(const std::unordered_map<std::filesystem::path, std::filesystem::file_time_type> paths) {
std::cout << "test" << std::endl;
emit newPathEntered(paths);
}