summaryrefslogtreecommitdiffstats
path: root/kioslave/trash
diff options
context:
space:
mode:
Diffstat (limited to 'kioslave/trash')
-rw-r--r--kioslave/trash/kio_trash.cpp116
-rw-r--r--kioslave/trash/kio_trash.h14
-rw-r--r--kioslave/trash/ktrash.cpp14
-rw-r--r--kioslave/trash/testtrash.cpp154
-rw-r--r--kioslave/trash/testtrash.h2
-rw-r--r--kioslave/trash/trashimpl.cpp68
-rw-r--r--kioslave/trash/trashimpl.h2
7 files changed, 185 insertions, 185 deletions
diff --git a/kioslave/trash/kio_trash.cpp b/kioslave/trash/kio_trash.cpp
index 8b033abd4..f77cbf9ab 100644
--- a/kioslave/trash/kio_trash.cpp
+++ b/kioslave/trash/kio_trash.cpp
@@ -94,7 +94,7 @@ void TrashProtocol::restore( const KURL& trashURL )
TQString fileId, relativePath;
bool ok = TrashImpl::parseURL( trashURL, trashId, fileId, relativePath );
if ( !ok ) {
- error( KIO::ERR_SLAVE_DEFINED, i18n( "Malformed URL %1" ).arg( trashURL.prettyURL() ) );
+ error( TDEIO::ERR_SLAVE_DEFINED, i18n( "Malformed URL %1" ).arg( trashURL.prettyURL() ) );
return;
}
TrashedFileInfo info;
@@ -112,7 +112,7 @@ void TrashProtocol::restore( const KURL& trashURL )
const TQString destDir = dest.directory();
KDE_struct_stat buff;
if ( KDE_lstat( TQFile::encodeName( destDir ), &buff ) == -1 ) {
- error( KIO::ERR_SLAVE_DEFINED,
+ error( TDEIO::ERR_SLAVE_DEFINED,
i18n( "The directory %1 does not exist anymore, so it is not possible to restore this item to its original location. "
"You can either recreate that directory and use the restore operation again, or drag the item anywhere else to restore it." ).arg( destDir ) );
return;
@@ -128,7 +128,7 @@ void TrashProtocol::rename( const KURL &oldURL, const KURL &newURL, bool overwri
kdDebug()<<"TrashProtocol::rename(): old="<<oldURL<<" new="<<newURL<<" overwrite=" << overwrite<<endl;
if ( oldURL.protocol() == "trash" && newURL.protocol() == "trash" ) {
- error( KIO::ERR_CANNOT_RENAME, oldURL.prettyURL() );
+ error( TDEIO::ERR_CANNOT_RENAME, oldURL.prettyURL() );
return;
}
@@ -142,7 +142,7 @@ void TrashProtocol::copy( const KURL &src, const KURL &dest, int /*permissions*/
kdDebug()<<"TrashProtocol::copy(): " << src << " " << dest << endl;
if ( src.protocol() == "trash" && dest.protocol() == "trash" ) {
- error( KIO::ERR_UNSUPPORTED_ACTION, i18n( "This file is already in the trash bin." ) );
+ error( TDEIO::ERR_UNSUPPORTED_ACTION, i18n( "This file is already in the trash bin." ) );
return;
}
@@ -157,7 +157,7 @@ void TrashProtocol::copyOrMove( const KURL &src, const KURL &dest, bool overwrit
TQString fileId, relativePath;
bool ok = TrashImpl::parseURL( src, trashId, fileId, relativePath );
if ( !ok ) {
- error( KIO::ERR_SLAVE_DEFINED, i18n( "Malformed URL %1" ).arg( src.prettyURL() ) );
+ error( TDEIO::ERR_SLAVE_DEFINED, i18n( "Malformed URL %1" ).arg( src.prettyURL() ) );
return;
}
const TQString destPath = dest.path();
@@ -166,7 +166,7 @@ void TrashProtocol::copyOrMove( const KURL &src, const KURL &dest, bool overwrit
ok = TQFile::remove( destPath );
Q_ASSERT( ok ); // ### TODO
} else {
- error( KIO::ERR_FILE_ALREADY_EXIST, destPath );
+ error( TDEIO::ERR_FILE_ALREADY_EXIST, destPath );
return;
}
}
@@ -224,33 +224,33 @@ void TrashProtocol::copyOrMove( const KURL &src, const KURL &dest, bool overwrit
}
return;
} else {
- kdDebug() << "returning KIO::ERR_ACCESS_DENIED, it's not allowed to add a file to an existing trash directory" << endl;
+ kdDebug() << "returning TDEIO::ERR_ACCESS_DENIED, it's not allowed to add a file to an existing trash directory" << endl;
// It's not allowed to add a file to an existing trash directory.
- error( KIO::ERR_ACCESS_DENIED, dest.prettyURL() );
+ error( TDEIO::ERR_ACCESS_DENIED, dest.prettyURL() );
return;
}
} else
- error( KIO::ERR_UNSUPPORTED_ACTION, "should never happen" );
+ error( TDEIO::ERR_UNSUPPORTED_ACTION, "should never happen" );
}
-static void addAtom(KIO::UDSEntry& entry, unsigned int ID, long long l, const TQString& s = TQString::null)
+static void addAtom(TDEIO::UDSEntry& entry, unsigned int ID, long long l, const TQString& s = TQString::null)
{
- KIO::UDSAtom atom;
+ TDEIO::UDSAtom atom;
atom.m_uds = ID;
atom.m_long = l;
atom.m_str = s;
entry.append(atom);
}
-void TrashProtocol::createTopLevelDirEntry(KIO::UDSEntry& entry)
+void TrashProtocol::createTopLevelDirEntry(TDEIO::UDSEntry& entry)
{
entry.clear();
- addAtom(entry, KIO::UDS_NAME, 0, ".");
- addAtom(entry, KIO::UDS_FILE_TYPE, S_IFDIR);
- addAtom(entry, KIO::UDS_ACCESS, 0700);
- addAtom(entry, KIO::UDS_MIME_TYPE, 0, "inode/directory");
- addAtom(entry, KIO::UDS_USER, 0, m_userName);
- addAtom(entry, KIO::UDS_GROUP, 0, m_groupName);
+ addAtom(entry, TDEIO::UDS_NAME, 0, ".");
+ addAtom(entry, TDEIO::UDS_FILE_TYPE, S_IFDIR);
+ addAtom(entry, TDEIO::UDS_ACCESS, 0700);
+ addAtom(entry, TDEIO::UDS_MIME_TYPE, 0, "inode/directory");
+ addAtom(entry, TDEIO::UDS_USER, 0, m_userName);
+ addAtom(entry, TDEIO::UDS_GROUP, 0, m_groupName);
}
void TrashProtocol::stat(const KURL& url)
@@ -259,7 +259,7 @@ void TrashProtocol::stat(const KURL& url)
const TQString path = url.path();
if( path.isEmpty() || path == "/" ) {
// The root is "virtual" - it's not a single physical directory
- KIO::UDSEntry entry;
+ TDEIO::UDSEntry entry;
createTopLevelDirEntry( entry );
statEntry( entry );
finished();
@@ -274,8 +274,8 @@ void TrashProtocol::stat(const KURL& url)
kdDebug() << k_funcinfo << url << " looks fishy, returning does-not-exist" << endl;
// A URL like trash:/file simply means that CopyJob is trying to see if
// the destination exists already (it made up the URL by itself).
- error( KIO::ERR_DOES_NOT_EXIST, url.prettyURL() );
- //error( KIO::ERR_SLAVE_DEFINED, i18n( "Malformed URL %1" ).arg( url.prettyURL() ) );
+ error( TDEIO::ERR_DOES_NOT_EXIST, url.prettyURL() );
+ //error( TDEIO::ERR_SLAVE_DEFINED, i18n( "Malformed URL %1" ).arg( url.prettyURL() ) );
return;
}
@@ -292,14 +292,14 @@ void TrashProtocol::stat(const KURL& url)
fileURL = url.url();
}
- KIO::UDSEntry entry;
+ TDEIO::UDSEntry entry;
TrashedFileInfo info;
ok = impl.infoForFile( trashId, fileId, info );
if ( ok )
ok = createUDSEntry( filePath, fileName, fileURL, entry, info );
if ( !ok ) {
- error( KIO::ERR_COULD_NOT_STAT, url.prettyURL() );
+ error( TDEIO::ERR_COULD_NOT_STAT, url.prettyURL() );
}
statEntry( entry );
@@ -314,13 +314,13 @@ void TrashProtocol::del( const KURL &url, bool /*isfile*/ )
bool ok = TrashImpl::parseURL( url, trashId, fileId, relativePath );
if ( !ok ) {
- error( KIO::ERR_SLAVE_DEFINED, i18n( "Malformed URL %1" ).arg( url.prettyURL() ) );
+ error( TDEIO::ERR_SLAVE_DEFINED, i18n( "Malformed URL %1" ).arg( url.prettyURL() ) );
return;
}
ok = relativePath.isEmpty();
if ( !ok ) {
- error( KIO::ERR_ACCESS_DENIED, url.prettyURL() );
+ error( TDEIO::ERR_ACCESS_DENIED, url.prettyURL() );
return;
}
@@ -346,7 +346,7 @@ void TrashProtocol::listDir(const KURL& url)
TQString relativePath;
bool ok = TrashImpl::parseURL( url, trashId, fileId, relativePath );
if ( !ok ) {
- error( KIO::ERR_SLAVE_DEFINED, i18n( "Malformed URL %1" ).arg( url.prettyURL() ) );
+ error( TDEIO::ERR_SLAVE_DEFINED, i18n( "Malformed URL %1" ).arg( url.prettyURL() ) );
return;
}
//was: const TQString physicalPath = impl.physicalPath( trashId, fileId, relativePath );
@@ -368,7 +368,7 @@ void TrashProtocol::listDir(const KURL& url)
kdDebug() << k_funcinfo << "listing " << info.physicalPath << endl;
TQStrList entryNames = impl.listDir( info.physicalPath );
totalSize( entryNames.count() );
- KIO::UDSEntry entry;
+ TDEIO::UDSEntry entry;
TQStrListIterator entryIt( entryNames );
for (; entryIt.current(); ++entryIt) {
TQString fileName = TQFile::decodeName( entryIt.current() );
@@ -390,7 +390,7 @@ void TrashProtocol::listDir(const KURL& url)
finished();
}
-bool TrashProtocol::createUDSEntry( const TQString& physicalPath, const TQString& fileName, const TQString& url, KIO::UDSEntry& entry, const TrashedFileInfo& info )
+bool TrashProtocol::createUDSEntry( const TQString& physicalPath, const TQString& fileName, const TQString& url, TDEIO::UDSEntry& entry, const TrashedFileInfo& info )
{
TQCString physicalPath_c = TQFile::encodeName( physicalPath );
KDE_struct_stat buff;
@@ -405,7 +405,7 @@ bool TrashProtocol::createUDSEntry( const TQString& physicalPath, const TQString
buffer2[ n ] = 0;
}
- addAtom( entry, KIO::UDS_LINK_DEST, 0, TQFile::decodeName( buffer2 ) );
+ addAtom( entry, TDEIO::UDS_LINK_DEST, 0, TQFile::decodeName( buffer2 ) );
// Follow symlink
// That makes sense in kio_file, but not in the trash, especially for the size
// #136876
@@ -422,21 +422,21 @@ bool TrashProtocol::createUDSEntry( const TQString& physicalPath, const TQString
mode_t type = buff.st_mode & S_IFMT; // extract file type
mode_t access = buff.st_mode & 07777; // extract permissions
access &= 07555; // make it readonly, since it's in the trashcan
- addAtom( entry, KIO::UDS_NAME, 0, fileName );
- addAtom( entry, KIO::UDS_FILE_TYPE, type );
+ addAtom( entry, TDEIO::UDS_NAME, 0, fileName );
+ addAtom( entry, TDEIO::UDS_FILE_TYPE, type );
if ( !url.isEmpty() )
- addAtom( entry, KIO::UDS_URL, 0, url );
+ addAtom( entry, TDEIO::UDS_URL, 0, url );
KMimeType::Ptr mt = KMimeType::findByPath( physicalPath, buff.st_mode );
- addAtom( entry, KIO::UDS_MIME_TYPE, 0, mt->name() );
- addAtom( entry, KIO::UDS_ACCESS, access );
- addAtom( entry, KIO::UDS_SIZE, buff.st_size );
- addAtom( entry, KIO::UDS_USER, 0, m_userName ); // assumption
- addAtom( entry, KIO::UDS_GROUP, 0, m_groupName ); // assumption
- addAtom( entry, KIO::UDS_MODIFICATION_TIME, buff.st_mtime );
- addAtom( entry, KIO::UDS_ACCESS_TIME, buff.st_atime ); // ## or use it for deletion time?
- addAtom( entry, KIO::UDS_EXTRA, 0, info.origPath );
- addAtom( entry, KIO::UDS_EXTRA, 0, info.deletionDate.toString( Qt::ISODate ) );
+ addAtom( entry, TDEIO::UDS_MIME_TYPE, 0, mt->name() );
+ addAtom( entry, TDEIO::UDS_ACCESS, access );
+ addAtom( entry, TDEIO::UDS_SIZE, buff.st_size );
+ addAtom( entry, TDEIO::UDS_USER, 0, m_userName ); // assumption
+ addAtom( entry, TDEIO::UDS_GROUP, 0, m_groupName ); // assumption
+ addAtom( entry, TDEIO::UDS_MODIFICATION_TIME, buff.st_mtime );
+ addAtom( entry, TDEIO::UDS_ACCESS_TIME, buff.st_atime ); // ## or use it for deletion time?
+ addAtom( entry, TDEIO::UDS_EXTRA, 0, info.origPath );
+ addAtom( entry, TDEIO::UDS_EXTRA, 0, info.deletionDate.toString( Qt::ISODate ) );
return true;
}
@@ -445,7 +445,7 @@ void TrashProtocol::listRoot()
INIT_IMPL;
const TrashedFileInfoList lst = impl.list();
totalSize( lst.count() );
- KIO::UDSEntry entry;
+ TDEIO::UDSEntry entry;
createTopLevelDirEntry( entry );
listEntry( entry, false );
for ( TrashedFileInfoList::ConstIterator it = lst.begin(); it != lst.end(); ++it ) {
@@ -488,7 +488,7 @@ void TrashProtocol::special( const TQByteArray & data )
}
default:
kdWarning(7116) << "Unknown command in special(): " << cmd << endl;
- error( KIO::ERR_UNSUPPORTED_ACTION, TQString::number(cmd) );
+ error( TDEIO::ERR_UNSUPPORTED_ACTION, TQString::number(cmd) );
break;
}
}
@@ -499,7 +499,7 @@ void TrashProtocol::put( const KURL& url, int /*permissions*/, bool /*overwrite*
kdDebug() << "put: " << url << endl;
// create deleted file. We need to get the mtime and original location from metadata...
// Maybe we can find the info file for url.fileName(), in case ::rename() was called first, and failed...
- error( KIO::ERR_ACCESS_DENIED, url.prettyURL() );
+ error( TDEIO::ERR_ACCESS_DENIED, url.prettyURL() );
}
void TrashProtocol::get( const KURL& url )
@@ -508,11 +508,11 @@ void TrashProtocol::get( const KURL& url )
kdDebug() << "get() : " << url << endl;
if ( !url.isValid() ) {
kdDebug() << kdBacktrace() << endl;
- error( KIO::ERR_SLAVE_DEFINED, i18n( "Malformed URL %1" ).arg( url.url() ) );
+ error( TDEIO::ERR_SLAVE_DEFINED, i18n( "Malformed URL %1" ).arg( url.url() ) );
return;
}
if ( url.path().length() <= 1 ) {
- error( KIO::ERR_IS_DIRECTORY, url.prettyURL() );
+ error( TDEIO::ERR_IS_DIRECTORY, url.prettyURL() );
return;
}
int trashId;
@@ -520,7 +520,7 @@ void TrashProtocol::get( const KURL& url )
TQString relativePath;
bool ok = TrashImpl::parseURL( url, trashId, fileId, relativePath );
if ( !ok ) {
- error( KIO::ERR_SLAVE_DEFINED, i18n( "Malformed URL %1" ).arg( url.prettyURL() ) );
+ error( TDEIO::ERR_SLAVE_DEFINED, i18n( "Malformed URL %1" ).arg( url.prettyURL() ) );
return;
}
const TQString physicalPath = impl.physicalPath( trashId, fileId, relativePath );
@@ -533,27 +533,27 @@ void TrashProtocol::get( const KURL& url )
// But for this one we wouldn't use DCOP for every bit of data...
KURL fileURL;
fileURL.setPath( physicalPath );
- KIO::Job* job = KIO::get( fileURL );
- connect( job, TQT_SIGNAL( data( KIO::Job*, const TQByteArray& ) ),
- this, TQT_SLOT( slotData( KIO::Job*, const TQByteArray& ) ) );
- connect( job, TQT_SIGNAL( mimetype( KIO::Job*, const TQString& ) ),
- this, TQT_SLOT( slotMimetype( KIO::Job*, const TQString& ) ) );
- connect( job, TQT_SIGNAL( result(KIO::Job *) ),
- this, TQT_SLOT( jobFinished(KIO::Job *) ) );
+ TDEIO::Job* job = TDEIO::get( fileURL );
+ connect( job, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ),
+ this, TQT_SLOT( slotData( TDEIO::Job*, const TQByteArray& ) ) );
+ connect( job, TQT_SIGNAL( mimetype( TDEIO::Job*, const TQString& ) ),
+ this, TQT_SLOT( slotMimetype( TDEIO::Job*, const TQString& ) ) );
+ connect( job, TQT_SIGNAL( result(TDEIO::Job *) ),
+ this, TQT_SLOT( jobFinished(TDEIO::Job *) ) );
tqApp->eventLoop()->enterLoop();
}
-void TrashProtocol::slotData( KIO::Job*, const TQByteArray&arr )
+void TrashProtocol::slotData( TDEIO::Job*, const TQByteArray&arr )
{
data( arr );
}
-void TrashProtocol::slotMimetype( KIO::Job*, const TQString& mt )
+void TrashProtocol::slotMimetype( TDEIO::Job*, const TQString& mt )
{
mimeType( mt );
}
-void TrashProtocol::jobFinished( KIO::Job* job )
+void TrashProtocol::jobFinished( TDEIO::Job* job )
{
if ( job->error() )
error( job->error(), job->errorText() );
@@ -588,7 +588,7 @@ void TrashProtocol::mkdir( const KURL& url, int /*permissions*/ )
}
} else {
// Well it's not allowed to add a directory to an existing deleted directory.
- error( KIO::ERR_ACCESS_DENIED, url.prettyURL() );
+ error( TDEIO::ERR_ACCESS_DENIED, url.prettyURL() );
}
}
#endif
diff --git a/kioslave/trash/kio_trash.h b/kioslave/trash/kio_trash.h
index 37ea1944f..6f94512d7 100644
--- a/kioslave/trash/kio_trash.h
+++ b/kioslave/trash/kio_trash.h
@@ -22,12 +22,12 @@
#include <kio/slavebase.h>
#include "trashimpl.h"
-namespace KIO { class Job; }
+namespace TDEIO { class Job; }
typedef TrashImpl::TrashedFileInfo TrashedFileInfo;
typedef TrashImpl::TrashedFileInfoList TrashedFileInfoList;
-class TrashProtocol : public TQObject, public KIO::SlaveBase
+class TrashProtocol : public TQObject, public TDEIO::SlaveBase
{
Q_OBJECT
public:
@@ -50,16 +50,16 @@ public:
virtual void special( const TQByteArray & data );
private slots:
- void slotData( KIO::Job*, const TQByteArray& );
- void slotMimetype( KIO::Job*, const TQString& );
- void jobFinished( KIO::Job* job );
+ void slotData( TDEIO::Job*, const TQByteArray& );
+ void slotMimetype( TDEIO::Job*, const TQString& );
+ void jobFinished( TDEIO::Job* job );
private:
typedef enum CopyOrMove { Copy, Move };
void copyOrMove( const KURL& src, const KURL& dest, bool overwrite, CopyOrMove action );
- void createTopLevelDirEntry(KIO::UDSEntry& entry);
+ void createTopLevelDirEntry(TDEIO::UDSEntry& entry);
bool createUDSEntry( const TQString& physicalPath, const TQString& fileName, const TQString& url,
- KIO::UDSEntry& entry, const TrashedFileInfo& info );
+ TDEIO::UDSEntry& entry, const TrashedFileInfo& info );
void listRoot();
void restore( const KURL& trashURL );
diff --git a/kioslave/trash/ktrash.cpp b/kioslave/trash/ktrash.cpp
index 630b8e314..b05cac249 100644
--- a/kioslave/trash/ktrash.cpp
+++ b/kioslave/trash/ktrash.cpp
@@ -53,8 +53,8 @@ int main(int argc, char *argv[])
TQByteArray packedArgs;
TQDataStream stream( packedArgs, IO_WriteOnly );
stream << (int)1;
- KIO::Job* job = KIO::special( "trash:/", packedArgs );
- (void)KIO::NetAccess::synchronousRun( job, 0 );
+ TDEIO::Job* job = TDEIO::special( "trash:/", packedArgs );
+ (void)TDEIO::NetAccess::synchronousRun( job, 0 );
// Update konq windows opened on trash:/
KDirNotify_stub allDirNotify("*", "KDirNotify*");
@@ -68,8 +68,8 @@ int main(int argc, char *argv[])
TQByteArray packedArgs;
TQDataStream stream( packedArgs, IO_WriteOnly );
stream << (int)2;
- KIO::Job* job = KIO::special( "trash:/", packedArgs );
- (void)KIO::NetAccess::synchronousRun( job, 0 );
+ TDEIO::Job* job = TDEIO::special( "trash:/", packedArgs );
+ (void)TDEIO::NetAccess::synchronousRun( job, 0 );
return 0;
}
#endif
@@ -91,10 +91,10 @@ int main(int argc, char *argv[])
TQByteArray packedArgs;
TQDataStream stream( packedArgs, IO_WriteOnly );
stream << (int)3 << trashURL;
- KIO::Job* job = KIO::special( trashURL, packedArgs );
- bool ok = KIO::NetAccess::synchronousRun( job, 0 );
+ TDEIO::Job* job = TDEIO::special( trashURL, packedArgs );
+ bool ok = TDEIO::NetAccess::synchronousRun( job, 0 );
if ( !ok )
- kdError() << KIO::NetAccess::lastErrorString() << endl;
+ kdError() << TDEIO::NetAccess::lastErrorString() << endl;
return 0;
}
diff --git a/kioslave/trash/testtrash.cpp b/kioslave/trash/testtrash.cpp
index ef255e91d..e3d06a6d2 100644
--- a/kioslave/trash/testtrash.cpp
+++ b/kioslave/trash/testtrash.cpp
@@ -197,12 +197,12 @@ void TestTrash::setup()
// Start with a clean base dir
if ( TQFileInfo( homeTmpDir() ).exists() ) {
- bool ok = KIO::NetAccess::del( homeTmpDir(), 0 );
+ bool ok = TDEIO::NetAccess::del( homeTmpDir(), 0 );
if ( !ok )
kdFatal() << "Couldn't delete " << homeTmpDir() << endl;
}
if ( TQFileInfo( otherTmpDir() ).exists() ) {
- bool ok = KIO::NetAccess::del( otherTmpDir(), 0 );
+ bool ok = TDEIO::NetAccess::del( otherTmpDir(), 0 );
if ( !ok )
kdFatal() << "Couldn't delete " << otherTmpDir() << endl;
}
@@ -249,11 +249,11 @@ void TestTrash::cleanTrash()
removeFile( m_trashDir, "/info/trashDirFromOther.trashinfo" );
removeFile( m_trashDir, "/files/trashDirFromOther/testfile" );
removeDir( m_trashDir, "/files/trashDirFromOther" );
- KIO::NetAccess::del( m_trashDir + "/files/readonly", 0 );
+ TDEIO::NetAccess::del( m_trashDir + "/files/readonly", 0 );
// for trashDirectoryOwnedByRoot
- KIO::NetAccess::del( m_trashDir + "/files/cups", 0 );
- KIO::NetAccess::del( m_trashDir + "/files/boot", 0 );
- KIO::NetAccess::del( m_trashDir + "/files/etc", 0 );
+ TDEIO::NetAccess::del( m_trashDir + "/files/cups", 0 );
+ TDEIO::NetAccess::del( m_trashDir + "/files/boot", 0 );
+ TDEIO::NetAccess::del( m_trashDir + "/files/etc", 0 );
//system( "find ~/.local-testtrash/share/Trash" );
}
@@ -405,12 +405,12 @@ void TestTrash::trashFile( const TQString& origFilePath, const TQString& fileId
u.setPath( origFilePath );
// test
- KIO::Job* job = KIO::move( u, "trash:/" );
+ TDEIO::Job* job = TDEIO::move( u, "trash:/" );
TQMap<TQString, TQString> metaData;
- //bool ok = KIO::NetAccess::move( u, "trash:/" );
- bool ok = KIO::NetAccess::synchronousRun( job, 0, 0, 0, &metaData );
+ //bool ok = TDEIO::NetAccess::move( u, "trash:/" );
+ bool ok = TDEIO::NetAccess::synchronousRun( job, 0, 0, 0, &metaData );
if ( !ok )
- kdError() << "moving " << u << " to trash failed with error " << KIO::NetAccess::lastError() << " " << KIO::NetAccess::lastErrorString() << endl;
+ kdError() << "moving " << u << " to trash failed with error " << TDEIO::NetAccess::lastError() << " " << TDEIO::NetAccess::lastErrorString() << endl;
assert( ok );
if ( origFilePath.startsWith( "/tmp" ) && m_tmpIsWritablePartition ) {
kdDebug() << " TESTS SKIPPED" << endl;
@@ -512,9 +512,9 @@ void TestTrash::trashFileIntoOtherPartition()
u.setPath( origFilePath );
// test
- KIO::Job* job = KIO::move( u, "trash:/" );
+ TDEIO::Job* job = TDEIO::move( u, "trash:/" );
TQMap<TQString, TQString> metaData;
- bool ok = KIO::NetAccess::synchronousRun( job, 0, 0, 0, &metaData );
+ bool ok = TDEIO::NetAccess::synchronousRun( job, 0, 0, 0, &metaData );
assert( ok );
// Note that the Path stored in the info file is relative, on other partitions (#95652)
checkInfoFile( m_otherPartitionTrashDir + "/info/" + fileId + ".trashinfo", fileName );
@@ -550,13 +550,13 @@ void TestTrash::trashFileOwnedByRoot()
u.setPath( "/etc/passwd" );
const TQString fileId = "passwd";
- KIO::CopyJob* job = KIO::move( u, "trash:/" );
+ TDEIO::CopyJob* job = TDEIO::move( u, "trash:/" );
job->setInteractive( false ); // no skip dialog, thanks
TQMap<TQString, TQString> metaData;
- //bool ok = KIO::NetAccess::move( u, "trash:/" );
- bool ok = KIO::NetAccess::synchronousRun( job, 0, 0, 0, &metaData );
+ //bool ok = TDEIO::NetAccess::move( u, "trash:/" );
+ bool ok = TDEIO::NetAccess::synchronousRun( job, 0, 0, 0, &metaData );
assert( !ok );
- assert( KIO::NetAccess::lastError() == KIO::ERR_ACCESS_DENIED );
+ assert( TDEIO::NetAccess::lastError() == TDEIO::ERR_ACCESS_DENIED );
const TQString infoPath( m_trashDir + "/info/" + fileId + ".trashinfo" );
assert( !TQFile::exists( infoPath ) );
@@ -577,7 +577,7 @@ void TestTrash::trashSymlink( const TQString& origFilePath, const TQString& file
u.setPath( origFilePath );
// test
- ok = KIO::NetAccess::move( u, "trash:/" );
+ ok = TDEIO::NetAccess::move( u, "trash:/" );
assert( ok );
if ( origFilePath.startsWith( "/tmp" ) && m_tmpIsWritablePartition ) {
kdDebug() << " TESTS SKIPPED" << endl;
@@ -625,7 +625,7 @@ void TestTrash::trashDirectory( const TQString& origPath, const TQString& fileId
KURL u; u.setPath( origPath );
// test
- bool ok = KIO::NetAccess::move( u, "trash:/" );
+ bool ok = TDEIO::NetAccess::move( u, "trash:/" );
assert( ok );
if ( origPath.startsWith( "/tmp" ) && m_tmpIsWritablePartition ) {
kdDebug() << " TESTS SKIPPED" << endl;
@@ -678,14 +678,14 @@ void TestTrash::trashDirectoryFromOther()
void TestTrash::tryRenameInsideTrash()
{
kdDebug() << k_funcinfo << " with file_move" << endl;
- bool worked = KIO::NetAccess::file_move( "trash:/0-tryRenameInsideTrash", "trash:/foobar" );
+ bool worked = TDEIO::NetAccess::file_move( "trash:/0-tryRenameInsideTrash", "trash:/foobar" );
assert( !worked );
- assert( KIO::NetAccess::lastError() == KIO::ERR_CANNOT_RENAME );
+ assert( TDEIO::NetAccess::lastError() == TDEIO::ERR_CANNOT_RENAME );
kdDebug() << k_funcinfo << " with move" << endl;
- worked = KIO::NetAccess::move( "trash:/0-tryRenameInsideTrash", "trash:/foobar" );
+ worked = TDEIO::NetAccess::move( "trash:/0-tryRenameInsideTrash", "trash:/foobar" );
assert( !worked );
- assert( KIO::NetAccess::lastError() == KIO::ERR_CANNOT_RENAME );
+ assert( TDEIO::NetAccess::lastError() == TDEIO::ERR_CANNOT_RENAME );
}
void TestTrash::delRootFile()
@@ -693,7 +693,7 @@ void TestTrash::delRootFile()
kdDebug() << k_funcinfo << endl;
// test deleting a trashed file
- bool ok = KIO::NetAccess::del( "trash:/0-fileFromHome", 0L );
+ bool ok = TDEIO::NetAccess::del( "trash:/0-fileFromHome", 0L );
assert( ok );
TQFileInfo file( m_trashDir + "/files/fileFromHome" );
@@ -711,9 +711,9 @@ void TestTrash::delFileInDirectory()
kdDebug() << k_funcinfo << endl;
// test deleting a file inside a trashed directory -> not allowed
- bool ok = KIO::NetAccess::del( "trash:/0-trashDirFromHome/testfile", 0L );
+ bool ok = TDEIO::NetAccess::del( "trash:/0-trashDirFromHome/testfile", 0L );
assert( !ok );
- assert( KIO::NetAccess::lastError() == KIO::ERR_ACCESS_DENIED );
+ assert( TDEIO::NetAccess::lastError() == TDEIO::ERR_ACCESS_DENIED );
TQFileInfo dir( m_trashDir + "/files/trashDirFromHome" );
assert( dir.exists() );
@@ -728,7 +728,7 @@ void TestTrash::delDirectory()
kdDebug() << k_funcinfo << endl;
// test deleting a trashed directory
- bool ok = KIO::NetAccess::del( "trash:/0-trashDirFromHome", 0L );
+ bool ok = TDEIO::NetAccess::del( "trash:/0-trashDirFromHome", 0L );
assert( ok );
TQFileInfo dir( m_trashDir + "/files/trashDirFromHome" );
@@ -747,8 +747,8 @@ void TestTrash::statRoot()
{
kdDebug() << k_funcinfo << endl;
KURL url( "trash:/" );
- KIO::UDSEntry entry;
- bool ok = KIO::NetAccess::stat( url, entry, 0 );
+ TDEIO::UDSEntry entry;
+ bool ok = TDEIO::NetAccess::stat( url, entry, 0 );
assert( ok );
KFileItem item( entry, url );
assert( item.isDir() );
@@ -764,8 +764,8 @@ void TestTrash::statFileInRoot()
{
kdDebug() << k_funcinfo << endl;
KURL url( "trash:/0-fileFromHome" );
- KIO::UDSEntry entry;
- bool ok = KIO::NetAccess::stat( url, entry, 0 );
+ TDEIO::UDSEntry entry;
+ bool ok = TDEIO::NetAccess::stat( url, entry, 0 );
assert( ok );
KFileItem item( entry, url );
assert( item.isFile() );
@@ -782,8 +782,8 @@ void TestTrash::statDirectoryInRoot()
{
kdDebug() << k_funcinfo << endl;
KURL url( "trash:/0-trashDirFromHome" );
- KIO::UDSEntry entry;
- bool ok = KIO::NetAccess::stat( url, entry, 0 );
+ TDEIO::UDSEntry entry;
+ bool ok = TDEIO::NetAccess::stat( url, entry, 0 );
assert( ok );
KFileItem item( entry, url );
assert( item.isDir() );
@@ -799,8 +799,8 @@ void TestTrash::statSymlinkInRoot()
{
kdDebug() << k_funcinfo << endl;
KURL url( "trash:/0-symlinkFromHome" );
- KIO::UDSEntry entry;
- bool ok = KIO::NetAccess::stat( url, entry, 0 );
+ TDEIO::UDSEntry entry;
+ bool ok = TDEIO::NetAccess::stat( url, entry, 0 );
assert( ok );
KFileItem item( entry, url );
assert( item.isLink() );
@@ -816,8 +816,8 @@ void TestTrash::statFileInDirectory()
{
kdDebug() << k_funcinfo << endl;
KURL url( "trash:/0-trashDirFromHome/testfile" );
- KIO::UDSEntry entry;
- bool ok = KIO::NetAccess::stat( url, entry, 0 );
+ TDEIO::UDSEntry entry;
+ bool ok = TDEIO::NetAccess::stat( url, entry, 0 );
assert( ok );
KFileItem item( entry, url );
assert( item.isFile() );
@@ -837,12 +837,12 @@ void TestTrash::copyFromTrash( const TQString& fileId, const TQString& destPath,
KURL dest;
dest.setPath( destPath );
- assert( KIO::NetAccess::exists( src, true, (TQWidget*)0 ) );
+ assert( TDEIO::NetAccess::exists( src, true, (TQWidget*)0 ) );
// A dnd would use copy(), but we use copyAs to ensure the final filename
//kdDebug() << k_funcinfo << "copyAs:" << src << " -> " << dest << endl;
- KIO::Job* job = KIO::copyAs( src, dest );
- bool ok = KIO::NetAccess::synchronousRun( job, 0 );
+ TDEIO::Job* job = TDEIO::copyAs( src, dest );
+ bool ok = TDEIO::NetAccess::synchronousRun( job, 0 );
assert( ok );
TQString infoFile( m_trashDir + "/info/" + fileId + ".trashinfo" );
assert( TQFile::exists( infoFile ) );
@@ -895,11 +895,11 @@ void TestTrash::moveFromTrash( const TQString& fileId, const TQString& destPath,
KURL dest;
dest.setPath( destPath );
- assert( KIO::NetAccess::exists( src, true, (TQWidget*)0 ) );
+ assert( TDEIO::NetAccess::exists( src, true, (TQWidget*)0 ) );
// A dnd would use move(), but we use moveAs to ensure the final filename
- KIO::Job* job = KIO::moveAs( src, dest );
- bool ok = KIO::NetAccess::synchronousRun( job, 0 );
+ TDEIO::Job* job = TDEIO::moveAs( src, dest );
+ bool ok = TDEIO::NetAccess::synchronousRun( job, 0 );
assert( ok );
TQString infoFile( m_trashDir + "/info/" + fileId + ".trashinfo" );
assert( !TQFile::exists( infoFile ) );
@@ -956,14 +956,14 @@ void TestTrash::trashDirectoryOwnedByRoot()
const TQString fileId = u.path();
kdDebug() << k_funcinfo << "fileId=" << fileId << endl;
- KIO::CopyJob* job = KIO::move( u, "trash:/" );
+ TDEIO::CopyJob* job = TDEIO::move( u, "trash:/" );
job->setInteractive( false ); // no skip dialog, thanks
TQMap<TQString, TQString> metaData;
- bool ok = KIO::NetAccess::synchronousRun( job, 0, 0, 0, &metaData );
+ bool ok = TDEIO::NetAccess::synchronousRun( job, 0, 0, 0, &metaData );
assert( !ok );
- const int err = KIO::NetAccess::lastError();
- assert( err == KIO::ERR_ACCESS_DENIED
- || err == KIO::ERR_CANNOT_OPEN_FOR_READING );
+ const int err = TDEIO::NetAccess::lastError();
+ assert( err == TDEIO::ERR_ACCESS_DENIED
+ || err == TDEIO::ERR_CANNOT_OPEN_FOR_READING );
const TQString infoPath( m_trashDir + "/info/" + fileId + ".trashinfo" );
assert( !TQFile::exists( infoPath ) );
@@ -988,7 +988,7 @@ void TestTrash::getFile()
const TQString fileId = "fileFromHome_1";
const KURL url = TrashImpl::makeURL( 0, fileId, TQString::null );
TQString tmpFile;
- bool ok = KIO::NetAccess::download( url, tmpFile, 0 );
+ bool ok = TDEIO::NetAccess::download( url, tmpFile, 0 );
assert( ok );
TQFile file( tmpFile );
ok = file.open( IO_ReadOnly );
@@ -998,7 +998,7 @@ void TestTrash::getFile()
if ( cstr != "Hello world\n" )
kdFatal() << "get() returned the following data:" << cstr << endl;
file.close();
- KIO::NetAccess::removeTempFile( tmpFile );
+ TDEIO::NetAccess::removeTempFile( tmpFile );
}
void TestTrash::restoreFile()
@@ -1015,8 +1015,8 @@ void TestTrash::restoreFile()
TQByteArray packedArgs;
TQDataStream stream( packedArgs, IO_WriteOnly );
stream << (int)3 << url;
- KIO::Job* job = KIO::special( url, packedArgs );
- bool ok = KIO::NetAccess::synchronousRun( job, 0 );
+ TDEIO::Job* job = TDEIO::special( url, packedArgs );
+ bool ok = TDEIO::NetAccess::synchronousRun( job, 0 );
assert( ok );
assert( !TQFile::exists( infoFile ) );
@@ -1042,11 +1042,11 @@ void TestTrash::restoreFileFromSubDir()
TQByteArray packedArgs;
TQDataStream stream( packedArgs, IO_WriteOnly );
stream << (int)3 << url;
- KIO::Job* job = KIO::special( url, packedArgs );
- bool ok = KIO::NetAccess::synchronousRun( job, 0 );
+ TDEIO::Job* job = TDEIO::special( url, packedArgs );
+ bool ok = TDEIO::NetAccess::synchronousRun( job, 0 );
assert( !ok );
// dest dir doesn't exist -> error message
- assert( KIO::NetAccess::lastError() == KIO::ERR_SLAVE_DEFINED );
+ assert( TDEIO::NetAccess::lastError() == TDEIO::ERR_SLAVE_DEFINED );
// check that nothing happened
assert( TQFile::exists( infoFile ) );
@@ -1062,7 +1062,7 @@ void TestTrash::restoreFileToDeletedDirectory()
removeFile( m_trashDir, "/files/fileFromHome" );
trashFileFromHome();
// Delete orig dir
- bool delOK = KIO::NetAccess::del( homeTmpDir(), 0 );
+ bool delOK = TDEIO::NetAccess::del( homeTmpDir(), 0 );
assert( delOK );
const TQString fileId = "fileFromHome";
@@ -1076,11 +1076,11 @@ void TestTrash::restoreFileToDeletedDirectory()
TQByteArray packedArgs;
TQDataStream stream( packedArgs, IO_WriteOnly );
stream << (int)3 << url;
- KIO::Job* job = KIO::special( url, packedArgs );
- bool ok = KIO::NetAccess::synchronousRun( job, 0 );
+ TDEIO::Job* job = TDEIO::special( url, packedArgs );
+ bool ok = TDEIO::NetAccess::synchronousRun( job, 0 );
assert( !ok );
// dest dir doesn't exist -> error message
- assert( KIO::NetAccess::lastError() == KIO::ERR_SLAVE_DEFINED );
+ assert( TDEIO::NetAccess::lastError() == TDEIO::ERR_SLAVE_DEFINED );
// check that nothing happened
assert( TQFile::exists( infoFile ) );
@@ -1095,10 +1095,10 @@ void TestTrash::listRootDir()
kdDebug() << k_funcinfo << endl;
m_entryCount = 0;
m_listResult.clear();
- KIO::ListJob* job = KIO::listDir( "trash:/" );
- connect( job, TQT_SIGNAL( entries( KIO::Job*, const KIO::UDSEntryList& ) ),
- TQT_SLOT( slotEntries( KIO::Job*, const KIO::UDSEntryList& ) ) );
- bool ok = KIO::NetAccess::synchronousRun( job, 0 );
+ TDEIO::ListJob* job = TDEIO::listDir( "trash:/" );
+ connect( job, TQT_SIGNAL( entries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ),
+ TQT_SLOT( slotEntries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ) );
+ bool ok = TDEIO::NetAccess::synchronousRun( job, 0 );
assert( ok );
kdDebug() << "listDir done - m_entryCount=" << m_entryCount << endl;
assert( m_entryCount > 1 );
@@ -1112,10 +1112,10 @@ void TestTrash::listRecursiveRootDir()
kdDebug() << k_funcinfo << endl;
m_entryCount = 0;
m_listResult.clear();
- KIO::ListJob* job = KIO::listRecursive( "trash:/" );
- connect( job, TQT_SIGNAL( entries( KIO::Job*, const KIO::UDSEntryList& ) ),
- TQT_SLOT( slotEntries( KIO::Job*, const KIO::UDSEntryList& ) ) );
- bool ok = KIO::NetAccess::synchronousRun( job, 0 );
+ TDEIO::ListJob* job = TDEIO::listRecursive( "trash:/" );
+ connect( job, TQT_SIGNAL( entries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ),
+ TQT_SLOT( slotEntries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ) );
+ bool ok = TDEIO::NetAccess::synchronousRun( job, 0 );
assert( ok );
kdDebug() << "listDir done - m_entryCount=" << m_entryCount << endl;
assert( m_entryCount > 1 );
@@ -1129,10 +1129,10 @@ void TestTrash::listSubDir()
kdDebug() << k_funcinfo << endl;
m_entryCount = 0;
m_listResult.clear();
- KIO::ListJob* job = KIO::listDir( "trash:/0-trashDirFromHome" );
- connect( job, TQT_SIGNAL( entries( KIO::Job*, const KIO::UDSEntryList& ) ),
- TQT_SLOT( slotEntries( KIO::Job*, const KIO::UDSEntryList& ) ) );
- bool ok = KIO::NetAccess::synchronousRun( job, 0 );
+ TDEIO::ListJob* job = TDEIO::listDir( "trash:/0-trashDirFromHome" );
+ connect( job, TQT_SIGNAL( entries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ),
+ TQT_SLOT( slotEntries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ) );
+ bool ok = TDEIO::NetAccess::synchronousRun( job, 0 );
assert( ok );
kdDebug() << "listDir done - m_entryCount=" << m_entryCount << endl;
assert( m_entryCount == 2 );
@@ -1142,18 +1142,18 @@ void TestTrash::listSubDir()
assert( m_listResult.contains( "testfile" ) == 1 ); // found it, and only once
}
-void TestTrash::slotEntries( KIO::Job*, const KIO::UDSEntryList& lst )
+void TestTrash::slotEntries( TDEIO::Job*, const TDEIO::UDSEntryList& lst )
{
- for( KIO::UDSEntryList::ConstIterator it = lst.begin(); it != lst.end(); ++it ) {
- KIO::UDSEntry::ConstIterator it2 = (*it).begin();
+ for( TDEIO::UDSEntryList::ConstIterator it = lst.begin(); it != lst.end(); ++it ) {
+ TDEIO::UDSEntry::ConstIterator it2 = (*it).begin();
TQString displayName;
KURL url;
for( ; it2 != (*it).end(); it2++ ) {
switch ((*it2).m_uds) {
- case KIO::UDS_NAME:
+ case TDEIO::UDS_NAME:
displayName = (*it2).m_str;
break;
- case KIO::UDS_URL:
+ case TDEIO::UDS_URL:
url = (*it2).m_str;
break;
}
@@ -1177,8 +1177,8 @@ void TestTrash::emptyTrash()
TQByteArray packedArgs;
TQDataStream stream( packedArgs, IO_WriteOnly );
stream << (int)1;
- KIO::Job* job = KIO::special( "trash:/", packedArgs );
- bool ok = KIO::NetAccess::synchronousRun( job, 0 );
+ TDEIO::Job* job = TDEIO::special( "trash:/", packedArgs );
+ bool ok = TDEIO::NetAccess::synchronousRun( job, 0 );
assert( ok );
KSimpleConfig cfg( "trashrc", true );
diff --git a/kioslave/trash/testtrash.h b/kioslave/trash/testtrash.h
index fd286c945..ebc217aac 100644
--- a/kioslave/trash/testtrash.h
+++ b/kioslave/trash/testtrash.h
@@ -88,7 +88,7 @@ public:
void emptyTrash();
private slots:
- void slotEntries( KIO::Job*, const KIO::UDSEntryList& );
+ void slotEntries( TDEIO::Job*, const TDEIO::UDSEntryList& );
private:
void trashFile( const TQString& origFilePath, const TQString& fileId );
diff --git a/kioslave/trash/trashimpl.cpp b/kioslave/trash/trashimpl.cpp
index 96888f9d5..3e109c119 100644
--- a/kioslave/trash/trashimpl.cpp
+++ b/kioslave/trash/trashimpl.cpp
@@ -97,7 +97,7 @@ int TrashImpl::testDir( const TQString &_name ) const
ok = false;
}
if ( !ok ) {
- return KIO::ERR_DIR_ALREADY_EXIST;
+ return TDEIO::ERR_DIR_ALREADY_EXIST;
}
#if 0
//} else {
@@ -109,7 +109,7 @@ int TrashImpl::testDir( const TQString &_name ) const
{
//KMessageBox::sorry( 0, i18n( "Couldn't create directory %1. Check for permissions." ).arg( name ) );
kdWarning() << "could not create " << name << endl;
- return KIO::ERR_COULD_NOT_MKDIR;
+ return TDEIO::ERR_COULD_NOT_MKDIR;
} else {
kdDebug() << name << " created." << endl;
}
@@ -201,9 +201,9 @@ bool TrashImpl::createInfo( const TQString& origPath, int& trashId, TQString& fi
KDE_struct_stat buff_src;
if ( KDE_lstat( origPath_c.data(), &buff_src ) == -1 ) {
if ( errno == EACCES )
- error( KIO::ERR_ACCESS_DENIED, origPath );
+ error( TDEIO::ERR_ACCESS_DENIED, origPath );
else
- error( KIO::ERR_DOES_NOT_EXIST, origPath );
+ error( TDEIO::ERR_DOES_NOT_EXIST, origPath );
return false;
}
@@ -231,10 +231,10 @@ bool TrashImpl::createInfo( const TQString& origPath, int& trashId, TQString& fi
fd = ::open( TQFile::encodeName( url.path() ), O_WRONLY | O_CREAT | O_EXCL, 0600 );
if ( fd < 0 ) {
if ( errno == EEXIST ) {
- url.setFileName( KIO::RenameDlg::suggestName( baseDirectory, url.fileName() ) );
+ url.setFileName( TDEIO::RenameDlg::suggestName( baseDirectory, url.fileName() ) );
// and try again on the next iteration
} else {
- error( KIO::ERR_COULD_NOT_WRITE, url.path() );
+ error( TDEIO::ERR_COULD_NOT_WRITE, url.path() );
return false;
}
}
@@ -246,7 +246,7 @@ bool TrashImpl::createInfo( const TQString& origPath, int& trashId, TQString& fi
FILE* file = ::fdopen( fd, "w" );
if ( !file ) { // can't see how this would happen
- error( KIO::ERR_COULD_NOT_WRITE, infoPath );
+ error( TDEIO::ERR_COULD_NOT_WRITE, infoPath );
return false;
}
@@ -270,7 +270,7 @@ bool TrashImpl::createInfo( const TQString& origPath, int& trashId, TQString& fi
if ( written != sz ) {
::fclose( file );
TQFile::remove( infoPath );
- error( KIO::ERR_DISK_FULL, infoPath );
+ error( TDEIO::ERR_DISK_FULL, infoPath );
return false;
}
@@ -351,7 +351,7 @@ bool TrashImpl::moveFromTrash( const TQString& dest, int trashId, const TQString
bool TrashImpl::move( const TQString& src, const TQString& dest )
{
if ( directRename( src, dest ) ) {
- // This notification is done by KIO::moveAs when using the code below
+ // This notification is done by TDEIO::moveAs when using the code below
// But if we do a direct rename we need to do the notification ourselves
KDirNotify_stub allDirNotify( "*", "KDirNotify*" );
KURL urlDest; urlDest.setPath( dest );
@@ -359,25 +359,25 @@ bool TrashImpl::move( const TQString& src, const TQString& dest )
allDirNotify.FilesAdded( urlDest );
return true;
}
- if ( m_lastErrorCode != KIO::ERR_UNSUPPORTED_ACTION )
+ if ( m_lastErrorCode != TDEIO::ERR_UNSUPPORTED_ACTION )
return false;
KURL urlSrc, urlDest;
urlSrc.setPath( src );
urlDest.setPath( dest );
kdDebug() << k_funcinfo << urlSrc << " -> " << urlDest << endl;
- KIO::CopyJob* job = KIO::moveAs( urlSrc, urlDest, false );
+ TDEIO::CopyJob* job = TDEIO::moveAs( urlSrc, urlDest, false );
#ifdef KIO_COPYJOB_HAS_SETINTERACTIVE
job->setInteractive( false );
#endif
- connect( job, TQT_SIGNAL( result(KIO::Job *) ),
- this, TQT_SLOT( jobFinished(KIO::Job *) ) );
+ connect( job, TQT_SIGNAL( result(TDEIO::Job *) ),
+ this, TQT_SLOT( jobFinished(TDEIO::Job *) ) );
tqApp->eventLoop()->enterLoop();
return m_lastErrorCode == 0;
}
-void TrashImpl::jobFinished(KIO::Job* job)
+void TrashImpl::jobFinished(TDEIO::Job* job)
{
kdDebug() << k_funcinfo << " error=" << job->error() << endl;
error( job->error(), job->errorText() );
@@ -413,12 +413,12 @@ bool TrashImpl::copy( const TQString& src, const TQString& dest )
KURL urlDest;
urlDest.setPath( dest );
kdDebug() << k_funcinfo << "copying " << src << " to " << dest << endl;
- KIO::CopyJob* job = KIO::copyAs( urlSrc, urlDest, false );
+ TDEIO::CopyJob* job = TDEIO::copyAs( urlSrc, urlDest, false );
#ifdef KIO_COPYJOB_HAS_SETINTERACTIVE
job->setInteractive( false );
#endif
- connect( job, TQT_SIGNAL( result( KIO::Job* ) ),
- this, TQT_SLOT( jobFinished( KIO::Job* ) ) );
+ connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ),
+ this, TQT_SLOT( jobFinished( TDEIO::Job* ) ) );
tqApp->eventLoop()->enterLoop();
return m_lastErrorCode == 0;
@@ -429,14 +429,14 @@ bool TrashImpl::directRename( const TQString& src, const TQString& dest )
kdDebug() << k_funcinfo << src << " -> " << dest << endl;
if ( ::rename( TQFile::encodeName( src ), TQFile::encodeName( dest ) ) != 0 ) {
if (errno == EXDEV) {
- error( KIO::ERR_UNSUPPORTED_ACTION, TQString::fromLatin1("rename") );
+ error( TDEIO::ERR_UNSUPPORTED_ACTION, TQString::fromLatin1("rename") );
} else {
if (( errno == EACCES ) || (errno == EPERM)) {
- error( KIO::ERR_ACCESS_DENIED, dest );
+ error( TDEIO::ERR_ACCESS_DENIED, dest );
} else if (errno == EROFS) { // The file is on a read-only filesystem
- error( KIO::ERR_CANNOT_DELETE, src );
+ error( TDEIO::ERR_CANNOT_DELETE, src );
} else {
- error( KIO::ERR_CANNOT_RENAME, src );
+ error( TDEIO::ERR_CANNOT_RENAME, src );
}
}
return false;
@@ -450,13 +450,13 @@ bool TrashImpl::mkdir( int trashId, const TQString& fileId, int permissions )
const TQString path = filesPath( trashId, fileId );
if ( ::mkdir( TQFile::encodeName( path ), permissions ) != 0 ) {
if ( errno == EACCES ) {
- error( KIO::ERR_ACCESS_DENIED, path );
+ error( TDEIO::ERR_ACCESS_DENIED, path );
return false;
} else if ( errno == ENOSPC ) {
- error( KIO::ERR_DISK_FULL, path );
+ error( TDEIO::ERR_DISK_FULL, path );
return false;
} else {
- error( KIO::ERR_COULD_NOT_MKDIR, path );
+ error( TDEIO::ERR_COULD_NOT_MKDIR, path );
return false;
}
} else {
@@ -477,9 +477,9 @@ bool TrashImpl::del( int trashId, const TQString& fileId )
KDE_struct_stat buff;
if ( KDE_lstat( info_c.data(), &buff ) == -1 ) {
if ( errno == EACCES )
- error( KIO::ERR_ACCESS_DENIED, file );
+ error( TDEIO::ERR_ACCESS_DENIED, file );
else
- error( KIO::ERR_DOES_NOT_EXIST, file );
+ error( TDEIO::ERR_DOES_NOT_EXIST, file );
return false;
}
@@ -505,16 +505,16 @@ bool TrashImpl::synchronousDel( const TQString& path, bool setLastErrorCode, boo
KFileItem fileItem( url, "inode/directory", KFileItem::Unknown );
KFileItemList fileItemList;
fileItemList.append( &fileItem );
- KIO::ChmodJob* chmodJob = KIO::chmod( fileItemList, 0200, 0200, TQString::null, TQString::null, true /*recursive*/, false /*showProgressInfo*/ );
- connect( chmodJob, TQT_SIGNAL( result(KIO::Job *) ),
- this, TQT_SLOT( jobFinished(KIO::Job *) ) );
+ TDEIO::ChmodJob* chmodJob = TDEIO::chmod( fileItemList, 0200, 0200, TQString::null, TQString::null, true /*recursive*/, false /*showProgressInfo*/ );
+ connect( chmodJob, TQT_SIGNAL( result(TDEIO::Job *) ),
+ this, TQT_SLOT( jobFinished(TDEIO::Job *) ) );
tqApp->eventLoop()->enterLoop();
}
kdDebug() << k_funcinfo << "deleting " << url << endl;
- KIO::DeleteJob *job = KIO::del( url, false, false );
- connect( job, TQT_SIGNAL( result(KIO::Job *) ),
- this, TQT_SLOT( jobFinished(KIO::Job *) ) );
+ TDEIO::DeleteJob *job = TDEIO::del( url, false, false );
+ connect( job, TQT_SIGNAL( result(TDEIO::Job *) ),
+ this, TQT_SLOT( jobFinished(TDEIO::Job *) ) );
tqApp->eventLoop()->enterLoop();
bool ok = m_lastErrorCode == 0;
if ( !setLastErrorCode ) {
@@ -615,7 +615,7 @@ bool TrashImpl::readInfoFile( const TQString& infoPath, TrashedFileInfo& info, i
{
KSimpleConfig cfg( infoPath, true );
if ( !cfg.hasGroup( "Trash Info" ) ) {
- error( KIO::ERR_CANNOT_OPEN_FOR_READING, infoPath );
+ error( TDEIO::ERR_CANNOT_OPEN_FOR_READING, infoPath );
return false;
}
cfg.setGroup( "Trash Info" );
@@ -713,7 +713,7 @@ int TrashImpl::findTrashDirectory( const TQString& origPath )
&& buff.st_dev == m_homeDevice )
return 0;
- TQString mountPoint = KIO::findPathMountPoint( origPath );
+ TQString mountPoint = TDEIO::findPathMountPoint( origPath );
const TQString trashDir = trashForMountPoint( mountPoint, true );
kdDebug() << "mountPoint=" << mountPoint << " trashDir=" << trashDir << endl;
if ( trashDir.isEmpty() )
diff --git a/kioslave/trash/trashimpl.h b/kioslave/trash/trashimpl.h
index fb34e5be0..366f8a869 100644
--- a/kioslave/trash/trashimpl.h
+++ b/kioslave/trash/trashimpl.h
@@ -149,7 +149,7 @@ private:
static TQString makeRelativePath( const TQString& topdir, const TQString& path );
private slots:
- void jobFinished(KIO::Job *job);
+ void jobFinished(TDEIO::Job *job);
private:
/// Last error code stored in class to simplify API.