<table><tr><td style="">davidhurka 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/D21281">View Revision</a></tr></table><br /><div><div><p>Giving up for today, there are sooooo many functions of the format open*(url).</p>
<p>You can now look at my changes and comments and so on. If some of my questions contratict themselves (like questions normally do...), feel free to ask. ;)</p>
<p>I will make a list of open*(url) functions soon, they definitely need a call graph before I understand them.</p></div></div><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/D21281#inline-120246">View Inline</a><span style="color: #4b4d51; font-weight: bold;">document.h:1280</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "><span style="color: #74777d"> */</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="n">DocumentViewport</span><span class="p">(</span> <span style="color: #aa4000">const</span> <span class="n">QString</span> <span style="color: #aa2211">&</span><span class="n">description</span> <span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I had a note that this would be called with a source location, and something with GotoAction. No idea what I meant with that.</p>
<p style="padding: 0; margin: 8px;">Anyway, I have no idea how Actions or GotoActions work, and also am not sure what is meant with “source location”. Someone who knows more about them? Or where I can find documentation fragments about them? Doxygen reveals nothing (except that they describe “actions”), and the code is to obscure for me.</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/D21281#inline-120248">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.cpp:1381</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #aa2211">*</span><span class="n">isCompressedFile</span> <span style="color: #aa2211">=</span> <span style="color: #304a96">true</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="n">uncompressOk</span> <span style="color: #aa2211">=</span> <span class="n">handleCompressed</span><span class="p">(</span> <span class="n">fileNameToOpen</span><span class="p">,</span> <span class="n">localFilePath</span><span class="p">(),</span> <span class="n">compressionType</span> <span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="n">mime</span> <span style="color: #aa2211">=</span> <span class="n">db</span><span class="p">.</span><span class="n">mimeTypeForFile</span><span class="p">(</span> <span class="n">fileNameToOpen</span> <span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">If uncompressOk is false now, this could directly return openResult, which is now OpenError.<br />
Pro: Reduces nesting level and makes if tests smaller.</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/D21281#inline-120249">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.cpp:1428</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "><span style="color: #304a96">#ifdef WITH_KWALLET</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #74777d">// if the file didn't open correctly it might be encrypted, so ask for a pass</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="n">QString</span> <span class="n">walletName</span><span class="p">,</span> <span class="n">walletFolder</span><span class="p">,</span> <span class="n">walletKey</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">So, <tt style="background: #ebebeb; font-size: 13px;">swapInsteadOfOpening</tt> does not work with encrypted files?</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/D21281#inline-120250">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.cpp:1428</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "><span style="color: #304a96">#ifdef WITH_KWALLET</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #74777d">// if the file didn't open correctly it might be encrypted, so ask for a pass</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="n">QString</span> <span class="n">walletName</span><span class="p">,</span> <span class="n">walletFolder</span><span class="p">,</span> <span class="n">walletKey</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Assume, the document <em>did</em> opened correctly. Why do all this wallet stuff then?</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/D21281#inline-120251">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.cpp:1440</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #74777d">// 1.A. try to retrieve the first password from the kde wallet system</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #aa4000">if</span> <span class="p">(</span> <span style="color: #aa2211">!</span><span class="n">triedWallet</span> <span style="color: #aa2211">&&</span> <span style="color: #aa2211">!</span><span class="n">walletKey</span><span class="p">.</span><span class="n">isNull</span><span class="p">()</span> <span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This <tt style="background: #ebebeb; font-size: 13px;">if</tt> is effectively executing <em>before</em> the while loop.</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/D21281#inline-120252">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.cpp:1491</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #aa4000">if</span> <span class="p">(</span> <span class="n">openResult</span> <span style="color: #aa2211">==</span> <span class="n">Document</span><span style="color: #aa2211">::</span><span class="n">OpenSuccess</span> <span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">And this <tt style="background: #ebebeb; font-size: 13px;">if</tt> is effectively executing <em>after</em> the while loop.</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/D21281#inline-120253">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.cpp:1568</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">bool</span> <span class="n">canSearch</span> <span style="color: #aa2211">=</span> <span class="n">m_document</span><span style="color: #aa2211">-></span><span class="n">supportsSearching</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #aa4000">const</span> <span style="color: #aa4000">bool</span> <span class="n">ok</span> <span style="color: #aa2211">=</span> <span class="n">openResult</span> <span style="color: #aa2211">==</span> <span class="n">Document</span><span style="color: #aa2211">::</span><span class="n">OpenSuccess</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="n">emit</span> <span style="color: #004012">enableCloseAction</span><span class="p">(</span> <span class="n">ok</span> <span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This ok variable is effectively enabling the whole rest of the function. Why not return directly if <tt style="background: #ebebeb; font-size: 13px;">openResult != Document::OpenSuccess</tt>?<br />
There is very few code being executed without <tt style="background: #ebebeb; font-size: 13px;">ok == true</tt>, mostly disabling several actions.</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/D21281#inline-120254">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.cpp:1583</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #74777d">// Show a message if embedded files are present.</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="n">m_topMessage</span><span style="color: #aa2211">-></span><span class="n">setVisible</span><span class="p">(</span> <span class="n">hasEmbeddedFiles</span> <span style="color: #aa2211">&&</span> <span class="n">Okular</span><span style="color: #aa2211">::</span><span class="n">Settings</span><span style="color: #aa2211">::</span><span class="n">showOSD</span><span class="p">()</span> <span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I’d like to rename m_topMessage -> m_embeddedFilesMessage.</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/D21281#inline-120255">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.cpp:1653</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="n">m_realUrl</span> <span style="color: #aa2211">=</span> <span class="n">url</span><span class="p">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Uncompressed files have un-real URLs?</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/D21281#inline-120256">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.cpp:1742</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "><span style="color: #74777d"> * to read it */</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="n">m_swapInsteadOfOpening</span> <span style="color: #aa2211">=</span> <span class="n">swapInsteadOfOpening</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Because openFile() is called by ReadWritePart::openUrl(), which won’t pass arguments, right?</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/D21281#inline-120258">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.cpp:1746</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #74777d">// We want to save them and restore them later.</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #aa4000">const</span> <span class="n">KParts</span><span style="color: #aa2211">::</span><span class="n">OpenUrlArguments</span> <span class="n">args</span> <span style="color: #aa2211">=</span> <span class="n">arguments</span><span class="p">();</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Seems pointless, because closeUrl() will be called some more times.</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/D21281#inline-120260">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.cpp:3063</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"> <span class="bright"></span><span style="color: #aa4000"><span class="bright">const</span></span><span class="bright"> </span><span style="color: #aa4000"><span class="bright">bool</span></span><span class="bright"> </span><span class="n"><span class="bright">currentPage</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">=</span></span><span class="bright"> </span><span class="n"><span class="bright">page</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">&&</span></span><span class="bright"> </span><span class="n"><span class="bright">page</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">-></span></span><span class="bright"></span><span class="n"><span class="bright">number</span></span><span class="bright"></span><span class="p"><span class="bright">()</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">==</span></span><span class="bright"> </span><span class="n"><span class="bright">m_document</span></span><span class="bright"></span><span style="color: #aa2211"><span class="bright">-></span></span><span class="bright"></span><span class="n"><span class="bright">viewport</span></span><span class="bright"></span><span class="p"><span class="bright">().</span></span><span class="bright"></span><span class="n"><span class="bright">pageNumber</span></span><span class="bright"></span><span class="p"><span class="bright">;</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="bright"></span><span style="color: #74777d"><span class="bright">// The existing actions are expected in some other KXMLGuiClient.</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #aa4000">if</span> <span class="p">(</span><span style="color: #aa2211">!</span><span class="n">m_actionsSearched</span><span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">m_actionsSearched is not used outside this function. Make it a static local variable?</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/D21281#inline-120261">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.cpp:3147</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #aa4000">else</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="n">m_document</span><span style="color: #aa2211">-></span><span class="n">bookmarkManager</span><span class="p">()</span><span style="color: #aa2211">-></span><span class="n">addBookmark</span><span class="p">(</span> <span class="n">page</span><span style="color: #aa2211">-></span><span class="n">number</span><span class="p">()</span> <span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This could cause a segfault. Who says that <tt style="background: #ebebeb; font-size: 13px;">page</tt> will be valid?</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/D21281#inline-120262">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.cpp:3347</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #aa4000">if</span> <span class="p">(</span> <span class="n">printDialog</span> <span class="p">)</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">printDialog was just constructed. So, why test it?<br />
If it could be invalid, who will clean up the memory then?</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/D21281#inline-120263">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.cpp:3354</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #74777d">// If the user has bookmarked pages for printing, then enable Selection</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #aa4000">if</span> <span class="p">(</span> <span style="color: #aa2211">!</span><span class="n">m_document</span><span style="color: #aa2211">-></span><span class="n">bookmarkedPageRange</span><span class="p">().</span><span class="n">isEmpty</span><span class="p">()</span> <span class="p">)</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">How does the Selection option work? Print all pages with bookmarks? Print all pages between bookmarks? Print the page with the selected bookmark? Could not find that in the user documentation.</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/D21281#inline-120247">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.h:123</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #74777d">/**</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);"><span style="color: #74777d"> * <span class="bright">If one element of 'args' contains one of the strings "Print/Preview" or "Viewer</span>Widget<span class="bright">",</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> * <span class="bright">@param parent</span>Widget<span class="bright"> TODO</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> * @param parent The parent object.</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">parentWidget is what will be a parent of the Part::widget(), so it can receive QEvents which are not used by the Part? Assuming that, a Part receives its QEvents through its widget(), right?</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/D21281#inline-120264">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.h:329</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "> <span class="n">protected</span> <span style="color: #a0a000">Q_SLOTS</span><span class="p">:</span>
</div><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #74777d">// connected to actions</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">What does this mean? Are these the functions which are called when the user clicks an action, and they will call the bunch of other open*(url) functions?</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/D21281#inline-120266">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.h:345</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> * @warning</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> * This will not notify the parent application about the URL change.</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> */</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Does this make sense? The parent application will loose control about the URL change. (Tried with KDevelop.)</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/D21281#inline-120267">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.h:386</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> *</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> * This slot must only be triggered by actions, which hold a viewport as data.</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> * The bookmark is determined using this data.</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">These slots use QObject::sender() and cast it to QAction* to extract the data, to convert it to a string and then to a DocumentViewport.<br />
This seems overly specific to me, and screws up my documentation.<br />
Why not simply connect to slotRenameBookmark(DocumentViewport) and pass the viewport as argument? (This is only used by showMenu() (?), which constructs actions on-demand anyway.)</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/D21281#inline-120268">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.h:513</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #74777d">/**</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> * Maybe hides the incremental find bar.</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> * Find bar is not hidden if a search is ongoing.</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Sounds funny, but that is how it works...<br />
Even calls FindBar::maybeHide(). ;)</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/D21281#inline-120269">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.h:529</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #74777d">// can be connected to widget elements </span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Not really an idea what this means. And to which members does it belong?</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/D21281#inline-120270">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.h:644</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; "> <span style="color: #aa4000">bool</span> <span style="color: #004012">eventFilter</span><span class="p">(</span><span class="n">QObject</span> <span style="color: #aa2211">*</span> <span class="n">watched</span><span class="p">,</span> <span class="n">QEvent</span> <span style="color: #aa2211">*</span> <span class="n">event</span><span class="p">)</span> <span class="n">override</span><span class="p">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This opens a context menu for context menu items, or what?</p>
<p style="padding: 0; margin: 8px;">It accepts events of type ContextMenu, that’s clear. To open the context menu, it seems to need a QMenu as event source.</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/D21281#inline-120271">View Inline</a><span style="color: #4b4d51; font-weight: bold;">part.h:647</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #74777d">/**</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> * Tries to open a file.</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span style="color: #74777d"> *</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Uh-oh, this is complicated. Would someone look over it?</p>
<p style="padding: 0; margin: 8px;">Yes, the language is not final.</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R223 Okular</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D21281">https://phabricator.kde.org/D21281</a></div></div><br /><div><strong>To: </strong>davidhurka, Okular<br /><strong>Cc: </strong>aacid, okular-devel, joaonetto, tfella, ngraham, darcyshen<br /></div>