[rkward-cvs] SF.net SVN: rkward: [2104] branches/KDE4_port

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon Oct 22 19:07:11 UTC 2007


Revision: 2104
          http://rkward.svn.sourceforge.net/rkward/?rev=2104&view=rev
Author:   tfry
Date:     2007-10-22 12:07:10 -0700 (Mon, 22 Oct 2007)

Log Message:
-----------
Remove some Qt3 support code here and there, make RKCommandEditor-Window focus work

Modified Paths:
--------------
    branches/KDE4_port/TODO_KDE4
    branches/KDE4_port/rkward/debug.h
    branches/KDE4_port/rkward/rbackend/rcommand.h
    branches/KDE4_port/rkward/rbackend/rcommandreceiver.cpp
    branches/KDE4_port/rkward/rbackend/rcommandreceiver.h
    branches/KDE4_port/rkward/rbackend/rthread.cpp
    branches/KDE4_port/rkward/rbackend/rthread.h
    branches/KDE4_port/rkward/rkconsole.cpp
    branches/KDE4_port/rkward/windows/rkcommandeditorwindow.cpp
    branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.cpp
    branches/KDE4_port/rkward/windows/rkmdiwindow.cpp
    branches/KDE4_port/rkward/windows/rkworkplace.cpp

Modified: branches/KDE4_port/TODO_KDE4
===================================================================
--- branches/KDE4_port/TODO_KDE4	2007-10-22 16:54:58 UTC (rev 2103)
+++ branches/KDE4_port/TODO_KDE4	2007-10-22 19:07:10 UTC (rev 2104)
@@ -30,7 +30,7 @@
 rkcommandeditorwindow
 	- code completion will be broken. Fix after porting.
 	- does the popup-menu still work? See SVN rev. 962.
-	- does highlighting work?
+	- placement of menu options?
 
 rkward
 	- does closing windows work
@@ -91,3 +91,5 @@
 rkhtmlwindow:
 	- when this is open, we always seem to crash on close
 
+rcontrolwindow:
+	- this does not really need to be a top-level tool window any more. Since it's rarely used, it might be hidden somewhere.

Modified: branches/KDE4_port/rkward/debug.h
===================================================================
--- branches/KDE4_port/rkward/debug.h	2007-10-22 16:54:58 UTC (rev 2103)
+++ branches/KDE4_port/rkward/debug.h	2007-10-22 19:07:10 UTC (rev 2104)
@@ -42,7 +42,7 @@
 #define DIALOGS 1024
 #define OUTPUT 2048
 #define XML 4096
-#define ALL (APP | PLUGIN | PHP | OBJECTS | EDITOR | RBACKEND | MISC | XML)
+#define ALL (APP | PLUGIN | PHP | OBJECTS | EDITOR | RBACKEND | COMMANDEDITOR | MISC | DIALOGS | OUTPUT | XML)
 
 #ifdef RKWARD_DEBUG
 

Modified: branches/KDE4_port/rkward/rbackend/rcommand.h
===================================================================
--- branches/KDE4_port/rkward/rbackend/rcommand.h	2007-10-22 16:54:58 UTC (rev 2103)
+++ branches/KDE4_port/rkward/rbackend/rcommand.h	2007-10-22 19:07:10 UTC (rev 2104)
@@ -21,7 +21,7 @@
 #include <qfile.h>
 #include <qstring.h>
 #include <qobject.h>
-#include <QLinkedList>
+#include <QList>
 
 #include "rdata.h"
 

