summaryrefslogtreecommitdiffabout
path: root/kmicromail
authorzautrix <zautrix>2004-10-18 09:08:13 (UTC)
committer zautrix <zautrix>2004-10-18 09:08:13 (UTC)
commit56990d318b15eacf7d3cc7425ab62f68da099ddf (patch) (unidiff)
treeb2f021bd75bc6a08fa8fc51a07ce1755b8e4a95e /kmicromail
parent1712d92ea25b220273859d985bc7211fa7a97a39 (diff)
downloadkdepimpi-56990d318b15eacf7d3cc7425ab62f68da099ddf.zip
kdepimpi-56990d318b15eacf7d3cc7425ab62f68da099ddf.tar.gz
kdepimpi-56990d318b15eacf7d3cc7425ab62f68da099ddf.tar.bz2
fix of tmp file path for desktop version
Diffstat (limited to 'kmicromail') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/viewmail.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp
index 6e560d7..32a3b7c 100644
--- a/kmicromail/viewmail.cpp
+++ b/kmicromail/viewmail.cpp
@@ -232,49 +232,53 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
232 { 232 {
233 case 0: 233 case 0:
234 { 234 {
235 //MimeTypes types; 235 //MimeTypes types;
236 //types.insert( "all", "*" ); 236 //types.insert( "all", "*" );
237 QString str = KFileDialog::getSaveFileName( "/", item->text( 2 ), this ); 237 QString str = KFileDialog::getSaveFileName( "/", item->text( 2 ), this );
238 238
239 if( !str.isEmpty() ) 239 if( !str.isEmpty() )
240 { 240 {
241 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); 241 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
242 if (content) 242 if (content)
243 { 243 {
244 QFile output(str); 244 QFile output(str);
245 output.open(IO_WriteOnly); 245 output.open(IO_WriteOnly);
246 output.writeBlock(content->Content(),content->Length()); 246 output.writeBlock(content->Content(),content->Length());
247 output.close(); 247 output.close();
248 delete content; 248 delete content;
249 } 249 }
250 } 250 }
251 } 251 }
252 break ; 252 break ;
253 253
254 case 2: 254 case 2:
255 { 255 {
256#ifdef DESKTOP_VERSION
257 QString tmpfile = locateLocal( "tmp", "opiemail-image");
258#else
256 QString tmpfile = "/tmp/opiemail-image"; 259 QString tmpfile = "/tmp/opiemail-image";
260#endif
257 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); 261 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
258 if (content) { 262 if (content) {
259 QFile output(tmpfile); 263 QFile output(tmpfile);
260 output.open(IO_WriteOnly); 264 output.open(IO_WriteOnly);
261 output.writeBlock(content->Content(),content->Length()); 265 output.writeBlock(content->Content(),content->Length());
262 output.close(); 266 output.close();
263 delete content; 267 delete content;
264 MailImageDlg iview(""); 268 MailImageDlg iview("");
265 iview.setName(tmpfile); 269 iview.setName(tmpfile);
266 KApplication::execDialog(&iview); 270 KApplication::execDialog(&iview);
267 output.remove(); 271 output.remove();
268 } 272 }
269 } 273 }
270 break; 274 break;
271 case 1: 275 case 1:
272 if ( ( ( AttachItem* )item )->Partnumber() == -1 ) 276 if ( ( ( AttachItem* )item )->Partnumber() == -1 )
273 { 277 {
274 setText(); 278 setText();
275 } 279 }
276 else 280 else
277 { 281 {
278 if ( m_recMail->Wrapper() != 0l ) 282 if ( m_recMail->Wrapper() != 0l )
279 { // make sure that there is a wrapper , even after delete or simular actions 283 { // make sure that there is a wrapper , even after delete or simular actions
280 browser->setText( m_recMail->Wrapper()->fetchTextPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) ); 284 browser->setText( m_recMail->Wrapper()->fetchTextPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) );