Commit f9e2b344 authored by Kurt Hindenburg's avatar Kurt Hindenburg
Browse files

Correct KPart issue where the wrong context menu was used and invalid menus were created.

BUG: 186745

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1017600
parent 163df682
...@@ -98,12 +98,10 @@ SessionController::SessionController(Session* session , TerminalDisplay* view, Q ...@@ -98,12 +98,10 @@ SessionController::SessionController(Session* session , TerminalDisplay* view, Q
Q_ASSERT( view ); Q_ASSERT( view );
// handle user interface related to session (menus etc.) // handle user interface related to session (menus etc.)
if (isKonsolePart())
#ifdef KONSOLE_PART
setXMLFile("konsole/partui.rc"); setXMLFile("konsole/partui.rc");
#else else
setXMLFile("konsole/sessionui.rc"); setXMLFile("konsole/sessionui.rc");
#endif
setupActions(); setupActions();
actionCollection()->addAssociatedWidget(view); actionCollection()->addAssociatedWidget(view);
...@@ -1109,6 +1107,15 @@ void SessionController::zmodemUpload() ...@@ -1109,6 +1107,15 @@ void SessionController::zmodemUpload()
} }
} }
bool SessionController::isKonsolePart() const
{
// Check to see if we are being called from Konsole or a KPart
if (QString(kapp->metaObject()->className()) == "Konsole::Application")
return false;
else
return true;
}
SessionTask::SessionTask(QObject* parent) SessionTask::SessionTask(QObject* parent)
: QObject(parent) : QObject(parent)
, _autoDelete(false) , _autoDelete(false)
......
...@@ -213,6 +213,9 @@ private slots: ...@@ -213,6 +213,9 @@ private slots:
void zmodemDownload(); void zmodemDownload();
void zmodemUpload(); void zmodemUpload();
/* Returns true if called within a KPart; false if called within Konsole. */
bool isKonsolePart() const;
private: private:
// begins the search // begins the search
// text - pattern to search for // text - pattern to search for
......
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