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

List:       kde-commits
Subject:    kdebase/konqueror/iconview
From:       Kévin Ottens <ervin () tuxfamily ! org>
Date:       2004-05-30 21:25:54
Message-ID: 20040530212554.23FF5126C7 () office ! kde ! org
[Download RAW message or body]

CVS commit by ervin: 

Spring Loading Folder behaviour update.

Now this feature is disabled if the user wants one window per folder.
It only works using the "browser metaphor", everything occurs in only
one window.


  M +11 -40    konq_iconview.cc   1.462
  M +0 -4      konq_iconview.h   1.168


--- kdebase/konqueror/iconview/konq_iconview.cc  #1.461:1.462
@@ -719,4 +719,8 @@ void KonqKfmIconView::slotDragHeld( QIco
     kdDebug() << "KonqKfmIconView::slotDragHeld()" << endl;
 
+    // This feature is not usable if the user wants one window per folder
+    if ( KonqFMSettings::settings()->alwaysNewWin() )
+        return;
+    
     if ( !item )
         return;
@@ -1341,5 +1345,5 @@ static KStaticDeleter<SpringLoadingManag
 
 SpringLoadingManager::SpringLoadingManager()
-    : m_startPart(0L), m_lastPart(0L)
+    : m_startPart(0L)
 {
     connect( &m_endTimer, SIGNAL( timeout() ),
@@ -1376,10 +1380,9 @@ void SpringLoadingManager::springLoadTri
         m_startURL = view->url();
         m_startPart = view;
-        m_lastPart = m_startPart;
     }
 
     // Only the last part of the chain is allowed to trigger a spring load
     // event (if a spring loading chain is in progress)
-    if ( view!=m_lastPart )
+    if ( view!=m_startPart )
         return;
 
@@ -1396,25 +1399,8 @@ void SpringLoadingManager::springLoadTri
     args.trustedSource = true;
 
-    if ( KonqFMSettings::settings()->alwaysNewWin() )
-    {
-        KParts::WindowArgs wargs;
-        KParts::ReadOnlyPart *new_part;
-        emit view->extension()->createNewWindow( url, args, wargs, new_part );
-
-        // The user wants one window by folder, then we keep a pointer
-        // on the created window for later use.
-        m_partsList.append(new_part);
-
-        // Only the new created part is allowed to trigger a new sping
-        // loading request
-        m_lastPart = new_part;
-    }
-    else
-    {
         // Open the folder URL, we don't want to modify the browser
         // history, hence the use of openURL and setLocationBarURL
         view->openURL(url);
         emit view->extension()->setLocationBarURL( url.prettyURL() );
-    }
 }
 
@@ -1431,6 +1417,5 @@ void SpringLoadingManager::dragEntered(K
 {
     // We enter a view involved in the spring loading chain
-    if ( !m_startURL.isEmpty()
-    &&   ( m_startPart==view || m_partsList.containsRef(view) ) )
+    if ( !m_startURL.isEmpty() && m_startPart==view )
     {
         m_endTimer.stop();
@@ -1456,5 +1441,4 @@ void SpringLoadingManager::finished()
     KParts::ReadOnlyPart *part = m_startPart;
     m_startPart = 0L;
-    m_lastPart = 0L;
 
     KonqKfmIconView *view = static_cast<KonqKfmIconView*>(part);
@@ -1462,17 +1446,4 @@ void SpringLoadingManager::finished()
     emit view->extension()->setLocationBarURL( url.prettyURL() );
 
-
-    // We close all the opened windows during the spring loading
-
-    QPtrListIterator<KParts::ReadOnlyPart> it( m_partsList );
-
-    while ( (part = it.current()) != 0 )
-    {
-        ++it;
-        part->widget()->topLevelWidget()->close(false);
-    }
-
-    m_partsList.clear();
-
     deleteLater();
     s_self = 0L;

--- kdebase/konqueror/iconview/konq_iconview.h  #1.167:1.168
@@ -284,8 +284,4 @@ private:
     // and go back to his start url (closing the opened window if needed)
     QTimer m_endTimer;
-
-    // Only useful when the user settings force one window by folder
-    KParts::ReadOnlyPart *m_lastPart; // Last opened part in the chain
-    QPtrList<KParts::ReadOnlyPart> m_partsList; // All opened parts in the chain
 };
 


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

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