Commit ea00ac9f authored by Laurent Montel's avatar Laurent Montel 😁

Port to QFileDialog

parent 70f5ea6b
......@@ -32,7 +32,6 @@
#include <KComboBox>
#include <KDateComboBox>
#include <KLineEdit>
#include <KFileDialog>
#include <KLocalizedString>
#include <KMessageBox>
#include <QUrl>
......@@ -201,8 +200,6 @@ ArchiveDialog::ArchiveDialog(const Akonadi::ETMCalendar::Ptr &cal,
"will not be modified or deleted. You can later load or merge the "
"file like any other calendar. It is not saved in a special "
"format, it uses the iCalendar format."));
//QT5
//mArchiveFile->fileDialog()->setOperationMode( KFileDialog::Saving );
l->setBuddy(mArchiveFile->lineEdit());
fileLayout->addWidget(mArchiveFile);
topLayout->addLayout(fileLayout);
......
......@@ -63,7 +63,7 @@
#include <boost/bind.hpp>
#include <KMessageBox>
#include <KIdentityManagement/IdentityManager>
#include <KFileDialog>
#include <QFileDialog>
#include <KIO/NetAccess>
#include "calendarsupport_debug.h"
......@@ -745,9 +745,7 @@ void CalendarSupport::saveAttachments(const Akonadi::Item &item, QWidget *parent
QString targetFile, targetDir;
if (attachments.count() > 1) {
// get the dir
targetDir = KFileDialog::getExistingDirectory(QUrl(QLatin1String("kfiledialog:///saveAttachment")),
parentWidget,
i18n("Save Attachments To"));
targetDir = QFileDialog::getExistingDirectory(parentWidget, i18n("Save Attachments To"));
if (targetDir.isEmpty()) {
return;
}
......@@ -762,10 +760,7 @@ void CalendarSupport::saveAttachments(const Akonadi::Item &item, QWidget *parent
if (fileName.isEmpty()) {
fileName = i18nc("filename for an unnamed attachment", "attachment.1");
}
targetFile = KFileDialog::getSaveFileName(QUrl(QLatin1String("kfiledialog:///saveAttachment/") + fileName),
QString(),
parentWidget,
i18n("Save Attachment"));
targetFile = QFileDialog::getSaveFileName(parentWidget, i18n("Save Attachment"), fileName);
if (targetFile.isEmpty()) {
return;
}
......
......@@ -68,7 +68,7 @@
#include <QAction>
#include <KActionCollection>
#include <KFileDialog>
#include <QFileDialog>
#include <QFileDialog>
#include <QMenu>
#include <QMenuBar>
......@@ -845,7 +845,7 @@ void ActionManager::file_new()
void ActionManager::file_open()
{
const QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/korganizer/") ;
const QUrl url = KFileDialog::getOpenUrl(defaultPath, QStringLiteral("text/calendar"), dialogParent());
const QUrl url = QFileDialog::getOpenFileUrl(dialogParent(), QString(), QUrl::fromLocalFile(defaultPath), QStringLiteral("text/calendar") );
file_open(url);
}
......@@ -922,9 +922,8 @@ void ActionManager::file_icalimport()
void ActionManager::file_import()
{
const QUrl url = KFileDialog::getOpenUrl(QString(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/korganizer/")) ,
QLatin1String("text/calendar"),
dialogParent());
const QUrl url = QFileDialog::getOpenFileUrl(dialogParent(), QString(), QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/korganizer/")),
QLatin1String("text/calendar"));
if (!url.isEmpty()) { // isEmpty if user canceled the dialog
importCalendar(url);
}
......@@ -1054,11 +1053,9 @@ void ActionManager::exportHTML(KOrg::HTMLExportSettings *settings, bool autoMode
}
const QString fileName =
KFileDialog::getSaveFileName(
QFileDialog::getSaveFileName(dialogParent(), i18n("Select path for HTML calendar export"),
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation),
i18n("*.html|HTML Files"),
dialogParent(),
i18n("Select path for HTML calendar export"), KFileDialog::ConfirmOverwrite);
i18n("HTML Files (*.html)"));
settings->setOutputFile(fileName);
settings->save();
}
......
Markdown is supported
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