summaryrefslogtreecommitdiffstats
path: root/src/fileaccess.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-25 00:07:22 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-25 00:07:22 -0600
commitbfd3620cd83f108b5f82d034ffb250748755dfd5 (patch)
treed14f8bc2abaa71dc9216b85dcf323cc3df62f845 /src/fileaccess.cpp
parent672c9c39de40e4da2849acbacf0b943dd26a31ac (diff)
downloadkdiff3-bfd3620cd83f108b5f82d034ffb250748755dfd5.tar.gz
kdiff3-bfd3620cd83f108b5f82d034ffb250748755dfd5.zip
Rename KCModule, KConfig, KIO, KServer, and KSocket to avoid conflicts with KDE4
Diffstat (limited to 'src/fileaccess.cpp')
-rw-r--r--src/fileaccess.cpp126
1 files changed, 63 insertions, 63 deletions
diff --git a/src/fileaccess.cpp b/src/fileaccess.cpp
index 0e1b599..eaf1732 100644
--- a/src/fileaccess.cpp
+++ b/src/fileaccess.cpp
@@ -239,27 +239,27 @@ void FileAccess::addPath( const TQString& txt )
*/
#ifdef KREPLACEMENTS_H
-void FileAccess::setUdsEntry( const KIO::UDSEntry& ){} // not needed if KDE is not available
+void FileAccess::setUdsEntry( const TDEIO::UDSEntry& ){} // not needed if KDE is not available
#else
-void FileAccess::setUdsEntry( const KIO::UDSEntry& e )
+void FileAccess::setUdsEntry( const TDEIO::UDSEntry& e )
{
- KIO::UDSEntry::const_iterator ei;
+ TDEIO::UDSEntry::const_iterator ei;
long acc = 0;
long fileType = 0;
for( ei=e.begin(); ei!=e.end(); ++ei )
{
- const KIO::UDSAtom& a = *ei;
+ const TDEIO::UDSAtom& a = *ei;
switch( a.m_uds )
{
- case KIO::UDS_SIZE : m_size = a.m_long; break;
- case KIO::UDS_USER : m_user = a.m_str; break;
- case KIO::UDS_GROUP : m_group = a.m_str; break;
- case KIO::UDS_NAME : m_path = a.m_str; break; // During listDir the relative path is given here.
- case KIO::UDS_MODIFICATION_TIME : m_modificationTime.setTime_t( a.m_long ); break;
- case KIO::UDS_ACCESS_TIME : m_accessTime.setTime_t( a.m_long ); break;
- case KIO::UDS_CREATION_TIME : m_creationTime.setTime_t( a.m_long ); break;
- case KIO::UDS_LINK_DEST : m_linkTarget = a.m_str; break;
- case KIO::UDS_ACCESS :
+ case TDEIO::UDS_SIZE : m_size = a.m_long; break;
+ case TDEIO::UDS_USER : m_user = a.m_str; break;
+ case TDEIO::UDS_GROUP : m_group = a.m_str; break;
+ case TDEIO::UDS_NAME : m_path = a.m_str; break; // During listDir the relative path is given here.
+ case TDEIO::UDS_MODIFICATION_TIME : m_modificationTime.setTime_t( a.m_long ); break;
+ case TDEIO::UDS_ACCESS_TIME : m_accessTime.setTime_t( a.m_long ); break;
+ case TDEIO::UDS_CREATION_TIME : m_creationTime.setTime_t( a.m_long ); break;
+ case TDEIO::UDS_LINK_DEST : m_linkTarget = a.m_str; break;
+ case TDEIO::UDS_ACCESS :
{
acc = a.m_long;
m_bReadable = (acc & S_IRUSR)!=0;
@@ -267,7 +267,7 @@ void FileAccess::setUdsEntry( const KIO::UDSEntry& e )
m_bExecutable = (acc & S_IXUSR)!=0;
break;
}
- case KIO::UDS_FILE_TYPE :
+ case TDEIO::UDS_FILE_TYPE :
{
fileType = a.m_long;
m_bDir = ( fileType & S_IFMT ) == S_IFDIR;
@@ -278,11 +278,11 @@ void FileAccess::setUdsEntry( const KIO::UDSEntry& e )
break;
}
- case KIO::UDS_URL : // m_url = KURL( a.str );
+ case TDEIO::UDS_URL : // m_url = KURL( a.str );
break;
- case KIO::UDS_MIME_TYPE : break;
- case KIO::UDS_GUESSED_MIME_TYPE : break;
- case KIO::UDS_XML_PROPERTIES : break;
+ case TDEIO::UDS_MIME_TYPE : break;
+ case TDEIO::UDS_GUESSED_MIME_TYPE : break;
+ case TDEIO::UDS_XML_PROPERTIES : break;
default: break;
}
}
@@ -621,16 +621,16 @@ bool FileAccessJobHandler::stat( int detail, bool bWantToWrite )
{
m_bSuccess = false;
m_pFileAccess->m_statusText = TQString();
- KIO::StatJob* pStatJob = KIO::stat( m_pFileAccess->m_url, ! bWantToWrite, detail, false );
+ TDEIO::StatJob* pStatJob = TDEIO::stat( m_pFileAccess->m_url, ! bWantToWrite, detail, false );
- connect( pStatJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotStatResult(KIO::Job*)));
+ connect( pStatJob, TQT_SIGNAL(result(TDEIO::Job*)), this, TQT_SLOT(slotStatResult(TDEIO::Job*)));
g_pProgressDialog->enterEventLoop( pStatJob, i18n("Getting file status: %1").arg(m_pFileAccess->prettyAbsPath()) );
return m_bSuccess;
}
-void FileAccessJobHandler::slotStatResult(KIO::Job* pJob)
+void FileAccessJobHandler::slotStatResult(TDEIO::Job* pJob)
{
if ( pJob->error() )
{
@@ -643,7 +643,7 @@ void FileAccessJobHandler::slotStatResult(KIO::Job* pJob)
m_bSuccess = true;
m_pFileAccess->m_bValidData = true;
- const KIO::UDSEntry e = static_cast<KIO::StatJob*>(pJob)->statResult();
+ const TDEIO::UDSEntry e = static_cast<TDEIO::StatJob*>(pJob)->statResult();
m_pFileAccess->setUdsEntry( e );
}
@@ -657,16 +657,16 @@ bool FileAccessJobHandler::get(void* pDestBuffer, long maxLength )
ProgressProxy pp; // Implicitly used in slotPercent()
if ( maxLength>0 && !pp.wasCancelled() )
{
- KIO::TransferJob* pJob = KIO::get( m_pFileAccess->m_url, false /*reload*/, false );
+ TDEIO::TransferJob* pJob = TDEIO::get( m_pFileAccess->m_url, false /*reload*/, false );
m_transferredBytes = 0;
m_pTransferBuffer = (char*)pDestBuffer;
m_maxLength = maxLength;
m_bSuccess = false;
m_pFileAccess->m_statusText = TQString();
- connect( pJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(KIO::Job*)));
- connect( pJob, TQT_SIGNAL(data(KIO::Job*,const TQByteArray &)), this, TQT_SLOT(slotGetData(KIO::Job*, const TQByteArray&)));
- connect( pJob, TQT_SIGNAL(percent(KIO::Job*,unsigned long)), this, TQT_SLOT(slotPercent(KIO::Job*, unsigned long)));
+ connect( pJob, TQT_SIGNAL(result(TDEIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(TDEIO::Job*)));
+ connect( pJob, TQT_SIGNAL(data(TDEIO::Job*,const TQByteArray &)), this, TQT_SLOT(slotGetData(TDEIO::Job*, const TQByteArray&)));
+ connect( pJob, TQT_SIGNAL(percent(TDEIO::Job*,unsigned long)), this, TQT_SLOT(slotPercent(TDEIO::Job*, unsigned long)));
g_pProgressDialog->enterEventLoop( pJob, i18n("Reading file: %1").arg(m_pFileAccess->prettyAbsPath()) );
return m_bSuccess;
@@ -675,7 +675,7 @@ bool FileAccessJobHandler::get(void* pDestBuffer, long maxLength )
return true;
}
-void FileAccessJobHandler::slotGetData( KIO::Job* pJob, const TQByteArray& newData )
+void FileAccessJobHandler::slotGetData( TDEIO::Job* pJob, const TQByteArray& newData )
{
if ( pJob->error() )
{
@@ -693,16 +693,16 @@ bool FileAccessJobHandler::put(const void* pSrcBuffer, long maxLength, bool bOve
{
if ( maxLength>0 )
{
- KIO::TransferJob* pJob = KIO::put( m_pFileAccess->m_url, permissions, bOverwrite, bResume, false );
+ TDEIO::TransferJob* pJob = TDEIO::put( m_pFileAccess->m_url, permissions, bOverwrite, bResume, false );
m_transferredBytes = 0;
m_pTransferBuffer = (char*)pSrcBuffer;
m_maxLength = maxLength;
m_bSuccess = false;
m_pFileAccess->m_statusText = TQString();
- connect( pJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotPutJobResult(KIO::Job*)));
- connect( pJob, TQT_SIGNAL(dataReq(KIO::Job*, TQByteArray&)), this, TQT_SLOT(slotPutData(KIO::Job*, TQByteArray&)));
- connect( pJob, TQT_SIGNAL(percent(KIO::Job*,unsigned long)), this, TQT_SLOT(slotPercent(KIO::Job*, unsigned long)));
+ connect( pJob, TQT_SIGNAL(result(TDEIO::Job*)), this, TQT_SLOT(slotPutJobResult(TDEIO::Job*)));
+ connect( pJob, TQT_SIGNAL(dataReq(TDEIO::Job*, TQByteArray&)), this, TQT_SLOT(slotPutData(TDEIO::Job*, TQByteArray&)));
+ connect( pJob, TQT_SIGNAL(percent(TDEIO::Job*,unsigned long)), this, TQT_SLOT(slotPercent(TDEIO::Job*, unsigned long)));
g_pProgressDialog->enterEventLoop( pJob, i18n("Writing file: %1").arg(m_pFileAccess->prettyAbsPath()) );
return m_bSuccess;
@@ -711,7 +711,7 @@ bool FileAccessJobHandler::put(const void* pSrcBuffer, long maxLength, bool bOve
return true;
}
-void FileAccessJobHandler::slotPutData( KIO::Job* pJob, TQByteArray& data )
+void FileAccessJobHandler::slotPutData( TDEIO::Job* pJob, TQByteArray& data )
{
if ( pJob->error() )
{
@@ -739,7 +739,7 @@ void FileAccessJobHandler::slotPutData( KIO::Job* pJob, TQByteArray& data )
}
}
-void FileAccessJobHandler::slotPutJobResult(KIO::Job* pJob)
+void FileAccessJobHandler::slotPutJobResult(TDEIO::Job* pJob)
{
if ( pJob->error() )
{
@@ -764,8 +764,8 @@ bool FileAccessJobHandler::mkDir( const TQString& dirName )
else
{
m_bSuccess = false;
- KIO::SimpleJob* pJob = KIO::mkdir( dirURL );
- connect( pJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(KIO::Job*)));
+ TDEIO::SimpleJob* pJob = TDEIO::mkdir( dirURL );
+ connect( pJob, TQT_SIGNAL(result(TDEIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(TDEIO::Job*)));
g_pProgressDialog->enterEventLoop( pJob, i18n("Making directory: %1").arg(dirName) );
return m_bSuccess;
@@ -784,8 +784,8 @@ bool FileAccessJobHandler::rmDir( const TQString& dirName )
else
{
m_bSuccess = false;
- KIO::SimpleJob* pJob = KIO::rmdir( dirURL );
- connect( pJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(KIO::Job*)));
+ TDEIO::SimpleJob* pJob = TDEIO::rmdir( dirURL );
+ connect( pJob, TQT_SIGNAL(result(TDEIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(TDEIO::Job*)));
g_pProgressDialog->enterEventLoop(pJob, i18n("Removing directory: %1").arg(dirName));
return m_bSuccess;
@@ -799,8 +799,8 @@ bool FileAccessJobHandler::removeFile( const TQString& fileName )
else
{
m_bSuccess = false;
- KIO::SimpleJob* pJob = KIO::file_delete( KURL::fromPathOrURL(fileName), false );
- connect( pJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(KIO::Job*)));
+ TDEIO::SimpleJob* pJob = TDEIO::file_delete( KURL::fromPathOrURL(fileName), false );
+ connect( pJob, TQT_SIGNAL(result(TDEIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(TDEIO::Job*)));
g_pProgressDialog->enterEventLoop( pJob, i18n("Removing file: %1").arg(fileName) );
return m_bSuccess;
@@ -814,8 +814,8 @@ bool FileAccessJobHandler::symLink( const TQString& linkTarget, const TQString&
else
{
m_bSuccess = false;
- KIO::CopyJob* pJob = KIO::link( KURL::fromPathOrURL(linkTarget), KURL::fromPathOrURL(linkLocation), false );
- connect( pJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(KIO::Job*)));
+ TDEIO::CopyJob* pJob = TDEIO::link( KURL::fromPathOrURL(linkTarget), KURL::fromPathOrURL(linkLocation), false );
+ connect( pJob, TQT_SIGNAL(result(TDEIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(TDEIO::Job*)));
g_pProgressDialog->enterEventLoop( pJob,
i18n("Creating symbolic link: %1 -> %2").arg(linkLocation).arg(linkTarget) );
@@ -843,9 +843,9 @@ bool FileAccessJobHandler::rename( const TQString& dest )
bool bShowProgress = false;
int permissions=-1;
m_bSuccess = false;
- KIO::FileCopyJob* pJob = KIO::file_move( m_pFileAccess->m_url, kurl, permissions, bOverwrite, bResume, bShowProgress );
- connect( pJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(KIO::Job*)));
- connect( pJob, TQT_SIGNAL(percent(KIO::Job*,unsigned long)), this, TQT_SLOT(slotPercent(KIO::Job*, unsigned long)));
+ TDEIO::FileCopyJob* pJob = TDEIO::file_move( m_pFileAccess->m_url, kurl, permissions, bOverwrite, bResume, bShowProgress );
+ connect( pJob, TQT_SIGNAL(result(TDEIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(TDEIO::Job*)));
+ connect( pJob, TQT_SIGNAL(percent(TDEIO::Job*,unsigned long)), this, TQT_SLOT(slotPercent(TDEIO::Job*, unsigned long)));
g_pProgressDialog->enterEventLoop( pJob,
i18n("Renaming file: %1 -> %2").arg(m_pFileAccess->prettyAbsPath()).arg(dest) );
@@ -853,7 +853,7 @@ bool FileAccessJobHandler::rename( const TQString& dest )
}
}
-void FileAccessJobHandler::slotSimpleJobResult(KIO::Job* pJob)
+void FileAccessJobHandler::slotSimpleJobResult(TDEIO::Job* pJob)
{
if ( pJob->error() )
{
@@ -880,9 +880,9 @@ bool FileAccessJobHandler::copyFile( const TQString& dest )
bool bShowProgress = false;
int permissions = (m_pFileAccess->isExecutable()?0111:0)+(m_pFileAccess->isWritable()?0222:0)+(m_pFileAccess->isReadable()?0444:0);
m_bSuccess = false;
- KIO::FileCopyJob* pJob = KIO::file_copy ( m_pFileAccess->m_url, destUrl, permissions, bOverwrite, bResume, bShowProgress );
- connect( pJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(KIO::Job*)));
- connect( pJob, TQT_SIGNAL(percent(KIO::Job*,unsigned long)), this, TQT_SLOT(slotPercent(KIO::Job*, unsigned long)));
+ TDEIO::FileCopyJob* pJob = TDEIO::file_copy ( m_pFileAccess->m_url, destUrl, permissions, bOverwrite, bResume, bShowProgress );
+ connect( pJob, TQT_SIGNAL(result(TDEIO::Job*)), this, TQT_SLOT(slotSimpleJobResult(TDEIO::Job*)));
+ connect( pJob, TQT_SIGNAL(percent(TDEIO::Job*,unsigned long)), this, TQT_SLOT(slotPercent(TDEIO::Job*, unsigned long)));
g_pProgressDialog->enterEventLoop( pJob,
i18n("Copying file: %1 -> %2").arg(m_pFileAccess->prettyAbsPath()).arg(dest) );
@@ -1326,22 +1326,22 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive,
{
bool bShowProgress = false;
- KIO::ListJob* pListJob=0;
- pListJob = KIO::listDir( m_pFileAccess->m_url, bShowProgress, true /*bFindHidden*/ );
+ TDEIO::ListJob* pListJob=0;
+ pListJob = TDEIO::listDir( m_pFileAccess->m_url, bShowProgress, true /*bFindHidden*/ );
m_bSuccess = false;
if ( pListJob!=0 )
{
- connect( pListJob, TQT_SIGNAL( entries( KIO::Job *, const KIO::UDSEntryList& ) ),
- this, TQT_SLOT( slotListDirProcessNewEntries( KIO::Job *, const KIO::UDSEntryList& )) );
- connect( pListJob, TQT_SIGNAL( result( KIO::Job* )),
- this, TQT_SLOT( slotSimpleJobResult(KIO::Job*) ) );
+ connect( pListJob, TQT_SIGNAL( entries( TDEIO::Job *, const TDEIO::UDSEntryList& ) ),
+ this, TQT_SLOT( slotListDirProcessNewEntries( TDEIO::Job *, const TDEIO::UDSEntryList& )) );
+ connect( pListJob, TQT_SIGNAL( result( TDEIO::Job* )),
+ this, TQT_SLOT( slotSimpleJobResult(TDEIO::Job*) ) );
- connect( pListJob, TQT_SIGNAL( infoMessage(KIO::Job*, const TQString&)),
- this, TQT_SLOT( slotListDirInfoMessage(KIO::Job*, const TQString&) ));
+ connect( pListJob, TQT_SIGNAL( infoMessage(TDEIO::Job*, const TQString&)),
+ this, TQT_SLOT( slotListDirInfoMessage(TDEIO::Job*, const TQString&) ));
// This line makes the transfer via fish unreliable.:-(
- //connect( pListJob, TQT_SIGNAL(percent(KIO::Job*,unsigned long)), this, TQT_SLOT(slotPercent(KIO::Job*, unsigned long)));
+ //connect( pListJob, TQT_SIGNAL(percent(TDEIO::Job*,unsigned long)), this, TQT_SLOT(slotPercent(TDEIO::Job*, unsigned long)));
g_pProgressDialog->enterEventLoop( pListJob,
i18n("Listing directory: %1").arg(m_pFileAccess->prettyAbsPath()) );
@@ -1418,14 +1418,14 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive,
}
-void FileAccessJobHandler::slotListDirProcessNewEntries( KIO::Job *, const KIO::UDSEntryList& l )
+void FileAccessJobHandler::slotListDirProcessNewEntries( TDEIO::Job *, const TDEIO::UDSEntryList& l )
{
KURL parentUrl( m_pFileAccess->m_absFilePath );
- KIO::UDSEntryList::ConstIterator i;
+ TDEIO::UDSEntryList::ConstIterator i;
for ( i=l.begin(); i!=l.end(); ++i )
{
- const KIO::UDSEntry& e = *i;
+ const TDEIO::UDSEntry& e = *i;
FileAccess fa;
fa.setUdsEntry( e );
@@ -1439,12 +1439,12 @@ void FileAccessJobHandler::slotListDirProcessNewEntries( KIO::Job *, const KIO::
}
}
-void FileAccessJobHandler::slotListDirInfoMessage( KIO::Job*, const TQString& msg )
+void FileAccessJobHandler::slotListDirInfoMessage( TDEIO::Job*, const TQString& msg )
{
g_pProgressDialog->setInformation( msg, 0.0 );
}
-void FileAccessJobHandler::slotPercent( KIO::Job*, unsigned long percent )
+void FileAccessJobHandler::slotPercent( TDEIO::Job*, unsigned long percent )
{
g_pProgressDialog->setCurrent( percent/100.0 );
}
@@ -1612,7 +1612,7 @@ void ProgressDialog::setSubRangeTransformation( double dMin, double dMax )
void tqt_enter_modal(TQWidget*);
void tqt_leave_modal(TQWidget*);
-void ProgressDialog::enterEventLoop( KIO::Job* pJob, const TQString& jobInfo )
+void ProgressDialog::enterEventLoop( TDEIO::Job* pJob, const TQString& jobInfo )
{
m_pJob = pJob;
m_pSlowJobInfo->setText("");