[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-frameworks-devel
Subject: D12538: Allow accepting by double-click in save dialog
From: Henrik Fehlauer <noreply () phabricator ! kde ! org>
Date: 2018-05-09 21:30:26
Message-ID: 20180509213026.1.7AA3DE71E7BD9309 () phabricator ! kde ! org
[Download RAW message or body]
rkflx added inline comments.
INLINE COMMENTS
> ngraham wrote in kfilewidget.cpp:1866
> Let's use new-style signal/slot syntax for new code. See \
> https://wiki.qt.io/New_Signal_Slot_Syntax
Is this even possible without a lot of refactoring (which would be out-of-scope for \
this patch)?
> kfilewidget.cpp:2183
> + // double clicking to save should only work on files
> + QFileInfo inf(ops->selectedItems().urlList().first().path());
> +
I find `inf` as a variable name slightly too cryptic.
But actually I'd just write this inline and go without `QFileInfo` and the `QUrl` \
conversion altogether, because `KFileItem` should already provide what is needed:
&& ops->selectedItems().first().isFile()
REPOSITORY
R241 KIO
REVISION DETAIL
https://phabricator.kde.org/D12538
To: anemeth, #frameworks, #vdg, ngraham, rkflx
Cc: kde-frameworks-devel, ltoscano, rkflx, broulik, jtamate, ngraham, #frameworks, \
michaelh, bruns
[Attachment #3 (unknown)]
<table><tr><td style="">rkflx 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/D12538">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/D12538#inline-65650">View Inline</a><span \
style="color: #4b4d51; font-weight: bold;">ngraham</span> wrote in <span \
style="color: #4b4d51; font-weight: bold;">kfilewidget.cpp:1866</span></div> <div \
style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: \
8px;">Let's use new-style signal/slot syntax for new code. See <a \
href="https://wiki.qt.io/New_Signal_Slot_Syntax" class="remarkup-link" \
target="_blank" rel="noreferrer">https://wiki.qt.io/New_Signal_Slot_Syntax</a></p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Is \
this even possible without a lot of refactoring (which would be out-of-scope for this \
patch)?</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/D12538#inline-65667">View \
Inline</a><span style="color: #4b4d51; font-weight: \
bold;">kfilewidget.cpp:2183</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">// double clicking to save should only work on files</span> </div><div \
style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span \
class="n">QFileInfo</span> <span class="n">inf</span><span class="p">(</span><span \
class="n">ops</span><span style="color: #aa2211">-></span><span \
class="n">selectedItems</span><span class="p">().</span><span \
class="n">urlList</span><span class="p">().</span><span class="n">first</span><span \
class="p">().</span><span class="n">path</span><span class="p">());</span> \
</div></div></div> <div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; \
margin: 8px;">I find <tt style="background: #ebebeb; font-size: 13px;">inf</tt> as a \
variable name slightly too cryptic.</p>
<p style="padding: 0; margin: 8px;">But actually I'd just write this inline and \
go without <tt style="background: #ebebeb; font-size: 13px;">QFileInfo</tt> and the \
<tt style="background: #ebebeb; font-size: 13px;">QUrl</tt> conversion altogether, \
because <tt style="background: #ebebeb; font-size: 13px;">KFileItem</tt> should \
already provide what is needed:</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);">&& \
ops->selectedItems().first().isFile()</pre></div></div></div></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/D12538">https://phabricator.kde.org/D12538</a></div></div><br \
/><div><strong>To: </strong>anemeth, Frameworks, VDG, ngraham, rkflx<br /><strong>Cc: \
</strong>kde-frameworks-devel, ltoscano, rkflx, broulik, jtamate, ngraham, \
Frameworks, michaelh, bruns<br /></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic