Compiling this module produces a number of warnings all referring to the same source:
kio-extras/smb/kio_smb_internal.h: In member function 'void SMBUrl::setFileName(const QString&)':
kio-extras/smb/kio_smb_internal.h:96: warning: ignoring return value of 'QUrl QUrl::adjusted(QUrl::FormattingOptions) const', declared with attribute nodiscard
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.
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.
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.