[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:       2005-03-28 22:18:59
Message-ID: 20050328221859.7E661631 () office ! kde ! org
[Download RAW message or body]

CVS commit by faure: 

Revised support for name filters: now that KShortURIFilter supports them, they
can be moved down to openURL - which fixes pasting a url with a wildcard.
BUG: 93825


  M +15 -17    konq_mainwindow.cc   1.1411
  M +1 -1      konq_mainwindow.h   1.461


--- kdebase/konqueror/konq_mainwindow.cc  #1.1410:1.1411
@@ -425,9 +425,6 @@ QString KonqMainWindow::detectNameFilter
 }
 
-void KonqMainWindow::openFilteredURL( const QString & _url, const KonqOpenURLRequest \
& _req) +void KonqMainWindow::openFilteredURL( const QString & url, \
KonqOpenURLRequest & req )  {
-    QString url = _url;
-    QString nameFilter = detectNameFilter( url );
-
     // Filter URL to build a correct one
     if (m_currentDir.isEmpty() && m_currentView)
@@ -435,23 +432,11 @@ void KonqMainWindow::openFilteredURL( co
 
     KURL filteredURL ( KonqMisc::konqFilteredURL( this, url, m_currentDir ) );
-    kdDebug(1202) << "_url " << _url << " filtered into " << filteredURL.prettyURL() \
<< endl; +    kdDebug(1202) << "url " << url << " filtered into " << \
filteredURL.prettyURL() << endl;  
     if ( filteredURL.isEmpty() ) // initially empty, or error (e.g. ~unknown_user)
         return;
 
-    if ( !nameFilter.isEmpty() )
-    {
-        if (!KProtocolInfo::supportsListing(filteredURL))
-        {
-            // Protocol doesn't support listing. Ouch. Revert to full URL, no \
                name-filtering.
-            url = _url;
-            nameFilter = QString::null;
-            filteredURL = KonqMisc::konqFilteredURL( this, url, m_currentDir );
-        }
-    }
     m_currentDir = QString::null;
 
-    KonqOpenURLRequest req( _req  );
-    req.nameFilter = nameFilter;
     openURL( 0L, filteredURL, QString::null, req );
 
@@ -498,4 +483,15 @@ void KonqMainWindow::openURL( KonqView *
   }
 
+  if ( KProtocolInfo::supportsListing(url) )
+  {
+    QString urlStr = url.url();
+    QString nameFilter = detectNameFilter( urlStr );
+    if ( !nameFilter.isEmpty() )
+    {
+      req.nameFilter = nameFilter;
+      url.setFileName( QString::null );
+    }
+  }
+
   KonqView *view = _view;
 
@@ -4147,4 +4143,6 @@ void KonqMainWindow::connectExtension( K
           if ( !text.isEmpty() )
               act->setText( text );
+          // TODO how to re-set the original action text, when switching to a part \
that didn't call setAction? +          // Can't test with Paste...
       } else
           act->setEnabled(false);

--- kdebase/konqueror/konq_mainwindow.h  #1.460:1.461
@@ -109,5 +109,5 @@ public:
    * Filters the URL and calls the main openURL method.
    */
-  void openFilteredURL( const QString & _url, const KonqOpenURLRequest& _req);
+  void openFilteredURL( const QString & _url, KonqOpenURLRequest& _req);
 
   /**


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

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