<table><tr><td style="">sitter added a comment.
</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/D23537">View Revision</a></tr></table><br /><div><div><p>I do wonder if maybe it would make sense to revise the verification system to be based off of a list of allowed/forbidden functions that may be called during a command.</p>
<p>e.g. for open the requirements are actually more complicated than this diff establishes. It should be: CMD_OPEN must result in exactly 1 opened() call OR exactly 1 error() call AND must not ever call finished(). This is a less specific variant of what m_finalityCommand represents. Where m_finalityCommand simply marks a command as allowed/forbidden to call error and finished, a more dynamic system would allow us to tightly control different calls.</p>
<p>Simply put: Any given command has 0:N functions it may or may not call. And currently we have no system to codify that.</p>
<p>So maybe something like this would make sense:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">void validateCall(QString name)
{
q_assert(m_CurrentlyAllowedCalls.include?(name), "mustn't call this function");
}
void opened()
{
validateCall("opened");
...
}
void finished()
{
validateCall("finished");
...
}</pre></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R241 KIO</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D23537">https://phabricator.kde.org/D23537</a></div></div><br /><div><strong>To: </strong>sitter, dfaure<br /><strong>Cc: </strong>kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns<br /></div>