Commit 981c4030f9cd63ae35ca8f77384a412e9199a8e5
1 parent
fb5473e3
just close the file
Showing
1 changed file
with
0 additions
and
21 deletions
openbr/plugins/gallery/csv.cpp
| @@ -127,32 +127,11 @@ class csvGallery : public FileGallery | @@ -127,32 +127,11 @@ class csvGallery : public FileGallery | ||
| 127 | Q_PROPERTY(bool combineFiles READ get_combineFiles WRITE set_combineFiles RESET reset_combineFiles STORED false) | 127 | Q_PROPERTY(bool combineFiles READ get_combineFiles WRITE set_combineFiles RESET reset_combineFiles STORED false) |
| 128 | BR_PROPERTY(bool, combineFiles, false) | 128 | BR_PROPERTY(bool, combineFiles, false) |
| 129 | 129 | ||
| 130 | - FileList files; | ||
| 131 | CSVHeaderList headers; | 130 | CSVHeaderList headers; |
| 132 | 131 | ||
| 133 | ~csvGallery() | 132 | ~csvGallery() |
| 134 | { | 133 | { |
| 135 | f.close(); | 134 | f.close(); |
| 136 | - if (files.isEmpty()) return; | ||
| 137 | - | ||
| 138 | - QSet<QString> samples; | ||
| 139 | - foreach (const File &file, files) | ||
| 140 | - foreach (const QString &key, file.localKeys()) | ||
| 141 | - samples.insert(key); | ||
| 142 | - | ||
| 143 | - QStringList lines; | ||
| 144 | - lines.reserve(files.size()+1); | ||
| 145 | - | ||
| 146 | - // Make header | ||
| 147 | - headers = CSVHeaderList(samples.values()); | ||
| 148 | - headers.sort(); | ||
| 149 | - lines.append(QStringList(QStringList("File") + headers.keys()).join(",")); | ||
| 150 | - | ||
| 151 | - // Make table | ||
| 152 | - foreach (const File &file, files) | ||
| 153 | - lines.append(lineFromFile(file)); | ||
| 154 | - | ||
| 155 | - QtUtils::writeFile(file, lines); | ||
| 156 | } | 135 | } |
| 157 | 136 | ||
| 158 | void setValuesFromHeaders(File &f, const CSVHeaderList &headers, const QVariantList &values) | 137 | void setValuesFromHeaders(File &f, const CSVHeaderList &headers, const QVariantList &values) |