aboutsummaryrefslogtreecommitdiffstats
path: root/Plugins/CsvImport
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/CsvImport')
-rw-r--r--Plugins/CsvImport/CsvImportOptions.ui5
-rw-r--r--Plugins/CsvImport/CsvImport_de.ts18
-rw-r--r--Plugins/CsvImport/CsvImport_es.ts18
-rw-r--r--Plugins/CsvImport/CsvImport_fr.qmbin2173 -> 1988 bytes
-rw-r--r--Plugins/CsvImport/CsvImport_fr.ts20
-rw-r--r--Plugins/CsvImport/CsvImport_it.qmbin0 -> 23 bytes
-rw-r--r--Plugins/CsvImport/CsvImport_it.ts18
-rw-r--r--Plugins/CsvImport/CsvImport_pl.qmbin2414 -> 2515 bytes
-rw-r--r--Plugins/CsvImport/CsvImport_pl.ts16
-rw-r--r--Plugins/CsvImport/CsvImport_pt_BR.ts18
-rw-r--r--Plugins/CsvImport/CsvImport_ru.qmbin2389 -> 2184 bytes
-rw-r--r--Plugins/CsvImport/CsvImport_ru.ts16
-rw-r--r--Plugins/CsvImport/CsvImport_sk.qmbin2228 -> 2035 bytes
-rw-r--r--Plugins/CsvImport/CsvImport_sk.ts16
-rw-r--r--Plugins/CsvImport/CsvImport_zh_CN.ts18
-rw-r--r--Plugins/CsvImport/csvimport.cpp50
16 files changed, 112 insertions, 101 deletions
diff --git a/Plugins/CsvImport/CsvImportOptions.ui b/Plugins/CsvImport/CsvImportOptions.ui
index b5e8ceb..f0f2728 100644
--- a/Plugins/CsvImport/CsvImportOptions.ui
+++ b/Plugins/CsvImport/CsvImportOptions.ui
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>365</width>
- <height>90</height>
+ <height>106</height>
</rect>
</property>
<property name="windowTitle">
@@ -81,6 +81,9 @@
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="nullCheck">
+ <property name="toolTip">
+ <string>If enabled, then text value provided on the right will be interpreted as NULL</string>
+ </property>
<property name="text">
<string>NULL values:</string>
</property>
diff --git a/Plugins/CsvImport/CsvImport_de.ts b/Plugins/CsvImport/CsvImport_de.ts
index 4ebea97..6106963 100644
--- a/Plugins/CsvImport/CsvImport_de.ts
+++ b/Plugins/CsvImport/CsvImport_de.ts
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.1" language="de_DE">
+<TS version="2.0" language="de_DE">
<context>
<name>CsvImport</name>
<message>
@@ -14,17 +14,12 @@
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="csvimport.cpp" line="167"/>
+ <location filename="csvimport.cpp" line="163"/>
<source>Enter the custom separator character.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="csvimport.cpp" line="181"/>
- <source>Enter the value that will be interpreted as a NULL.</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="csvimport.cpp" line="194"/>
+ <location filename="csvimport.cpp" line="186"/>
<source>CSV files (*.csv);;Text files (*.txt);;All files (*)</source>
<translation type="unfinished"></translation>
</message>
@@ -73,11 +68,16 @@
</message>
<message>
<location filename="CsvImportOptions.ui" line="85"/>
+ <source>If enabled, then text value provided on the right will be interpreted as NULL</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="CsvImportOptions.ui" line="88"/>
<source>NULL values:</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="CsvImportOptions.ui" line="95"/>
+ <location filename="CsvImportOptions.ui" line="98"/>
<source>If your CSV data contains null values, define how are they represented in the CSV.</source>
<translation type="unfinished"></translation>
</message>
diff --git a/Plugins/CsvImport/CsvImport_es.ts b/Plugins/CsvImport/CsvImport_es.ts
index 14ff9c3..19027fc 100644
--- a/Plugins/CsvImport/CsvImport_es.ts
+++ b/Plugins/CsvImport/CsvImport_es.ts
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.1" language="es_ES">
+<TS version="2.0" language="es_ES">
<context>
<name>CsvImport</name>
<message>
@@ -14,17 +14,12 @@
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="csvimport.cpp" line="167"/>
+ <location filename="csvimport.cpp" line="163"/>
<source>Enter the custom separator character.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="csvimport.cpp" line="181"/>
- <source>Enter the value that will be interpreted as a NULL.</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="csvimport.cpp" line="194"/>
+ <location filename="csvimport.cpp" line="186"/>
<source>CSV files (*.csv);;Text files (*.txt);;All files (*)</source>
<translation type="unfinished"></translation>
</message>
@@ -73,11 +68,16 @@
</message>
<message>
<location filename="CsvImportOptions.ui" line="85"/>
+ <source>If enabled, then text value provided on the right will be interpreted as NULL</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="CsvImportOptions.ui" line="88"/>
<source>NULL values:</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="CsvImportOptions.ui" line="95"/>
+ <location filename="CsvImportOptions.ui" line="98"/>
<source>If your CSV data contains null values, define how are they represented in the CSV.</source>
<translation type="unfinished"></translation>
</message>
diff --git a/Plugins/CsvImport/CsvImport_fr.qm b/Plugins/CsvImport/CsvImport_fr.qm
index fd26433..cd941d9 100644
--- a/Plugins/CsvImport/CsvImport_fr.qm
+++ b/Plugins/CsvImport/CsvImport_fr.qm
Binary files differ
diff --git a/Plugins/CsvImport/CsvImport_fr.ts b/Plugins/CsvImport/CsvImport_fr.ts
index f8854e0..3d160e1 100644
--- a/Plugins/CsvImport/CsvImport_fr.ts
+++ b/Plugins/CsvImport/CsvImport_fr.ts
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.1" language="fr_FR">
+<TS version="2.0" language="fr_FR">
<context>
<name>CsvImport</name>
<message>
@@ -14,17 +14,16 @@
<translation>Impossible de trouver des données dans le fichier %1.</translation>
</message>
<message>
- <location filename="csvimport.cpp" line="167"/>
+ <location filename="csvimport.cpp" line="163"/>
<source>Enter the custom separator character.</source>
<translation>Saisir le caractère séparateur.</translation>
</message>
<message>
- <location filename="csvimport.cpp" line="181"/>
<source>Enter the value that will be interpreted as a NULL.</source>
- <translation>Saisir la valeur qui sera interprétée comme NULL.</translation>
+ <translation type="obsolete">Saisir la valeur qui sera interprétée comme NULL.</translation>
</message>
<message>
- <location filename="csvimport.cpp" line="194"/>
+ <location filename="csvimport.cpp" line="186"/>
<source>CSV files (*.csv);;Text files (*.txt);;All files (*)</source>
<translation>Fichiers CSV (*.csv);;Fichiers texte (*.txt);;Tous les fichiers (*)</translation>
</message>
@@ -49,7 +48,7 @@
<message>
<location filename="CsvImportOptions.ui" line="39"/>
<source> (whitespace)</source>
- <translation>(Espace)</translation>
+ <translation> (Espace)</translation>
</message>
<message>
<location filename="CsvImportOptions.ui" line="44"/>
@@ -77,11 +76,16 @@
</message>
<message>
<location filename="CsvImportOptions.ui" line="85"/>
+ <source>If enabled, then text value provided on the right will be interpreted as NULL</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="CsvImportOptions.ui" line="88"/>
<source>NULL values:</source>
- <translation>Valeurs NULL:</translation>
+ <translation>Valeurs NULL:</translation>
</message>
<message>
- <location filename="CsvImportOptions.ui" line="95"/>
+ <location filename="CsvImportOptions.ui" line="98"/>
<source>If your CSV data contains null values, define how are they represented in the CSV.</source>
<translation>Si votre CSV de données contient des valeurs nulles, définissez leur représentation dans le CSV.</translation>
</message>
diff --git a/Plugins/CsvImport/CsvImport_it.qm b/Plugins/CsvImport/CsvImport_it.qm
new file mode 100644
index 0000000..9dad8df
--- /dev/null
+++ b/Plugins/CsvImport/CsvImport_it.qm
Binary files differ
diff --git a/Plugins/CsvImport/CsvImport_it.ts b/Plugins/CsvImport/CsvImport_it.ts
index bc60d95..46c1948 100644
--- a/Plugins/CsvImport/CsvImport_it.ts
+++ b/Plugins/CsvImport/CsvImport_it.ts
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.1" language="it_IT">
+<TS version="2.0" language="it_IT">
<context>
<name>CsvImport</name>
<message>
@@ -14,17 +14,12 @@
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="csvimport.cpp" line="167"/>
+ <location filename="csvimport.cpp" line="163"/>
<source>Enter the custom separator character.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="csvimport.cpp" line="181"/>
- <source>Enter the value that will be interpreted as a NULL.</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="csvimport.cpp" line="194"/>
+ <location filename="csvimport.cpp" line="186"/>
<source>CSV files (*.csv);;Text files (*.txt);;All files (*)</source>
<translation type="unfinished"></translation>
</message>
@@ -73,11 +68,16 @@
</message>
<message>
<location filename="CsvImportOptions.ui" line="85"/>
+ <source>If enabled, then text value provided on the right will be interpreted as NULL</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="CsvImportOptions.ui" line="88"/>
<source>NULL values:</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="CsvImportOptions.ui" line="95"/>
+ <location filename="CsvImportOptions.ui" line="98"/>
<source>If your CSV data contains null values, define how are they represented in the CSV.</source>
<translation type="unfinished"></translation>
</message>
diff --git a/Plugins/CsvImport/CsvImport_pl.qm b/Plugins/CsvImport/CsvImport_pl.qm
index 7a63ef3..6f56305 100644
--- a/Plugins/CsvImport/CsvImport_pl.qm
+++ b/Plugins/CsvImport/CsvImport_pl.qm
Binary files differ
diff --git a/Plugins/CsvImport/CsvImport_pl.ts b/Plugins/CsvImport/CsvImport_pl.ts
index 227b16c..376d0d2 100644
--- a/Plugins/CsvImport/CsvImport_pl.ts
+++ b/Plugins/CsvImport/CsvImport_pl.ts
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.1" language="pl_PL">
+<TS version="2.0" language="pl_PL">
<context>
<name>CsvImport</name>
<message>
@@ -14,17 +14,16 @@
<translation>Nie znaleziono danych w pliku %1.</translation>
</message>
<message>
- <location filename="csvimport.cpp" line="167"/>
+ <location filename="csvimport.cpp" line="163"/>
<source>Enter the custom separator character.</source>
<translation>Wprowadź własny znak separatora.</translation>
</message>
<message>
- <location filename="csvimport.cpp" line="181"/>
<source>Enter the value that will be interpreted as a NULL.</source>
- <translation>Wprowadź wartość, która będzie interpretowana jako NULL.</translation>
+ <translation type="obsolete">Wprowadź wartość, która będzie interpretowana jako NULL.</translation>
</message>
<message>
- <location filename="csvimport.cpp" line="194"/>
+ <location filename="csvimport.cpp" line="186"/>
<source>CSV files (*.csv);;Text files (*.txt);;All files (*)</source>
<translation>Pliki CSV (*.csv);;Pliki tekstowe (*.txt);;Wszystkie pliki (*)</translation>
</message>
@@ -81,11 +80,16 @@
</message>
<message>
<location filename="CsvImportOptions.ui" line="85"/>
+ <source>If enabled, then text value provided on the right will be interpreted as NULL</source>
+ <translation>Kiedy włączone, to wartość tekstowa podana z prawej strony będzie interpretowana jako NULL</translation>
+ </message>
+ <message>
+ <location filename="CsvImportOptions.ui" line="88"/>
<source>NULL values:</source>
<translation>Wartości NULL:</translation>
</message>
<message>
- <location filename="CsvImportOptions.ui" line="95"/>
+ <location filename="CsvImportOptions.ui" line="98"/>
<source>If your CSV data contains null values, define how are they represented in the CSV.</source>
<translation>Jeśli twoje dane CSV zawierają wartości null, zdefiniuj jak są one reprezentowane w CSV.</translation>
</message>
diff --git a/Plugins/CsvImport/CsvImport_pt_BR.ts b/Plugins/CsvImport/CsvImport_pt_BR.ts
index 063fc09..32276a3 100644
--- a/Plugins/CsvImport/CsvImport_pt_BR.ts
+++ b/Plugins/CsvImport/CsvImport_pt_BR.ts
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.1" language="pt_BR">
+<TS version="2.0" language="pt_BR">
<context>
<name>CsvImport</name>
<message>
@@ -14,17 +14,12 @@
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="csvimport.cpp" line="167"/>
+ <location filename="csvimport.cpp" line="163"/>
<source>Enter the custom separator character.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="csvimport.cpp" line="181"/>
- <source>Enter the value that will be interpreted as a NULL.</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="csvimport.cpp" line="194"/>
+ <location filename="csvimport.cpp" line="186"/>
<source>CSV files (*.csv);;Text files (*.txt);;All files (*)</source>
<translation type="unfinished"></translation>
</message>
@@ -73,11 +68,16 @@
</message>
<message>
<location filename="CsvImportOptions.ui" line="85"/>
+ <source>If enabled, then text value provided on the right will be interpreted as NULL</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="CsvImportOptions.ui" line="88"/>
<source>NULL values:</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="CsvImportOptions.ui" line="95"/>
+ <location filename="CsvImportOptions.ui" line="98"/>
<source>If your CSV data contains null values, define how are they represented in the CSV.</source>
<translation type="unfinished"></translation>
</message>
diff --git a/Plugins/CsvImport/CsvImport_ru.qm b/Plugins/CsvImport/CsvImport_ru.qm
index e72533e..8def441 100644
--- a/Plugins/CsvImport/CsvImport_ru.qm
+++ b/Plugins/CsvImport/CsvImport_ru.qm
Binary files differ
diff --git a/Plugins/CsvImport/CsvImport_ru.ts b/Plugins/CsvImport/CsvImport_ru.ts
index 93ecdba..41ab843 100644
--- a/Plugins/CsvImport/CsvImport_ru.ts
+++ b/Plugins/CsvImport/CsvImport_ru.ts
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.1" language="ru_RU">
+<TS version="2.0" language="ru_RU">
<context>
<name>CsvImport</name>
<message>
@@ -14,17 +14,16 @@
<translation>Невозможно найти данные в файле %1.</translation>
</message>
<message>
- <location filename="csvimport.cpp" line="167"/>
+ <location filename="csvimport.cpp" line="163"/>
<source>Enter the custom separator character.</source>
<translation>Введите произвольный символ разделителя.</translation>
</message>
<message>
- <location filename="csvimport.cpp" line="181"/>
<source>Enter the value that will be interpreted as a NULL.</source>
- <translation>Введите значение, которое будет интерпретировано как NULL.</translation>
+ <translation type="obsolete">Введите значение, которое будет интерпретировано как NULL.</translation>
</message>
<message>
- <location filename="csvimport.cpp" line="194"/>
+ <location filename="csvimport.cpp" line="186"/>
<source>CSV files (*.csv);;Text files (*.txt);;All files (*)</source>
<translation>Файлы CSV (*.csv);;Текстовые файлы (*.txt);;Все файлы (*)</translation>
</message>
@@ -77,11 +76,16 @@
</message>
<message>
<location filename="CsvImportOptions.ui" line="85"/>
+ <source>If enabled, then text value provided on the right will be interpreted as NULL</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="CsvImportOptions.ui" line="88"/>
<source>NULL values:</source>
<translation>Значения NULL:</translation>
</message>
<message>
- <location filename="CsvImportOptions.ui" line="95"/>
+ <location filename="CsvImportOptions.ui" line="98"/>
<source>If your CSV data contains null values, define how are they represented in the CSV.</source>
<translation>Если данные в CSV содержат значения NULL, укажите, как они представлены в файле CSV</translation>
</message>
diff --git a/Plugins/CsvImport/CsvImport_sk.qm b/Plugins/CsvImport/CsvImport_sk.qm
index 281fc9a..5e88aaa 100644
--- a/Plugins/CsvImport/CsvImport_sk.qm
+++ b/Plugins/CsvImport/CsvImport_sk.qm
Binary files differ
diff --git a/Plugins/CsvImport/CsvImport_sk.ts b/Plugins/CsvImport/CsvImport_sk.ts
index 3120bf9..134ed50 100644
--- a/Plugins/CsvImport/CsvImport_sk.ts
+++ b/Plugins/CsvImport/CsvImport_sk.ts
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.1" language="sk_SK">
+<TS version="2.0" language="sk_SK">
<context>
<name>CsvImport</name>
<message>
@@ -14,17 +14,16 @@
<translation>Nemôžem nájsť dáta v súbore %1.</translation>
</message>
<message>
- <location filename="csvimport.cpp" line="167"/>
+ <location filename="csvimport.cpp" line="163"/>
<source>Enter the custom separator character.</source>
<translation>Zadajte vlastný oddeľovač.</translation>
</message>
<message>
- <location filename="csvimport.cpp" line="181"/>
<source>Enter the value that will be interpreted as a NULL.</source>
- <translation>Zadajte hodnotu, ktorá bude interpretovaná ako NULL.</translation>
+ <translation type="obsolete">Zadajte hodnotu, ktorá bude interpretovaná ako NULL.</translation>
</message>
<message>
- <location filename="csvimport.cpp" line="194"/>
+ <location filename="csvimport.cpp" line="186"/>
<source>CSV files (*.csv);;Text files (*.txt);;All files (*)</source>
<translation>CSV súbory (*.csv);;Textové súbory (*.txt);;Všetky súbory (*)</translation>
</message>
@@ -73,11 +72,16 @@
</message>
<message>
<location filename="CsvImportOptions.ui" line="85"/>
+ <source>If enabled, then text value provided on the right will be interpreted as NULL</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="CsvImportOptions.ui" line="88"/>
<source>NULL values:</source>
<translation>NULL hodnoty:</translation>
</message>
<message>
- <location filename="CsvImportOptions.ui" line="95"/>
+ <location filename="CsvImportOptions.ui" line="98"/>
<source>If your CSV data contains null values, define how are they represented in the CSV.</source>
<translation>Ak váš CSV súbor obsahuje null hodnoty, zadajte ako sú reprezentované v CSV.</translation>
</message>
diff --git a/Plugins/CsvImport/CsvImport_zh_CN.ts b/Plugins/CsvImport/CsvImport_zh_CN.ts
index c1958e3..7a11e6f 100644
--- a/Plugins/CsvImport/CsvImport_zh_CN.ts
+++ b/Plugins/CsvImport/CsvImport_zh_CN.ts
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.1" language="zh_CN">
+<TS version="2.0" language="zh_CN">
<context>
<name>CsvImport</name>
<message>
@@ -14,17 +14,12 @@
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="csvimport.cpp" line="167"/>
+ <location filename="csvimport.cpp" line="163"/>
<source>Enter the custom separator character.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="csvimport.cpp" line="181"/>
- <source>Enter the value that will be interpreted as a NULL.</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="csvimport.cpp" line="194"/>
+ <location filename="csvimport.cpp" line="186"/>
<source>CSV files (*.csv);;Text files (*.txt);;All files (*)</source>
<translation type="unfinished"></translation>
</message>
@@ -73,11 +68,16 @@
</message>
<message>
<location filename="CsvImportOptions.ui" line="85"/>
+ <source>If enabled, then text value provided on the right will be interpreted as NULL</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="CsvImportOptions.ui" line="88"/>
<source>NULL values:</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="CsvImportOptions.ui" line="95"/>
+ <location filename="CsvImportOptions.ui" line="98"/>
<source>If your CSV data contains null values, define how are they represented in the CSV.</source>
<translation type="unfinished"></translation>
</message>
diff --git a/Plugins/CsvImport/csvimport.cpp b/Plugins/CsvImport/csvimport.cpp
index cec81df..b1d52ee 100644
--- a/Plugins/CsvImport/csvimport.cpp
+++ b/Plugins/CsvImport/csvimport.cpp
@@ -53,26 +53,25 @@ void CsvImport::afterImport()
bool CsvImport::extractColumns()
{
- QString line = stream->readLine();
- while (line.trimmed().isEmpty() && !stream->atEnd())
- line = stream->readLine();
+ QStringList deserializedEntry = CsvSerializer::deserializeOneEntry(*stream, csvFormat);
+ while (deserializedEntry.isEmpty() && !stream->atEnd())
+ deserializedEntry = CsvSerializer::deserializeOneEntry(*stream, csvFormat);
- if (line.trimmed().isEmpty())
+ if (deserializedEntry.isEmpty())
{
notifyError(tr("Could not find any data in the file %1.").arg(file->fileName()));
return false;
}
- QStringList deserialized = CsvSerializer::deserialize(line.trimmed(), csvFormat).first();
if (cfg.CsvImport.FirstRowAsColumns.get())
{
- columnNames = deserialized;
+ columnNames = deserializedEntry;
}
else
{
static const QString colTmp = QStringLiteral("column%1");
columnNames.clear();
- for (int i = 1, total = deserialized.size(); i <= total; ++i)
+ for (int i = 1, total = deserializedEntry.size(); i <= total; ++i)
columnNames << colTmp.arg(i);
stream->seek(0);
@@ -117,31 +116,28 @@ QList<ImportPlugin::ColumnDefinition> CsvImport::getColumns() const
QList<QVariant> CsvImport::next()
{
- QString line = stream->readLine();
- if (line.isNull())
- return QList<QVariant>();
+ QStringList deserializedEntry = CsvSerializer::deserializeOneEntry(*stream, csvFormat);
QList<QVariant> values;
- QList<QStringList> deserialized = CsvSerializer::deserialize(line, csvFormat);
- if (deserialized.size() > 0)
+ if (deserializedEntry.isEmpty())
+ return values;
+
+ if (cfg.CsvImport.NullValues.get())
{
- if (cfg.CsvImport.NullValues.get())
+ QString nullVal = cfg.CsvImport.NullValueString.get();
+ for (const QString& val : deserializedEntry)
{
- QString nullVal = cfg.CsvImport.NullValueString.get();
- for (const QString& val : deserialized.first())
- {
- if (val == nullVal)
- values << QVariant(QVariant::String);
- else
- values << val;
- }
- }
- else
- {
- for (const QString& val : deserialized.first())
+ if (val == nullVal)
+ values << QVariant(QVariant::String);
+ else
values << val;
}
}
+ else
+ {
+ for (const QString& val : deserializedEntry)
+ values << val;
+ }
return values;
}
@@ -176,10 +172,6 @@ bool CsvImport::validateOptions()
if (cfg.CsvImport.NullValues.get())
{
IMPORT_MANAGER->updateVisibilityAndEnabled(cfg.CsvImport.NullValueString, true, true);
-
- bool valid = !cfg.CsvImport.NullValueString.get().isEmpty();
- IMPORT_MANAGER->handleValidationFromPlugin(valid, cfg.CsvImport.NullValueString, tr("Enter the value that will be interpreted as a NULL."));
- isValid &= valid;
}
else
{