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

List:       kde-commits
Subject:    kdebase
From:       David Faure <faure () kde ! org>
Date:       2004-09-01 20:21:07
Message-ID: 20040901202107.A9F23E75 () office ! kde ! org
[Download RAW message or body]

CVS commit by faure: 

Make Antonio happy by implementing his suggestion: show an informative \
message in the statusbar when trying to drop something onto a readonly \
directory.


  M +7 -3      konqueror/iconview/konq_iconview.cc   1.473
  M +1 -1      konqueror/iconview/konq_iconview.h   1.173
  M +2 -1      libkonq/konq_iconviewwidget.cc   1.296
  M +1 -1      libkonq/konq_iconviewwidget.h   1.115


--- kdebase/libkonq/konq_iconviewwidget.cc  #1.295:1.296
@@ -1236,4 +1236,5 @@ void KonqIconViewWidget::contentsDragEnt
     if ( m_rootItem && !m_rootItem->isWritable() ) {
         e->ignore();
+        emit dragEntered( false );
         return;
     }
@@ -1251,5 +1252,5 @@ void KonqIconViewWidget::contentsDragEnt
     }
     KIconView::contentsDragEnterEvent( e );
-    emit dragEntered();
+    emit dragEntered( true /*accepted*/ );
 }
 

--- kdebase/libkonq/konq_iconviewwidget.h  #1.114:1.115
@@ -266,5 +266,5 @@ signals:
      * We need to track drag in icon views for the spring loading folders
      */
-    void dragEntered();
+    void dragEntered( bool accepted );
     void dragLeft();
     /**

--- kdebase/konqueror/iconview/konq_iconview.cc  #1.472:1.473
@@ -344,6 +344,6 @@ KonqKfmIconView::KonqKfmIconView( QWidge
     connect( m_pIconView, SIGNAL( held( QIconViewItem * ) ),
              this, SLOT( slotDragHeld( QIconViewItem * ) ) );
-    connect( m_pIconView, SIGNAL( dragEntered() ),
-             this, SLOT( slotDragEntered() ) );
+    connect( m_pIconView, SIGNAL( dragEntered( bool ) ),
+             this, SLOT( slotDragEntered( bool ) ) );
     connect( m_pIconView, SIGNAL( dragLeft() ),
              this, SLOT( slotDragLeft() ) );
@@ -740,7 +740,11 @@ void KonqKfmIconView::slotDragHeld( QIco
 }
 
-void KonqKfmIconView::slotDragEntered()
+void KonqKfmIconView::slotDragEntered( bool accepted )
 {
     kdDebug() << "KonqKfmIconView::slotDragEntered()" << endl;
+    if ( !accepted ) {
+        emit setStatusBarText( i18n( "You cannot drop any items in a \
directory in which you don't have write permission" ) ); +        return;
+    }
 
     if ( SpringLoadingManager::exists() )

--- kdebase/konqueror/iconview/konq_iconview.h  #1.172:1.173
@@ -104,5 +104,5 @@ protected slots:
   // Slot used for spring loading folders
   void slotDragHeld( QIconViewItem *item );
-  void slotDragEntered();
+  void slotDragEntered( bool accepted );
   void slotDragLeft();
   void slotDragFinished();


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

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