some changes on the filemonitor signals

This commit is contained in:
2024-06-12 15:41:12 +02:00
parent 09987eed01
commit df5e9bdfa9
5 changed files with 105 additions and 76 deletions

View File

@@ -1,20 +1,22 @@
#include "GridItemView.hpp"
#include <iostream>
GridItemView::GridItemView(QWidget* parent)
: QFrame(parent),
fileController(std::make_shared<FileController>( )) {
GridItemView::GridItemView(QWidget *parent)
: QFrame(parent), fileController(std::make_shared<FileController>()) {
QGridLayout* mainLayout = new QGridLayout( );
QGridLayout *mainLayout = new QGridLayout();
connect(fileController.get( ), &FileController::newPathEntered, this, [this, mainLayout](const std::unordered_map<std::filesystem::path, std::filesystem::file_time_type> paths) {
std::cout << "path.first" << std::endl;
for (auto path : paths) {
mainLayout->addWidget(new GridItem(path.first, this));
}
});
connect(fileController.get(), &FileController::pathChanged, this,
[this,
mainLayout](const std::unordered_map<std::filesystem::path,
std::filesystem::file_time_type>
paths) {
std::cout << "path.first" << std::endl;
for (auto path : paths) {
mainLayout->addWidget(new GridItem(path.first, this));
}
});
}
GridItemView::~GridItemView( ) { }
GridItemView::~GridItemView() {}