You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#include <klocale.h>
|
|
|
|
#include <kmessagebox.h>
|
|
|
|
#include <kurl.h>
|
|
|
|
#include <kio/netaccess.h>
|
|
|
|
|
|
|
|
#include <tqfileinfo.h>
|
|
|
|
|
|
|
|
#include "safedelete.h"
|
|
|
|
|
|
|
|
bool SafeDelete::deleteFile( const KURL& url )
|
|
|
|
{
|
|
|
|
if ( url.isLocalFile() )
|
|
|
|
{
|
|
|
|
TQFileInfo info( url.path() );
|
|
|
|
if ( info.isDir() )
|
|
|
|
{
|
|
|
|
KMessageBox::information(0L,
|
|
|
|
i18n("Not deleting\n%1\nas it is a "
|
|
|
|
"directory.").tqarg( url.prettyURL() ),
|
|
|
|
i18n("Not Deleted"));
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
KIO::NetAccess::del( url, 0L );
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
KMessageBox::information( 0L,
|
|
|
|
i18n("Not deleting\n%1\nas it is not a local"
|
|
|
|
" file.").tqarg( url.prettyURL() ),
|
|
|
|
i18n("Not Deleted") );
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|