Set default homedir path and name for fermentables XML export. Intent just 1 byte.

Sat, 05 Mar 2022 16:55:38 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 05 Mar 2022 16:55:38 +0100
changeset 43
26910c149073
parent 42
88e827ea7172
child 44
5a9a159c2d34

Set default homedir path and name for fermentables XML export. Intent just 1 byte.

src/InventoryFermentables.cpp file | annotate | diff | comparison | revisions
--- a/src/InventoryFermentables.cpp	Sat Mar 05 16:19:52 2022 +0100
+++ b/src/InventoryFermentables.cpp	Sat Mar 05 16:55:38 2022 +0100
@@ -151,7 +151,7 @@
     const QStringList graintypes({"Base", "Roast", "Crystal", "Kilned", "Sour Malt", "Special", "No malt"});
     const QStringList added({"Mash", "Boil", "Fermentation", "Lagering", "Bottle"});
 
-    QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), "", tr("Files (*.xml)"));
+    QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), QDir::homePath() + "/fermentables.xml", tr("Files (*.xml)"));
     if (fileName == 0) {
 	QMessageBox::warning(this, tr("Save File"), tr("No XML file selected."));
         return;
@@ -163,6 +163,7 @@
     QXmlStreamWriter *xmlWriter = new QXmlStreamWriter(&file);
     xmlWriter->writeStartDocument();
     xmlWriter->setAutoFormatting(true);
+    xmlWriter->setAutoFormattingIndent(1);
     xmlWriter->writeStartElement("FERMENTABLES");
 
     query.first();

mercurial