summaryrefslogtreecommitdiff
path: root/plugin/src/Caelestia/Models
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-10-14 16:00:17 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-10-14 16:00:17 +1100
commit27953a89d1110d6cc82ff198e1c28f698104d554 (patch)
tree69b302d1f8c0150c9a61e57dad9b0dd80ff11e48 /plugin/src/Caelestia/Models
parenttoasts: add toast for kb layout change (diff)
downloadcaelestia-shell-27953a89d1110d6cc82ff198e1c28f698104d554.tar.gz
caelestia-shell-27953a89d1110d6cc82ff198e1c28f698104d554.tar.bz2
caelestia-shell-27953a89d1110d6cc82ff198e1c28f698104d554.zip
internal: use QQmlListProperty
Fix lsp errors
Diffstat (limited to 'plugin/src/Caelestia/Models')
-rw-r--r--plugin/src/Caelestia/Models/filesystemmodel.cpp4
-rw-r--r--plugin/src/Caelestia/Models/filesystemmodel.hpp5
2 files changed, 5 insertions, 4 deletions
diff --git a/plugin/src/Caelestia/Models/filesystemmodel.cpp b/plugin/src/Caelestia/Models/filesystemmodel.cpp
index 3ceb1dd..e387ecd 100644
--- a/plugin/src/Caelestia/Models/filesystemmodel.cpp
+++ b/plugin/src/Caelestia/Models/filesystemmodel.cpp
@@ -211,8 +211,8 @@ void FileSystemModel::setNameFilters(const QStringList& nameFilters) {
update();
}
-QList<FileSystemEntry*> FileSystemModel::entries() const {
- return m_entries;
+QQmlListProperty<FileSystemEntry> FileSystemModel::entries() {
+ return QQmlListProperty<FileSystemEntry>(this, &m_entries);
}
void FileSystemModel::watchDirIfRecursive(const QString& path) {
diff --git a/plugin/src/Caelestia/Models/filesystemmodel.hpp b/plugin/src/Caelestia/Models/filesystemmodel.hpp
index cead43f..cf8eae8 100644
--- a/plugin/src/Caelestia/Models/filesystemmodel.hpp
+++ b/plugin/src/Caelestia/Models/filesystemmodel.hpp
@@ -8,6 +8,7 @@
#include <qmimedatabase.h>
#include <qobject.h>
#include <qqmlintegration.h>
+#include <qqmllist.h>
namespace caelestia::models {
@@ -71,7 +72,7 @@ class FileSystemModel : public QAbstractListModel {
Q_PROPERTY(Filter filter READ filter WRITE setFilter NOTIFY filterChanged)
Q_PROPERTY(QStringList nameFilters READ nameFilters WRITE setNameFilters NOTIFY nameFiltersChanged)
- Q_PROPERTY(QList<FileSystemEntry*> entries READ entries NOTIFY entriesChanged)
+ Q_PROPERTY(QQmlListProperty<caelestia::models::FileSystemEntry> entries READ entries NOTIFY entriesChanged)
public:
enum Filter {
@@ -109,7 +110,7 @@ public:
[[nodiscard]] QStringList nameFilters() const;
void setNameFilters(const QStringList& nameFilters);
- [[nodiscard]] QList<FileSystemEntry*> entries() const;
+ [[nodiscard]] QQmlListProperty<FileSystemEntry> entries();
signals:
void pathChanged();