Modified: branches/KDE4_port/rkward/rbackend/rcommandreceiver.cpp
===================================================================
--- branches/KDE4_port/rkward/rbackend/rcommandreceiver.cpp	2007-10-22 16:54:58 UTC (rev 2103)
+++ branches/KDE4_port/rkward/rbackend/rcommandreceiver.cpp	2007-10-22 19:07:10 UTC (rev 2104)
@@ -30,7 +30,7 @@
 RCommandReceiver::~RCommandReceiver () {
 	RK_TRACE (RBACKEND);
 
-	for (RCommandList::const_iterator it = outstanding_commands.begin (); it != outstanding_commands.end (); ++it) {
+	for (RCommandList::const_iterator it = outstanding_commands.constBegin (); it != outstanding_commands.constEnd (); ++it) {
 		(*it)->removeReceiver (this);
 	}
 }
@@ -46,7 +46,7 @@
 void RCommandReceiver::cancelOutstandingCommands () {
 	RK_TRACE (RBACKEND);
 
-	for (RCommandList::const_iterator it = outstanding_commands.begin (); it != outstanding_commands.end (); ++it) {
+	for (RCommandList::const_iterator it = outstanding_commands.constBegin (); it != outstanding_commands.constEnd (); ++it) {
 		RKGlobals::rInterface()->cancelCommand (*it);
 	}
 }

Modified: branches/KDE4_port/rkward/rbackend/rcommandreceiver.h
===================================================================
--- branches/KDE4_port/rkward/rbackend/rcommandreceiver.h	2007-10-22 16:54:58 UTC (rev 2103)
+++ branches/KDE4_port/rkward/rbackend/rcommandreceiver.h	2007-10-22 19:07:10 UTC (rev 2104)
@@ -17,7 +17,7 @@
 #ifndef RCOMMANDRECEIVER_H
 #define RCOMMANDRECEIVER_H
 
-#include <q3valuelist.h>
+#include <qlist.h>
 
 #include "rcommand.h"
 
@@ -33,7 +33,7 @@
 
 class RCommand;
 struct ROutput;
-typedef Q3ValueList<RCommand*> RCommandList;
+typedef QList<RCommand*> RCommandList;
 
 class RCommandReceiver {
 public:

Modified: branches/KDE4_port/rkward/rbackend/rthread.cpp
===================================================================
--- branches/KDE4_port/rkward/rbackend/rthread.cpp	2007-10-22 16:54:58 UTC (rev 2103)
+++ branches/KDE4_port/rkward/rbackend/rthread.cpp	2007-10-22 19:07:10 UTC (rev 2104)
@@ -32,9 +32,9 @@
 #include <qstring.h>
 #include <qapplication.h>
 #include <QDBusConnection>
+#include <QList>
 //Added by qt3to4:
 #include <QCustomEvent>
-#include <Q3ValueList>
 
 #include <signal.h>		// needed for pthread_kill
 
@@ -315,7 +315,7 @@
 	RK_TRACE (RBACKEND);
 
 	if (current_command) {
-		for (Q3ValueList<RCommand*>::const_iterator it = all_current_commands.constBegin (); it != all_current_commands.constEnd(); ++it) {
+		for (QList<RCommand*>::const_iterator it = all_current_commands.constBegin (); it != all_current_commands.constEnd(); ++it) {
 			ROutput *output = current_output;
 			if ((*it) != current_command) {		// this output belongs to several commands at once. So we need to copy it.
 				output = new ROutput;

Modified: branches/KDE4_port/rkward/rbackend/rthread.h
===================================================================
--- branches/KDE4_port/rkward/rbackend/rthread.h	2007-10-22 16:54:58 UTC (rev 2103)
+++ branches/KDE4_port/rkward/rbackend/rthread.h	2007-10-22 19:07:10 UTC (rev 2104)
@@ -19,7 +19,7 @@
 
 #include <qthread.h>
 #include <qstringlist.h>
-#include <q3valuelist.h>
+#include <QList>
 
 #include "rcommand.h"
 #include "rcommandstack.h"
@@ -189,7 +189,7 @@
 	QStringList changed_symbol_names;
 /** check wether the object list / global environment / individual symbols have changed, and updates them, if needed */
 	void checkObjectUpdatesNeeded (bool check_list);
-	Q3ValueList<RCommand*> all_current_commands;
+	QList<RCommand*> all_current_commands;
 };
 
 #endif

Modified: branches/KDE4_port/rkward/rkconsole.cpp
===================================================================
--- branches/KDE4_port/rkward/rkconsole.cpp	2007-10-22 16:54:58 UTC (rev 2103)
+++ branches/KDE4_port/rkward/rkconsole.cpp	2007-10-22 19:07:10 UTC (rev 2104)
@@ -91,7 +91,7 @@
 		RK_DO (qDebug ("Could not retrieve the katepart's edit action collection"), APP, DL_ERROR);
 	}
 
-	view->focusProxy()->installEventFilter(this);
+	if (view->focusProxy ()) view->focusProxy()->installEventFilter(this);
 	view->installEventFilter(this);
 
 	doc->setModified (false);

Modified: branches/KDE4_port/rkward/windows/rkcommandeditorwindow.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkcommandeditorwindow.cpp	2007-10-22 16:54:58 UTC (rev 2103)
+++ branches/KDE4_port/rkward/windows/rkcommandeditorwindow.cpp	2007-10-22 19:07:10 UTC (rev 2104)
@@ -32,8 +32,8 @@
 #include <qfile.h>
 #include <qtimer.h>
 #include <qobject.h>
+#include <QHBoxLayout>
 //Added by qt3to4:
-#include <Q3HBoxLayout>
 #include <QCloseEvent>
 #include <QFrame>
 #include <Q3ValueList>
@@ -73,17 +73,21 @@
 	RK_ASSERT (m_doc);
 	m_view = m_doc->createView (this);
 
+	setFocusProxy (m_view);
+	setFocusPolicy (Qt::StrongFocus);
+
 	// strip down the khtmlpart's GUI. remove some stuff we definitely don't need.
-	RKCommonFunctions::removeContainers (m_doc, QStringList::split (',', "bookmarks,tools_spelling,tools_spelling_from_cursor,tools_spelling_selection,switch_to_cmd_line"), true);
-	RKCommonFunctions::moveContainer (m_doc, "Menu", "tools", "edit", true);
+	RKCommonFunctions::removeContainers (m_view, QString ("bookmarks,tools_spelling,tools_spelling_from_cursor,tools_spelling_selection,switch_to_cmd_line").split (','), true);
+	RKCommonFunctions::moveContainer (m_view, "Menu", "tools", "edit", true);
 
-	m_doc->insertChildClient (new RKCommandEditorWindowPart (m_view, this));
-	setPart (m_doc);
+	RKCommandEditorWindowPart* part = new RKCommandEditorWindowPart (m_view, this);
+	part->insertChildClient (m_view);
+	setPart (part);
 	initializeActivationSignals ();
-	setFocusProxy (m_view);
 
-	Q3HBoxLayout *pLayout = new Q3HBoxLayout( this, 0, -1, "layout");
-	pLayout->addWidget(m_view);
+	QHBoxLayout *layout = new QHBoxLayout (this);
+	layout->setContentsMargins (0, 0, 0, 0);
+	layout->addWidget(m_view);
 
 	setIcon (SmallIcon ("source"));
 
@@ -161,7 +165,7 @@
 	RK_TRACE (COMMANDEDITOR);
 
 	// set syntax-highlighting for R
-	m_doc->setHighlightingMode("R Script");
+	if (!m_doc->setHighlightingMode("R Script")) RK_DO (qDebug ("R syntax highlighting defintion not found!"), COMMANDEDITOR, DL_ERROR);
 }
 
 void RKCommandEditorWindow::copy () {

Modified: branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.cpp	2007-10-22 16:54:58 UTC (rev 2103)
+++ branches/KDE4_port/rkward/windows/rkcommandeditorwindowpart.cpp	2007-10-22 19:07:10 UTC (rev 2104)
@@ -32,6 +32,7 @@
 	setComponentData (KGlobal::mainComponent ());
  
 	command_editor = editor_widget;
+	setWidget (parent);
 
 	setXMLFile ("rkcommandeditorwindowpart.rc");
 

Modified: branches/KDE4_port/rkward/windows/rkmdiwindow.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkmdiwindow.cpp	2007-10-22 16:54:58 UTC (rev 2103)
+++ branches/KDE4_port/rkward/windows/rkmdiwindow.cpp	2007-10-22 19:07:10 UTC (rev 2104)
@@ -145,7 +145,7 @@
 	if (watched == getPart ()) {
 		if (KParts::PartActivateEvent::test (e)) {
 			RK_TRACE (APP);		// trace only the "interesting" calls to this function
-	
+qDebug ("a/d %s", fullCaption().toLatin1().data());
 			KParts::PartActivateEvent *ev = static_cast<KParts::PartActivateEvent *> (e);
 			if (ev->activated ()) {
 				emit (windowActivated (this));

Modified: branches/KDE4_port/rkward/windows/rkworkplace.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkworkplace.cpp	2007-10-22 16:54:58 UTC (rev 2103)
+++ branches/KDE4_port/rkward/windows/rkworkplace.cpp	2007-10-22 19:07:10 UTC (rev 2104)
@@ -163,6 +163,7 @@
 	tool_window_bars[position]->addWidget (window);
 	if (windows.find (window) == windows.end ()) {	// must be new
 		addWindow (window, true);
+		RKWardMainWindow::getMain ()->partManager ()->addPart (window->getPart ());
 	}
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list