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

List:       kde-commits
Subject:    [plasmate/terietor/actions] /: Fix the conflicting shortcuts
From:       Giorgos Tsiapaliwkas <terietor () gmail ! com>
Date:       2012-05-08 19:09:21
Message-ID: 20120508190921.6580BA60A9 () git ! kde ! org
[Download RAW message or body]

Git commit f1832592cea58f27a30901ead45b80ede0fada91 by Giorgos Tsiapaliwkas.
Committed on 08/05/2012 at 21:08.
Pushed by tsiapaliwkas into branch 'terietor/actions'.

Fix the conflicting shortcuts

M  +6    -3    editors/text/texteditor.cpp
M  +1    -1    mainwindow.cpp

http://commits.kde.org/plasmate/f1832592cea58f27a30901ead45b80ede0fada91

diff --git a/editors/text/texteditor.cpp b/editors/text/texteditor.cpp
index e5e6e53..dca69b3 100644
--- a/editors/text/texteditor.cpp
+++ b/editors/text/texteditor.cpp
@@ -34,7 +34,7 @@ TextEditor::TextEditor(KTextEditor::Document *editorPart, PackageModel *model, Q
 {
     QHBoxLayout *l = new QHBoxLayout(this);
 
-    KTextEditor::View *view = editorPart->createView(this);
+    KTextEditor::View *view = qobject_cast<KTextEditor::View*>(editorPart);
     if (view) {
         view->setContextMenu(view->defaultContextMenu());
 
@@ -75,9 +75,12 @@ TextEditor::TextEditor(KTextEditor::Document *editorPart, PackageModel *model, Q
             // A: 4 spaces are recommended for python
         }*/
 
-       }
+    }
 
-    l->addWidget(view);
+    //Q: Why we need the above?
+    //A: If we don't do the above we will have conflicting shortcuts.
+    KParts::ReadWritePart *m_part = dynamic_cast<KParts::ReadWritePart *>(editorPart);
+    l->addWidget(m_part->widget());
 }
 
 void TextEditor::modifyToolBar(KToolBar* toolbar)
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 8f74057..4728894 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -189,7 +189,7 @@ void MainWindow::showDocumentation(bool show)
 void MainWindow::createMenus()
 {
     menuBar()->addMenu(helpMenu());
-    setupGUI();
+    setupGUI(ToolBar | Keys | StatusBar | Save);
 }
 
 void MainWindow::quit()
[prev in list] [next in list] [prev in thread] [next in thread] 

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