Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 9bb938de93248ca5cc71ecf424cefd6c > files > 1

kdebase-3.5.4-21.el5_5.1.src.rpm

--- konqueror/konq_viewmgr.h
+++ konqueror/konq_viewmgr.h
@@ -34,6 +34,7 @@
 
 class QString;
 class QStringList;
+class QTimer;
 class KConfig;
 class KonqMainWindow;
 class KonqFrameBase;
@@ -359,6 +360,8 @@ private:
   QString m_profileHomeURL;
 
   QMap<QString, QString> m_mapProfileNames;
+
+  QTimer *m_activePartChangedTimer;
 };
 
 #endif
--- konqueror/konq_viewmgr.cc
+++ konqueror/konq_viewmgr.cc
@@ -56,6 +56,8 @@ KonqViewManager::KonqViewManager( KonqMa
   m_bProfileListDirty = true;
   m_bLoadingProfile = false;
 
+  m_activePartChangedTimer = new QTimer(this);
+  connect(m_activePartChangedTimer, SIGNAL(timeout()), this, SLOT(emitActivePartChanged()));
   connect( this, SIGNAL( activePartChanged ( KParts::Part * ) ), this, SLOT( slotActivePartChanged ( KParts::Part * ) ) );
 }
 
@@ -1355,18 +1357,17 @@ void KonqViewManager::setActivePart( KPa
     if (part && part->widget())
         part->widget()->setFocus();
 
-    if (!immediate && reason() != ReasonRightClick)
+    if (!immediate && reason() != ReasonRightClick) {
         // We use a 0s single shot timer so that when left-clicking on a part,
         // we process the mouse event before rebuilding the GUI.
         // Otherwise, when e.g. dragging icons, the mouse pointer can already
         // be very far from where it was...
-        // TODO: use a QTimer member var, so that if two conflicting calls to
-        // setActivePart(part,immediate=false) happen, the 1st one gets cancelled.
-        QTimer::singleShot( 0, this, SLOT( emitActivePartChanged() ) );
+        m_activePartChangedTimer->start( 0, true );
         // This is not done with right-clicking so that the part is activated before the
         // popup appears (#75201)
-    else
+    } else {
         emitActivePartChanged();
+    }
 }
 
 void KonqViewManager::slotActivePartChanged ( KParts::Part *newPart )
--- konqueror/konq_combo.cc
+++ konqueror/konq_combo.cc
@@ -158,6 +158,9 @@ void KonqCombo::setURL( const QString& u
         kapp->dcopClient()->send( "konqueror*", "KonquerorIface",
                                   "addToCombo(QString,QCString)", data);
     }
+    // important security consideration: always display the beginning
+    // of the url rather than its end to prevent spoofing attempts.
+    lineEdit()->setCursorPosition( 0 );
 }
 
 void KonqCombo::setTemporary( const QString& text )
--- konqueror/konq_mainwindow.cc
+++ konqueror/konq_mainwindow.cc
@@ -611,12 +611,11 @@ void KonqMainWindow::openURL( KonqView *
   }
   else // no known serviceType, use KonqRun
   {
-      if ( ( view && view == m_currentView ) ||
-              ( !view && !req.newTab ) ) // startup with argument
+      if ( ( !view || view->url().isEmpty() ) && !req.newTab ) // startup with argument
       {
           // Show it for now in the location bar, but we'll need to store it in the view
           // later on (can't do it yet since either view == 0 or updateHistoryEntry will be called).
-          kdDebug(1202) << "setLocationBarURL : url = " << url << endl;
+          kdDebug(1202) << "setLocationBarURL (startup) : url = " << url << endl;
           setLocationBarURL( url );
       }
 
@@ -819,8 +818,6 @@ bool KonqMainWindow::openView( QString s
         if ( childView )
         {
             enableAllActions( true );
-
-            m_pViewManager->setActivePart( childView->part() );
             m_currentView = childView;
         }
       }
--- konqueror/konq_viewmgr.cc
+++ konqueror/konq_viewmgr.cc
@@ -1395,6 +1395,8 @@ void KonqViewManager::slotActivePartChan
 
 void KonqViewManager::emitActivePartChanged()
 {
+    // prevent unnecessary multiple calls to slotPartActivated:
+    m_activePartChangedTimer->stop();
     m_pMainWindow->slotPartActivated( activePart() );
 }