@ -168,18 +168,18 @@ void SendImages::run()
if ( ( m_sendImagesDialog - > m_comment2ImageName - > isChecked ( ) = = true ) & &
! commentItem . isEmpty ( ) )
{
qDebug( " commentItem: %s " , commentItem . ascii ( ) ) ;
t qDebug( " commentItem: %s " , commentItem . ascii ( ) ) ;
}
else
{
commentItem = ItemName . left ( ItemName . findRev ( ' . ' ) ) ;
qDebug( " commentItem is empty " ) ;
t qDebug( " commentItem is empty " ) ;
}
//TQString TempFileName = (*it).directory().section('/', -1);
TQString TempFileName = ( * it ) . path ( ) . section ( ' / ' , - 2 , - 2 ) + " / " + commentItem +
+ " . " + ( * it ) . path ( ) . section ( ' . ' , - 1 , - 1 ) ;
qDebug( " TempFileName: %s " , TempFileName . ascii ( ) ) ;
t qDebug( " TempFileName: %s " , TempFileName . ascii ( ) ) ;
// Thunderbird does not like (). Replace them, BUG:131343
@ -192,11 +192,11 @@ void SendImages::run()
//If TempFileName already exists, add a number oder increase number
if ( entry_already_exists ( m_filesSendList , m_tmp + TempFileName ) )
{
qDebug ( " I entered " ) ;
t qDebug ( " I entered " ) ;
TQString secondpart = ( m_tmp + TempFileName ) . section ( " . " , - 1 , - 1 ) ;
TQString firstpart =
( m_tmp + TempFileName ) . left ( ( m_tmp + TempFileName ) . length ( ) - secondpart . length ( ) - 1 ) ;
qDebug( " Firstpart: %s \n Secondpart: %s " , firstpart . ascii ( ) , secondpart . ascii ( ) ) ;
t qDebug( " Firstpart: %s \n Secondpart: %s " , firstpart . ascii ( ) , secondpart . ascii ( ) ) ;
//Add _integer value in the end and prove again
int int_index = 2 ;
TQString index = TQString : : number ( int_index , 10 ) ;
@ -204,7 +204,7 @@ void SendImages::run()
{
int_index + + ;
index = TQString : : number ( int_index , 10 ) ;
qDebug( " Index: %s " , index . ascii ( ) ) ;
t qDebug( " Index: %s " , index . ascii ( ) ) ;
}
TQString temp = firstpart + " _ " + index + " . " + secondpart ;
TempFileName = temp . right ( temp . length ( ) - m_tmp . length ( ) ) ;
@ -219,7 +219,7 @@ void SendImages::run()
//TQString imageNameFormat = TempFileName.replace(TQChar('.'), "_") +
// extension(m_imageFormat);
qDebug( " Resizing %s-> '%s %s ' (%s ; %d ) " , imageName . ascii ( ) ,
t qDebug( " Resizing %s-> '%s %s ' (%s ; %d ) " , imageName . ascii ( ) ,
m_tmp . ascii ( ) , TempFileName . ascii ( ) , m_imageFormat . ascii ( ) , m_sizeFactor ) ;
// Return value for resizeImageProcess-function, in order to avoid reopening
@ -260,7 +260,7 @@ void SendImages::run()
}
else
{
qWarning( " createThumb::No Exif Data Found " ) ;
t qWarning( " createThumb::No Exif Data Found " ) ;
}
d = new KIPISendimagesPlugin : : EventData ;
@ -418,21 +418,21 @@ KURL::List SendImages::divideEmails(void)
for ( KURL : : List : : Iterator it = m_filesSendList . begin ( ) ; it ! = m_filesSendList . end ( ) ; + + it )
{
qDebug( " m_attachmentlimit: %lu " , m_attachmentlimit ) ;
t qDebug( " m_attachmentlimit: %lu " , m_attachmentlimit ) ;
TQString imageName = ( * it ) . path ( ) ;
qDebug( " Imagename: %s " , imageName . ascii ( ) ) ;
t qDebug( " Imagename: %s " , imageName . ascii ( ) ) ;
TQFile file ( imageName ) ;
qDebug( " filesize: %lu " , file . size ( ) ) ;
t qDebug( " filesize: %lu " , file . size ( ) ) ;
if ( ( mylistsize + file . size ( ) ) < = m_attachmentlimit )
{
mylistsize + = file . size ( ) ;
sendnow . append ( * it ) ;
qDebug( " mylistsize: %lu; attachmentlimit: %lu " , mylistsize , m_attachmentlimit ) ;
t qDebug( " mylistsize: %lu; attachmentlimit: %lu " , mylistsize , m_attachmentlimit ) ;
}
else
{
qDebug( " file %s is out of %lu " , imageName . ascii ( ) , m_attachmentlimit ) ;
t qDebug( " file %s is out of %lu " , imageName . ascii ( ) , m_attachmentlimit ) ;
filesSendList . append ( * it ) ;
}
}
@ -450,13 +450,13 @@ bool SendImages::invokeMailAgent(void)
KURL : : List filelist ;
kurllistdeepcopy ( m_filesSendList_copy , m_filesSendList ) ;
qDebug( " invokeMailagent1: Number of elements in m_filesSendList=%d, and in m_filesSendList_copy=%d) " , ( int ) m_filesSendList . size ( ) , ( int ) m_filesSendList_copy . size ( ) ) ;
t qDebug( " invokeMailagent1: Number of elements in m_filesSendList=%d, and in m_filesSendList_copy=%d) " , ( int ) m_filesSendList . size ( ) , ( int ) m_filesSendList_copy . size ( ) ) ;
while ( ! ( ( filelist = divideEmails ( ) ) . empty ( ) ) )
{
qDebug( " invokeMailagent2: Number of elements in m_filesSendList=%d, and in m_filesSendList_copy=%d) " , ( int ) m_filesSendList . size ( ) , ( int ) m_filesSendList_copy . size ( ) ) ;
qDebug( " number of elements in filelist %d " , ( int ) filelist . size ( ) ) ;
qDebug( " number of elements in m_filelist %d " , ( int ) m_filesSendList . size ( ) ) ;
t qDebug( " invokeMailagent2: Number of elements in m_filesSendList=%d, and in m_filesSendList_copy=%d) " , ( int ) m_filesSendList . size ( ) , ( int ) m_filesSendList_copy . size ( ) ) ;
t qDebug( " number of elements in filelist %d " , ( int ) filelist . size ( ) ) ;
t qDebug( " number of elements in m_filelist %d " , ( int ) m_filesSendList . size ( ) ) ;
if ( m_sendImagesDialog - > m_mailAgentName - > currentText ( ) = = " Default " )
{
KApplication : : kApplication ( ) - > invokeMailer (
@ -587,7 +587,7 @@ bool SendImages::invokeMailAgent(void)
else if ( m_sendImagesDialog - > m_mailAgentName - > currentText ( ) = = " Thunderbird " )
{
* m_mailAgentProc < < m_thunderbirdUrl < < " -remote " ;
qDebug( " URL: %s " , m_thunderbirdUrl . ascii ( ) ) ;
t qDebug( " URL: %s " , m_thunderbirdUrl . ascii ( ) ) ;
}
else if ( m_sendImagesDialog - > m_mailAgentName - > currentText ( ) = = " GmailAgent " )
{
@ -621,7 +621,7 @@ bool SendImages::invokeMailAgent(void)
connect ( m_mailAgentProc , TQT_SIGNAL ( receivedStderr ( KProcess * , char * , int ) ) ,
this , TQT_SLOT ( slotMozillaReadStderr ( KProcess * , char * , int ) ) ) ;
}
qDebug ( " %s " , Temp . ascii ( ) ) ;
t qDebug ( " %s " , Temp . ascii ( ) ) ;
if ( m_mailAgentProc - > start ( KProcess : : NotifyOnExit , KProcess : : All ) = = false )
KMessageBox : : error ( TQT_TQWIDGET ( kapp - > activeWindow ( ) ) ,
@ -756,8 +756,8 @@ bool SendImages::copyImageProcess(const TQString &oldFilePath, const TQString &D
const TQString & ImageName )
{
//same file, no need to copy
qDebug( " DestPath: %s " , ( DestPath ) . ascii ( ) ) ;
qDebug( " ImageName: %s " , ( ImageName ) . ascii ( ) ) ;
t qDebug( " DestPath: %s " , ( DestPath ) . ascii ( ) ) ;
t qDebug( " ImageName: %s " , ( ImageName ) . ascii ( ) ) ;
if ( oldFilePath . compare ( DestPath + ImageName ) = = 0 )
return true ;
@ -834,7 +834,7 @@ bool SendImages::resizeImageProcess(const TQString &SourcePath, const TQString &
if ( scaleImg . width ( ) ! = w | | scaleImg . height ( ) ! = h )
{
qDebug ( " Resizing failed. Aborting. " ) ;
t qDebug ( " Resizing failed. Aborting. " ) ;
return false ;
}
@ -844,7 +844,7 @@ bool SendImages::resizeImageProcess(const TQString &SourcePath, const TQString &
if ( ! img . save ( DestPath + ImageName , ImageFormat . latin1 ( ) , ImageCompression ) )
{
qDebug( " Saving failed with specific compression value. Aborting. " ) ;
t qDebug( " Saving failed with specific compression value. Aborting. " ) ;
return false ;
}
@ -858,13 +858,13 @@ bool SendImages::resizeImageProcess(const TQString &SourcePath, const TQString &
wait 5 seconds and start SlotMozillaTimeout ( ) */
void SendImages : : slotMozillaExited ( KProcess * )
{
qDebug( " slotMozillaExited " ) ;
t qDebug( " slotMozillaExited " ) ;
///Here would be the right point to clear the sendlist in order to avoid infinite resendings!!
m_filesSendList . clear ( ) ;
///Also disconnect SLOT
m_mailAgentProc - > disconnect ( TQT_SIGNAL ( processExited ( KProcess * ) ) , this , TQT_SLOT ( slotMozillaExited ( KProcess * ) ) ) ;
qDebug( " Number of elements in m_filesSendList=%d, and in m_filesSendList_copy=%d) " , ( int ) m_filesSendList . size ( ) , ( int ) m_filesSendList_copy . size ( ) ) ;
t qDebug( " Number of elements in m_filesSendList=%d, and in m_filesSendList_copy=%d) " , ( int ) m_filesSendList . size ( ) , ( int ) m_filesSendList_copy . size ( ) ) ;
if ( m_mozillaStdErr . find ( " No running window found " ) ! = - 1 ) // No remote Mozilla | Netscape |
{ // Thunderbird env. loaded !
m_mailAgentProc2 = new KProcess ; // Init a new env.
@ -902,7 +902,7 @@ void SendImages::slotMozillaTimeout(void)
{
m_mozillaTimer - > disconnect ( TQT_SIGNAL ( timeout ( ) ) , this , TQT_SLOT ( slotMozillaTimeout ( ) ) ) ;
qDebug( " slotMozillaTimeout: Number of elements in m_filesSendList=%d, and in m_filesSendList_copy=%d) " , ( int ) m_filesSendList . size ( ) , ( int ) m_filesSendList_copy . size ( ) ) ;
t qDebug( " slotMozillaTimeout: Number of elements in m_filesSendList=%d, and in m_filesSendList_copy=%d) " , ( int ) m_filesSendList . size ( ) , ( int ) m_filesSendList_copy . size ( ) ) ;
kurllistdeepcopy ( m_filesSendList , m_filesSendList_copy ) ;
invokeMailAgent ( ) ;
@ -918,26 +918,26 @@ void SendImages::slotMozillaReadStderr(KProcess*, char *buffer, int buflen)
bool SendImages : : kurllistdeepcopy ( KURL : : List & Destination , KURL : : List Source )
{
Destination . clear ( ) ;
qDebug( " kurllistdeepcopy started " ) ;
t qDebug( " kurllistdeepcopy started " ) ;
for ( KURL : : List : : Iterator it = Source . begin ( ) ; it ! = Source . end ( ) ; + + it )
{
//TQString Tempstring;
TQString Getstring = ( * it ) . path ( ) ;
TQString Tempstring = Getstring . copy ( ) ;
Destination . append ( Tempstring ) ;
qDebug( " %s " , Tempstring . ascii ( ) ) ;
t qDebug( " %s " , Tempstring . ascii ( ) ) ;
}
/*
qDebug( " deepcopytest " ) ;
t qDebug( " deepcopytest " ) ;
Source . clear ( ) ;
for ( KURL : : List : : Iterator it = Destination . begin ( ) ; it ! = Destination . end ( ) ; + + it )
{
qDebug( " %s " , ( * it ) . path ( ) . ascii ( ) ) ;
t qDebug( " %s " , ( * it ) . path ( ) . ascii ( ) ) ;
}
*/
qDebug( " kurllistdeepcopy ended \n " ) ;
t qDebug( " kurllistdeepcopy ended \n " ) ;
return true ;
}