mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-21 19:30:26 +08:00
tweaking: optimize importing logic
this commit will apply a warning to whoever tries to import an http:// link. also this commit tweaks the logic of link trimming.
This commit is contained in:
parent
e258be6575
commit
3bddc7cace
@ -168,11 +168,16 @@ void ImportConfigWindow::on_beginImportBtn_clicked()
|
||||
while (!linkList.isEmpty())
|
||||
{
|
||||
aliasPrefix = nameTxt->text();
|
||||
auto link = linkList.takeFirst();
|
||||
if (link.trimmed().isEmpty() || link.startsWith("#") || link.startsWith("//"))
|
||||
{
|
||||
auto link = linkList.takeFirst().trimmed();
|
||||
if (link.isEmpty() || link.startsWith("#") || link.startsWith("//"))
|
||||
continue;
|
||||
|
||||
// warn if someone tries to import a https:// link
|
||||
if (link.startsWith("https://"))
|
||||
{
|
||||
errorsList->addItem(tr("WARNING: You may have mistaken 'subscription link' with 'share link': %1").arg(link));
|
||||
}
|
||||
|
||||
QString errMessage;
|
||||
QString newGroupName = "";
|
||||
const auto config = ConvertConfigFromString(link, &aliasPrefix, &errMessage, &newGroupName);
|
||||
|
Loading…
Reference in New Issue
Block a user