Verified Commit 9cad7766 authored by Jonah Brüchert's avatar Jonah Brüchert 🍪
Browse files

Support fuse on mobile filechooser as well

parent bbfa7471
Pipeline #157933 passed with stage
in 51 seconds
......@@ -302,7 +302,7 @@ uint FileChooserPortal::OpenFile(const QDBusObjectPath &handle,
uint retCode = m_mobileFileDialog->exec();
results.insert(QStringLiteral("uris"), m_mobileFileDialog->results());
results.insert(QStringLiteral("uris"), fuseRedirect(m_mobileFileDialog->results()));
return retCode;
}
......@@ -487,7 +487,7 @@ uint FileChooserPortal::SaveFile(const QDBusObjectPath &handle,
uint retCode = m_mobileFileDialog->exec();
results.insert(QStringLiteral("uris"), m_mobileFileDialog->results());
results.insert(QStringLiteral("uris"), fuseRedirect(m_mobileFileDialog->results()));
return retCode;
}
......
......@@ -185,10 +185,8 @@ uint MobileFileDialog::exec()
bool handled = false;
uint exitCode = 0;
const auto acceptedConn = connect(m_callback, &FileChooserQmlCallback::accepted, this, [this, &exitCode, &handled](const QStringList &urls) {
for (const auto &filename : urls) {
m_results << QUrl(filename).toDisplayString();
}
const auto acceptedConn = connect(m_callback, &FileChooserQmlCallback::accepted, this, [this, &exitCode, &handled](const QList<QUrl> &urls) {
m_results = urls;
handled = true;
exitCode = 0;
qDebug(KirigamiFilepicker) << "Got results" << m_results;
......@@ -216,7 +214,7 @@ uint MobileFileDialog::exec()
return exitCode;
}
QStringList MobileFileDialog::results() const
QList<QUrl> MobileFileDialog::results() const
{
return m_results;
}
......@@ -46,12 +46,12 @@ public:
bool selectFolder() const;
void setSelectFolder(bool selectFolder);
QStringList results() const;
QList<QUrl> results() const;
uint exec();
Q_SIGNALS:
void accepted(const QStringList &files);
void accepted(const QList<QUrl> &files);
void titleChanged();
void selectMultipleChanged();
void selectExistingChanged();
......@@ -65,7 +65,7 @@ Q_SIGNALS:
private:
QQmlApplicationEngine *m_engine;
FileChooserQmlCallback *m_callback;
QStringList m_results;
QList<QUrl> m_results;
QQuickWindow *m_window;
bool m_customTitleSet;
......
......@@ -52,7 +52,7 @@ public:
void setSelectFolder(bool selectFolder);
Q_SIGNALS:
void accepted(const QStringList &files);
void accepted(const QList<QUrl> &files);
void cancel();
void titleChanged();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment