[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim
From:       Andreas Hartmetz <ahartmetz () gmail ! com>
Date:       2008-01-17 19:37:20
Message-ID: 1200598640.354840.26756.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 762736 by ahartmetz:

Recorded merge of revisions \
729661-731333,731335-731356,731358-731361,731363-731652,731654-731669,731671-731690,73 \
1692-731700,731702-731715,731717-731719,731721-731734,731736-731867,731869-731870,7318 \
72-732022,732024-732421,732423-732439,732441-732793,732795-733047,733050-733088,733090 \
-733100,733102-733148,733150-733158,733160-733463,733466-733468,733470-733482,733484-7 \
33494,733496-733510,733512-733518,733520-733685,733687,733689-733875,733877-733882,733 \
884-734241,734243-734246,734248-734272,734274-734534,734536,734538-734579,734582,73458 \
6-734591,734593-734733,734735-735174,735176-735204,735206-735246,735248-735280,735283- \
735286,735288-735300,735302-735683,735685-736198,736200-736232,736235-736242,736244-73 \
6314,736316-736376,736378,736380-736390,736392-737034,737036-737071,737073-737092,7370 \
94-737468,737470,737472-737483,737485-737489,737492-737495,737497-738628,738630-739062 \
,739064-739068,739070-739113,739115-739134,739136-739156,739158-739602,739604-739669,739671-739688,739
  690-739993,739995-740022,740024-740109,740111-740116,740118-740147,740149-740152,740 \
154-740441,740443-740446,740448-740459,740461-740471,740473-740475,740478-740487,74048 \
9-740519,740521-740528,740530-740535,740537-740574,740576-740588,740591-740607,740609- \
741781,741783-741805,741807-741832,741834-741901,741903-742150,742152-742213,742216-74 \
2229,742231-742288,742290-742291,742293,742296-742602,742604-742670,742673-742986,7429 \
88-742990,742994-742999,743001,743004,743006-743010,743012-743019,743021-743022,743024 \
-743025,743027-743883,743885-743887,743889-744004,744006-744045,744047-744086,744088-7 \
44091,744093-744109,744111-744675,744678-744688,744690-744692,744694-744707,744709-745 \
805,745808-745812,745815-746844,746846-746872,746875-746896,746898-746924,746926-74693 \
1,746933-746978,746980-747181,747183-747317,747319-747339,747341-747511,747513-747517, \
747519-747583,747585-747587,747589-747591,747593-747597,747599-747621,747623-747640,747642-747791,747793-747970,747972-748004 \
via s  vnmerge from 
svn+ssh://ahartmetz@svn.kde.org/home/kde/branches/kdepim/enterprise/kdepim

........
  r729661 | tilladam | 2007-10-26 17:04:54 +0200 (Fr, 26 Okt 2007) | 4 lines
  
  Allow attachments to be dragged out of composers.
  
  Prokde35-z Item 201.
........
  r748004 | vkrause | 2007-12-13 11:46:15 +0100 (Do, 13 Dez 2007) | 2 lines
  
  Handle URL drags correctly.
........


 _M            . (directory)  
 M  +9 -3      kmail/attachmentlistview.cpp  
 M  +2 -0      kmail/attachmentlistview.h  
 M  +45 -4     kmail/kmcomposewin.cpp  
 M  +2 -0      kmail/kmcomposewin.h  


** trunk/KDE/kdepim #property svnmerge-integrated
   - /branches/kdepim/enterprise/kdepim:1-708704,708706,708741,708749,708854,709032-70 \
9084,709134,710606-710610,711603-711604,711623,712056,714358,715112,715206-715217,7152 \
19-715232,715234-716226,716228-716287,716289-716299,716302-716375,716377-716392,716394 \
-716414,716416-716437,716439-716475,716477-716776,716779-716881,716883-716899,716901-7 \
16903,716933-717190,717192-717213,717215-717251,717253,717255-717263,717265-717284,717 \
287-717291,717294,717296-717303,717305-717312,717314-717317,717319-718340,718342-71850 \
5,718507-721121,721123-721406,721408-721424,721426-723030,723032-724381,724383-724384, \
724386-724443,724445-724768,724770-727625,727627-728016,728018-728089,728091-728450,72 \
8452-728558,728560-728580,728582-728814,728816-729239,729241-729283,729285-729580,7295 \
83-729660,729662-731333,731335-731356,731358-731361,731363-731669,731671-731700,731702 \
-731719,731721-731734,731736-731867,731869-731870,731872-732022,732024-732421,732423-733047,733050-733088,733090-733100,733102-733
  148,733150-733463,733466-733468,733470-733482,733484-733685,733687,733689-733875,733 \
877-734534,734536,734538-734579,734582,734586-734591,734593-734733,734735-735174,73517 \
6-735204,735206-735246,735248-735280,735283-735286,735288-735300,735302-736198,736200- \
736232,736235-736242,736244-736314,736316-736376,736378,736380-736390,736392-737071,73 \
7073-737092,737094-737483,737485-737489,737492-737495,737497-739062,739064-739134,7391 \
36-739156,739158-739602,739604-739688,739690-739993,739995-740022,740024-740109,740111 \
-740116,740118-740147,740149-740152,740154-740441,740443-740446,740448-740459,740461-7 \
40471,740473-740475,740478-740487,740489-740519,740521-740528,740530-740535,740537-740 \
574,740576-740588,740591-740607,740609-741781,741783-741805,741807-741832,741834-74190 \
1,741903-742150,742152-742213,742216-742229,742231-742288,742290-742291,742293,742296- \
742602,742604-742670,742673-742986,742988-742990,742994-742999,743001,743004,743006-743010,743012-743019,743021-743022,743024-74302
  5,743027-743887,743889-744004,744006-744086,744088-744091,744093-744109,744111-74467 \
5,744678-744692,744694-744707,744709-745805,745808-745812,745815-746844,746846-746872, \
746875-746896,746898-746924,746926-746931,746933-746978,746980-747511,747513-747517,74 \
7519-747583,747585-747587,747589-747591,747593-747597,747599-747621,747623-747640,7476 \
42-747791,747793-748003,748005-748349,748351-748424,748426-748496,748498-748500,748502 \
-748528,748530-750092,750094-750561,750564-750566,750568-750610,750904-750920,758955,762653 \
/branches/work/kdab-post-4.0/kdepim:1-706050,708721,708760,709048,711609,717175,717749
  + /branches/kdepim/enterprise/kdepim:1-708704,708706,708741,708749,708854,709032-709 \
084,709134,710606-710610,711603-711604,711623,712056,714358,715112,715206-715217,71521 \
9-715232,715234-716226,716228-716287,716289-716299,716302-716375,716377-716392,716394- \
716414,716416-716437,716439-716475,716477-716776,716779-716881,716883-716899,716901-71 \
6903,716933-717190,717192-717213,717215-717251,717253,717255-717263,717265-717284,7172 \
87-717291,717294,717296-717303,717305-717312,717314-717317,717319-718340,718342-718505 \
,718507-721121,721123-721406,721408-721424,721426-723030,723032-724381,724383-724384,7 \
24386-724443,724445-724768,724770-727625,727627-728016,728018-728089,728091-728450,728 \
452-728558,728560-728580,728582-728814,728816-729239,729241-729283,729285-729580,72958 \
3-731333,731335-731356,731358-731361,731363-731669,731671-731700,731702-731719,731721- \
731734,731736-731867,731869-731870,731872-732022,732024-732421,732423-733047,733050-733088,733090-733100,733102-733148,733150-733
  463,733466-733468,733470-733482,733484-733685,733687,733689-733875,733877-734534,734 \
536,734538-734579,734582,734586-734591,734593-734733,734735-735174,735176-735204,73520 \
6-735246,735248-735280,735283-735286,735288-735300,735302-736198,736200-736232,736235- \
736242,736244-736314,736316-736376,736378,736380-736390,736392-737071,737073-737092,73 \
7094-737483,737485-737489,737492-737495,737497-739062,739064-739134,739136-739156,7391 \
58-739602,739604-739688,739690-739993,739995-740022,740024-740109,740111-740116,740118 \
-740147,740149-740152,740154-740441,740443-740446,740448-740459,740461-740471,740473-7 \
40475,740478-740487,740489-740519,740521-740528,740530-740535,740537-740574,740576-740 \
588,740591-740607,740609-741781,741783-741805,741807-741832,741834-741901,741903-74215 \
0,742152-742213,742216-742229,742231-742288,742290-742291,742293,742296-742602,742604- \
742670,742673-742986,742988-742990,742994-742999,743001,743004,743006-743010,743012-743019,743021-743022,743024-743025,743027-74388
  7,743889-744004,744006-744086,744088-744091,744093-744109,744111-744675,744678-74469 \
2,744694-744707,744709-745805,745808-745812,745815-746844,746846-746872,746875-746896, \
746898-746924,746926-746931,746933-746978,746980-747511,747513-747517,747519-747583,74 \
7585-747587,747589-747591,747593-747597,747599-747621,747623-747640,747642-747791,7477 \
93-748349,748351-748424,748426-748496,748498-748500,748502-748528,748530-750092,750094-750561,750564-750566,750568-750610,750904-750920,758955,762653 \
/branches/work/kdab-post-4.0/kdepim:1-706050,708721,708760,709048,711609,717175,717749
                
--- trunk/KDE/kdepim/kmail/attachmentlistview.cpp #762735:762736
@@ -39,6 +39,7 @@
     mComposer( composer )
 {
   setAcceptDrops( true );
+  setDragEnabled( true );  //H4X artifact of porting, revise!
   setObjectName( "attachment list view" );
   setSelectionMode( QAbstractItemView::ExtendedSelection );
   setIndentation( 0 );
@@ -157,7 +158,8 @@
 
 void AttachmentListView::dragEnterEvent( QDragEnterEvent* e )
 {
-  if( KPIM::MailList::canDecode( e->mimeData() ) )
+  KUrl::List uriList = KUrl::List::fromMimeData( e->mimeData() );
+  if( KPIM::MailList::canDecode( e->mimeData() ) || !uriList.isEmpty() )
     e->setAccepted( true );
   else
     QTreeWidget::dragEnterEvent( e );
@@ -167,7 +169,8 @@
 
 void AttachmentListView::dragMoveEvent( QDragMoveEvent* e )
 {
-  if( KPIM::MailList::canDecode( e->mimeData() ) )
+  KUrl::List uriList = KUrl::List::fromMimeData( e->mimeData() );
+  if( KPIM::MailList::canDecode( e->mimeData() ) || !uriList.isEmpty() )
     e->setAccepted( true );
   else
     QTreeWidget::dragMoveEvent( e );
@@ -228,7 +231,10 @@
   }
 }
 
-//-----------------------------------------------------------------------------
+void AttachmentListView::startDrag( Qt::DropActions supportedActions )
+{
+  emit dragStarted();
+}
 
 void AttachmentListView::contextMenuEvent( QContextMenuEvent* event )
 {
--- trunk/KDE/kdepim/kmail/attachmentlistview.h #762735:762736
@@ -46,6 +46,7 @@
 protected:
   virtual void keyPressEvent( QKeyEvent * e );
   virtual void contextMenuEvent( QContextMenuEvent * event );
+  virtual void startDrag( Qt::DropActions supportedActions );
 
 private:
   KMail::Composer * mComposer;
@@ -56,6 +57,7 @@
 signals:
   void attachmentDeleted();
   void rightButtonPressed( QTreeWidgetItem * item );
+  void dragStarted();
 };
 
 } // namespace KMail
--- trunk/KDE/kdepim/kmail/kmcomposewin.cpp #762735:762736
@@ -96,8 +96,10 @@
 #include <krun.h>
 #include <ksavefile.h>
 #include <kshortcutsdialog.h>
+#include <kstandarddirs.h>
 #include <kstandardshortcut.h>
 #include <kstatusbar.h>
+#include <ktempdir.h>
 #include <ktoggleaction.h>
 #include <ktoolbar.h>
 #include <ktoolinvocation.h>
@@ -255,6 +257,9 @@
   connect( mAtmListView,
            SIGNAL(attachmentDeleted()),
            SLOT(slotAttachRemove()) );
+  connect( mAtmListView,
+           SIGNAL( dragStarted() ),
+           SLOT( slotAttachmentDragStarted() ) );
   mAttachMenu = 0;
 
   readConfig();
@@ -340,6 +345,10 @@
 
   qDeleteAll( mAtmList );
   qDeleteAll( mAtmTempList );
+
+  foreach ( KTempDir *const dir, mTempDirs ) {
+    delete dir;
+  }
 }
 
 
@@ -2086,8 +2095,8 @@
   }
 
   const int maxAttachmentSize = GlobalSettings::maximumAttachmentSize();
-  if ( maxAttachmentSize > 0 &&
-       aUrl.isLocalFile() && QFileInfo( aUrl.pathOrUrl() ).size() > \
maxAttachmentSize*1024*1024 ) { +  const uint maximumAttachmentSizeInBytes = \
maxAttachmentSize*1024*1024; +  if ( aUrl.isLocalFile() && QFileInfo( \
                aUrl.pathOrUrl() ).size() > maximumAttachmentSizeInBytes ) {
     KMessageBox::sorry( this, i18n( "<qt><p>Your administrator has disallowed \
attaching files bigger than %1 MB.</p>", maxAttachmentSize ) );  return false;
   }
@@ -2735,7 +2744,7 @@
   if ( array.size() >= decoded.size() ) {
     if ( KMessageBox::questionYesNo( this,
                                      i18n( "The compressed file is larger "
-                                          "than the original. Do you want to keep \
the original one?" ), +                                           "than the original. \
Do you want to keep the original one?" ),  QString(),
                                      KGuiItem( i18nc("Do not compress", "Keep") ),
                                      KGuiItem( i18n("Compress") ) ) == \
KMessageBox::Yes ) { @@ -2925,7 +2934,7 @@
   atmTempFile->open();
   mAtmTempList.append( atmTempFile );
   KPIMUtils::kByteArrayToFile( msgPart->bodyDecodedBinary(), \
                atmTempFile->fileName(),
-                          false, false, false );
+                               false, false, false );
   KMReaderMainWin *win =
     new KMReaderMainWin( msgPart, false, atmTempFile->fileName(), pname, mCharset );
   win->show();
@@ -4503,3 +4512,35 @@
     }
   }
 }
+
+void KMComposeWin::slotAttachmentDragStarted()
+{
+  kDebug(5006);
+  int idx = 0;
+  QList<QUrl> urls;
+  foreach ( KMAtmListViewItem *const item, mAtmItemList ) {
+    if ( item->isSelected() ) {
+      KMMessagePart *msgPart = mAtmList.at( idx );
+      KTempDir *tempDir = new KTempDir(); // will remove the directory on \
destruction +      mTempDirs.append( tempDir );
+      const QString fileName = tempDir->name() + '/' + msgPart->name();
+      KPIMUtils::kByteArrayToFile( msgPart->bodyDecodedBinary(),
+                                   fileName,
+                                   false, false, false );
+      QUrl url;
+      url.setProtocol( "file" );
+      url.setPath( fileName );
+      urls.append( url );
+      idx++;
+    }
+  }
+  if ( urls.isEmpty() )
+    return;
+
+  QDrag *drag = new QDrag( mAtmListView );
+  QMimeData *mimeData = new QMimeData();
+  mimeData->setUrls( urls );
+  drag->setMimeData( mimeData );
+  drag->exec( Qt::CopyAction );
+}
+
--- trunk/KDE/kdepim/kmail/kmcomposewin.h #762735:762736
@@ -433,6 +433,7 @@
     void slotAttachRemove();
     void slotAttachSave();
     void slotAttachProperties();
+    void slotAttachmentDragStarted();
 
     void slotCleanSpace();
     void slotToggleMarkup();
@@ -851,6 +852,7 @@
     QMap<KMail::EditorWatcher*, KTemporaryFile*> mEditorTempFiles;
 
     SnippetWidget *mSnippetWidget;
+    QList<KTempDir*> mTempDirs;
 };
 
 #endif


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic