<div dir="ltr">Glib for Windows:<div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">gboolean</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">name_ok</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">false</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_print</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"Glib</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">version</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">%i.%i.%i</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">for</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Windows.\n"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span>glib_major_version<span style="color:rgb(0,0,0)">,</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>glib_minor_version<span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span>glib_micro_version<span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">gchar</span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">name</span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(0,128,0)">":"</span><span style="color:rgb(0,0,0)">;</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Шинное</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">имя</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">процесса.</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">name_ok</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_dbus_is_name</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">name</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_print</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"Process</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">bus</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">name</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)"><%s></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">check:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)"><%s>\n"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,0)">name</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">name_ok</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">?</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"good"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"bad"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">name</span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(0,128,0)">":.a"</span><span style="color:rgb(0,0,0)">;</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Шинное</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">имя</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">процесса.</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">name_ok</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_dbus_is_name</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">name</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_print</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"Process</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">bus</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">name</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)"><%s></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">check:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)"><%s>\n"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">name</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">name_ok</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">?</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"good"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"bad"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">);</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">Output:</span></pre><pre style="margin-top:0px;margin-bottom:0px"><p style="margin:0px;white-space:pre-wrap"><br></p><p style="margin:0px;white-space:pre-wrap"><span style="font-family:Courier;font-size:14pt;color:rgb(0,0,0)">Glib version 2.44.1 for Windows.</span></p><p style="margin:0px;white-space:pre-wrap"><span style="font-family:Courier;font-size:14pt;color:rgb(0,0,0)">Process bus name <:> check: <bad></span></p><p style="margin:0px;white-space:pre-wrap"><span style="font-family:Courier;font-size:14pt;color:rgb(0,0,0)">Process bus name <:.a> check: <good></span></p></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">ср, 3 февр. 2021 г. в 03:36, Thiago Macieira <<a href="mailto:thiago@kde.org">thiago@kde.org</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Monday, 1 February 2021 07:25:43 PST Igor Plastov wrote:<br>
> Just ":" is also valid:<br>
> ~# python3 -ic "import dbussy"<br>
> <br>
> >>> dbussy.validate_bus_name(":")<br>
> <br>
> True<br>
> <br>
> It looks strange.<br>
<br>
Those are unique connection names and can only be created by the bus. One must <br>
assume that the bus only creates valid names for itself.<br>
<br>
The implementation I have in QDBusUtil::isValidUniqueConnectionName() would <br>
return false for ":" and ":.a" though.<br>
<br>
-- <br>
Thiago Macieira - thiago (AT) <a href="http://macieira.info" rel="noreferrer" target="_blank">macieira.info</a> - thiago (AT) <a href="http://kde.org" rel="noreferrer" target="_blank">kde.org</a><br>
Software Architect - Intel DPG Cloud Engineering<br>
<br>
<br>
<br>
</blockquote></div>