Skip to content

Commit cf72f13

Browse files
authored
Merge pull request #1226 from deXol/develop
Add support for multi-url CSV import
2 parents 7659dbe + 624bb7a commit cf72f13

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

src/WSClient.cpp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -815,11 +815,25 @@ void WSClient::importCSVFile(const QList<QStringList> &fileData)
815815
continue;
816816
}
817817

818-
QJsonObject o;
819-
o["service"] = ll[0];
820-
o["login"] = ll[1];
821-
o["password"] = ll[2];
822-
creds.append(o);
818+
QStringList serviceList;
819+
if (ll[0].contains(','))
820+
{
821+
// Add support for multiple services in one CSV line
822+
serviceList = ll[0].split(',');
823+
}
824+
else
825+
{
826+
serviceList = QStringList{ll[0]};
827+
}
828+
829+
for (auto& service : serviceList)
830+
{
831+
QJsonObject o;
832+
o["service"] = service;
833+
o["login"] = ll[1];
834+
o["password"] = ll[2];
835+
creds.append(o);
836+
}
823837
}
824838

825839
sendJsonData({{ "msg", "import_csv" },

0 commit comments

Comments
 (0)