Sophie

Sophie

distrib > Mandriva > 2006.0 > i586 > media > main-src > by-pkgid > a6bc312ce50b5c8d0c51736e58ac32bc > files > 127

kdebase-3.4.2-55mdk.src.rpm

--- kdebase-3.1.3/libkonq/konq_popupmenu.cc--	2003-08-20 09:14:55.000000000 +0200
+++ kdebase-3.1.3/libkonq/konq_popupmenu.cc	2003-08-20 09:19:53.000000000 +0200
@@ -226,14 +226,15 @@ void KonqPopupMenu::setup(bool showPrope
                           url.path(1) == KGlobalSettings::trashPath() &&
                           currentDir) ||
 		       ( m_lstItems.count() == 1 && bTrashIncluded );
+  bool isIntoTrash =  url.isLocalFile() && url.path(1).startsWith(KGlobalSettings::trashPath());
 
   clear();
 
   //////////////////////////////////////////////////////////////////////////
 
   KAction * act;
-
-  addMerge( "konqueror" );
+  if (!isCurrentTrash)
+      addMerge( "konqueror" );
 
   bool isKDesktop = QCString(  kapp->name() ) == "kdesktop";
   QString openStr = isKDesktop ? i18n( "&Open" ) : i18n( "Open in New &Window" );
@@ -244,7 +245,8 @@ void KonqPopupMenu::setup(bool showPrope
   if ( ( isCurrentTrash && currentDir ) ||
        ( m_lstItems.count() == 1 && bTrashIncluded ) )
   {
-    addAction( actNewView );
+      if( actNewView)
+          addAction( actNewView );
     addGroup( "tabhandling" );
     addSeparator();
 
@@ -253,7 +255,7 @@ void KonqPopupMenu::setup(bool showPrope
   }
   else
   {
-    if ( S_ISDIR(mode) && sWriting ) // A dir, and we can create things into it
+    if ( S_ISDIR(mode) && sWriting && !isIntoTrash) // A dir, and we can create things into it
     {
       if ( currentDir && m_pMenuNew ) // Current dir -> add the "new" menu
       {
@@ -288,11 +290,12 @@ void KonqPopupMenu::setup(bool showPrope
     }
 
     // "open in new window" always available
-    addAction( actNewView );
+    if( actNewView )
+        addAction( actNewView );
     addGroup( "tabhandling" );
     bool separatorAdded = false;
 
-    if ( !currentDir && sReading ) {
+    if ( !currentDir && sReading && !isIntoTrash) {
         addSeparator();
         separatorAdded = true;
       if ( sDeleting ) {
@@ -302,7 +305,7 @@ void KonqPopupMenu::setup(bool showPrope
       addAction( "copy" );
     }
 
-    if ( S_ISDIR(mode) && sWriting ) {
+    if ( S_ISDIR(mode) && sWriting && !isIntoTrash) {
         if ( !separatorAdded )
             addSeparator();
         if ( currentDir )
@@ -314,7 +317,8 @@ void KonqPopupMenu::setup(bool showPrope
     // The actions in this group are defined in PopupMenuGUIClient
     // When defined, it includes a separator before the 'find' action
     addGroup( "find" );
-
+    if( !isIntoTrash )
+    {
     if (!currentDir)
     {
         if ( sReading || sWriting ) // only if we added an action above
@@ -332,8 +336,9 @@ void KonqPopupMenu::setup(bool showPrope
             //    addAction( "shred" );
         }
     }
+    }
   }
-  if( !isCurrentTrash )
+  if( !isCurrentTrash && !isIntoTrash)
   {
       act = new KAction( i18n( "&Add to Bookmarks" ), "bookmark_add", 0, this, SLOT( slotPopupAddToBookmark() ), &m_ownActions, "bookmark_add" );
       if (kapp->authorizeKAction("bookmarks"))
@@ -352,7 +357,7 @@ void KonqPopupMenu::setup(bool showPrope
       builtin = KDEDesktopMimeType::builtinServices( m_lstItems.first()->url() );
       user = KDEDesktopMimeType::userDefinedServices( m_lstItems.first()->url().path(), url.isLocalFile() );
   }
-  if ( !isCurrentTrash )
+  if ( !isCurrentTrash && !isIntoTrash)
   {
   // 2 - Look for "servicesmenus" bindings (konqueror-specific user-defined services)
   QStringList dirs = KGlobal::dirs()->findDirs( "data", "konqueror/servicemenus/" );
@@ -537,10 +542,10 @@ void KonqPopupMenu::setup(bool showPrope
       if ( insertedOffer )
         addSeparator();
   }
-  if( !isCurrentTrash)
+  if( !isCurrentTrash && !isIntoTrash)
       addPlugins( ); // now it's time to add plugins
 
-  if ( !m_sMimeType.isEmpty() && showPropertiesAndFileType  && !isCurrentTrash)
+  if ( !m_sMimeType.isEmpty() && showPropertiesAndFileType  && !isCurrentTrash && !isIntoTrash)
   {
       act = new KAction( i18n( "&Edit File Type..." ), 0, this, SLOT( slotPopupMimeType() ),
                        &m_ownActions, "editfiletype" );
@@ -558,7 +563,7 @@ void KonqPopupMenu::setup(bool showPrope
             m_menuElement.lastChild().toElement().tagName().lower() == "separator" )
     m_menuElement.removeChild( m_menuElement.lastChild() );
 
-  if( bCanChangeSharing)
+  if( bCanChangeSharing && !isCurrentTrash && !isIntoTrash)
   {
    if(KFileShare::authorization()==KFileShare::Authorized)
    {
--- kdebase-3.1.3/konqueror/konq_guiclients.h--	2003-08-20 09:25:07.000000000 +0200
+++ kdebase-3.1.3/konqueror/konq_guiclients.h	2003-08-20 09:26:21.000000000 +0200
@@ -34,7 +34,7 @@ class PopupMenuGUIClient : public KXMLGU
 {
 public:
   PopupMenuGUIClient( KonqMainWindow *mainWindow, const KTrader::OfferList &embeddingServices,
-                      bool dirsSelected );
+                      bool dirsSelected, bool isIntoTrash );
   virtual ~PopupMenuGUIClient();
 
   virtual KAction *action( const QDomElement &element ) const;
--- kdebase-3.1.3/konqueror/konq_guiclients.cc--	2003-08-20 09:25:11.000000000 +0200
+++ kdebase-3.1.3/konqueror/konq_guiclients.cc	2003-08-20 09:26:25.000000000 +0200
@@ -28,7 +28,7 @@
 
 PopupMenuGUIClient::PopupMenuGUIClient( KonqMainWindow *mainWindow,
                                         const KTrader::OfferList &embeddingServices,
-                                        bool dirsSelected )
+                                        bool dirsSelected, bool isIntoTrash )
 {
   m_mainWindow = mainWindow;
 
@@ -60,7 +60,8 @@ PopupMenuGUIClient::PopupMenuGUIClient( 
   }
 
   QString currentServiceName = mainWindow->currentView()->service()->desktopEntryName();
-
+  if ( !isIntoTrash )
+  {
   KTrader::OfferList::ConstIterator it = embeddingServices.begin();
   KTrader::OfferList::ConstIterator end = embeddingServices.end();
 
@@ -100,7 +101,7 @@ PopupMenuGUIClient::PopupMenuGUIClient( 
     if ( !inserted ) // oops, if empty then remove the menu :-]
       menu.removeChild( menu.namedItem( "menu" ) );
   }
-
+  }
   KonqView *v = mainWindow->currentView();
   if ( v && v->part() && v->part()->inherits( "KonqDirPart" ) && dirsSelected )
   {
--- kdebase-3.1.3/konqueror/konq_mainwindow.cc--	2003-08-20 09:23:18.000000000 +0200
+++ kdebase-3.1.3/konqueror/konq_mainwindow.cc	2003-08-20 09:30:21.000000000 +0200
@@ -3735,8 +3735,12 @@ void KonqMainWindow::slotPopupMenu( KXML
       dirsSelected = S_ISDIR( _items.getFirst()->mode() );
   }
 
+  KURL url = viewURL;
+  url.cleanPath();
+  bool isIntoTrash =  url.isLocalFile() && url.path(1).startsWith(KGlobalSettings::trashPath());
+
   PopupMenuGUIClient *konqyMenuClient = new PopupMenuGUIClient( this, m_popupEmbeddingServices,
-                                                                dirsSelected );
+                                                                dirsSelected, isIntoTrash );
 
   //kdDebug(1202) << "KonqMainWindow::slotPopupMenu " << viewURL.prettyURL() << endl;