diff --git a/motus/brain.cpp b/motus/brain.cpp index b59f3443c31ad94625851beb411e3bc5f64b11f1..bd38bd8b8b546902355acd1827cb877b7f8082dc 100644 --- a/motus/brain.cpp +++ b/motus/brain.cpp @@ -50,10 +50,10 @@ vector<string> Brain::getTxtFiles() { vector<string> txtFiles; try { - // Iterate through the folder + for (const auto& entry : fs::directory_iterator(dicodir)) { if (entry.is_regular_file() && entry.path().extension() == ".txt") { - txtFiles.push_back(entry.path().string()); // Add the file path to the vector + txtFiles.push_back(entry.path().string()); } } } catch (const exception& e) { diff --git a/motus/jeu.h b/motus/jeu.h index cc4ae5bc69b75a3e3ec9ebf35e86a5013c8150b9..5661f1825ff82190866a15606952430845b702df 100644 --- a/motus/jeu.h +++ b/motus/jeu.h @@ -21,19 +21,19 @@ public: Q_INVOKABLE int getWidth(); Q_INVOKABLE int getHeight(); Q_INVOKABLE void startGame(); // pour init depuis QML - QQuickItem* getGameWindow() const { return gameWindow; } // Getter for gameWindow + QQuickItem* getGameWindow() const { return gameWindow; } // Getter pour gameWindow void setLetterModel(LetterModel* model); // Setter pour le modèle signals: void motChanged(); - void gameWindowChanged(); // Signal to notify when the game window is set + void gameWindowChanged(); private: Brain* brain; QQmlApplicationEngine* engine; QString mot; - QQuickItem* gameWindow; // Pointer to the QQuickItem of the GameWindow + QQuickItem* gameWindow; LetterModel* m_letterModel = nullptr; // Modèle QML int currentIndex = 0; // Pour suivre où on écrit int width;