diff data/fileio/CSVFileWriter.h @ 1435:365876627fb0 streaming-csv-writer

Add constructor overload for using an optional ProgressReporter
author Lucas Thompson <dev@lucas.im>
date Tue, 17 Apr 2018 10:03:49 +0100
parents 074d7c51e973
children 09c2ba31a711
line wrap: on
line diff
--- a/data/fileio/CSVFileWriter.h	Tue Apr 17 10:03:49 2018 +0100
+++ b/data/fileio/CSVFileWriter.h	Tue Apr 17 10:03:49 2018 +0100
@@ -23,6 +23,7 @@
 
 class Model;
 class MultiSelection;
+class ProgressReporter;
 
 class CSVFileWriter : public QObject
 {
@@ -33,6 +34,17 @@
                   Model *model,
                   QString delimiter = ",",
                   DataExportOptions options = DataExportDefaults);
+
+    CSVFileWriter(
+        QString path,
+        Model *model,
+        ProgressReporter *reporter,
+        QString delimiter = ",",
+        DataExportOptions options = DataExportDefaults
+    ) : CSVFileWriter(path, model, delimiter, options)
+    {
+        m_reporter = reporter;
+    }
     virtual ~CSVFileWriter();
 
     virtual bool isOK() const;
@@ -47,6 +59,7 @@
     QString m_error;
     QString m_delimiter;
     DataExportOptions m_options;
+    ProgressReporter *m_reporter;
 };
 
 #endif