[rkward-cvs] SF.net SVN: rkward: [768] trunk/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Wed Sep 27 14:06:50 UTC 2006
Revision: 768
http://svn.sourceforge.net/rkward/?rev=768&view=rev
Author: tfry
Date: 2006-09-27 07:06:38 -0700 (Wed, 27 Sep 2006)
Log Message:
-----------
Remove obsolete RKEditorManager, and never used RKDocManager
Modified Paths:
--------------
trunk/rkward/ChangeLog
trunk/rkward/TODO
trunk/rkward/rkward/agents/rksaveagent.cpp
trunk/rkward/rkward/core/rkmodificationtracker.cpp
trunk/rkward/rkward/dataeditor/rkeditordataframe.cpp
trunk/rkward/rkward/rkwatch.cpp
trunk/rkward/rkward/robjectbrowser.cpp
trunk/rkward/rkward/windows/rkcommandeditorwindow.cpp
Removed Paths:
-------------
trunk/rkward/rkward/rkdocmanager.cpp
trunk/rkward/rkward/rkdocmanager.h
trunk/rkward/rkward/rkeditormanager.cpp
trunk/rkward/rkward/rkeditormanager.h
Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog 2006-09-27 14:02:29 UTC (rev 767)
+++ trunk/rkward/ChangeLog 2006-09-27 14:06:38 UTC (rev 768)
@@ -1,3 +1,4 @@
+- internal cleanups (partially to make porting to KDE4/Qt4 easier)
- when saving/loading the workspace, save / restore all windows (not just data editors)
- remember workspace filename after saving
- fix a long standing (but hard to trigger) crash while closing data editor window
Modified: trunk/rkward/TODO
===================================================================
--- trunk/rkward/TODO 2006-09-27 14:02:29 UTC (rev 767)
+++ trunk/rkward/TODO 2006-09-27 14:06:38 UTC (rev 768)
@@ -108,7 +108,6 @@
- get rid of all the superflous dependencies: http://lists.debian.org/debian-devel/2005/12/msg00439.html
- use more QDicts instead of QMap<QString,...>s
- remove classes/files:
- - RKDocManager? Is this used?
- RKGlobals
- static members should be moved to the respective classes. Much cleaner!
Modified: trunk/rkward/rkward/agents/rksaveagent.cpp
===================================================================
--- trunk/rkward/rkward/agents/rksaveagent.cpp 2006-09-27 14:02:29 UTC (rev 767)
+++ trunk/rkward/rkward/agents/rksaveagent.cpp 2006-09-27 14:06:38 UTC (rev 768)
@@ -27,7 +27,6 @@
#include "../rkglobals.h"
#include "../rkward.h"
#include "../windows/rkworkplace.h"
-#include "../rkeditormanager.h"
#include "../debug.h"
Modified: trunk/rkward/rkward/core/rkmodificationtracker.cpp
===================================================================
--- trunk/rkward/rkward/core/rkmodificationtracker.cpp 2006-09-27 14:02:29 UTC (rev 767)
+++ trunk/rkward/rkward/core/rkmodificationtracker.cpp 2006-09-27 14:06:38 UTC (rev 768)
@@ -20,7 +20,6 @@
#include <klocale.h>
#include "../rkglobals.h"
-#include "../rkeditormanager.h"
#include "../dataeditor/rkeditor.h"
#include "rcontainerobject.h"
Modified: trunk/rkward/rkward/dataeditor/rkeditordataframe.cpp
===================================================================
--- trunk/rkward/rkward/dataeditor/rkeditordataframe.cpp 2006-09-27 14:02:29 UTC (rev 767)
+++ trunk/rkward/rkward/dataeditor/rkeditordataframe.cpp 2006-09-27 14:06:38 UTC (rev 768)
@@ -25,7 +25,6 @@
#include "../core/robject.h"
#include "../core/rkvariable.h"
#include "../core/rcontainerobject.h"
-#include "../rkeditormanager.h"
#include "../core/rkmodificationtracker.h"
#include "rkeditordataframepart.h"
#include "../windows/rkworkplace.h"
Deleted: trunk/rkward/rkward/rkdocmanager.cpp
===================================================================
--- trunk/rkward/rkward/rkdocmanager.cpp 2006-09-27 14:02:29 UTC (rev 767)
+++ trunk/rkward/rkward/rkdocmanager.cpp 2006-09-27 14:06:38 UTC (rev 768)
@@ -1,99 +0,0 @@
-/***************************************************************************
- rkward.cpp - description
- -------------------
- begin : Tue Oct 29 20:06:08 CET 2002
- copyright : (C) 2002 by Thomas Friedrichsmeier
- email : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
-#include "rkdocmanager.h"
-
-#include <kate/document.h>
-#include <kate/view.h>
-
-#include <ktexteditor/configinterface.h>
-#include <ktexteditor/sessionconfiginterface.h>
-#include <ktexteditor/viewcursorinterface.h>
-#include <ktexteditor/printinterface.h>
-#include <ktexteditor/encodinginterface.h>
-#include <ktexteditor/editorchooser.h>
-#include <ktexteditor/popupmenuinterface.h>
-
-#include "debug.h"
-
-RKDocManager::RKDocManager(QObject *parent, const char *name)
- : QObject(parent, name)
-{
- m_factory = (KParts::Factory *) KLibLoader::self()->factory ("libkatepart");
-
-
-
- createDoc();
-}
-
-
-RKDocManager::~RKDocManager()
-{
- KTextEditor::Document *doc;
- for ( doc = m_docList.first(); doc; doc = m_docList.next() ) {
- m_docList.remove (doc);
- delete doc;
- }
-}
-
-
-
-KTextEditor::Document *RKDocManager::createDoc ()
-{
- KTextEditor::Document *doc; /*= (KTextEditor::Document *) m_factory->createPart (0, "", this, "", "KTextEditor::Document");*/
- m_docList.append(doc);
-
- return doc;
-}
-
-void RKDocManager::deleteDoc (Kate::Document *doc)
-{
- m_docList.remove (doc);
- delete doc;
-}
-
-
-KTextEditor::Document *RKDocManager::activeDocument ()
-{
- return m_docList.current();
-}
-
-
-KTextEditor::Document *RKDocManager::firstDocument ()
-{
- return m_docList.first();
-}
-
-KTextEditor::Document *RKDocManager::nextDocument ()
-{
- return m_docList.next();
-}
-
-
-int RKDocManager::findDocument (Kate::Document *doc)
-{
- return m_docList.find (doc);
-}
-
-uint RKDocManager::documents ()
-{
- return m_docList.count ();
-}
-
-
-
-#include "rkdocmanager.moc"
Deleted: trunk/rkward/rkward/rkdocmanager.h
===================================================================
--- trunk/rkward/rkward/rkdocmanager.h 2006-09-27 14:02:29 UTC (rev 767)
+++ trunk/rkward/rkward/rkdocmanager.h 2006-09-27 14:06:38 UTC (rev 768)
@@ -1,57 +0,0 @@
-/***************************************************************************
- rkward.cpp - description
- -------------------
- begin : Tue Oct 29 20:06:08 CET 2002
- copyright : (C) 2002 by Thomas Friedrichsmeier
- email : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
-
-#ifndef RKDOCMANAGER_H
-#define RKDOCMANAGER_H
-
-#include <qobject.h>
-#include <kate/document.h>
-#include <kparts/factory.h>
-
-/**
-* This class handles Kate documents.
-*
-* @author Pierre Ecochard
-*/
-class RKDocManager : public QObject
-{
-Q_OBJECT
-public:
- RKDocManager(QObject *parent = 0, const char *name = 0);
-
- ~RKDocManager();
-
- KTextEditor::Document *createDoc ();
- void deleteDoc (Kate::Document *doc);
-
-
- KTextEditor::Document *activeDocument ();
-
- KTextEditor::Document *firstDocument ();
- KTextEditor::Document *nextDocument ();
-
- int findDocument (Kate::Document *doc);
- uint documents ();
-
-
-private:
- QPtrList<KTextEditor::Document> m_docList;
- KParts::Factory *m_factory;
-};
-
-#endif
Deleted: trunk/rkward/rkward/rkeditormanager.cpp
===================================================================
--- trunk/rkward/rkward/rkeditormanager.cpp 2006-09-27 14:02:29 UTC (rev 767)
+++ trunk/rkward/rkward/rkeditormanager.cpp 2006-09-27 14:06:38 UTC (rev 768)
@@ -1,172 +0,0 @@
-/***************************************************************************
- rkeditormanager - description
- -------------------
- begin : Fri Aug 20 2004
- copyright : (C) 2004 by Thomas Friedrichsmeier
- email : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-#include "rkeditormanager.h"
-
-#include "dataeditor/rkeditor.h"
-#include "dataeditor/rkeditordataframe.h"
-#include "dataeditor/rkeditordataframepart.h"
-#include "core/robject.h"
-#include "core/rcontainerobject.h"
-#include "core/robjectlist.h"
-#include "rbackend/rinterface.h"
-#include "rkglobals.h"
-#include "rkward.h"
-
-#include "debug.h"
-
-#include <kiconloader.h>
-
-#define RESTORE_COMMAND 1
-
-RKEditorManager::RKEditorManager () : QObject () {
- RK_TRACE (APP);
-
- restore_chain = 0;
-}
-
-RKEditorManager::~RKEditorManager () {
- RK_TRACE (APP);
-}
-
-RKEditor *RKEditorManager::editObject (RObject *object, bool initialize_to_empty) {
- RK_TRACE (APP);
- RObject *iobj = object;
- RKEditor *ed = 0;
- if (!object->objectOpened ()) {
- if (object->isDataFrame ()) {
- ed = newRKEditorDataFrame ();
- // TODO: add child objects, too?
- ed->openObject (object, initialize_to_empty);
- } else if (object->isVariable () && object->getContainer ()->isDataFrame ()) {
- if (!object->getContainer ()->objectOpened ()) {
- iobj = object->getContainer ();
- ed = newRKEditorDataFrame ();
- // TODO: add child objects, too?
- ed->openObject (iobj, initialize_to_empty);
- // ed->focusObject (obj);
- } else {
- if (object->getContainer ()->objectOpened ()) {
- object->getContainer ()->objectOpened ()->show ();
- object->getContainer ()->objectOpened ()->raise ();
- }
- }
- }
-
- if (ed) {
- setEditorName (ed, iobj->getShortName ());
-
- RCommand *command = new RCommand (".rk.editor.opened (" + iobj->getFullName() + ")", RCommand::App | RCommand::Sync);
- RKGlobals::rInterface ()->issueCommand (command, restore_chain);
- }
- } else {
- object->objectOpened ()->show ();
- object->objectOpened ()->raise ();
- }
-
- return ed;
-}
-
-void RKEditorManager::restoreEditors () {
- RK_TRACE (APP);
- restore_chain = RKGlobals::rInterface ()->startChain (restore_chain);
-
- RCommand *command = new RCommand ("if (exists (\".rk.editing\")) { .rk.editingtemp <- .rk.editing; remove (.rk.editing); .rk.editingtemp; }", RCommand::App | RCommand::Sync | RCommand::GetStringVector, QString::null, this, RESTORE_COMMAND);
- RKGlobals::rInterface ()->issueCommand (command, restore_chain);
-}
-
-void RKEditorManager::rCommandDone (RCommand *command) {
- RK_TRACE (APP);
- if (command->getFlags () == RESTORE_COMMAND) {
- for (int i=0; i < command->stringVectorLength (); ++i) {
- RObject *object = RKGlobals::rObjectList ()->findObject (command->getStringVector ()[i]);
- if (object) {
- editObject (object);
- }
- }
-
- RCommand *command = new RCommand ("if (exists (\".rk.editingtemp\")) remove (.rk.editingtemp)", RCommand::App | RCommand::Sync);
- RKGlobals::rInterface ()->issueCommand (command, restore_chain);
- restore_chain = RKGlobals::rInterface ()->closeChain (restore_chain);
- } else {
- RK_ASSERT (false);
- }
-}
-
-void RKEditorManager::closedEditor (RKEditor *editor) {
- RK_TRACE (APP);
-
- RK_ASSERT (editor);
-
- RObject *object = editor->getObject ();
- object->setObjectOpened (editor, false);
- QValueList<RKEditor*>::iterator it = editors.find (editor);
- if (it != editors.end ()) editors.erase (it);
-
- RCommand *command = new RCommand (".rk.editor.closed (" + object->getFullName() + ")", RCommand::App | RCommand::Sync);
- RKGlobals::rInterface ()->issueCommand (command, 0);
-}
-
-void RKEditorManager::flushAll () {
- RK_TRACE (APP);
-
- for (QValueList<RKEditor*>::const_iterator it = editors.begin (); it != editors.end (); ++it) {
- (*it)->flushChanges ();
- }
-}
-
-void RKEditorManager::closeAll () {
- RK_TRACE (APP);
-
- QValueList<RKEditor*>::const_iterator it = editors.begin ();
-
- while (it != editors.end ()){
- RKEditor *ed = *it;
- ++it;
- ed->close (); // will be removed from list of editors in closedEditor ()
- }
-}
-
-bool RKEditorManager::canEditObject (RObject *object) {
- RK_TRACE (APP);
-
- if (object->isDataFrame ()) {
- return true;
- } else if (object->isVariable () && object->getContainer ()->isDataFrame ()) {
- return true;
- }
- return false;
-}
-
-void RKEditorManager::setEditorName (RKEditor *editor, const QString &new_name) {
- RK_TRACE (APP);
- editor->setMDICaption (new_name);
-}
-
-RKEditorDataFrame *RKEditorManager::newRKEditorDataFrame () {
- RK_TRACE (APP);
-
- RKEditorDataFramePart *part = new RKEditorDataFramePart (0);
- (RKGlobals::rkApp()->m_manager)->addPart (part, false);
- part->getEditor ()->setIcon (SmallIcon ("spreadsheet"));
- RKGlobals::rkApp ()->addWindow (part->getEditor ());
- part->getEditor ()->setFocus (); // somehow we need to call this explicitely
- editors.append (part->getEditor ());
-
- return part->getEditor ();
-}
-
-#include "rkeditormanager.moc"
Deleted: trunk/rkward/rkward/rkeditormanager.h
===================================================================
--- trunk/rkward/rkward/rkeditormanager.h 2006-09-27 14:02:29 UTC (rev 767)
+++ trunk/rkward/rkward/rkeditormanager.h 2006-09-27 14:06:38 UTC (rev 768)
@@ -1,66 +0,0 @@
-/***************************************************************************
- rkeditormanager - description
- -------------------
- begin : Fri Aug 20 2004
- copyright : (C) 2004 by Thomas Friedrichsmeier
- email : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-#ifndef RKEDITORMANAGER_H
-#define RKEDITORMANAGER_H
-
-#include <qwidget.h>
-#include <qmap.h>
-#include <qvaluelist.h>
-
-#include "rbackend/rcommandreceiver.h"
-
-class RKEditor;
-class RObject;
-class RCommandChain;
-class RCommand;
-class RKEditorDataFrame;
-
-/**
-This class is used to manage open editor windows. It is used to do some generic functions, like notifying the backend, when an editor window has been closed. Also (and perhaps most importantly), it contains a function editObject (), which will open any editable RObject with the editor capable to do so.
-
- at author Thomas Friedrichsmeier
-*/
-class RKEditorManager : public QObject, public RCommandReceiver {
-Q_OBJECT
-public:
- RKEditorManager();
-
- ~RKEditorManager();
-
- RKEditor *editObject (RObject *object, bool initialize_to_empty=false);
-/** tries to open the editors/objects that were last opened (in the previous session) */
- void restoreEditors ();
-
- void closedEditor (RKEditor *editor);
-
- void flushAll ();
- void closeAll ();
-
-/** is an editor availble for the type of object given? */
- bool canEditObject (RObject *object);
-
-/** set the name (caption) of an editor */
- void setEditorName (RKEditor *editor, const QString &new_name);
-protected:
- void rCommandDone (RCommand *command);
-private:
- RCommandChain *restore_chain;
- RKEditorDataFrame *newRKEditorDataFrame ();
- QValueList<RKEditor*> editors;
-};
-
-#endif
Modified: trunk/rkward/rkward/rkwatch.cpp
===================================================================
--- trunk/rkward/rkward/rkwatch.cpp 2006-09-27 14:02:29 UTC (rev 767)
+++ trunk/rkward/rkward/rkwatch.cpp 2006-09-27 14:06:38 UTC (rev 768)
@@ -21,7 +21,6 @@
#include "rkglobals.h"
#include "settings/rksettingsmodulewatch.h"
#include "settings/rksettings.h"
-#include "rkeditormanager.h"
#include "windows/rkcommandeditorwindow.h"
#include <qtextedit.h>
Modified: trunk/rkward/rkward/robjectbrowser.cpp
===================================================================
--- trunk/rkward/rkward/robjectbrowser.cpp 2006-09-27 14:02:29 UTC (rev 767)
+++ trunk/rkward/rkward/robjectbrowser.cpp 2006-09-27 14:06:38 UTC (rev 768)
@@ -28,7 +28,6 @@
#include "rkward.h"
#include "windows/rkcommandeditorwindow.h"
#include "rkglobals.h"
-#include "rkeditormanager.h"
#include "core/robjectlist.h"
#include "core/rkmodificationtracker.h"
#include "misc/rkobjectlistview.h"
Modified: trunk/rkward/rkward/windows/rkcommandeditorwindow.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkcommandeditorwindow.cpp 2006-09-27 14:02:29 UTC (rev 767)
+++ trunk/rkward/rkward/windows/rkcommandeditorwindow.cpp 2006-09-27 14:06:38 UTC (rev 768)
@@ -45,7 +45,6 @@
#include <klibloader.h>
#include <kiconloader.h>
-#include "../rkeditormanager.h"
#include "../misc/rkcommonfunctions.h"
#include "../core/robject.h"
#include "../rkglobals.h"
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