feverfew created this revision. feverfew added reviewers: chinmoyr, akrutzler, elvisangelaccio, dfaure. Herald added projects: Dolphin, Frameworks. Herald added subscribers: kfm-devel, kde-frameworks-devel. feverfew requested review of this revision.
REVISION SUMMARY This patch fixes two cases where invalid KTMPFile objects would be treated as valid. In particular, this would manifest in KIO::stat() and KIO::mimetype() returning without error when they, in fact, should do. One would note that in the rest of the code, KMTPFile objects that are received via KMTPStorageInterface::getFileMetaData() always have a isValid() check applied before use. The two previously mentioned functions, incorrectly, do not have this check applied. This patch simply adds these necessary checks. TEST PLAN KIOFuse uses KIO::stat() to complete a lookup. Before this patch lookup would always succeed and this was determined to be because stat would always succeed. This bug could be easily found as tab completion would never work correctly. Trying to tab complete would seem to add what was already typed in to the directory. With this patch applied, lookup no longer always succeeds and tab completion now works. REPOSITORY R320 KIO Extras BRANCH mtpFixStat (branched from master) REVISION DETAIL https://phabricator.kde.org/D23454 AFFECTED FILES mtp/kio_mtp.cpp To: feverfew, chinmoyr, akrutzler, elvisangelaccio, dfaure Cc: kde-frameworks-devel, kfm-devel, fvogt, aprcela, vmarinescu, fprice, LeGast00n, MrPepe, fbampaloukas, alexde, GB_2, Codezela, feverfew, meven, michaelh, spoorun, navarromorales, firef, ngraham, andrebarros, bruns, emmanuelp, mikesomov