summaryrefslogtreecommitdiff
path: root/plugin/src/Caelestia/filesystemmodel.hpp
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-01 17:41:26 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-01 17:41:26 +1000
commit8b1f2be27be18459ba2c8f4d675b5bf36f7d2307 (patch)
tree1a46525d6d3b4f50c17d0dd7aa41930895bdb257 /plugin/src/Caelestia/filesystemmodel.hpp
parentplugin/fsm: only provide modelData role (diff)
downloadcaelestia-shell-8b1f2be27be18459ba2c8f4d675b5bf36f7d2307.tar.gz
caelestia-shell-8b1f2be27be18459ba2c8f4d675b5bf36f7d2307.tar.bz2
caelestia-shell-8b1f2be27be18459ba2c8f4d675b5bf36f7d2307.zip
internal: format cpp
Diffstat (limited to 'plugin/src/Caelestia/filesystemmodel.hpp')
-rw-r--r--plugin/src/Caelestia/filesystemmodel.hpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/plugin/src/Caelestia/filesystemmodel.hpp b/plugin/src/Caelestia/filesystemmodel.hpp
index 77a5826..e12b26a 100644
--- a/plugin/src/Caelestia/filesystemmodel.hpp
+++ b/plugin/src/Caelestia/filesystemmodel.hpp
@@ -1,12 +1,12 @@
#pragma once
-#include <QObject>
-#include <qqmlintegration.h>
#include <QAbstractListModel>
-#include <QFileSystemWatcher>
-#include <QFileInfo>
#include <QDir>
+#include <QFileInfo>
+#include <QFileSystemWatcher>
#include <QImageReader>
+#include <QObject>
+#include <qqmlintegration.h>
class FileSystemEntry : public QObject {
Q_OBJECT
@@ -23,7 +23,10 @@ class FileSystemEntry : public QObject {
public:
explicit FileSystemEntry(const QString& path, const QString& relativePath, QObject* parent = nullptr)
- : QObject(parent), m_fileInfo(QFileInfo(path)), m_path(path), m_relativePath(relativePath) {}
+ : QObject(parent)
+ , m_fileInfo(QFileInfo(path))
+ , m_path(path)
+ , m_relativePath(relativePath) {}
QString path() const { return m_path; };
QString relativePath() const { return m_relativePath; };
@@ -71,10 +74,12 @@ public:
Q_ENUM(Filter)
explicit FileSystemModel(QObject* parent = nullptr)
- : QAbstractListModel(parent), m_recursive(true), m_filter(NoFilter) {
- connect(&m_watcher, &QFileSystemWatcher::directoryChanged, this, &FileSystemModel::watchDirIfRecursive);
- connect(&m_watcher, &QFileSystemWatcher::directoryChanged, this, &FileSystemModel::updateEntries);
- }
+ : QAbstractListModel(parent)
+ , m_recursive(true)
+ , m_filter(NoFilter) {
+ connect(&m_watcher, &QFileSystemWatcher::directoryChanged, this, &FileSystemModel::watchDirIfRecursive);
+ connect(&m_watcher, &QFileSystemWatcher::directoryChanged, this, &FileSystemModel::updateEntries);
+ }
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;