diff options
Diffstat (limited to 'smb4k/core/smb4kmounter.cpp')
-rw-r--r-- | smb4k/core/smb4kmounter.cpp | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/smb4k/core/smb4kmounter.cpp b/smb4k/core/smb4kmounter.cpp index ccf687d..5e1faa6 100644 --- a/smb4k/core/smb4kmounter.cpp +++ b/smb4k/core/smb4kmounter.cpp @@ -26,9 +26,9 @@ // TQt includes #include <tqapplication.h> #include <tqdir.h> -#include <tqtextstream.h> +#include <textstream.h> #include <tqfile.h> -#include <tqtextstream.h> +#include <textstream.h> // KDE includes #include <kapplication.h> @@ -115,8 +115,8 @@ Smb4KMounter::~Smb4KMounter() void Smb4KMounter::init() { - m_queue.enqueue( new TQString( TQString( "%1:" ).tqarg( Import ) ) ); - m_queue.enqueue( new TQString( TQString( "%1:" ).tqarg( Remount ) ) ); + m_queue.enqueue( new TQString( TQString( "%1:" ).arg( Import ) ) ); + m_queue.enqueue( new TQString( TQString( "%1:" ).arg( Remount ) ) ); startTimer( TIMER_INTERVAL ); } @@ -160,7 +160,7 @@ void Smb4KMounter::abort() KProcess proc; proc.setUseShell( true ); - proc << TQString( "%1 smb4k_kill %2" ).tqarg( suid_program ).tqarg( m_proc->pid() ); + proc << TQString( "%1 smb4k_kill %2" ).arg( suid_program ).arg( m_proc->pid() ); proc.start( KProcess::DontCare, KProcess::NoCommunication ); } else @@ -491,7 +491,7 @@ void Smb4KMounter::mountShare( const TQString &workgroup, const TQString &host, { // Before doing anything else let's check that the // share has not been mounted by the user already: - TQValueList<Smb4KShare> list = findShareByName( TQString( "//%1/%2" ).tqarg( host, share_name ) ); + TQValueList<Smb4KShare> list = findShareByName( TQString( "//%1/%2" ).arg( host, share_name ) ); for ( TQValueList<Smb4KShare>::ConstIterator it = list.begin(); it != list.end(); ++it ) { @@ -503,9 +503,9 @@ void Smb4KMounter::mountShare( const TQString &workgroup, const TQString &host, } } - m_queue.enqueue( new TQString( TQString( "%1:%2:%3:%4:%5" ).tqarg( Mount ) - .tqarg( workgroup, host ) - .tqarg( ip, share_name ) ) ); + m_queue.enqueue( new TQString( TQString( "%1:%2:%3:%4:%5" ).arg( Mount ) + .arg( workgroup, host ) + .arg( ip, share_name ) ) ); } } @@ -604,7 +604,7 @@ void Smb4KMounter::mount( const TQString &workgroup, const TQString &host, const #ifndef __FreeBSD__ // Let's see if the options handler knows the share: - Smb4KSambaOptionsInfo *info = optionsHandler()->findItem( TQString( "//%1/%2" ).tqarg( m_priv->host(), m_priv->share() ), true ); + Smb4KSambaOptionsInfo *info = optionsHandler()->findItem( TQString( "//%1/%2" ).arg( m_priv->host(), m_priv->share() ), true ); // Determine the file system we have to use: int filesystem; @@ -626,28 +626,28 @@ void Smb4KMounter::mount( const TQString &workgroup, const TQString &host, const case Smb4KSettings::EnumFilesystem::CIFS: { command.append( Smb4KSettings::alwaysUseSuperUser() ? // FIXME: Check if suid program is installed - TQString( "%1 smb4k_mount -s -t cifs " ).tqarg( suid_program ) : + TQString( "%1 smb4k_mount -s -t cifs " ).arg( suid_program ) : "smb4k_mount -n -t cifs " ); command.append( "-o " ); - command.append( optionsHandler()->mountOptions( TQString( "//%1/%2" ).tqarg( m_priv->host(), m_priv->share() ) ) ); + command.append( optionsHandler()->mountOptions( TQString( "//%1/%2" ).arg( m_priv->host(), m_priv->share() ) ) ); command.append( !m_priv->workgroup().stripWhiteSpace().isEmpty() ? - TQString( "domain='%1'," ).tqarg( m_priv->workgroup() ) : + TQString( "domain='%1'," ).arg( m_priv->workgroup() ) : "" ); command.append( !m_priv->ip().stripWhiteSpace().isEmpty() ? - TQString( "ip=%1," ).tqarg( m_priv->ip() ) : + TQString( "ip=%1," ).arg( m_priv->ip() ) : "" ); command.append( !authInfo.user().isEmpty() ? - TQString( "user=%1" ).tqarg( authInfo.user().data() ) : + TQString( "user=%1" ).arg( authInfo.user().data() ) : "guest" ); command.append( " -- " ); - command.append( TQString( "//'%1'/'%2' '%3'" ).tqarg( m_priv->host(), m_priv->share(), m_priv->path() ) ); + command.append( TQString( "//'%1'/'%2' '%3'" ).arg( m_priv->host(), m_priv->share(), m_priv->path() ) ); m_priv->setCIFSLogin( !authInfo.user().isEmpty() ? authInfo.user() : @@ -660,28 +660,28 @@ void Smb4KMounter::mount( const TQString &workgroup, const TQString &host, const case Smb4KSettings::EnumFilesystem::SMBFS: { command.append( Smb4KSettings::alwaysUseSuperUser() ? // FIXME: Check if suid program is installed - TQString( "%1 smb4k_mount -s -t smbfs " ).tqarg( suid_program ) : + TQString( "%1 smb4k_mount -s -t smbfs " ).arg( suid_program ) : "smb4k_mount -n -t smbfs " ); command.append( "-o " ); - command.append( optionsHandler()->mountOptions( TQString( "//%1/%2" ).tqarg( m_priv->host(), m_priv->share() ) ) ); + command.append( optionsHandler()->mountOptions( TQString( "//%1/%2" ).arg( m_priv->host(), m_priv->share() ) ) ); command.append( !m_priv->workgroup().stripWhiteSpace().isEmpty() ? - TQString( "workgroup='%1'," ).tqarg( m_priv->workgroup() ) : + TQString( "workgroup='%1'," ).arg( m_priv->workgroup() ) : "" ); command.append( !m_priv->ip().stripWhiteSpace().isEmpty() ? - TQString( "ip=%1," ).tqarg( m_priv->ip() ) : + TQString( "ip=%1," ).arg( m_priv->ip() ) : "" ); command.append( !authInfo.user().isEmpty() ? - TQString( "username=%1" ).tqarg( authInfo.user().data() ) : + TQString( "username=%1" ).arg( authInfo.user().data() ) : "guest" ); command.append( " -- " ); - command.append( TQString( "//'%1'/'%2' '%3'" ).tqarg( m_priv->host(), m_priv->share(), m_priv->path() ) ); + command.append( TQString( "//'%1'/'%2' '%3'" ).arg( m_priv->host(), m_priv->share(), m_priv->path() ) ); m_priv->setFileSystem( "smbfs" ); @@ -704,27 +704,27 @@ void Smb4KMounter::mount( const TQString &workgroup, const TQString &host, const Smb4KSettings::remotePort(); command.append( Smb4KSettings::alwaysUseSuperUser() ? // FIXME: Check if suid program is installed - TQString( "%1 smb4k_mount " ).tqarg( suid_program ) : + TQString( "%1 smb4k_mount " ).arg( suid_program ) : "smb4k_mount " ); - command.append( optionsHandler()->mountOptions( TQString( "//%1/%2" ).tqarg( m_priv->host(), m_priv->share() ) ) ); + command.append( optionsHandler()->mountOptions( TQString( "//%1/%2" ).arg( m_priv->host(), m_priv->share() ) ) ); command.append( !m_priv->workgroup().stripWhiteSpace().isEmpty() ? - TQString( " -W '%1'" ).tqarg( m_priv->workgroup() ) : + TQString( " -W '%1'" ).arg( m_priv->workgroup() ) : "" ); command.append( !m_priv->ip().stripWhiteSpace().isEmpty() ? - TQString( " -I %1" ).tqarg( m_priv->ip() ) : + TQString( " -I %1" ).arg( m_priv->ip() ) : "" ); command.append( " -N" ); command.append( " -- " ); - command.append( TQString( "//%1@'%2':%3/'%4' '%5'" ).tqarg( !authInfo.user().isEmpty() ? authInfo.user() : "guest" ) - .tqarg( m_priv->host() ) - .tqarg( port ) - .tqarg( m_priv->share(), m_priv->path() ) ); + command.append( TQString( "//%1@'%2':%3/'%4' '%5'" ).arg( !authInfo.user().isEmpty() ? authInfo.user() : "guest" ) + .arg( m_priv->host() ) + .arg( port ) + .arg( m_priv->share(), m_priv->path() ) ); #endif @@ -743,9 +743,9 @@ void Smb4KMounter::unmountShare( Smb4KShare *share, bool force, bool noMessage ) { // Do *not* change share->canonicalPath(). It is necessary for the // checks below to work. - m_queue.enqueue( new TQString( TQString( "%1:%2:%3:%4" ).tqarg( Unmount ) - .tqarg( share->canonicalPath().data() ) - .tqarg( force, noMessage ) ) ); + m_queue.enqueue( new TQString( TQString( "%1:%2:%3:%4" ).arg( Unmount ) + .arg( share->canonicalPath().data() ) + .arg( force, noMessage ) ) ); } @@ -815,12 +815,12 @@ void Smb4KMounter::unmount( const TQString &mountpoint, bool force, bool noMessa if ( KMessageBox::questionYesNo( 0, i18n( "Do you really want to force the unmounting of this share?" ), TQString(), KStdGuiItem::yes(), KStdGuiItem::no(), "Dont Ask Forced", KMessageBox::Notify ) == KMessageBox::Yes ) { #ifdef __linux__ - command.append( TQString( "%1 smb4k_umount -s -l " ).tqarg( suid_program ) ); + command.append( TQString( "%1 smb4k_umount -s -l " ).arg( suid_program ) ); #else #ifdef __FreeBSD__ - command.append( TQString( "%1 smb4k_umount " ).tqarg( suid_program ) ); + command.append( TQString( "%1 smb4k_umount " ).arg( suid_program ) ); #else - command.append( TQString( "%1 smb4k_umount -s " ).tqarg( suid_program ) ); + command.append( TQString( "%1 smb4k_umount -s " ).arg( suid_program ) ); #endif #endif execute = true; @@ -846,9 +846,9 @@ void Smb4KMounter::unmount( const TQString &mountpoint, bool force, bool noMessa else { #ifndef __FreeBSD__ - command.append( TQString( "%1 smb4k_umount -s " ).tqarg( suid_program ) ); + command.append( TQString( "%1 smb4k_umount -s " ).arg( suid_program ) ); #else - command.append( TQString( "%1 smb4k_umount " ).tqarg( suid_program ) ); + command.append( TQString( "%1 smb4k_umount " ).arg( suid_program ) ); #endif } } @@ -862,12 +862,12 @@ void Smb4KMounter::unmount( const TQString &mountpoint, bool force, bool noMessa if ( KMessageBox::questionYesNo( 0, i18n( "Do you really want to force the unmounting of this share?" ), TQString(), KStdGuiItem::yes(), KStdGuiItem::no(), "Dont Ask Forced", KMessageBox::Notify ) == KMessageBox::Yes ) { #ifdef __linux__ - command.append( TQString( "%1 smb4k_umount -s -l " ).tqarg( suid_program ) ); + command.append( TQString( "%1 smb4k_umount -s -l " ).arg( suid_program ) ); #else #ifdef __FreeBSD__ - command.append( TQString( "%1 smb4k_umount " ).tqarg( suid_program ) ); + command.append( TQString( "%1 smb4k_umount " ).arg( suid_program ) ); #else - command.append( TQString( "%1 smb4k_umount -s " ).tqarg( suid_program ) ); + command.append( TQString( "%1 smb4k_umount -s " ).arg( suid_program ) ); #endif #endif execute = true; @@ -893,9 +893,9 @@ void Smb4KMounter::unmount( const TQString &mountpoint, bool force, bool noMessa else { #ifndef __FreeBSD__ - command.append( TQString( "%1 smb4k_umount -s " ).tqarg( suid_program ) ); + command.append( TQString( "%1 smb4k_umount -s " ).arg( suid_program ) ); #else - command.append( TQString( "%1 smb4k_umount " ).tqarg( suid_program ) ); + command.append( TQString( "%1 smb4k_umount " ).arg( suid_program ) ); #endif } } @@ -915,9 +915,9 @@ void Smb4KMounter::unmount( const TQString &mountpoint, bool force, bool noMessa } #ifndef __FreeBSD__ - command.append( TQString( "-t %1 " ).tqarg( share->filesystem() ) ); + command.append( TQString( "-t %1 " ).arg( share->filesystem() ) ); #endif - command.append( TQString( "'%1'" ).tqarg( m_priv->path() ) ); + command.append( TQString( "'%1'" ).arg( m_priv->path() ) ); if ( force && !execute ) { @@ -952,7 +952,7 @@ void Smb4KMounter::unmount( const TQString &mountpoint, bool force, bool noMessa void Smb4KMounter::unmountAllShares() { - m_queue.enqueue( new TQString( TQString( "%1" ).tqarg( UnmountAll ) ) ); + m_queue.enqueue( new TQString( TQString( "%1" ).arg( UnmountAll ) ) ); } @@ -1043,7 +1043,7 @@ void Smb4KMounter::processMount() m_buffer.contains( "bad user name" ) == 0 && m_buffer.contains( "bad group name" ) == 0 ) { - TQString name = TQString( "//%1/%2" ).tqarg( m_priv->host() ).tqarg( m_priv->share() ); + TQString name = TQString( "//%1/%2" ).arg( m_priv->host() ).arg( m_priv->share() ); // Check file system #if !defined(__solaris__) @@ -1176,7 +1176,7 @@ void Smb4KMounter::processMount() } else { - TQString name = TQString( "//%1/%2" ).tqarg( m_priv->host() ).tqarg( m_priv->share() ); + TQString name = TQString( "//%1/%2" ).arg( m_priv->host() ).arg( m_priv->share() ); Smb4KError::error( ERROR_MOUNTING_SHARE, name, m_buffer ); } @@ -1200,7 +1200,7 @@ void Smb4KMounter::processMount() Smb4KAuthInfo authInfo( m_priv->workgroup(), m_priv->host(), m_priv->share() ); (void) passwordHandler()->readAuth( &authInfo ); - TQString name = TQString( "//%1@%2/%3" ).tqarg( authInfo.user().upper(), m_priv->host().upper(), m_priv->share().upper() ); + TQString name = TQString( "//%1@%2/%3" ).arg( authInfo.user().upper(), m_priv->host().upper(), m_priv->share().upper() ); share = new Smb4KShare( name, m_priv->path(), m_priv->filesystem(), (int)getuid(), (int)getgid() ); m_mounted_shares.append( share ); @@ -1225,7 +1225,7 @@ void Smb4KMounter::processMount() Smb4KAuthInfo authInfo( m_priv->workgroup(), m_priv->host(), m_priv->share() ); (void) passwordHandler()->readAuth( &authInfo ); - TQString name = TQString( "//%1@%2/%3" ).tqarg( authInfo.user().upper(), m_priv->host().upper(), m_priv->share().upper() ); + TQString name = TQString( "//%1@%2/%3" ).arg( authInfo.user().upper(), m_priv->host().upper(), m_priv->share().upper() ); Smb4KError::error( ERROR_MOUNTING_SHARE, name, m_buffer ); } @@ -1284,7 +1284,7 @@ void Smb4KMounter::processUnmount() } else { - TQString str = TQString( "sudo: unable to resolve host %1\n" ).tqarg( hostname ); + TQString str = TQString( "sudo: unable to resolve host %1\n" ).arg( hostname ); m_buffer.remove( str, false /* case insensitive */ ); @@ -1527,7 +1527,7 @@ void Smb4KMounter::timerEvent( TQTimerEvent * ) if ( m_priv->timerTicks * timerInterval() >= Smb4KSettings::checkInterval() /* msec */ && (!m_working || m_queue.isEmpty()) ) { - m_queue.enqueue( new TQString( TQString( "%1:" ).tqarg( Import ) ) ); + m_queue.enqueue( new TQString( TQString( "%1:" ).arg( Import ) ) ); m_priv->timerTicks = 0; } } @@ -1663,9 +1663,9 @@ void Smb4KMounter::slotShutdown() if ( Smb4KSettings::alwaysUseSuperUser() ) { #ifndef __FreeBSD__ - command.append( TQString( "%1 smb4k_umount -s -t %2 " ).tqarg( suid_program ).tqarg( (*it)->filesystem() ) ); + command.append( TQString( "%1 smb4k_umount -s -t %2 " ).arg( suid_program ).arg( (*it)->filesystem() ) ); #else - command.append( TQString( "%1 smb4k_umount " ).tqarg( suid_program ) ); + command.append( TQString( "%1 smb4k_umount " ).arg( suid_program ) ); #endif command.append( KProcess::quote( (*it)->path() ) ); command.append( " ; " ); @@ -1673,7 +1673,7 @@ void Smb4KMounter::slotShutdown() else { #ifndef __FreeBSD__ - command.append( TQString( "smb4k_umount -n -t %1 " ).tqarg( (*it)->filesystem() ) ); + command.append( TQString( "smb4k_umount -n -t %1 " ).arg( (*it)->filesystem() ) ); #else command.append( "smb4k_umount " ); #endif |