kioslave: replace QFile::exists() with QDir::exists() where applicable

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2020-02-03 19:52:10 +00:00
parent 87797006e7
commit c877c3e49b

View file

@ -118,7 +118,7 @@ static void removeDir( const QString& trashDir, const QString& dirName )
static void removeDirRecursive( const QString& dir )
{
if ( QFile::exists( dir ) ) {
if ( QDir( dir ).exists() ) {
// Make it work even with readonly dirs, like trashReadOnlyDirFromHome() creates
KUrl u = KUrl::fromPath( dir );
@ -856,9 +856,9 @@ void TestTrash::moveDirectoryFromTrash()
void TestTrash::trashDirectoryOwnedByRoot()
{
KUrl u;
if ( QFile::exists( "/etc/cups" ) )
if ( QDir( "/etc/cups" ).exists() )
u.setPath( "/etc/cups" );
else if ( QFile::exists( "/boot" ) )
else if ( QDir( "/boot" ).exists() )
u.setPath( "/boot" );
else
u.setPath( "/etc" );