Commit d2e1fe9c authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Remove last dependency on KDELibs4Support

parent e9ebe426
......@@ -33,6 +33,7 @@ target_link_libraries(kontact_knotesplugin
KF5::KCMUtils
KF5::AkonadiWidgets
KF5::AkonadiNotes
KF5::ItemViews
KF5::Contacts
)
......
......@@ -62,7 +62,6 @@
#include <KActionCollection>
#include <KCheckableProxyModel>
#include <KFileDialog>
#include <KLocalizedString>
#include <KMessageBox>
#include <KDNSSD/DNSSD/PublicService>
......@@ -740,17 +739,17 @@ void KNotesPart::slotSaveAs()
if (knoteItem->isRichText()) {
convert = new QCheckBox(i18n("Save note as plain text"), nullptr);
}
QPointer<KFileDialog> dlg = new KFileDialog(url, QString(), widget(), convert);
dlg->setOperationMode(KFileDialog::Saving);
dlg->setWindowTitle(i18n("Save As"));
if (!dlg->exec()) {
delete dlg;
return;
QStringList filters;
if (knoteItem->isRichText()) {
filters << i18n("Rich text (*.html)");
}
filters << i18n("Plain text (*.txt)");
const QString fileName = dlg->selectedFile();
const bool htmlFormatAndSaveAsHtml = (convert && !convert->isChecked());
delete dlg;
QString format;
const QString fileName = QFileDialog::getSaveFileName(widget(), i18n("Save As"), QString(),
filters.join(QStringLiteral(";;")), &format);
const bool htmlFormatAndSaveAsHtml = (knoteItem->isRichText() && !format.contains(QStringLiteral("(*.txt)")));
if (fileName.isEmpty()) {
return;
}
......
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