Changeset View
Standalone View
src/platformtheme/kdeplatformfiledialoghelper.cpp
Show First 20 Lines • Show All 355 Lines • ▼ Show 20 Line(s) | |||||
356 | QUrl KDEPlatformFileDialogHelper::directory() const | 356 | QUrl KDEPlatformFileDialogHelper::directory() const | ||
357 | { | 357 | { | ||
358 | return m_dialog->directory(); | 358 | return m_dialog->directory(); | ||
359 | } | 359 | } | ||
360 | 360 | | |||
361 | void KDEPlatformFileDialogHelper::selectFile(const QUrl &filename) | 361 | void KDEPlatformFileDialogHelper::selectFile(const QUrl &filename) | ||
362 | { | 362 | { | ||
363 | m_dialog->selectFile(filename); | 363 | m_dialog->selectFile(filename); | ||
364 | | ||||
365 | // Qt 5 at least until 5.7.0 does not derive the directory from the passed url | ||||
dfaure: Should say 5.8.0, the autotest fails for me (without the fix) with current Qt 5.8 git.
| |||||
366 | // and set the initialDirectory option accordingly, also not for known schemes | ||||
367 | // like file://, so we have to do it ourselves | ||||
368 | QSharedPointer<QFileDialogOptions> opt(new QFileDialogOptions(*options())); | ||||
This does NOT build for me. qplatformdialoghelper.h:295:5: error: ‘QFileDialogOptions::QFileDialogOptions(const QFileDialogOptions&)’ is private Qt 5.8 git, gcc 4.8. I am not sure why Q_DISABLE_COPY(QFileDialogOptions) is used, sounds like the right fix is to add support for copying and moving to these classes in Qt; but short term this might mean doing the copy by hand (calling 20 setters, sucks). It is curious however that it built for you? dfaure: This does NOT build for me.
qplatformdialoghelper.h:295:5: error: ‘QFileDialogOptions… | |||||
Seems the code needs to be adapted to have a variant for the changes introduced by this commit: QSharedPointer<QFileDialogOptions> opt = options()->clone(); Could you give that a try? I only have Qt from my distro packages, which is Qt 5.7.0 I am not used to browsing of Qt branches and sadly cannot spot from http://code.qt.io/cgit/qt/qtbase.git/log/src/gui/kernel/qplatformdialoghelper.h at which version this is added. kossebau: Seems the code needs to be adapted to have a variant for the changes introduced by this commit… | |||||
369 | opt->setInitialDirectory(m_dialog->directory()); | ||||
370 | setOptions(opt); | ||||
364 | } | 371 | } | ||
365 | 372 | | |||
366 | void KDEPlatformFileDialogHelper::setDirectory(const QUrl &directory) | 373 | void KDEPlatformFileDialogHelper::setDirectory(const QUrl &directory) | ||
367 | { | 374 | { | ||
368 | m_dialog->setDirectory(directory); | 375 | m_dialog->setDirectory(directory); | ||
369 | } | 376 | } | ||
370 | 377 | | |||
371 | void KDEPlatformFileDialogHelper::selectNameFilter(const QString &filter) | 378 | void KDEPlatformFileDialogHelper::selectNameFilter(const QString &filter) | ||
Show All 12 Lines |
Should say 5.8.0, the autotest fails for me (without the fix) with current Qt 5.8 git.