|
|
@ -378,7 +378,7 @@ void kio_digikamalbums::get( const KURL& url )
|
|
|
|
TQString libraryPath = url.user();
|
|
|
|
TQString libraryPath = url.user();
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
error(TDEIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -389,28 +389,28 @@ void kio_digikamalbums::get( const KURL& url )
|
|
|
|
if ( KDE_stat( path.data(), &buff ) == -1 )
|
|
|
|
if ( KDE_stat( path.data(), &buff ) == -1 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( errno == EACCES )
|
|
|
|
if ( errno == EACCES )
|
|
|
|
error( KIO::ERR_ACCESS_DENIED, url.url() );
|
|
|
|
error( TDEIO::ERR_ACCESS_DENIED, url.url() );
|
|
|
|
else
|
|
|
|
else
|
|
|
|
error( KIO::ERR_DOES_NOT_EXIST, url.url() );
|
|
|
|
error( TDEIO::ERR_DOES_NOT_EXIST, url.url() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( S_ISDIR( buff.st_mode ) )
|
|
|
|
if ( S_ISDIR( buff.st_mode ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_IS_DIRECTORY, url.url() );
|
|
|
|
error( TDEIO::ERR_IS_DIRECTORY, url.url() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( !S_ISREG( buff.st_mode ) )
|
|
|
|
if ( !S_ISREG( buff.st_mode ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_CANNOT_OPEN_FOR_READING, url.url() );
|
|
|
|
error( TDEIO::ERR_CANNOT_OPEN_FOR_READING, url.url() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int fd = KDE_open( path.data(), O_RDONLY);
|
|
|
|
int fd = KDE_open( path.data(), O_RDONLY);
|
|
|
|
if ( fd < 0 )
|
|
|
|
if ( fd < 0 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_CANNOT_OPEN_FOR_READING, url.url() );
|
|
|
|
error( TDEIO::ERR_CANNOT_OPEN_FOR_READING, url.url() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -424,7 +424,7 @@ void kio_digikamalbums::get( const KURL& url )
|
|
|
|
|
|
|
|
|
|
|
|
char buffer[ MAX_IPC_SIZE ];
|
|
|
|
char buffer[ MAX_IPC_SIZE ];
|
|
|
|
TQByteArray array;
|
|
|
|
TQByteArray array;
|
|
|
|
KIO::filesize_t processed_size = 0;
|
|
|
|
TDEIO::filesize_t processed_size = 0;
|
|
|
|
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -433,7 +433,7 @@ void kio_digikamalbums::get( const KURL& url )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (errno == EINTR)
|
|
|
|
if (errno == EINTR)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
error( KIO::ERR_COULD_NOT_READ, url.url());
|
|
|
|
error( TDEIO::ERR_COULD_NOT_READ, url.url());
|
|
|
|
close(fd);
|
|
|
|
close(fd);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -464,7 +464,7 @@ void kio_digikamalbums::put(const KURL& url, int permissions, bool overwrite, bo
|
|
|
|
TQString libraryPath = url.user();
|
|
|
|
TQString libraryPath = url.user();
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
error(TDEIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -483,7 +483,7 @@ void kio_digikamalbums::put(const KURL& url, int permissions, bool overwrite, bo
|
|
|
|
AlbumInfo album = findAlbum(url.directory());
|
|
|
|
AlbumInfo album = findAlbum(url.directory());
|
|
|
|
if (album.id == -1)
|
|
|
|
if (album.id == -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, i18n("Source album %1 not found in database")
|
|
|
|
error(TDEIO::ERR_UNKNOWN, i18n("Source album %1 not found in database")
|
|
|
|
.arg(url.directory()));
|
|
|
|
.arg(url.directory()));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -498,9 +498,9 @@ void kio_digikamalbums::put(const KURL& url, int permissions, bool overwrite, bo
|
|
|
|
if ( origExists && !overwrite)
|
|
|
|
if ( origExists && !overwrite)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (S_ISDIR(buff.st_mode))
|
|
|
|
if (S_ISDIR(buff.st_mode))
|
|
|
|
error( KIO::ERR_DIR_ALREADY_EXIST, url.url() );
|
|
|
|
error( TDEIO::ERR_DIR_ALREADY_EXIST, url.url() );
|
|
|
|
else
|
|
|
|
else
|
|
|
|
error( KIO::ERR_FILE_ALREADY_EXIST, url.url() );
|
|
|
|
error( TDEIO::ERR_FILE_ALREADY_EXIST, url.url() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -517,9 +517,9 @@ void kio_digikamalbums::put(const KURL& url, int permissions, bool overwrite, bo
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdWarning() << "####################### COULD NOT OPEN " << dest << endl;
|
|
|
|
kdWarning() << "####################### COULD NOT OPEN " << dest << endl;
|
|
|
|
if ( errno == EACCES )
|
|
|
|
if ( errno == EACCES )
|
|
|
|
error( KIO::ERR_WRITE_ACCESS_DENIED, url.url() );
|
|
|
|
error( TDEIO::ERR_WRITE_ACCESS_DENIED, url.url() );
|
|
|
|
else
|
|
|
|
else
|
|
|
|
error( KIO::ERR_CANNOT_OPEN_FOR_WRITING, url.url() );
|
|
|
|
error( TDEIO::ERR_CANNOT_OPEN_FOR_WRITING, url.url() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -538,13 +538,13 @@ void kio_digikamalbums::put(const KURL& url, int permissions, bool overwrite, bo
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( errno == ENOSPC ) // disk full
|
|
|
|
if ( errno == ENOSPC ) // disk full
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_DISK_FULL, url.url());
|
|
|
|
error( TDEIO::ERR_DISK_FULL, url.url());
|
|
|
|
result = -1;
|
|
|
|
result = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdWarning() << "Couldn't write. Error:" << strerror(errno) << endl;
|
|
|
|
kdWarning() << "Couldn't write. Error:" << strerror(errno) << endl;
|
|
|
|
error( KIO::ERR_COULD_NOT_WRITE, url.url());
|
|
|
|
error( TDEIO::ERR_COULD_NOT_WRITE, url.url());
|
|
|
|
result = -1;
|
|
|
|
result = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -566,7 +566,7 @@ void kio_digikamalbums::put(const KURL& url, int permissions, bool overwrite, bo
|
|
|
|
if ( close(fd) )
|
|
|
|
if ( close(fd) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdWarning() << "Error when closing file descriptor:" << strerror(errno) << endl;
|
|
|
|
kdWarning() << "Error when closing file descriptor:" << strerror(errno) << endl;
|
|
|
|
error( KIO::ERR_COULD_NOT_WRITE, url.url());
|
|
|
|
error( TDEIO::ERR_COULD_NOT_WRITE, url.url());
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -576,7 +576,7 @@ void kio_digikamalbums::put(const KURL& url, int permissions, bool overwrite, bo
|
|
|
|
if (::chmod(_dest.data(), permissions) != 0)
|
|
|
|
if (::chmod(_dest.data(), permissions) != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// couldn't chmod. Eat the error if the filesystem apparently doesn't support it.
|
|
|
|
// couldn't chmod. Eat the error if the filesystem apparently doesn't support it.
|
|
|
|
if ( KIO::testFileSystemFlag( _dest, KIO::SupportsChmod ) )
|
|
|
|
if ( TDEIO::testFileSystemFlag( _dest, TDEIO::SupportsChmod ) )
|
|
|
|
warning( i18n( "Could not change permissions for\n%1" ).arg( url.url() ) );
|
|
|
|
warning( i18n( "Could not change permissions for\n%1" ).arg( url.url() ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -618,7 +618,7 @@ void kio_digikamalbums::copy( const KURL &src, const KURL &dst, int mode, bool o
|
|
|
|
TQString libraryPath = src.user();
|
|
|
|
TQString libraryPath = src.user();
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
error(TDEIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -626,7 +626,7 @@ void kio_digikamalbums::copy( const KURL &src, const KURL &dst, int mode, bool o
|
|
|
|
TQString dstLibraryPath = dst.user();
|
|
|
|
TQString dstLibraryPath = dst.user();
|
|
|
|
if (libraryPath != dstLibraryPath)
|
|
|
|
if (libraryPath != dstLibraryPath)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN,
|
|
|
|
error(TDEIO::ERR_UNKNOWN,
|
|
|
|
TQString("Source and Destination have different Album Library Paths. ") +
|
|
|
|
TQString("Source and Destination have different Album Library Paths. ") +
|
|
|
|
TQString("Src: ") + src.user() +
|
|
|
|
TQString("Src: ") + src.user() +
|
|
|
|
TQString(", Dest: ") + dst.user());
|
|
|
|
TQString(", Dest: ") + dst.user());
|
|
|
@ -648,7 +648,7 @@ void kio_digikamalbums::copy( const KURL &src, const KURL &dst, int mode, bool o
|
|
|
|
AlbumInfo srcAlbum = findAlbum(src.directory());
|
|
|
|
AlbumInfo srcAlbum = findAlbum(src.directory());
|
|
|
|
if (srcAlbum.id == -1)
|
|
|
|
if (srcAlbum.id == -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, TQString("Source album %1 not found in database")
|
|
|
|
error(TDEIO::ERR_UNKNOWN, TQString("Source album %1 not found in database")
|
|
|
|
.arg(src.directory()));
|
|
|
|
.arg(src.directory()));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -657,7 +657,7 @@ void kio_digikamalbums::copy( const KURL &src, const KURL &dst, int mode, bool o
|
|
|
|
AlbumInfo dstAlbum = findAlbum(dst.directory());
|
|
|
|
AlbumInfo dstAlbum = findAlbum(dst.directory());
|
|
|
|
if (dstAlbum.id == -1)
|
|
|
|
if (dstAlbum.id == -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, TQString("Destination album %1 not found in database")
|
|
|
|
error(TDEIO::ERR_UNKNOWN, TQString("Destination album %1 not found in database")
|
|
|
|
.arg(dst.directory()));
|
|
|
|
.arg(dst.directory()));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -688,23 +688,23 @@ void kio_digikamalbums::copy( const KURL &src, const KURL &dst, int mode, bool o
|
|
|
|
if ( KDE_stat( _src.data(), &buff_src ) == -1 )
|
|
|
|
if ( KDE_stat( _src.data(), &buff_src ) == -1 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( errno == EACCES )
|
|
|
|
if ( errno == EACCES )
|
|
|
|
error( KIO::ERR_ACCESS_DENIED, src.url() );
|
|
|
|
error( TDEIO::ERR_ACCESS_DENIED, src.url() );
|
|
|
|
else
|
|
|
|
else
|
|
|
|
error( KIO::ERR_DOES_NOT_EXIST, src.url() );
|
|
|
|
error( TDEIO::ERR_DOES_NOT_EXIST, src.url() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// bail out if its a directory
|
|
|
|
// bail out if its a directory
|
|
|
|
if ( S_ISDIR( buff_src.st_mode ) )
|
|
|
|
if ( S_ISDIR( buff_src.st_mode ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_IS_DIRECTORY, src.url() );
|
|
|
|
error( TDEIO::ERR_IS_DIRECTORY, src.url() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// bail out if its a socket or fifo
|
|
|
|
// bail out if its a socket or fifo
|
|
|
|
if ( S_ISFIFO( buff_src.st_mode ) || S_ISSOCK ( buff_src.st_mode ) )
|
|
|
|
if ( S_ISFIFO( buff_src.st_mode ) || S_ISSOCK ( buff_src.st_mode ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_CANNOT_OPEN_FOR_READING, src.url() );
|
|
|
|
error( TDEIO::ERR_CANNOT_OPEN_FOR_READING, src.url() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -716,14 +716,14 @@ void kio_digikamalbums::copy( const KURL &src, const KURL &dst, int mode, bool o
|
|
|
|
// bail out if its a directory
|
|
|
|
// bail out if its a directory
|
|
|
|
if (S_ISDIR(buff_dest.st_mode))
|
|
|
|
if (S_ISDIR(buff_dest.st_mode))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_DIR_ALREADY_EXIST, dst.url() );
|
|
|
|
error( TDEIO::ERR_DIR_ALREADY_EXIST, dst.url() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// if !overwrite bail out
|
|
|
|
// if !overwrite bail out
|
|
|
|
if (!overwrite)
|
|
|
|
if (!overwrite)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_FILE_ALREADY_EXIST, dst.url() );
|
|
|
|
error( TDEIO::ERR_FILE_ALREADY_EXIST, dst.url() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -740,7 +740,7 @@ void kio_digikamalbums::copy( const KURL &src, const KURL &dst, int mode, bool o
|
|
|
|
int src_fd = KDE_open( _src.data(), O_RDONLY);
|
|
|
|
int src_fd = KDE_open( _src.data(), O_RDONLY);
|
|
|
|
if ( src_fd < 0 )
|
|
|
|
if ( src_fd < 0 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_CANNOT_OPEN_FOR_READING, src.path() );
|
|
|
|
error( TDEIO::ERR_CANNOT_OPEN_FOR_READING, src.path() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -758,11 +758,11 @@ void kio_digikamalbums::copy( const KURL &src, const KURL &dst, int mode, bool o
|
|
|
|
kdDebug() << "###### COULD NOT WRITE " << dst.url() << endl;
|
|
|
|
kdDebug() << "###### COULD NOT WRITE " << dst.url() << endl;
|
|
|
|
if ( errno == EACCES )
|
|
|
|
if ( errno == EACCES )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_WRITE_ACCESS_DENIED, dst.url() );
|
|
|
|
error( TDEIO::ERR_WRITE_ACCESS_DENIED, dst.url() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_CANNOT_OPEN_FOR_WRITING, dst.url() );
|
|
|
|
error( TDEIO::ERR_CANNOT_OPEN_FOR_WRITING, dst.url() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(src_fd);
|
|
|
|
close(src_fd);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -771,7 +771,7 @@ void kio_digikamalbums::copy( const KURL &src, const KURL &dst, int mode, bool o
|
|
|
|
// emit the total size for copying
|
|
|
|
// emit the total size for copying
|
|
|
|
totalSize( buff_src.st_size );
|
|
|
|
totalSize( buff_src.st_size );
|
|
|
|
|
|
|
|
|
|
|
|
KIO::filesize_t processed_size = 0;
|
|
|
|
TDEIO::filesize_t processed_size = 0;
|
|
|
|
char buffer[ MAX_IPC_SIZE ];
|
|
|
|
char buffer[ MAX_IPC_SIZE ];
|
|
|
|
int n;
|
|
|
|
int n;
|
|
|
|
|
|
|
|
|
|
|
@ -784,7 +784,7 @@ void kio_digikamalbums::copy( const KURL &src, const KURL &dst, int mode, bool o
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (errno == EINTR)
|
|
|
|
if (errno == EINTR)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
error( KIO::ERR_COULD_NOT_READ, src.path());
|
|
|
|
error( TDEIO::ERR_COULD_NOT_READ, src.path());
|
|
|
|
close(src_fd);
|
|
|
|
close(src_fd);
|
|
|
|
close(dest_fd);
|
|
|
|
close(dest_fd);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -802,13 +802,13 @@ void kio_digikamalbums::copy( const KURL &src, const KURL &dst, int mode, bool o
|
|
|
|
|
|
|
|
|
|
|
|
if ( errno == ENOSPC ) // disk full
|
|
|
|
if ( errno == ENOSPC ) // disk full
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_DISK_FULL, dst.url());
|
|
|
|
error( TDEIO::ERR_DISK_FULL, dst.url());
|
|
|
|
remove( _dst.data() );
|
|
|
|
remove( _dst.data() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdWarning() << "Couldn't write[2]. Error:" << strerror(errno) << endl;
|
|
|
|
kdWarning() << "Couldn't write[2]. Error:" << strerror(errno) << endl;
|
|
|
|
error( KIO::ERR_COULD_NOT_WRITE, dst.url());
|
|
|
|
error( TDEIO::ERR_COULD_NOT_WRITE, dst.url());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -822,7 +822,7 @@ void kio_digikamalbums::copy( const KURL &src, const KURL &dst, int mode, bool o
|
|
|
|
if (close( dest_fd))
|
|
|
|
if (close( dest_fd))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdWarning() << "Error when closing file descriptor[2]:" << strerror(errno) << endl;
|
|
|
|
kdWarning() << "Error when closing file descriptor[2]:" << strerror(errno) << endl;
|
|
|
|
error( KIO::ERR_COULD_NOT_WRITE, dst.url());
|
|
|
|
error( TDEIO::ERR_COULD_NOT_WRITE, dst.url());
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -832,7 +832,7 @@ void kio_digikamalbums::copy( const KURL &src, const KURL &dst, int mode, bool o
|
|
|
|
if (::chmod(_dst.data(), mode) != 0)
|
|
|
|
if (::chmod(_dst.data(), mode) != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Eat the error if the filesystem apparently doesn't support chmod.
|
|
|
|
// Eat the error if the filesystem apparently doesn't support chmod.
|
|
|
|
if ( KIO::testFileSystemFlag( _dst, KIO::SupportsChmod ) )
|
|
|
|
if ( TDEIO::testFileSystemFlag( _dst, TDEIO::SupportsChmod ) )
|
|
|
|
warning( i18n( "Could not change permissions for\n%1" ).arg( dst.url() ) );
|
|
|
|
warning( i18n( "Could not change permissions for\n%1" ).arg( dst.url() ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -869,14 +869,14 @@ void kio_digikamalbums::rename( const KURL& src, const KURL& dst, bool overwrite
|
|
|
|
TQString libraryPath = src.user();
|
|
|
|
TQString libraryPath = src.user();
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
error(TDEIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString dstLibraryPath = dst.user();
|
|
|
|
TQString dstLibraryPath = dst.user();
|
|
|
|
if (libraryPath != dstLibraryPath)
|
|
|
|
if (libraryPath != dstLibraryPath)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN,
|
|
|
|
error(TDEIO::ERR_UNKNOWN,
|
|
|
|
i18n("Source and Destination have different Album Library Paths.\n"
|
|
|
|
i18n("Source and Destination have different Album Library Paths.\n"
|
|
|
|
"Source: %1\n"
|
|
|
|
"Source: %1\n"
|
|
|
|
"Destination: %2")
|
|
|
|
"Destination: %2")
|
|
|
@ -901,9 +901,9 @@ void kio_digikamalbums::rename( const KURL& src, const KURL& dst, bool overwrite
|
|
|
|
if ( KDE_stat( csrc.data(), &buff_src ) == -1 )
|
|
|
|
if ( KDE_stat( csrc.data(), &buff_src ) == -1 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( errno == EACCES )
|
|
|
|
if ( errno == EACCES )
|
|
|
|
error( KIO::ERR_ACCESS_DENIED, src.url() );
|
|
|
|
error( TDEIO::ERR_ACCESS_DENIED, src.url() );
|
|
|
|
else
|
|
|
|
else
|
|
|
|
error( KIO::ERR_DOES_NOT_EXIST, src.url() );
|
|
|
|
error( TDEIO::ERR_DOES_NOT_EXIST, src.url() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -914,13 +914,13 @@ void kio_digikamalbums::rename( const KURL& src, const KURL& dst, bool overwrite
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (S_ISDIR(buff_dest.st_mode))
|
|
|
|
if (S_ISDIR(buff_dest.st_mode))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_DIR_ALREADY_EXIST, dst.url() );
|
|
|
|
error( TDEIO::ERR_DIR_ALREADY_EXIST, dst.url() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!overwrite)
|
|
|
|
if (!overwrite)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_FILE_ALREADY_EXIST, dst.url() );
|
|
|
|
error( TDEIO::ERR_FILE_ALREADY_EXIST, dst.url() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -939,7 +939,7 @@ void kio_digikamalbums::rename( const KURL& src, const KURL& dst, bool overwrite
|
|
|
|
srcAlbum = findAlbum(src.path());
|
|
|
|
srcAlbum = findAlbum(src.path());
|
|
|
|
if (srcAlbum.id == -1)
|
|
|
|
if (srcAlbum.id == -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, i18n("Source album %1 not found in database")
|
|
|
|
error(TDEIO::ERR_UNKNOWN, i18n("Source album %1 not found in database")
|
|
|
|
.arg(src.url()));
|
|
|
|
.arg(src.url()));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -949,7 +949,7 @@ void kio_digikamalbums::rename( const KURL& src, const KURL& dst, bool overwrite
|
|
|
|
srcAlbum = findAlbum(src.directory());
|
|
|
|
srcAlbum = findAlbum(src.directory());
|
|
|
|
if (srcAlbum.id == -1)
|
|
|
|
if (srcAlbum.id == -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, i18n("Source album %1 not found in database")
|
|
|
|
error(TDEIO::ERR_UNKNOWN, i18n("Source album %1 not found in database")
|
|
|
|
.arg(src.directory()));
|
|
|
|
.arg(src.directory()));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -957,7 +957,7 @@ void kio_digikamalbums::rename( const KURL& src, const KURL& dst, bool overwrite
|
|
|
|
dstAlbum = findAlbum(dst.directory());
|
|
|
|
dstAlbum = findAlbum(dst.directory());
|
|
|
|
if (dstAlbum.id == -1)
|
|
|
|
if (dstAlbum.id == -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, i18n("Destination album %1 not found in database")
|
|
|
|
error(TDEIO::ERR_UNKNOWN, i18n("Destination album %1 not found in database")
|
|
|
|
.arg(dst.directory()));
|
|
|
|
.arg(dst.directory()));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -970,23 +970,23 @@ void kio_digikamalbums::rename( const KURL& src, const KURL& dst, bool overwrite
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQFileInfo toCheck(libraryPath + src.path());
|
|
|
|
TQFileInfo toCheck(libraryPath + src.path());
|
|
|
|
if (!toCheck.isWritable())
|
|
|
|
if (!toCheck.isWritable())
|
|
|
|
error( KIO::ERR_CANNOT_RENAME_ORIGINAL, src.path() );
|
|
|
|
error( TDEIO::ERR_CANNOT_RENAME_ORIGINAL, src.path() );
|
|
|
|
else
|
|
|
|
else
|
|
|
|
error( KIO::ERR_ACCESS_DENIED, dst.path() );
|
|
|
|
error( TDEIO::ERR_ACCESS_DENIED, dst.path() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (errno == EXDEV)
|
|
|
|
else if (errno == EXDEV)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_UNSUPPORTED_ACTION, i18n("This file/folder is on a different "
|
|
|
|
error( TDEIO::ERR_UNSUPPORTED_ACTION, i18n("This file/folder is on a different "
|
|
|
|
"filesystem through symlinks. "
|
|
|
|
"filesystem through symlinks. "
|
|
|
|
"Moving/Renaming files between "
|
|
|
|
"Moving/Renaming files between "
|
|
|
|
"them is currently unsupported "));
|
|
|
|
"them is currently unsupported "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (errno == EROFS)
|
|
|
|
else if (errno == EROFS)
|
|
|
|
{ // The file is on a read-only filesystem
|
|
|
|
{ // The file is on a read-only filesystem
|
|
|
|
error( KIO::ERR_CANNOT_DELETE, src.url() );
|
|
|
|
error( TDEIO::ERR_CANNOT_DELETE, src.url() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
error( KIO::ERR_CANNOT_RENAME, src.url() );
|
|
|
|
error( TDEIO::ERR_CANNOT_RENAME, src.url() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1010,14 +1010,14 @@ void kio_digikamalbums::stat( const KURL& url )
|
|
|
|
TQString libraryPath = url.user();
|
|
|
|
TQString libraryPath = url.user();
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
error(TDEIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
KIO::UDSEntry entry;
|
|
|
|
TDEIO::UDSEntry entry;
|
|
|
|
if (!createUDSEntry(libraryPath + url.path(), entry))
|
|
|
|
if (!createUDSEntry(libraryPath + url.path(), entry))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_DOES_NOT_EXIST, url.path(-1));
|
|
|
|
error(TDEIO::ERR_DOES_NOT_EXIST, url.path(-1));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1033,7 +1033,7 @@ void kio_digikamalbums::listDir( const KURL& url )
|
|
|
|
TQString libraryPath = url.user();
|
|
|
|
TQString libraryPath = url.user();
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
error(TDEIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
kdWarning() << "Album Library Path not supplied to kioslave" << endl;
|
|
|
|
kdWarning() << "Album Library Path not supplied to kioslave" << endl;
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1042,14 +1042,14 @@ void kio_digikamalbums::listDir( const KURL& url )
|
|
|
|
TQString path = libraryPath + url.path();
|
|
|
|
TQString path = libraryPath + url.path();
|
|
|
|
if (KDE_stat(TQFile::encodeName(path), &stbuf) != 0)
|
|
|
|
if (KDE_stat(TQFile::encodeName(path), &stbuf) != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_DOES_NOT_EXIST, url.path(-1));
|
|
|
|
error(TDEIO::ERR_DOES_NOT_EXIST, url.path(-1));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQDir dir(path);
|
|
|
|
TQDir dir(path);
|
|
|
|
if (!dir.isReadable())
|
|
|
|
if (!dir.isReadable())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_CANNOT_ENTER_DIRECTORY, url.path());
|
|
|
|
error( TDEIO::ERR_CANNOT_ENTER_DIRECTORY, url.path());
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1057,7 +1057,7 @@ void kio_digikamalbums::listDir( const KURL& url )
|
|
|
|
TQFileInfoListIterator it( *list );
|
|
|
|
TQFileInfoListIterator it( *list );
|
|
|
|
TQFileInfo *fi;
|
|
|
|
TQFileInfo *fi;
|
|
|
|
|
|
|
|
|
|
|
|
KIO::UDSEntry entry;
|
|
|
|
TDEIO::UDSEntry entry;
|
|
|
|
createDigikamPropsUDSEntry(entry);
|
|
|
|
createDigikamPropsUDSEntry(entry);
|
|
|
|
listEntry(entry, false);
|
|
|
|
listEntry(entry, false);
|
|
|
|
while ((fi = it.current()) != 0)
|
|
|
|
while ((fi = it.current()) != 0)
|
|
|
@ -1083,7 +1083,7 @@ void kio_digikamalbums::mkdir( const KURL& url, int permissions )
|
|
|
|
TQString libraryPath = url.user();
|
|
|
|
TQString libraryPath = url.user();
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
error(TDEIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1104,17 +1104,17 @@ void kio_digikamalbums::mkdir( const KURL& url, int permissions )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( errno == EACCES )
|
|
|
|
if ( errno == EACCES )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_ACCESS_DENIED, path );
|
|
|
|
error( TDEIO::ERR_ACCESS_DENIED, path );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( errno == ENOSPC )
|
|
|
|
else if ( errno == ENOSPC )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_DISK_FULL, path );
|
|
|
|
error( TDEIO::ERR_DISK_FULL, path );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_COULD_NOT_MKDIR, path );
|
|
|
|
error( TDEIO::ERR_COULD_NOT_MKDIR, path );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1129,7 +1129,7 @@ void kio_digikamalbums::mkdir( const KURL& url, int permissions )
|
|
|
|
if ( permissions != -1 )
|
|
|
|
if ( permissions != -1 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( ::chmod( _path.data(), permissions ) == -1 )
|
|
|
|
if ( ::chmod( _path.data(), permissions ) == -1 )
|
|
|
|
error( KIO::ERR_CANNOT_CHMOD, path );
|
|
|
|
error( TDEIO::ERR_CANNOT_CHMOD, path );
|
|
|
|
else
|
|
|
|
else
|
|
|
|
finished();
|
|
|
|
finished();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1141,11 +1141,11 @@ void kio_digikamalbums::mkdir( const KURL& url, int permissions )
|
|
|
|
|
|
|
|
|
|
|
|
if ( S_ISDIR( buff.st_mode ) )
|
|
|
|
if ( S_ISDIR( buff.st_mode ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_DIR_ALREADY_EXIST, path );
|
|
|
|
error( TDEIO::ERR_DIR_ALREADY_EXIST, path );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
error( KIO::ERR_FILE_ALREADY_EXIST, path );
|
|
|
|
error( TDEIO::ERR_FILE_ALREADY_EXIST, path );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void kio_digikamalbums::chmod( const KURL& url, int permissions )
|
|
|
|
void kio_digikamalbums::chmod( const KURL& url, int permissions )
|
|
|
@ -1157,13 +1157,13 @@ void kio_digikamalbums::chmod( const KURL& url, int permissions )
|
|
|
|
TQString libraryPath = url.user();
|
|
|
|
TQString libraryPath = url.user();
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
error(TDEIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQCString path( TQFile::encodeName(libraryPath + url.path()));
|
|
|
|
TQCString path( TQFile::encodeName(libraryPath + url.path()));
|
|
|
|
if ( ::chmod( path.data(), permissions ) == -1 )
|
|
|
|
if ( ::chmod( path.data(), permissions ) == -1 )
|
|
|
|
error( KIO::ERR_CANNOT_CHMOD, url.url() );
|
|
|
|
error( TDEIO::ERR_CANNOT_CHMOD, url.url() );
|
|
|
|
else
|
|
|
|
else
|
|
|
|
finished();
|
|
|
|
finished();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1177,7 +1177,7 @@ void kio_digikamalbums::del( const KURL& url, bool isfile)
|
|
|
|
TQString libraryPath = url.user();
|
|
|
|
TQString libraryPath = url.user();
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
if (libraryPath.isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
error(TDEIO::ERR_UNKNOWN, "Album Library Path not supplied to kioslave");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1209,7 +1209,7 @@ void kio_digikamalbums::del( const KURL& url, bool isfile)
|
|
|
|
AlbumInfo album = findAlbum(url.directory());
|
|
|
|
AlbumInfo album = findAlbum(url.directory());
|
|
|
|
if (album.id == -1)
|
|
|
|
if (album.id == -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, i18n("Source album %1 not found in database")
|
|
|
|
error(TDEIO::ERR_UNKNOWN, i18n("Source album %1 not found in database")
|
|
|
|
.arg(url.directory()));
|
|
|
|
.arg(url.directory()));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1218,11 +1218,11 @@ void kio_digikamalbums::del( const KURL& url, bool isfile)
|
|
|
|
if ( unlink( path.data() ) == -1 )
|
|
|
|
if ( unlink( path.data() ) == -1 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ((errno == EACCES) || (errno == EPERM))
|
|
|
|
if ((errno == EACCES) || (errno == EPERM))
|
|
|
|
error( KIO::ERR_ACCESS_DENIED, url.url());
|
|
|
|
error( TDEIO::ERR_ACCESS_DENIED, url.url());
|
|
|
|
else if (errno == EISDIR)
|
|
|
|
else if (errno == EISDIR)
|
|
|
|
error( KIO::ERR_IS_DIRECTORY, url.url());
|
|
|
|
error( TDEIO::ERR_IS_DIRECTORY, url.url());
|
|
|
|
else
|
|
|
|
else
|
|
|
|
error( KIO::ERR_CANNOT_DELETE, url.url() );
|
|
|
|
error( TDEIO::ERR_CANNOT_DELETE, url.url() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1237,7 +1237,7 @@ void kio_digikamalbums::del( const KURL& url, bool isfile)
|
|
|
|
AlbumInfo album = findAlbum(url.path());
|
|
|
|
AlbumInfo album = findAlbum(url.path());
|
|
|
|
if (album.id == -1)
|
|
|
|
if (album.id == -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, i18n("Source album %1 not found in database")
|
|
|
|
error(TDEIO::ERR_UNKNOWN, i18n("Source album %1 not found in database")
|
|
|
|
.arg(url.path()));
|
|
|
|
.arg(url.path()));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1248,13 +1248,13 @@ void kio_digikamalbums::del( const KURL& url, bool isfile)
|
|
|
|
|
|
|
|
|
|
|
|
if ((errno == EACCES) || (errno == EPERM))
|
|
|
|
if ((errno == EACCES) || (errno == EPERM))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_ACCESS_DENIED, url.url());
|
|
|
|
error( TDEIO::ERR_ACCESS_DENIED, url.url());
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdDebug() << "could not rmdir " << perror << endl;
|
|
|
|
kdDebug() << "could not rmdir " << perror << endl;
|
|
|
|
error( KIO::ERR_COULD_NOT_RMDIR, url.url() );
|
|
|
|
error( TDEIO::ERR_COULD_NOT_RMDIR, url.url() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1267,7 +1267,7 @@ void kio_digikamalbums::del( const KURL& url, bool isfile)
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool kio_digikamalbums::createUDSEntry(const TQString& path, KIO::UDSEntry& entry)
|
|
|
|
bool kio_digikamalbums::createUDSEntry(const TQString& path, TDEIO::UDSEntry& entry)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
entry.clear();
|
|
|
|
entry.clear();
|
|
|
|
|
|
|
|
|
|
|
@ -1275,40 +1275,40 @@ bool kio_digikamalbums::createUDSEntry(const TQString& path, KIO::UDSEntry& entr
|
|
|
|
if (KDE_stat(TQFile::encodeName(path), &stbuf) != 0)
|
|
|
|
if (KDE_stat(TQFile::encodeName(path), &stbuf) != 0)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
KIO::UDSAtom atom;
|
|
|
|
TDEIO::UDSAtom atom;
|
|
|
|
|
|
|
|
|
|
|
|
atom.m_uds = KIO::UDS_FILE_TYPE;
|
|
|
|
atom.m_uds = TDEIO::UDS_FILE_TYPE;
|
|
|
|
atom.m_long = stbuf.st_mode & S_IFMT;
|
|
|
|
atom.m_long = stbuf.st_mode & S_IFMT;
|
|
|
|
entry.append( atom );
|
|
|
|
entry.append( atom );
|
|
|
|
|
|
|
|
|
|
|
|
atom.m_uds = KIO::UDS_ACCESS;
|
|
|
|
atom.m_uds = TDEIO::UDS_ACCESS;
|
|
|
|
atom.m_long = stbuf.st_mode & 07777;
|
|
|
|
atom.m_long = stbuf.st_mode & 07777;
|
|
|
|
entry.append( atom );
|
|
|
|
entry.append( atom );
|
|
|
|
|
|
|
|
|
|
|
|
atom.m_uds = KIO::UDS_SIZE;
|
|
|
|
atom.m_uds = TDEIO::UDS_SIZE;
|
|
|
|
atom.m_long = stbuf.st_size;
|
|
|
|
atom.m_long = stbuf.st_size;
|
|
|
|
entry.append( atom );
|
|
|
|
entry.append( atom );
|
|
|
|
|
|
|
|
|
|
|
|
atom.m_uds = KIO::UDS_MODIFICATION_TIME;
|
|
|
|
atom.m_uds = TDEIO::UDS_MODIFICATION_TIME;
|
|
|
|
atom.m_long = stbuf.st_mtime;
|
|
|
|
atom.m_long = stbuf.st_mtime;
|
|
|
|
entry.append( atom );
|
|
|
|
entry.append( atom );
|
|
|
|
|
|
|
|
|
|
|
|
atom.m_uds = KIO::UDS_ACCESS_TIME;
|
|
|
|
atom.m_uds = TDEIO::UDS_ACCESS_TIME;
|
|
|
|
atom.m_long = stbuf.st_atime;
|
|
|
|
atom.m_long = stbuf.st_atime;
|
|
|
|
entry.append( atom );
|
|
|
|
entry.append( atom );
|
|
|
|
|
|
|
|
|
|
|
|
atom.m_uds = KIO::UDS_NAME;
|
|
|
|
atom.m_uds = TDEIO::UDS_NAME;
|
|
|
|
atom.m_str = TQFileInfo(path).fileName();
|
|
|
|
atom.m_str = TQFileInfo(path).fileName();
|
|
|
|
entry.append(atom);
|
|
|
|
entry.append(atom);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
// If we provide the local path, a KIO::CopyJob will optimize away
|
|
|
|
// If we provide the local path, a TDEIO::CopyJob will optimize away
|
|
|
|
// the use of our custom digikamalbums:/ ioslave, which breaks
|
|
|
|
// the use of our custom digikamalbums:/ ioslave, which breaks
|
|
|
|
// copying the database entry:
|
|
|
|
// copying the database entry:
|
|
|
|
// Disabling this as a temporary solution for bug #137282
|
|
|
|
// Disabling this as a temporary solution for bug #137282
|
|
|
|
// This code is intended as a fix for bug #122653.
|
|
|
|
// This code is intended as a fix for bug #122653.
|
|
|
|
#if KDE_IS_VERSION(3,4,0)
|
|
|
|
#if KDE_IS_VERSION(3,4,0)
|
|
|
|
atom.m_uds = KIO::UDS_LOCAL_PATH;
|
|
|
|
atom.m_uds = TDEIO::UDS_LOCAL_PATH;
|
|
|
|
atom.m_str = path;
|
|
|
|
atom.m_str = path;
|
|
|
|
entry.append(atom);
|
|
|
|
entry.append(atom);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -1317,33 +1317,33 @@ bool kio_digikamalbums::createUDSEntry(const TQString& path, KIO::UDSEntry& entr
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void kio_digikamalbums::createDigikamPropsUDSEntry(KIO::UDSEntry& entry)
|
|
|
|
void kio_digikamalbums::createDigikamPropsUDSEntry(TDEIO::UDSEntry& entry)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
entry.clear();
|
|
|
|
entry.clear();
|
|
|
|
|
|
|
|
|
|
|
|
KIO::UDSAtom atom;
|
|
|
|
TDEIO::UDSAtom atom;
|
|
|
|
|
|
|
|
|
|
|
|
atom.m_uds = KIO::UDS_FILE_TYPE;
|
|
|
|
atom.m_uds = TDEIO::UDS_FILE_TYPE;
|
|
|
|
atom.m_long = S_IFREG;
|
|
|
|
atom.m_long = S_IFREG;
|
|
|
|
entry.append( atom );
|
|
|
|
entry.append( atom );
|
|
|
|
|
|
|
|
|
|
|
|
atom.m_uds = KIO::UDS_ACCESS;
|
|
|
|
atom.m_uds = TDEIO::UDS_ACCESS;
|
|
|
|
atom.m_long = 00666;
|
|
|
|
atom.m_long = 00666;
|
|
|
|
entry.append( atom );
|
|
|
|
entry.append( atom );
|
|
|
|
|
|
|
|
|
|
|
|
atom.m_uds = KIO::UDS_SIZE;
|
|
|
|
atom.m_uds = TDEIO::UDS_SIZE;
|
|
|
|
atom.m_long = 0;
|
|
|
|
atom.m_long = 0;
|
|
|
|
entry.append( atom );
|
|
|
|
entry.append( atom );
|
|
|
|
|
|
|
|
|
|
|
|
atom.m_uds = KIO::UDS_MODIFICATION_TIME;
|
|
|
|
atom.m_uds = TDEIO::UDS_MODIFICATION_TIME;
|
|
|
|
atom.m_long = TQDateTime::currentDateTime().toTime_t();
|
|
|
|
atom.m_long = TQDateTime::currentDateTime().toTime_t();
|
|
|
|
entry.append( atom );
|
|
|
|
entry.append( atom );
|
|
|
|
|
|
|
|
|
|
|
|
atom.m_uds = KIO::UDS_ACCESS_TIME;
|
|
|
|
atom.m_uds = TDEIO::UDS_ACCESS_TIME;
|
|
|
|
atom.m_long = TQDateTime::currentDateTime().toTime_t();
|
|
|
|
atom.m_long = TQDateTime::currentDateTime().toTime_t();
|
|
|
|
entry.append( atom );
|
|
|
|
entry.append( atom );
|
|
|
|
|
|
|
|
|
|
|
|
atom.m_uds = KIO::UDS_NAME;
|
|
|
|
atom.m_uds = TDEIO::UDS_NAME;
|
|
|
|
atom.m_str = ".digikam_properties";
|
|
|
|
atom.m_str = ".digikam_properties";
|
|
|
|
entry.append(atom);
|
|
|
|
entry.append(atom);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1749,7 +1749,7 @@ void kio_digikamalbums::copyImage(int srcAlbumID, const TQString& srcName,
|
|
|
|
// check for src == dest
|
|
|
|
// check for src == dest
|
|
|
|
if (srcAlbumID == dstAlbumID && srcName == dstName)
|
|
|
|
if (srcAlbumID == dstAlbumID && srcName == dstName)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error( KIO::ERR_FILE_ALREADY_EXIST, dstName );
|
|
|
|
error( TDEIO::ERR_FILE_ALREADY_EXIST, dstName );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1762,7 +1762,7 @@ void kio_digikamalbums::copyImage(int srcAlbumID, const TQString& srcName,
|
|
|
|
|
|
|
|
|
|
|
|
if (values.isEmpty())
|
|
|
|
if (values.isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
error(KIO::ERR_UNKNOWN, i18n("Source image %1 not found in database")
|
|
|
|
error(TDEIO::ERR_UNKNOWN, i18n("Source image %1 not found in database")
|
|
|
|
.arg(srcName));
|
|
|
|
.arg(srcName));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|