@ -234,12 +234,12 @@ bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
{
{
// Find the beginning and the end of the entries in
// Find the beginning and the end of the entries in
// the sudoers file:
// the sudoers file:
TQStringList : : Iterator begin = contents . tq find( " # Entries for Smb4K users. " ) ;
TQStringList : : Iterator begin = contents . find( " # Entries for Smb4K users. " ) ;
TQStringList : : Iterator end = contents . tq find( " # End of Smb4K user entries. " ) ;
TQStringList : : Iterator end = contents . find( " # End of Smb4K user entries. " ) ;
for ( TQStringList : : Iterator it = begin ; it ! = end ; + + it )
for ( TQStringList : : Iterator it = begin ; it ! = end ; + + it )
{
{
if ( ( * it ) . startsWith ( " User_Alias \t SMB4KUSERS " ) & & ( * it ) . tq contains( getpwuid ( getuid ( ) ) - > pw_name , true ) = = 0 )
if ( ( * it ) . startsWith ( " User_Alias \t SMB4KUSERS " ) & & ( * it ) . contains( getpwuid ( getuid ( ) ) - > pw_name , true ) = = 0 )
{
{
( * it ) . append ( " , " + TQString ( getpwuid ( getuid ( ) ) - > pw_name ) ) ;
( * it ) . append ( " , " + TQString ( getpwuid ( getuid ( ) ) - > pw_name ) ) ;
@ -260,8 +260,8 @@ bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
{
{
// Find the beginning and the end of the entries in
// Find the beginning and the end of the entries in
// the sudoers file:
// the sudoers file:
TQStringList : : Iterator begin = contents . tq find( " # Entries for Smb4K users. " ) ;
TQStringList : : Iterator begin = contents . find( " # Entries for Smb4K users. " ) ;
TQStringList : : Iterator end = contents . tq find( " # End of Smb4K user entries. " ) ;
TQStringList : : Iterator end = contents . find( " # End of Smb4K user entries. " ) ;
// Now, check if the user is in the list of users. If he is,
// Now, check if the user is in the list of users. If he is,
// remove him from there or remove all if he is the only one:
// remove him from there or remove all if he is the only one:
@ -271,7 +271,7 @@ bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
{
{
TQString users = ( * it ) . section ( " = " , 1 , 1 ) . stripWhiteSpace ( ) ;
TQString users = ( * it ) . section ( " = " , 1 , 1 ) . stripWhiteSpace ( ) ;
if ( users . tq contains( " , " ) = = 0 )
if ( users . contains( " , " ) = = 0 )
{
{
// In this case, there is only one user in the list. Check if
// In this case, there is only one user in the list. Check if
// it is the user who requested the removal:
// it is the user who requested the removal:
@ -298,7 +298,7 @@ bool Smb4KFileIO::writeSudoers( Smb4KFileIO::Operation operation )
TQStringList list = TQStringList : : split ( " , " , users , false ) ;
TQStringList list = TQStringList : : split ( " , " , users , false ) ;
list . remove ( getpwuid ( getuid ( ) ) - > pw_name ) ;
list . remove ( getpwuid ( getuid ( ) ) - > pw_name ) ;
( * it ) . tq replace( users , list . join ( " , " ) ) ;
( * it ) . replace( users , list . join ( " , " ) ) ;
write = true ;
write = true ;
@ -587,12 +587,12 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
{
{
// Find the beginning and the end of the entries in
// Find the beginning and the end of the entries in
// the super.tab file:
// the super.tab file:
TQStringList : : Iterator begin = contents . tq find( " # Entries for Smb4K users. " ) ;
TQStringList : : Iterator begin = contents . find( " # Entries for Smb4K users. " ) ;
TQStringList : : Iterator end = contents . tq find( " # End of Smb4K user entries. " ) ;
TQStringList : : Iterator end = contents . find( " # End of Smb4K user entries. " ) ;
for ( TQStringList : : Iterator it = begin ; it ! = end ; + + it )
for ( TQStringList : : Iterator it = begin ; it ! = end ; + + it )
{
{
if ( ( * it ) . startsWith ( " :define Smb4KUsers " ) & & ( * it ) . tq contains( getpwuid ( getuid ( ) ) - > pw_name , true ) = = 0 )
if ( ( * it ) . startsWith ( " :define Smb4KUsers " ) & & ( * it ) . contains( getpwuid ( getuid ( ) ) - > pw_name , true ) = = 0 )
{
{
( * it ) . append ( " , " + TQString ( getpwuid ( getuid ( ) ) - > pw_name ) ) ;
( * it ) . append ( " , " + TQString ( getpwuid ( getuid ( ) ) - > pw_name ) ) ;
@ -613,8 +613,8 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
{
{
// Find the beginning and the end of the entries in
// Find the beginning and the end of the entries in
// the super.tab file:
// the super.tab file:
TQStringList : : Iterator begin = contents . tq find( " # Entries for Smb4K users. " ) ;
TQStringList : : Iterator begin = contents . find( " # Entries for Smb4K users. " ) ;
TQStringList : : Iterator end = contents . tq find( " # End of Smb4K user entries. " ) ;
TQStringList : : Iterator end = contents . find( " # End of Smb4K user entries. " ) ;
// Now, check if the user is in the list of users. If he is,
// Now, check if the user is in the list of users. If he is,
// remove him from there or remove all if he is the only one:
// remove him from there or remove all if he is the only one:
@ -624,7 +624,7 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
{
{
TQString users = ( * it ) . section ( " Smb4KUsers " , 1 , 1 ) . stripWhiteSpace ( ) ;
TQString users = ( * it ) . section ( " Smb4KUsers " , 1 , 1 ) . stripWhiteSpace ( ) ;
if ( users . tq contains( " , " ) = = 0 )
if ( users . contains( " , " ) = = 0 )
{
{
// In this case, there is only one user in the list. Check if
// In this case, there is only one user in the list. Check if
// it is the user who requested the removal:
// it is the user who requested the removal:
@ -651,7 +651,7 @@ bool Smb4KFileIO::writeSuperTab( Smb4KFileIO::Operation operation )
TQStringList list = TQStringList : : split ( " , " , users , false ) ;
TQStringList list = TQStringList : : split ( " , " , users , false ) ;
list . remove ( getpwuid ( getuid ( ) ) - > pw_name ) ;
list . remove ( getpwuid ( getuid ( ) ) - > pw_name ) ;
( * it ) . tq replace( users , list . join ( " , " ) ) ;
( * it ) . replace( users , list . join ( " , " ) ) ;
write = true ;
write = true ;
@ -1237,12 +1237,12 @@ void Smb4KFileIO::processSudoers()
{
{
// Find the beginning and the end of the entries in
// Find the beginning and the end of the entries in
// the sudoers file:
// the sudoers file:
TQStringList : : Iterator begin = contents . tq find( " # Entries for Smb4K users. " ) ;
TQStringList : : Iterator begin = contents . find( " # Entries for Smb4K users. " ) ;
TQStringList : : Iterator end = contents . tq find( " # End of Smb4K user entries. " ) ;
TQStringList : : Iterator end = contents . find( " # End of Smb4K user entries. " ) ;
for ( TQStringList : : Iterator it = begin ; it ! = end ; + + it )
for ( TQStringList : : Iterator it = begin ; it ! = end ; + + it )
{
{
if ( ( * it ) . startsWith ( " User_Alias \t SMB4KUSERS " ) & & ( * it ) . tq contains( getpwuid ( getuid ( ) ) - > pw_name , true ) = = 0 )
if ( ( * it ) . startsWith ( " User_Alias \t SMB4KUSERS " ) & & ( * it ) . contains( getpwuid ( getuid ( ) ) - > pw_name , true ) = = 0 )
{
{
( * it ) . append ( " , " + TQString ( getpwuid ( getuid ( ) ) - > pw_name ) ) ;
( * it ) . append ( " , " + TQString ( getpwuid ( getuid ( ) ) - > pw_name ) ) ;
@ -1263,8 +1263,8 @@ void Smb4KFileIO::processSudoers()
{
{
// Find the beginning and the end of the entries in
// Find the beginning and the end of the entries in
// the sudoers file:
// the sudoers file:
TQStringList : : Iterator begin = contents . tq find( " # Entries for Smb4K users. " ) ;
TQStringList : : Iterator begin = contents . find( " # Entries for Smb4K users. " ) ;
TQStringList : : Iterator end = contents . tq find( " # End of Smb4K user entries. " ) ;
TQStringList : : Iterator end = contents . find( " # End of Smb4K user entries. " ) ;
// Now, check if the user is in the list of users. If he is,
// Now, check if the user is in the list of users. If he is,
// remove him from there or remove all if he is the only one:
// remove him from there or remove all if he is the only one:
@ -1274,7 +1274,7 @@ void Smb4KFileIO::processSudoers()
{
{
TQString users = ( * it ) . section ( " = " , 1 , 1 ) . stripWhiteSpace ( ) ;
TQString users = ( * it ) . section ( " = " , 1 , 1 ) . stripWhiteSpace ( ) ;
if ( users . tq contains( " , " ) = = 0 )
if ( users . contains( " , " ) = = 0 )
{
{
// In this case, there is only one user in the list. Check if
// In this case, there is only one user in the list. Check if
// it is the user who requested the removal:
// it is the user who requested the removal:
@ -1301,7 +1301,7 @@ void Smb4KFileIO::processSudoers()
TQStringList list = TQStringList : : split ( " , " , users , false ) ;
TQStringList list = TQStringList : : split ( " , " , users , false ) ;
list . remove ( getpwuid ( getuid ( ) ) - > pw_name ) ;
list . remove ( getpwuid ( getuid ( ) ) - > pw_name ) ;
( * it ) . tq replace( users , list . join ( " , " ) ) ;
( * it ) . replace( users , list . join ( " , " ) ) ;
write = true ;
write = true ;
@ -1500,12 +1500,12 @@ void Smb4KFileIO::processSuperTab()
{
{
// Find the beginning and the end of the entries in
// Find the beginning and the end of the entries in
// the super.tab file:
// the super.tab file:
TQStringList : : Iterator begin = contents . tq find( " # Entries for Smb4K users. " ) ;
TQStringList : : Iterator begin = contents . find( " # Entries for Smb4K users. " ) ;
TQStringList : : Iterator end = contents . tq find( " # End of Smb4K user entries. " ) ;
TQStringList : : Iterator end = contents . find( " # End of Smb4K user entries. " ) ;
for ( TQStringList : : Iterator it = begin ; it ! = end ; + + it )
for ( TQStringList : : Iterator it = begin ; it ! = end ; + + it )
{
{
if ( ( * it ) . startsWith ( " :define Smb4KUsers " ) & & ( * it ) . tq contains( getpwuid ( getuid ( ) ) - > pw_name , true ) = = 0 )
if ( ( * it ) . startsWith ( " :define Smb4KUsers " ) & & ( * it ) . contains( getpwuid ( getuid ( ) ) - > pw_name , true ) = = 0 )
{
{
( * it ) . append ( " , " + TQString ( getpwuid ( getuid ( ) ) - > pw_name ) ) ;
( * it ) . append ( " , " + TQString ( getpwuid ( getuid ( ) ) - > pw_name ) ) ;
@ -1526,8 +1526,8 @@ void Smb4KFileIO::processSuperTab()
{
{
// Find the beginning and the end of the entries in
// Find the beginning and the end of the entries in
// the super.tab file:
// the super.tab file:
TQStringList : : Iterator begin = contents . tq find( " # Entries for Smb4K users. " ) ;
TQStringList : : Iterator begin = contents . find( " # Entries for Smb4K users. " ) ;
TQStringList : : Iterator end = contents . tq find( " # End of Smb4K user entries. " ) ;
TQStringList : : Iterator end = contents . find( " # End of Smb4K user entries. " ) ;
// Now, check if the user is in the list of users. If he is,
// Now, check if the user is in the list of users. If he is,
// remove him from there or remove all if he is the only one:
// remove him from there or remove all if he is the only one:
@ -1537,7 +1537,7 @@ void Smb4KFileIO::processSuperTab()
{
{
TQString users = ( * it ) . section ( " Smb4KUsers " , 1 , 1 ) . stripWhiteSpace ( ) ;
TQString users = ( * it ) . section ( " Smb4KUsers " , 1 , 1 ) . stripWhiteSpace ( ) ;
if ( users . tq contains( " , " ) = = 0 )
if ( users . contains( " , " ) = = 0 )
{
{
// In this case, there is only one user in the list. Check if
// In this case, there is only one user in the list. Check if
// it is the user who requested the removal:
// it is the user who requested the removal:
@ -1564,7 +1564,7 @@ void Smb4KFileIO::processSuperTab()
TQStringList list = TQStringList : : split ( " , " , users , false ) ;
TQStringList list = TQStringList : : split ( " , " , users , false ) ;
list . remove ( getpwuid ( getuid ( ) ) - > pw_name ) ;
list . remove ( getpwuid ( getuid ( ) ) - > pw_name ) ;
( * it ) . tq replace( users , list . join ( " , " ) ) ;
( * it ) . replace( users , list . join ( " , " ) ) ;
write = true ;
write = true ;
@ -1708,7 +1708,7 @@ void Smb4KFileIO::slotReceivedStderr( KProcess *, char *buf, int len )
{
{
TQString error_output = TQString : : fromLocal8Bit ( buf , len ) ;
TQString error_output = TQString : : fromLocal8Bit ( buf , len ) ;
if ( error_output . tq contains( " smb4k_mv " ) ! = 0 )
if ( error_output . contains( " smb4k_mv " ) ! = 0 )
{
{
m_error_occurred = true ;
m_error_occurred = true ;
@ -1721,7 +1721,7 @@ void Smb4KFileIO::slotReceivedStderr( KProcess *, char *buf, int len )
removeLockFile ( ) ;
removeLockFile ( ) ;
}
}
else if ( error_output . tq contains( " smb4k_cat " ) ! = 0 )
else if ( error_output . contains( " smb4k_cat " ) ! = 0 )
{
{
m_error_occurred = true ;
m_error_occurred = true ;