Commit 7a63547c authored by Robert Knight's avatar Robert Knight

Tidy up SessionController::showDisplayContextMenu(). Remove unused parameters...

Tidy up SessionController::showDisplayContextMenu().  Remove unused parameters and unnecessary pointer checks.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=863331
parent 21b0f906
......@@ -118,8 +118,8 @@ SessionController::SessionController(Session* session , TerminalDisplay* view, Q
SLOT(sessionResizeRequest(const QSize&)) );
// listen for popup menu requests
connect( _view , SIGNAL(configureRequest(TerminalDisplay*,int,const QPoint&)) , this,
SLOT(showDisplayContextMenu(TerminalDisplay*,int,const QPoint&)) );
connect( _view , SIGNAL(configureRequest(QPoint)) , this,
SLOT(showDisplayContextMenu(QPoint)) );
// move view to newest output when keystrokes occur
connect( _view , SIGNAL(keyPressedSignal(QKeyEvent*)) , this ,
......@@ -1053,23 +1053,20 @@ void SessionController::sessionTitleChanged()
setTitle( title );
}
void SessionController::showDisplayContextMenu(TerminalDisplay* /*display*/ , int /*state*/, const QPoint& position)
void SessionController::showDisplayContextMenu(const QPoint& position)
{
QMenu* popup = 0;
// needed to make sure the popup menu is available, even if a hosting
// application did not merge our GUI.
if (!factory()) {
if (!clientBuilder()) {
if (!factory())
{
if (!clientBuilder())
setClientBuilder(new KXMLGUIBuilder(_view));
}
KXMLGUIFactory* f = new KXMLGUIFactory(clientBuilder(), this);
f->addClient(this);
KXMLGUIFactory* factory = new KXMLGUIFactory(clientBuilder(), this);
factory->addClient(this);
}
if ( factory() )
popup = qobject_cast<QMenu*>(factory()->container("session-popup-menu",this));
QMenu* popup = qobject_cast<QMenu*>(factory()->container("session-popup-menu",this));
if (popup)
{
// prepend content-specific actions such as "Open Link", "Copy Email Address" etc.
......@@ -1096,7 +1093,7 @@ void SessionController::showDisplayContextMenu(TerminalDisplay* /*display*/ , in
}
else
{
kWarning(1211) << "Unable to display popup menu for session"
kWarning() << "Unable to display popup menu for session"
<< _session->title(Session::NameRole)
<< ", no GUI factory available to build the popup.";
}
......
......@@ -188,7 +188,7 @@ private slots:
// other
void prepareChangeProfileMenu();
void updateCodecAction();
void showDisplayContextMenu(TerminalDisplay* display , int state , const QPoint& position);
void showDisplayContextMenu(const QPoint& position);
void sessionStateChanged(int state);
void sessionTitleChanged();
void searchTextChanged(const QString& text);
......
......@@ -1664,14 +1664,9 @@ void TerminalDisplay::mousePressEvent(QMouseEvent* ev)
else if ( ev->button() == Qt::RightButton )
{
if (_mouseMarks || (ev->modifiers() & Qt::ShiftModifier))
{
emit configureRequest( this,
ev->modifiers() & (Qt::ShiftModifier|Qt::ControlModifier),
ev->pos()
);
}
emit configureRequest(ev->pos());
else
emit mouseSignal( 2, charColumn +1, charLine +1 +_scrollBar->value() -_scrollBar->maximum() , 0);
emit mouseSignal( 2, charColumn +1, charLine +1 +_scrollBar->value() -_scrollBar->maximum() , 0);
}
}
......
......@@ -505,7 +505,7 @@ signals:
*
* This can be used to display a context menu.
*/
void configureRequest( TerminalDisplay*, int state, const QPoint& position );
void configureRequest(const QPoint& position);
/**
* When a shortcut which is also a valid terminal key sequence is pressed while
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment