<table><tr><td style="">marten created this revision.<br />marten added reviewers: Plasma, Frameworks.<br />Herald added projects: Dolphin, Frameworks.<br />Herald added subscribers: kfm-devel, kde-frameworks-devel.<br />marten requested review of this revision.
</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/D19439">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Compiling this module produces a number of warnings all referring to the same source:</p>

<p>kio-extras/smb/kio_smb_internal.h: In member function 'void SMBUrl::setFileName(const QString&)':<br />
kio-extras/smb/kio_smb_internal.h:96: warning: ignoring return value of 'QUrl QUrl::adjusted(QUrl::FormattingOptions) const', declared with attribute nodiscard</p>

<p>The problem code is trying to make a URL for a partial file being uploaded/copied.  However, because QUrl::adjusted() does not modify the URL in place, the copy operation works but does not use the intended partial file name.  For example, if the destination file is "smb://server/dir/foobar.ext", the partial file name used will be "smb://server/dir/foobar.extfoobar.ext.part".  The complete file will eventually be saved under the correct name, but the name will be wrong if the transfer is aborted and the user wants to find the partial file.</p>

<p>There is also the possibility of an error if the file name is long and the destination server has a length limit, because it effectively doubles in length.</p>

<p>The change fixes the problem and simplifies the code by simply appending ".part" to the supplied URL path directly.  No other part of the ioslave uses SMBUrl::setFileName() or SMBUrl::partUrl(), so this does not raise any compatibility problems.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Built kio_smb with this change.  Observed no compiler warning messages, correct copying to and from SMB, and use of the correct partial file name.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R320 KIO Extras</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D19439">https://phabricator.kde.org/D19439</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>smb/kio_smb_internal.cpp<br />
smb/kio_smb_internal.h</div></div></div><br /><div><strong>To: </strong>marten, Plasma, Frameworks<br /><strong>Cc: </strong>kde-frameworks-devel, kfm-devel, alexde, feverfew, michaelh, spoorun, navarromorales, firef, ngraham, andrebarros, bruns, emmanuelp, mikesomov<br /></div>