2024-08-25 04:08:24 +00:00
|
|
|
#include <QDateTime>
|
|
|
|
#include <QDir>
|
|
|
|
#include <QFileIconProvider>
|
|
|
|
#include <QFileInfo>
|
|
|
|
#include <QFileSystemModel>
|
|
|
|
#include <QIcon>
|
|
|
|
#include <QList>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QMimeData>
|
|
|
|
#include <QModelIndex>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QVariant>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qfilesystemmodel.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qfilesystemmodel.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QFileSystemModel* QFileSystemModel_new() {
|
|
|
|
return new QFileSystemModel();
|
|
|
|
}
|
|
|
|
|
|
|
|
QFileSystemModel* QFileSystemModel_new2(QObject* parent) {
|
|
|
|
return new QFileSystemModel(parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QFileSystemModel_MetaObject(const QFileSystemModel* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
void* QFileSystemModel_Metacast(QFileSystemModel* self, const char* param1) {
|
|
|
|
return self->qt_metacast(param1);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QFileSystemModel_Tr(const char* s) {
|
|
|
|
QString _ret = QFileSystemModel::tr(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QFileSystemModel_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QFileSystemModel::trUtf8(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QFileSystemModel_RootPathChanged(QFileSystemModel* self, struct miqt_string* newPath) {
|
|
|
|
QString newPath_QString = QString::fromUtf8(&newPath->data, newPath->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->rootPathChanged(newPath_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-13 06:06:06 +00:00
|
|
|
void QFileSystemModel_connect_RootPathChanged(QFileSystemModel* self, intptr_t slot) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QFileSystemModel::connect(self, static_cast<void (QFileSystemModel::*)(const QString&)>(&QFileSystemModel::rootPathChanged), self, [=](const QString& newPath) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QString newPath_ret = newPath;
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray newPath_b = newPath_ret.toUtf8();
|
|
|
|
struct miqt_string* sigval1 = miqt_strdup(newPath_b.data(), newPath_b.length());
|
|
|
|
miqt_exec_callback_QFileSystemModel_RootPathChanged(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QFileSystemModel_FileRenamed(QFileSystemModel* self, struct miqt_string* path, struct miqt_string* oldName, struct miqt_string* newName) {
|
|
|
|
QString path_QString = QString::fromUtf8(&path->data, path->len);
|
|
|
|
QString oldName_QString = QString::fromUtf8(&oldName->data, oldName->len);
|
|
|
|
QString newName_QString = QString::fromUtf8(&newName->data, newName->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->fileRenamed(path_QString, oldName_QString, newName_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-13 06:06:06 +00:00
|
|
|
void QFileSystemModel_connect_FileRenamed(QFileSystemModel* self, intptr_t slot) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QFileSystemModel::connect(self, static_cast<void (QFileSystemModel::*)(const QString&, const QString&, const QString&)>(&QFileSystemModel::fileRenamed), self, [=](const QString& path, const QString& oldName, const QString& newName) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QString path_ret = path;
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray path_b = path_ret.toUtf8();
|
|
|
|
struct miqt_string* sigval1 = miqt_strdup(path_b.data(), path_b.length());
|
|
|
|
const QString oldName_ret = oldName;
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray oldName_b = oldName_ret.toUtf8();
|
|
|
|
struct miqt_string* sigval2 = miqt_strdup(oldName_b.data(), oldName_b.length());
|
|
|
|
const QString newName_ret = newName;
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray newName_b = newName_ret.toUtf8();
|
|
|
|
struct miqt_string* sigval3 = miqt_strdup(newName_b.data(), newName_b.length());
|
|
|
|
miqt_exec_callback_QFileSystemModel_FileRenamed(slot, sigval1, sigval2, sigval3);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QFileSystemModel_DirectoryLoaded(QFileSystemModel* self, struct miqt_string* path) {
|
|
|
|
QString path_QString = QString::fromUtf8(&path->data, path->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->directoryLoaded(path_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-13 06:06:06 +00:00
|
|
|
void QFileSystemModel_connect_DirectoryLoaded(QFileSystemModel* self, intptr_t slot) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QFileSystemModel::connect(self, static_cast<void (QFileSystemModel::*)(const QString&)>(&QFileSystemModel::directoryLoaded), self, [=](const QString& path) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QString path_ret = path;
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray path_b = path_ret.toUtf8();
|
|
|
|
struct miqt_string* sigval1 = miqt_strdup(path_b.data(), path_b.length());
|
|
|
|
miqt_exec_callback_QFileSystemModel_DirectoryLoaded(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QFileSystemModel_Index(const QFileSystemModel* self, int row, int column) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->index(static_cast<int>(row), static_cast<int>(column)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QModelIndex* QFileSystemModel_IndexWithPath(const QFileSystemModel* self, struct miqt_string* path) {
|
|
|
|
QString path_QString = QString::fromUtf8(&path->data, path->len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->index(path_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QFileSystemModel_Parent(const QFileSystemModel* self, QModelIndex* child) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->parent(*child));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QFileSystemModel_Sibling(const QFileSystemModel* self, int row, int column, QModelIndex* idx) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->sibling(static_cast<int>(row), static_cast<int>(column), *idx));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileSystemModel_HasChildren(const QFileSystemModel* self) {
|
|
|
|
return self->hasChildren();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileSystemModel_CanFetchMore(const QFileSystemModel* self, QModelIndex* parent) {
|
|
|
|
return self->canFetchMore(*parent);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFileSystemModel_FetchMore(QFileSystemModel* self, QModelIndex* parent) {
|
|
|
|
self->fetchMore(*parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFileSystemModel_RowCount(const QFileSystemModel* self) {
|
|
|
|
return self->rowCount();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFileSystemModel_ColumnCount(const QFileSystemModel* self) {
|
|
|
|
return self->columnCount();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVariant* QFileSystemModel_MyComputer(const QFileSystemModel* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->myComputer());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVariant* QFileSystemModel_Data(const QFileSystemModel* self, QModelIndex* index) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->data(*index));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QFileSystemModel_SetData(QFileSystemModel* self, QModelIndex* index, QVariant* value) {
|
|
|
|
return self->setData(*index, *value);
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
QVariant* QFileSystemModel_HeaderData(const QFileSystemModel* self, int section, int orientation) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->headerData(static_cast<int>(section), static_cast<Qt::Orientation>(orientation)));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFileSystemModel_Flags(const QFileSystemModel* self, QModelIndex* index) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::ItemFlags _ret = self->flags(*index);
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFileSystemModel_Sort(QFileSystemModel* self, int column) {
|
|
|
|
self->sort(static_cast<int>(column));
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QFileSystemModel_MimeTypes(const QFileSystemModel* self) {
|
|
|
|
QStringList _ret = self->mimeTypes();
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QString _lv_ret = _ret[i];
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _lv_b = _lv_ret.toUtf8();
|
|
|
|
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-16 07:33:40 +00:00
|
|
|
QMimeData* QFileSystemModel_MimeData(const QFileSystemModel* self, struct miqt_array* /* of QModelIndex* */ indexes) {
|
2024-10-16 05:07:56 +00:00
|
|
|
QModelIndexList indexes_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
indexes_QList.reserve(indexes->len);
|
|
|
|
QModelIndex** indexes_arr = static_cast<QModelIndex**>(indexes->data);
|
|
|
|
for(size_t i = 0; i < indexes->len; ++i) {
|
|
|
|
indexes_QList.push_back(*(indexes_arr[i]));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->mimeData(indexes_QList);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
bool QFileSystemModel_DropMimeData(QFileSystemModel* self, QMimeData* data, int action, int row, int column, QModelIndex* parent) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return self->dropMimeData(data, static_cast<Qt::DropAction>(action), static_cast<int>(row), static_cast<int>(column), *parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFileSystemModel_SupportedDropActions(const QFileSystemModel* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::DropActions _ret = self->supportedDropActions();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QModelIndex* QFileSystemModel_SetRootPath(QFileSystemModel* self, struct miqt_string* path) {
|
|
|
|
QString path_QString = QString::fromUtf8(&path->data, path->len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->setRootPath(path_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QFileSystemModel_RootPath(const QFileSystemModel* self) {
|
|
|
|
QString _ret = self->rootPath();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QDir* QFileSystemModel_RootDirectory(const QFileSystemModel* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QDir(self->rootDirectory());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFileSystemModel_SetIconProvider(QFileSystemModel* self, QFileIconProvider* provider) {
|
|
|
|
self->setIconProvider(provider);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QFileIconProvider* QFileSystemModel_IconProvider(const QFileSystemModel* self) {
|
|
|
|
return self->iconProvider();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFileSystemModel_SetFilter(QFileSystemModel* self, int filters) {
|
|
|
|
self->setFilter(static_cast<QDir::Filters>(filters));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFileSystemModel_Filter(const QFileSystemModel* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QDir::Filters _ret = self->filter();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFileSystemModel_SetResolveSymlinks(QFileSystemModel* self, bool enable) {
|
|
|
|
self->setResolveSymlinks(enable);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileSystemModel_ResolveSymlinks(const QFileSystemModel* self) {
|
|
|
|
return self->resolveSymlinks();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFileSystemModel_SetReadOnly(QFileSystemModel* self, bool enable) {
|
|
|
|
self->setReadOnly(enable);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileSystemModel_IsReadOnly(const QFileSystemModel* self) {
|
|
|
|
return self->isReadOnly();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFileSystemModel_SetNameFilterDisables(QFileSystemModel* self, bool enable) {
|
|
|
|
self->setNameFilterDisables(enable);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileSystemModel_NameFilterDisables(const QFileSystemModel* self) {
|
|
|
|
return self->nameFilterDisables();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-16 07:33:40 +00:00
|
|
|
void QFileSystemModel_SetNameFilters(QFileSystemModel* self, struct miqt_array* /* of struct miqt_string* */ filters) {
|
2024-10-16 05:07:56 +00:00
|
|
|
QStringList filters_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
filters_QList.reserve(filters->len);
|
2024-09-17 07:43:35 +00:00
|
|
|
struct miqt_string** filters_arr = static_cast<struct miqt_string**>(filters->data);
|
2024-09-14 22:29:05 +00:00
|
|
|
for(size_t i = 0; i < filters->len; ++i) {
|
2024-09-17 07:43:35 +00:00
|
|
|
QString filters_arr_i_QString = QString::fromUtf8(&filters_arr[i]->data, filters_arr[i]->len);
|
|
|
|
filters_QList.push_back(filters_arr_i_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
self->setNameFilters(filters_QList);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QFileSystemModel_NameFilters(const QFileSystemModel* self) {
|
|
|
|
QStringList _ret = self->nameFilters();
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QString _lv_ret = _ret[i];
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _lv_b = _lv_ret.toUtf8();
|
|
|
|
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QFileSystemModel_SetOption(QFileSystemModel* self, int option) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setOption(static_cast<QFileSystemModel::Option>(option));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
bool QFileSystemModel_TestOption(const QFileSystemModel* self, int option) {
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->testOption(static_cast<QFileSystemModel::Option>(option));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFileSystemModel_SetOptions(QFileSystemModel* self, int options) {
|
|
|
|
self->setOptions(static_cast<QFileSystemModel::Options>(options));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFileSystemModel_Options(const QFileSystemModel* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileSystemModel::Options _ret = self->options();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QFileSystemModel_FilePath(const QFileSystemModel* self, QModelIndex* index) {
|
|
|
|
QString _ret = self->filePath(*index);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileSystemModel_IsDir(const QFileSystemModel* self, QModelIndex* index) {
|
|
|
|
return self->isDir(*index);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
long long QFileSystemModel_Size(const QFileSystemModel* self, QModelIndex* index) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qint64 _ret = self->size(*index);
|
|
|
|
return static_cast<long long>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QFileSystemModel_Type(const QFileSystemModel* self, QModelIndex* index) {
|
|
|
|
QString _ret = self->type(*index);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QDateTime* QFileSystemModel_LastModified(const QFileSystemModel* self, QModelIndex* index) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QDateTime(self->lastModified(*index));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QModelIndex* QFileSystemModel_Mkdir(QFileSystemModel* self, QModelIndex* parent, struct miqt_string* name) {
|
|
|
|
QString name_QString = QString::fromUtf8(&name->data, name->len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->mkdir(*parent, name_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QFileSystemModel_Rmdir(QFileSystemModel* self, QModelIndex* index) {
|
|
|
|
return self->rmdir(*index);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QFileSystemModel_FileName(const QFileSystemModel* self, QModelIndex* index) {
|
|
|
|
QString _ret = self->fileName(*index);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QIcon* QFileSystemModel_FileIcon(const QFileSystemModel* self, QModelIndex* index) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QIcon(self->fileIcon(*index));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFileSystemModel_Permissions(const QFileSystemModel* self, QModelIndex* index) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QFile::Permissions _ret = self->permissions(*index);
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QFileInfo* QFileSystemModel_FileInfo(const QFileSystemModel* self, QModelIndex* index) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QFileInfo(self->fileInfo(*index));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QFileSystemModel_Remove(QFileSystemModel* self, QModelIndex* index) {
|
|
|
|
return self->remove(*index);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QFileSystemModel_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QFileSystemModel::tr(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QFileSystemModel_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QFileSystemModel::tr(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QFileSystemModel_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QFileSystemModel::trUtf8(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QFileSystemModel_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QFileSystemModel::trUtf8(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QModelIndex* QFileSystemModel_Index3(const QFileSystemModel* self, int row, int column, QModelIndex* parent) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->index(static_cast<int>(row), static_cast<int>(column), *parent));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QModelIndex* QFileSystemModel_Index2(const QFileSystemModel* self, struct miqt_string* path, int column) {
|
|
|
|
QString path_QString = QString::fromUtf8(&path->data, path->len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QModelIndex(self->index(path_QString, static_cast<int>(column)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileSystemModel_HasChildren1(const QFileSystemModel* self, QModelIndex* parent) {
|
|
|
|
return self->hasChildren(*parent);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFileSystemModel_RowCount1(const QFileSystemModel* self, QModelIndex* parent) {
|
|
|
|
return self->rowCount(*parent);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFileSystemModel_ColumnCount1(const QFileSystemModel* self, QModelIndex* parent) {
|
|
|
|
return self->columnCount(*parent);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVariant* QFileSystemModel_MyComputer1(const QFileSystemModel* self, int role) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->myComputer(static_cast<int>(role)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVariant* QFileSystemModel_Data2(const QFileSystemModel* self, QModelIndex* index, int role) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->data(*index, static_cast<int>(role)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QFileSystemModel_SetData3(QFileSystemModel* self, QModelIndex* index, QVariant* value, int role) {
|
|
|
|
return self->setData(*index, *value, static_cast<int>(role));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
QVariant* QFileSystemModel_HeaderData3(const QFileSystemModel* self, int section, int orientation, int role) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->headerData(static_cast<int>(section), static_cast<Qt::Orientation>(orientation), static_cast<int>(role)));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QFileSystemModel_Sort2(QFileSystemModel* self, int column, int order) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->sort(static_cast<int>(column), static_cast<Qt::SortOrder>(order));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QFileSystemModel_SetOption2(QFileSystemModel* self, int option, bool on) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setOption(static_cast<QFileSystemModel::Option>(option), on);
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QFileSystemModel_Delete(QFileSystemModel* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|