]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
Nodes: don't append http:// on add custom node
authortobtoht <thotbot@protonmail.com>
Sat, 14 Aug 2021 15:14:27 +0000 (17:14 +0200)
committertobtoht <thotbot@protonmail.com>
Wed, 15 Sep 2021 21:45:29 +0000 (23:45 +0200)
src/widgets/NodeWidget.cpp

index 23d6afa02b5970238098aa3f6d04bfc40fb9e9f1..3b94d892111302f4d77c6e6963ae5bc1d4ad5337 100644 (file)
@@ -135,8 +135,9 @@ void NodeWidget::onCustomAddClicked(){
     auto currentNodes = m_ctx->nodes->customNodes();
     QString currentNodesText;
 
-    for (auto &entry: currentNodes)
-        currentNodesText += QString("%1\n").arg(entry.url.toString());
+    for (auto &entry: currentNodes) {
+        currentNodesText += QString("%1\n").arg(entry.toFullAddress());
+    }
 
     bool ok;
     QString text = QInputDialog::getMultiLineText(this, "Add custom node(s).", "E.g: user:password@127.0.0.1:18081", currentNodesText, &ok);
@@ -145,9 +146,9 @@ void NodeWidget::onCustomAddClicked(){
 
     QList<FeatherNode> nodesList;
     auto newNodesList = text.split("\n");
-    for(auto &newNodeText: newNodesList) {
+    for (auto &newNodeText: newNodesList) {
         newNodeText = newNodeText.replace("\r", "").trimmed();
-        if(newNodeText.isEmpty())
+        if (newNodeText.isEmpty())
             continue;
 
         auto node = FeatherNode(newNodeText);