Commit bd0cfffe authored by Max Kellermann's avatar Max Kellermann

neighbor/Info: add constructor

parent 8c5ea7ec
...@@ -25,6 +25,11 @@ ...@@ -25,6 +25,11 @@
struct NeighborInfo { struct NeighborInfo {
std::string uri; std::string uri;
std::string display_name; std::string display_name;
template<typename U, typename DN>
NeighborInfo(U &&_uri, DN &&_display_name)
:uri(std::forward<U>(_uri)),
display_name(std::forward<DN>(_display_name)) {}
}; };
#endif #endif
...@@ -122,12 +122,7 @@ ReadServer(NeighborExplorer::List &list, const smbc_dirent &e) ...@@ -122,12 +122,7 @@ ReadServer(NeighborExplorer::List &list, const smbc_dirent &e)
const std::string name(e.name, e.namelen); const std::string name(e.name, e.namelen);
const std::string comment(e.comment, e.commentlen); const std::string comment(e.comment, e.commentlen);
NeighborInfo info{ list.emplace_front("smb://" + name, name + " (" + comment + ")");
"smb://" + name,
name + " (" + comment + ")",
};
list.emplace_front(std::move(info));
} }
static void static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment