[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE_3_2_BRANCH: kdelibs/kate/part
From: Anders Lund <anders () alweb ! dk>
Date: 2004-03-24 7:37:32
Message-ID: 20040324073732.992A49993 () office ! kde ! org
[Download RAW message or body]
CVS commit by alund:
Use the views show event instead of the gotFocus signal to look for the
KXMLGUIClient factory. Dont bother unless the view is visible.
M +11 -3 katebookmarks.cpp 1.29.2.2
M +2 -0 katebookmarks.h 1.10.2.2
--- kdelibs/kate/part/katebookmarks.cpp #1.29.2.1:1.29.2.2
@@ -65,5 +65,5 @@ KateBookmarks::KateBookmarks( KateView*
{
connect (view->getDoc(), SIGNAL(marksChanged()), this, SLOT(marksChanged()));
- connect( view, SIGNAL(gotFocus(Kate::View*)), this, SLOT(connectMenuAndDisConnectAgain()) );
+ m_view->installEventFilter( this );
}
@@ -72,4 +72,11 @@ KateBookmarks::~KateBookmarks()
}
+bool KateBookmarks::eventFilter( QObject *o, QEvent *e )
+{
+ if ( o == m_view && e->type() == QEvent::Show )
+ connectMenuAndDisConnectAgain();
+ return false;
+}
+
void KateBookmarks::createActions( KActionCollection* ac )
{
@@ -117,9 +124,10 @@ void KateBookmarks::connectMenuAndDisCon
this, SLOT(bookmarkMenuAboutToHide()) );
- disconnect( m_view, 0, this, SLOT(connectMenuAndDisConnectAgain()) );
+ m_view->removeEventFilter( this );
return;
}
// FUCKY-SUCKY -- try later
+ if ( m_view->isVisible() )
QTimer::singleShot( 0, this, SLOT(connectMenuAndDisConnectAgain()));
}
--- kdelibs/kate/part/katebookmarks.h #1.10.2.1:1.10.2.2
@@ -44,4 +44,6 @@ class KateBookmarks : public QObject
KateBookmarks::Sorting sorting() { return m_sorting; };
void setSorting( Sorting s ) { m_sorting = s; };
+ protected:
+ bool EventFilter( QObject *, class QEvent * );
private slots:
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic