Allow setting the save path via JavaScript
This commit is contained in:
parent
ccb516d47b
commit
1d4c18f474
|
@ -408,6 +408,17 @@ QString MediaFileInfoObject::currentName() const
|
||||||
return QString::fromStdString(m_f.fileName());
|
return QString::fromStdString(m_f.fileName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString MediaFileInfoObject::savePath() const
|
||||||
|
{
|
||||||
|
return QtUtilities::fromNativeFileName(m_f.saveFilePath());
|
||||||
|
}
|
||||||
|
|
||||||
|
void MediaFileInfoObject::setSavePath(const QString &path)
|
||||||
|
{
|
||||||
|
const auto nativePath = QtUtilities::toNativeFileName(path);
|
||||||
|
m_f.setSaveFilePath(std::string_view(nativePath.data(), static_cast<std::size_t>(nativePath.size())));
|
||||||
|
}
|
||||||
|
|
||||||
QList<Cli::TagObject *> &MediaFileInfoObject::tags()
|
QList<Cli::TagObject *> &MediaFileInfoObject::tags()
|
||||||
{
|
{
|
||||||
if (!m_tags.isEmpty()) {
|
if (!m_tags.isEmpty()) {
|
||||||
|
|
|
@ -164,6 +164,7 @@ class MediaFileInfoObject : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(QString currentPath READ currentPath)
|
Q_PROPERTY(QString currentPath READ currentPath)
|
||||||
Q_PROPERTY(QString currentName READ currentName)
|
Q_PROPERTY(QString currentName READ currentName)
|
||||||
|
Q_PROPERTY(QString savePath READ savePath WRITE setSavePath)
|
||||||
Q_PROPERTY(QList<TagObject *> tags READ tags)
|
Q_PROPERTY(QList<TagObject *> tags READ tags)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -173,6 +174,8 @@ public:
|
||||||
TagParser::MediaFileInfo &fileInfo();
|
TagParser::MediaFileInfo &fileInfo();
|
||||||
QString currentPath() const;
|
QString currentPath() const;
|
||||||
QString currentName() const;
|
QString currentName() const;
|
||||||
|
QString savePath() const;
|
||||||
|
void setSavePath(const QString &path);
|
||||||
QList<TagObject *> &tags();
|
QList<TagObject *> &tags();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
|
Loading…
Reference in New Issue