<table><tr><td style="">meven marked an inline comment as done.<br />meven added inline comments.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D26934">View Revision</a></tr></table><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D26934#inline-156265">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ervin</span> wrote in <span style="color: #4b4d51; font-weight: bold;">autostart.cpp:87</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">Unrelated right? Where do this come from?</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">The current default size was not very appropriate.<br />
I took the liberty of changing this as well.<br />
Before:<br />
<a href="https://phabricator.kde.org/F8133214" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">F8133214: Screenshot_20200226_140516.png</a></p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D26934#inline-156275">View Inline</a><span style="color: #4b4d51; font-weight: bold;">ervin</span> wrote in <span style="color: #4b4d51; font-weight: bold;">autostartmodel.h:15</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">I'd give it a less generic name or move it in a namespace this is an ambiguous call waiting to happen. :-)</p>
<p style="padding: 0; margin: 8px;">Also I'd move the implementation in the cpp file and drop the static.</p>
<p style="padding: 0; margin: 8px;">Finally, are you sure this is needed at all? I mean this is mostly about implicit conversion except that you provide a fallback in case of a missing value.</p>
<p style="padding: 0; margin: 8px;">If that's really needed I'd simplify the implementation by checking the index is between 0 and the last value of the enum in which case you can return it right away or otherwise return Xdg_Autostart.</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p style="padding: 0; margin: 8px;">I'd give it a less generic name or move it in a namespace this is an ambiguous call waiting to happen. :-)</p></blockquote>
<p style="padding: 0; margin: 8px;">I renamed it to <tt style="background: #ebebeb; font-size: 13px;">AutostartModel::sourceFromInt</tt></p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p style="padding: 0; margin: 8px;">Also I'd move the implementation in the cpp file and drop the static.</p></blockquote>
<p style="padding: 0; margin: 8px;">I am sure of the point.</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p style="padding: 0; margin: 8px;">Finally, are you sure this is needed at all? I mean this is mostly about implicit conversion except that you provide a fallback in case of a missing value.<br />
If that's really needed I'd simplify the implementation by checking the index is between 0 and the last value of the enum in which case you can return it right away or otherwise return Xdg_Autostart.</p></blockquote>
<p style="padding: 0; margin: 8px;">It makes the implementation quite explicit IMO, cannot return bad values, and can be enum-case checked by the compiler.<br />
Checking against a range is less maintainable IMO.</p>
<p style="padding: 0; margin: 8px;">(This is inspired by idiomatic rust, I am afraid)</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R119 Plasma Desktop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D26934">https://phabricator.kde.org/D26934</a></div></div><br /><div><strong>To: </strong>meven, mlaurent, ervin, Plasma, broulik, bport, crossi<br /><strong>Cc: </strong>alex, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart<br /></div>