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

List:       kde-commits
Subject:    kdebase/konqueror
From:       David Faure <faure () kde ! org>
Date:       2003-07-16 9:54:50
[Download RAW message or body]

CVS commit by faure: 

Better fix for 52161, aka "opening the url in a directory-only view like
sidebar or konsolepart isn't enough to see its contents".
John: thanks for the investigation and initial patch.
CCMAIL: 52161-done@bugs.kde.org


  M +29 -17    konq_mainwindow.cc   1.1202
  M +9 -12     konq_view.cc   1.337


--- kdebase/konqueror/konq_mainwindow.cc  #1.1201:1.1202
@@ -802,4 +802,5 @@ bool KonqMainWindow::openView( QString s
   else // We know the child view
   {
+      if ( !childView->isLockedViewMode() )
       ok = childView->changeViewMode( serviceType, serviceName );
   }
@@ -923,4 +924,5 @@ bool KonqMainWindow::makeViewsFollow( co
   for ( KonqView * view = listViews.first() ; view ; view = listViews.next() )
   {
+    bool followed = false;
     // Views that should follow this URL as both views are linked
     if ( (view != senderView) && view->isLinkedView() && senderView->isLinkedView())
@@ -937,5 +939,5 @@ bool KonqMainWindow::makeViewsFollow( co
           view->stop();
 
-      res = openView( serviceType, url, view, req ) || res;
+      followed = openView( serviceType, url, view, req );
     }
     else
@@ -944,10 +946,20 @@ bool KonqMainWindow::makeViewsFollow( co
         if ((view!=senderView) && view->isFollowActive() && senderView == m_currentView)
         {
-            // Note that the return value is ignored. When clicking on a file it's not enough
-            // that the dirtree follows, to mean "the other views followed".
-            // We still want to see that file (e.g. in a separate viewer).
-            (void)openView(serviceType,url,view,req);
+        followed = openView(serviceType, url, view, req);
         }
     }
+
+    // Ignore return value if the view followed but doesn't really
+    // show the file contents. We still want to see that
+    // file, e.g. in a separate viewer.
+    // This happens in views locked to a directory mode,
+    // like sidebar and konsolepart (#52161).
+    bool ignore = view->isLockedViewMode() && view->supportsServiceType("inode/directory");
+    //kdDebug(1202) << "View " << view->service()->name()
+    //              << " supports dirs: " << view->supportsServiceType( "inode/directory" )
+    //              << " is locked-view-mode:" << view->isLockedViewMode()
+    //              << " ignore=" << ignore << endl;
+    if ( !ignore )
+      res = followed || res;
   }
 

--- kdebase/konqueror/konq_view.cc  #1.336:1.337
@@ -292,12 +292,9 @@ bool KonqView::changeViewMode( const QSt
     return true;
 
-  // Special hack for sidebar views. They are isLockedViewMode(), but we want
-  // to be able to follow directory changes. So, pretend we changed the view
-  // mode instead of returning false.
-  if ( isLockedViewMode() && m_serviceType == "Browser/View" && serviceType == "inode/directory" )
-    return true;
-
   if ( isLockedViewMode() )
+  {
+    //kdDebug(1202) << "This view's mode is locked - can't change" << endl;
     return false; // we can't do that if our view mode is locked
+  }
 
   kdDebug(1202) << "Switching view modes..." << endl;


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

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