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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Fri Nov 16 15:10:26 UTC 2007


Revision: 2230
          http://rkward.svn.sourceforge.net/rkward/?rev=2230&view=rev
Author:   tfry
Date:     2007-11-16 07:10:26 -0800 (Fri, 16 Nov 2007)

Log Message:
-----------
Sigh, there is lost of more hideous Qt3 support code. Start making it go away

Modified Paths:
--------------
    branches/KDE4_port/rkward/agents/rkquitagent.cpp
    branches/KDE4_port/rkward/agents/showedittextfileagent.cpp
    branches/KDE4_port/rkward/dialogs/rkimportdialog.cpp
    branches/KDE4_port/rkward/dialogs/rkloadlibsdialog.cpp
    branches/KDE4_port/rkward/dialogs/rkreadlinedialog.cpp
    branches/KDE4_port/rkward/plugin/rkcomponent.cpp
    branches/KDE4_port/rkward/plugin/rkcomponentcontext.cpp
    branches/KDE4_port/rkward/plugin/rkcomponentmap.cpp
    branches/KDE4_port/rkward/plugin/rkcomponentmap.h
    branches/KDE4_port/rkward/plugin/rkcomponentproperties.cpp
    branches/KDE4_port/rkward/plugin/rkstandardcomponent.cpp
    branches/KDE4_port/rkward/windows/detachedwindowcontainer.cpp
    branches/KDE4_port/rkward/windows/rcontrolwindow.cpp
    branches/KDE4_port/rkward/windows/rkcommandeditorwindow.cpp
    branches/KDE4_port/rkward/windows/rkcommandlog.cpp
    branches/KDE4_port/rkward/windows/rkhelpsearchwindow.cpp
    branches/KDE4_port/rkward/windows/rkhtmlwindow.cpp
    branches/KDE4_port/rkward/windows/rkmdiwindow.cpp
    branches/KDE4_port/rkward/windows/rktoolwindowbar.cpp
    branches/KDE4_port/rkward/windows/rkwindowcatcher.cpp
    branches/KDE4_port/rkward/windows/rkworkplace.cpp
    branches/KDE4_port/rkward/windows/rkworkplaceview.cpp
    branches/KDE4_port/rkward/windows/rkworkplaceview.h

Modified: branches/KDE4_port/rkward/agents/rkquitagent.cpp
===================================================================
--- branches/KDE4_port/rkward/agents/rkquitagent.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/agents/rkquitagent.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -68,7 +68,7 @@
 void RKQuitAgent::doQuitNow () {
 	RK_TRACE (APP);
 
-	RKWardMainWindow::getMain ()->close (true);		// this will kill the agent as well.
+	RKWardMainWindow::getMain ()->close ();		// this will kill the agent as well.
 }
 
 void RKQuitAgent::rCommandDone (RCommand *) {

Modified: branches/KDE4_port/rkward/agents/showedittextfileagent.cpp
===================================================================
--- branches/KDE4_port/rkward/agents/showedittextfileagent.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/agents/showedittextfileagent.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -122,12 +122,7 @@
 	// int_b in RShowFiles means files are to be deleted
 	if ((args->type == RCallbackArgs::RShowFiles) && args->int_b) {
 		for (int n = 0; n < args->int_a; ++n) {
-			// does not compile on some systems (October 2005).
-			//QFile (QString (args->chars_a[n])).remove ();
-			// Workaround (use this instead for a couple of months):
-			QFile file;
-			file.setName (QString (args->chars_a[n]));
-			file.remove ();
+			RK_ASSERT (QFile::remove (QString (args->chars_a[n])));
 		}
 	}
 

Modified: branches/KDE4_port/rkward/dialogs/rkimportdialog.cpp
===================================================================
--- branches/KDE4_port/rkward/dialogs/rkimportdialog.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/dialogs/rkimportdialog.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -72,7 +72,7 @@
 	}
 
 	// file format selection box
-	format_selector->combo->insertStringList (format_labels);
+	format_selector->combo->insertItems (0, format_labels);
 
 	// initialize
 	setMode (KFile::File | KFile::ExistingOnly | KFile::LocalOnly);
@@ -89,13 +89,13 @@
 void RKImportDialog::filterWasChanged (const QString &) {
 	RK_TRACE (DIALOGS);
 
-	int index = filters.findIndex (filterWidget ()->currentFilter ());
+	int index = filters.indexOf (filterWidget ()->currentFilter ());
 
 	if (index < 0) {		// All files
 		format_selector->combo->setEnabled (true);
 	} else {
 		format_selector->combo->setEnabled (false);
-		format_selector->combo->setCurrentItem (index);
+		format_selector->combo->setCurrentIndex (index);
 	}
 }
 
@@ -104,7 +104,7 @@
 
 	KFileDialog::accept ();
 
-	int index = format_selector->combo->currentItem ();
+	int index = format_selector->combo->currentIndex ();
 	QString cid = component_ids[index];
 	RKComponentHandle *handle = RKComponentMap::getComponentHandle (cid);
 	RKContextHandler *chandler = context->makeContextHandler (this, false);

Modified: branches/KDE4_port/rkward/dialogs/rkloadlibsdialog.cpp
===================================================================
--- branches/KDE4_port/rkward/dialogs/rkloadlibsdialog.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/dialogs/rkloadlibsdialog.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -209,7 +209,7 @@
 		call = "sh";
 		params << "-c";
 	}
-	params << R_binary + " CMD R --no-save < " + file.name ();
+	params << R_binary + " CMD R --no-save < " + file.fileName ();
 
 	installation_process = new QProcess ();
 	installation_process->setProcessChannelMode (QProcess::SeparateChannels);
@@ -279,13 +279,17 @@
 	label->setWordWrap (true);
 	mvbox->addWidget (label);
 	
-	QHBoxLayout *hbox = new QHBoxLayout (mvbox);
+	QHBoxLayout *hbox = new QHBoxLayout ();
+	mvbox->addLayout (hbox);
 	hbox->setContentsMargins (0, 0, 0, 0);
-	QVBoxLayout *instvbox = new QVBoxLayout (hbox);
+	QVBoxLayout *instvbox = new QVBoxLayout ();
+	hbox->addLayout (instvbox);
 	instvbox->setContentsMargins (0, 0, 0, 0);
-	QVBoxLayout *buttonvbox = new QVBoxLayout (hbox);
+	QVBoxLayout *buttonvbox = new QVBoxLayout ();
+	hbox->addLayout (buttonvbox);
 	buttonvbox->setContentsMargins (0, 0, 0, 0);
-	QVBoxLayout *loadedvbox = new QVBoxLayout (hbox);
+	QVBoxLayout *loadedvbox = new QVBoxLayout ();
+	hbox->addLayout (loadedvbox);
 	loadedvbox->setContentsMargins (0, 0, 0, 0);
 	
 	label = new QLabel (i18n ("Installed packages"), this);
@@ -464,13 +468,14 @@
 	RK_TRACE (DIALOGS);
 	UpdatePackagesWidget::parent = dialog;
 	
-	QVBoxLayout *mvbox = new QVBoxLayout (this, 0);
+	QVBoxLayout *mvbox = new QVBoxLayout (this);
 	mvbox->setContentsMargins (0, 0, 0, 0);
 	QLabel *label = new QLabel (i18n ("In order to find out, which of your installed packaged have an update available, click \"Fetch List\". This feature requires a working internet connection."), this);
 	label->setWordWrap (true);
 	mvbox->addWidget (label);
 	
-	QHBoxLayout *hbox = new QHBoxLayout (mvbox);
+	QHBoxLayout *hbox = new QHBoxLayout ();
+	mvbox->addLayout (hbox);
 	hbox->setContentsMargins (0, 0, 0, 0);
 	
 	updateable_view = new QTreeWidget (this);
@@ -478,7 +483,8 @@
 	updateable_view->setSelectionMode (QAbstractItemView::ExtendedSelection);
 	hbox->addWidget (updateable_view);
 	
-	QVBoxLayout *buttonvbox = new QVBoxLayout (hbox);
+	QVBoxLayout *buttonvbox = new QVBoxLayout ();
+	hbox->addLayout (buttonvbox);
 	buttonvbox->setContentsMargins (0, 0, 0, 0);
 	get_list_button = new QPushButton (i18n ("Fetch list"), this);
 	connect (get_list_button, SIGNAL (clicked ()), this, SLOT (getListButtonClicked ()));
@@ -628,7 +634,8 @@
 	QLabel *label = new QLabel (i18n ("Many packages are available on CRAN (Comprehensive R Archive Network), and other repositories (click \"Configure Repositories\" to add more sources). Click \"Fetch List\" to find out, which packages are available. This feature requires a working internet connection."), this);
 	label->setWordWrap (true);
 	mvbox->addWidget (label);
-	QHBoxLayout *hbox = new QHBoxLayout (mvbox);
+	QHBoxLayout *hbox = new QHBoxLayout ();
+	mvbox->addLayout (hbox);
 	hbox->setContentsMargins (0, 0, 0, 0);
 	
 	installable_view = new QTreeWidget (this);
@@ -636,7 +643,8 @@
 	installable_view->setSelectionMode (QAbstractItemView::ExtendedSelection);
 	hbox->addWidget (installable_view);
 
-	QVBoxLayout *buttonvbox = new QVBoxLayout (hbox);
+	QVBoxLayout *buttonvbox = new QVBoxLayout ();
+	hbox->addLayout (buttonvbox);
 	buttonvbox->setContentsMargins (0, 0, 0, 0);
 	get_list_button = new QPushButton (i18n ("Fetch list"), this);
 	connect (get_list_button, SIGNAL (clicked ()), this, SLOT (getListButtonClicked ()));
@@ -829,7 +837,7 @@
 	RK_TRACE (DIALOGS);
 
 	libloc_selector->clear ();
-	libloc_selector->insertStringList (newlist);
+	libloc_selector->insertItems (0, newlist);
 }
 
 #include "rkloadlibsdialog.moc"

Modified: branches/KDE4_port/rkward/dialogs/rkreadlinedialog.cpp
===================================================================
--- branches/KDE4_port/rkward/dialogs/rkreadlinedialog.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/dialogs/rkreadlinedialog.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -58,7 +58,7 @@
 		output->setPlainText (QString ());
 		output->setCurrentFont (KGlobalSettings::fixedFont ());
 		output->setLineWrapMode (QTextEdit::NoWrap);
-		output->insert (context);
+		output->insertPlainText (context);
 		output->setReadOnly (true);
 		// there seems to be no easier way to get at the contents width...
 		int cwidth = output->horizontalScrollBar ()->maximum () + output->width ();

Modified: branches/KDE4_port/rkward/plugin/rkcomponent.cpp
===================================================================
--- branches/KDE4_port/rkward/plugin/rkcomponent.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/plugin/rkcomponent.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -67,7 +67,7 @@
 		QString mod;
 		RKComponentBase *prop = lookupComponent (it.key (), &mod);
 		if (mod.isEmpty () && prop->isProperty ()) {		// found a property
-			static_cast<RKComponentPropertyBase*>(prop)->setValue (it.data ());
+			static_cast<RKComponentPropertyBase*>(prop)->setValue (it.value ());
 		}
 	}
 }
@@ -133,9 +133,9 @@
 	// slightly more elaborat than necessary on first thought, to prevent loops
 	if (property == visibility_property) {
 		if (visibility_property->boolValue ()) {
-			if (!isShown ()) show ();
+			if (isHidden ()) show ();
 		} else {
-			if (isShown ()) hide ();
+			if (!isHidden ()) hide ();
 		}
 	} else if (property == enabledness_property) {
 		updateEnablednessRecursive ();

Modified: branches/KDE4_port/rkward/plugin/rkcomponentcontext.cpp
===================================================================
--- branches/KDE4_port/rkward/plugin/rkcomponentcontext.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/plugin/rkcomponentcontext.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -20,6 +20,7 @@
 #include <kaction.h>
 #include <kactioncollection.h>
 
+#include "rkstandardcomponent.h"
 #include "../misc/xmlhelper.h"
 
 #include "../debug.h"

Modified: branches/KDE4_port/rkward/plugin/rkcomponentmap.cpp
===================================================================
--- branches/KDE4_port/rkward/plugin/rkcomponentmap.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/plugin/rkcomponentmap.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -153,14 +153,14 @@
 
 	actionCollection ()->clear ();
 	for (ComponentMap::iterator it = components.begin (); it != components.end (); ++it) {
-		delete (it.data ());
+		delete (it.value ());
 /* TODO: this is not technically correct, as there may be several actions for this id, and we're only deleting one. But practically this should not really be relevant. */
 		delete (actionCollection ()->action (it.key ()));
 	}
 	components.clear ();
 
 	for (PluginMapFileMap::const_iterator it = pluginmapfiles.constBegin (); it != pluginmapfiles.constEnd (); ++it) {
-		delete (it.data ());
+		delete (it.value ());
 	}
 	pluginmapfiles.clear ();
 
@@ -220,7 +220,7 @@
 	RK_TRACE (PLUGIN);
 
 	for (ComponentMap::iterator it = components.begin (); it != components.end (); ++it) {
-		if (it.data () == component) {
+		if (it.value () == component) {
 			return it.key ();
 		}
 	}
@@ -356,7 +356,7 @@
 	return true;
 }
 
-RKComponent *RKComponentHandle::invoke (RKComponent *parent_component, QWidget *parent_widget) {
+RKStandardComponent *RKComponentHandle::invoke (RKComponent *parent_component, QWidget *parent_widget) {
 	RK_TRACE (PLUGIN);
 	RK_ASSERT (isPlugin ());
 

Modified: branches/KDE4_port/rkward/plugin/rkcomponentmap.h
===================================================================
--- branches/KDE4_port/rkward/plugin/rkcomponentmap.h	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/plugin/rkcomponentmap.h	2007-11-16 15:10:26 UTC (rev 2230)
@@ -43,6 +43,7 @@
 
 class RKComponent;
 class RKComponentMap;
+class RKStandardComponent;
 class QWidget;
 class KActionCollection;
 /** This simple class keeps the most basic information about a component in RKWard. Most work is done in RKComponentMap.
@@ -61,7 +62,7 @@
 	RKComponentType getType () { return type; };
 	bool isPlugin ();
 
-	RKComponent *invoke (RKComponent *parent_component, QWidget *parent_widget);
+	RKStandardComponent *invoke (RKComponent *parent_component, QWidget *parent_widget);
 
 	QString getAttributeValue (const QString &attribute_id);
 	QString getAttributeLabel (const QString &attribute_id);

Modified: branches/KDE4_port/rkward/plugin/rkcomponentproperties.cpp
===================================================================
--- branches/KDE4_port/rkward/plugin/rkcomponentproperties.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/plugin/rkcomponentproperties.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -809,7 +809,7 @@
 	object_list.clear ();
 
 	bool ok = true;
-	QStringList slist = QStringList::split (separator, value);
+	QStringList slist = value.split (separator);
 
 	for (QStringList::const_iterator it = slist.begin (); it != slist.end (); ++it) {
 		RObject *obj = RObjectList::getObjectList ()->findObject (value);
@@ -829,7 +829,7 @@
 bool RKComponentPropertyRObjects::isStringValid (const QString &value) {
 	RK_TRACE (PLUGIN);
 
-	QStringList slist = QStringList::split (separator, value);
+	QStringList slist = value.split (separator);
 
 	for (QStringList::const_iterator it = slist.begin (); it != slist.end (); ++it) {
 		RObject *obj = RObjectList::getObjectList ()->findObject (value);
@@ -1045,7 +1045,7 @@
 	RK_TRACE (PLUGIN);
 
 	sources.clear ();
-	QStringList source_ids = QStringList::split (";", source_string);
+	QStringList source_ids = source_string.split (";");
 	for (QStringList::const_iterator it = source_ids.constBegin (); it != source_ids.constEnd (); ++it) {
 		Source s;
 		RKComponentBase *prop = c_parent->lookupComponent (*it, &(s.modifier));

Modified: branches/KDE4_port/rkward/plugin/rkstandardcomponent.cpp
===================================================================
--- branches/KDE4_port/rkward/plugin/rkstandardcomponent.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/plugin/rkstandardcomponent.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -103,6 +103,7 @@
 	have_help = QFileInfo (dummy).exists ();
 
 	handle_change_timer = new QTimer (this);
+	handle_change_timer->setSingleShot (true);
 	connect (handle_change_timer, SIGNAL (timeout ()), this, SLOT (handleChange ()));
 
 // construct the GUI
@@ -177,7 +178,7 @@
 	RK_TRACE (PLUGIN);
 
 	if (!gui) return;
-	gui->setCaption (caption);
+	gui->setWindowTitle (caption);
 }
 
 bool RKStandardComponent::createTopLevel (const QDomElement &doc_element, int force_mode, bool enslaved) {
@@ -314,7 +315,7 @@
 	if (gui) gui->enableSubmit (false);
 
 	// delay actual handling, until all changes have run up
-	handle_change_timer->start (10, true);
+	handle_change_timer->start (10);
 }
 
 void RKStandardComponent::handleChange () {
@@ -577,9 +578,10 @@
 			RKComponentHandle *handle = RKComponentMap::getComponentHandle (component_id);
 			if (handle) {
 				if (xml->getBoolAttribute (e, "as_button", false, DL_INFO)) {
-					widget = handle->invoke (component (), 0);
+					RKStandardComponent* swidget = handle->invoke (component (), 0);
+					widget = swidget;
 					QString dummy = xml->getStringAttribute (e, "label", "Options", DL_WARNING);
-					widget->setCaption (dummy);
+					swidget->setCaption (dummy);
 // TODO we should use a specialized pushbutton, that changes color if the corresponding component is dissatisfied!
 					QPushButton *button = new QPushButton (dummy, parent_widget);
 					component ()->connect (button, SIGNAL (clicked ()), widget, SLOT (showGUI ()));

Modified: branches/KDE4_port/rkward/windows/detachedwindowcontainer.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/detachedwindowcontainer.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/windows/detachedwindowcontainer.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -88,7 +88,7 @@
 	QString ntext = text.trimmed ();
 	ntext.replace ("<qt>", "");	// WORKAROUND: what the ?!? is going on? The KTHMLPart seems to post such messages.
 
-	statusBar ()->message (ntext);
+	statusBar ()->showMessage (ntext);
 	statusBar ()->show ();
 }
 

Modified: branches/KDE4_port/rkward/windows/rcontrolwindow.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rcontrolwindow.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/windows/rcontrolwindow.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -42,8 +42,10 @@
 	initializeActivationSignals ();
 	setFocusPolicy (Qt::ClickFocus);
 
-	QVBoxLayout *main_vbox = new QVBoxLayout (this, RKGlobals::marginHint ());
-	QHBoxLayout *button_hbox = new QHBoxLayout (main_vbox, RKGlobals::spacingHint ());
+	QVBoxLayout *main_vbox = new QVBoxLayout (this);
+	QHBoxLayout *button_hbox = new QHBoxLayout ();
+	button_hbox->setContentsMargins (0, 0, 0, 0);
+	main_vbox->addLayout (button_hbox);
 
 	QPushButton *configure_r_button = new QPushButton (i18n ("Configure R backend"), this);
 	connect (configure_r_button, SIGNAL (clicked ()), this, SLOT (configureButtonClicked ()));

Modified: branches/KDE4_port/rkward/windows/rkcommandeditorwindow.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkcommandeditorwindow.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/windows/rkcommandeditorwindow.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -92,6 +92,7 @@
 	// somehow the katepart loses the context menu each time it loses focus
 	connect (m_view, SIGNAL (focusIn(KTextEditor::View*)), this, SLOT (focusIn(KTextEditor::View*)));
 	completion_timer = new QTimer (this);
+	completion_timer->setSingleShot (true);
 	connect (completion_timer, SIGNAL (timeout ()), this, SLOT (tryCompletion()));
 
 	completion_model = 0;
@@ -153,7 +154,7 @@
 
 void RKCommandEditorWindow::closeEvent (QCloseEvent *e) {
 	if (isModified ()) {
-		int status = KMessageBox::warningYesNo (this, i18n ("The document \"%1\" has been modified. Close it anyway?", caption ()), i18n ("File not saved"));
+		int status = KMessageBox::warningYesNo (this, i18n ("The document \"%1\" has been modified. Close it anyway?", windowTitle ()), i18n ("File not saved"));
 	
 		if (status != KMessageBox::Yes) {
 			e->ignore ();
@@ -244,7 +245,7 @@
 		if (cc_iface && cc_iface->isCompletionActive ()) {
 			tryCompletion ();
 		} else {
-			completion_timer->start (RKSettingsModuleCommandEditor::completionTimeout (), true);
+			completion_timer->start (RKSettingsModuleCommandEditor::completionTimeout ());
 		}
 	}
 }
@@ -257,7 +258,7 @@
 	uint para=c.line(); uint cursor_pos=c.column();
 
 	QString current_line = m_doc->line (para);
-	if (current_line.findRev ("#", cursor_pos) >= 0) return QString ();	// do not hint while in comments
+	if (current_line.lastIndexOf ("#", cursor_pos) >= 0) return QString ();	// do not hint while in comments
 
 	return RKCommonFunctions::getCurrentSymbol (current_line, cursor_pos, false);
 }
@@ -280,7 +281,7 @@
 
 	KTextEditor::Range range = KTextEditor::Range (para, start, para, end);
 	QString word = m_doc->text (range);
-	if (current_line.findRev ("#", cursor_pos) >= 0) word.clear ();	// do not hint while in comments
+	if (current_line.lastIndexOf ("#", cursor_pos) >= 0) word.clear ();	// do not hint while in comments
 	if (word.length () >= RKSettingsModuleCommandEditor::completionMinChars ()) {
 		completion_model->updateCompletionList (word);
 		if (completion_model->isEmpty ()) {
@@ -477,7 +478,7 @@
 }
 
 bool RKFunctionArgHinter::eventFilter (QObject *, QEvent *e) {
-	if (e->type () == QEvent::KeyPress || e->type () == QEvent::AccelOverride) {
+	if (e->type () == QEvent::KeyPress || e->type () == QEvent::ShortcutOverride) {
 		RK_TRACE (COMMANDEDITOR);	// avoid loads of empty traces, putting this here
 		QKeyEvent *k = static_cast<QKeyEvent *> (e);
 
@@ -526,7 +527,7 @@
 	list_names.reserve (count);
 	// this is silly, but we need an int indexable storage, so we copy the map to a list
 	for (RObject::RObjectSearchMap::const_iterator it = map.constBegin (); it != map.constEnd (); ++it) {
-		list.append (it.data ());
+		list.append (it.value ());
 		// the second list is used to store the name that should be used for completion.
 		// This may be object->getBaseName() or object->getFullName () depending on whether the object is
 		// masked or not.

Modified: branches/KDE4_port/rkward/windows/rkcommandlog.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkcommandlog.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/windows/rkcommandlog.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -28,8 +28,8 @@
 #include <qfont.h>
 #include <qlayout.h>
 #include <qsplitter.h>
-#include <qobject.h>
 #include <QMenu>
+#include <QContextMenuEvent>
 
 #include <klocale.h>
 #include <kactioncollection.h>
@@ -226,7 +226,7 @@
 void RKCommandLog::runSelection () {
 	RK_TRACE (APP);
 
-	RKConsole::pipeUserCommand (getView ()->selectedText ());
+	RKConsole::pipeUserCommand (getView ()->textCursor ().selectedText ());
 }
 
 ////////////////////////// END RKCommandLog ///////////////////////////
@@ -292,8 +292,8 @@
 	RK_TRACE (APP);
 
 	QMenu *menu = static_cast<QMenu *> (factory ()->container ("rkcommandlog_context_menu", this));
-	copy->setEnabled (log->getView ()->hasSelectedText ());
-	run_selection->setEnabled (log->getView ()->hasSelectedText ());
+	copy->setEnabled (log->getView ()->textCursor ().hasSelection ());
+	run_selection->setEnabled (log->getView ()->textCursor ().hasSelection ());
 
 	if (!menu) {
 		RK_ASSERT (false);

Modified: branches/KDE4_port/rkward/windows/rkhelpsearchwindow.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkhelpsearchwindow.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/windows/rkhelpsearchwindow.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -59,10 +59,12 @@
 	setFocusPolicy (Qt::ClickFocus);
 
 	QVBoxLayout* main_layout = new QVBoxLayout (this);
-	QHBoxLayout* selection_layout = new QHBoxLayout (main_layout);
+	QHBoxLayout* selection_layout = new QHBoxLayout ();
+	main_layout->addLayout (selection_layout);
 	selection_layout->setContentsMargins (0, 0, 0, 0);
 
-	QVBoxLayout* labels_layout = new QVBoxLayout (selection_layout);
+	QVBoxLayout* labels_layout = new QVBoxLayout ();
+	selection_layout->addLayout (labels_layout);
 	labels_layout->setContentsMargins (0, 0, 0, 0);
 	QLabel *label = new QLabel (i18n ("Find:"), this);
 	label->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Minimum);
@@ -71,16 +73,20 @@
 	label->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Minimum);
 	labels_layout->addWidget (label);
 
-	QVBoxLayout* main_settings_layout = new QVBoxLayout (selection_layout, RKGlobals::spacingHint ());
+	QVBoxLayout* main_settings_layout = new QVBoxLayout ();
+	selection_layout->addLayout (main_settings_layout);
 	main_settings_layout->setContentsMargins (0, 0, 0, 0);
-	field = new QComboBox (true, this);
+	field = new QComboBox (this);
+	field->setEditable (true);
 	field->setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
 	connect (field->lineEdit () , SIGNAL (returnPressed ()), this, SLOT (slotFindButtonClicked ()));
 	main_settings_layout->addWidget (field);
 
-	QHBoxLayout* fields_packages_layout = new QHBoxLayout (main_settings_layout, RKGlobals::spacingHint ());
+	QHBoxLayout* fields_packages_layout = new QHBoxLayout ();
+	main_settings_layout->addLayout (fields_packages_layout);
 	fields_packages_layout->setContentsMargins (0, 0, 0, 0);
-	fieldsList = new QComboBox (false, this);
+	fieldsList = new QComboBox (this);
+	fieldsList->setEditable (false);
 	fieldsList->addItem (i18n ("All"), "c(\"alias\", \"concept\", \"title\",\"keyword\")");
 	fieldsList->addItem (i18n ("All but keywords"), "c(\"alias\", \"concept\", \"title\")");
 	fieldsList->addItem (i18n ("Keywords"), "c(\"keyword\")");
@@ -91,11 +97,13 @@
 	label->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Minimum);
 	fields_packages_layout->addWidget (label);
 
-	packagesList = new QComboBox (false, this);
-	packagesList->insertItem (i18n("All"));
+	packagesList = new QComboBox (this);
+	packagesList->setEditable (false);
+	packagesList->addItem (i18n("All"));
 	fields_packages_layout->addWidget (packagesList);
 
-	QVBoxLayout* checkboxes_layout = new QVBoxLayout (selection_layout, RKGlobals::spacingHint ());
+	QVBoxLayout* checkboxes_layout = new QVBoxLayout ();
+	selection_layout->addLayout (checkboxes_layout);
 	checkboxes_layout->setContentsMargins (0, 0, 0, 0);
 	caseSensitiveCheckBox = new QCheckBox (i18n ("Case sensitive"), this);
 	checkboxes_layout->addWidget (caseSensitiveCheckBox);
@@ -174,7 +182,7 @@
 	
 	RKGlobals::rInterface ()->issueCommand (s, RCommand::App | RCommand::Sync | RCommand::GetStringVector, QString::null, this, HELP_SEARCH, 0);
 	setEnabled (false);
-	field->insertItem (field->currentText ());
+	field->addItem (field->currentText ());
 }
 
 void RKHelpSearchWindow::resultDoubleClicked (const QModelIndex& index) {
@@ -221,7 +229,7 @@
 		RK_ASSERT (command->getDataType () == RData::StringVector);
 		unsigned int count = command->getDataLength ();
 		for (unsigned int i=0; i < count; ++i) {
-			packagesList->insertItem (command->getStringVector ()[i]);
+			packagesList->addItem (command->getStringVector ()[i]);
 		}
 	} else {
 		RK_ASSERT (false);

Modified: branches/KDE4_port/rkward/windows/rkhtmlwindow.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkhtmlwindow.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/windows/rkhtmlwindow.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -249,7 +249,7 @@
 	// for this window, we need to set it explicitely, as the logic in RKHTMLWindow though we are an RKHTMLWindow, only
 	setWindowIcon (RKStandardIcons::getIcon (RKStandardIcons::WindowOutput));
 	// strip down the khtmlpart's GUI. remove some stuff we definitely don't need.
-	RKCommonFunctions::removeContainers (khtmlpart, QStringList::split (',', "tools,security,extraToolBar,saveBackground,saveFrame,printFrame,kget_menu"), true);
+	RKCommonFunctions::removeContainers (khtmlpart, QString ("tools,security,extraToolBar,saveBackground,saveFrame,printFrame,kget_menu").split (','), true);
 
 	setComponentData (KGlobal::mainComponent ());
 	setXMLFile ("rkoutputwindow.rc");
@@ -370,11 +370,11 @@
 	int res = KMessageBox::questionYesNo (this, i18n ("Do you really want to flush the output? It will not be possible to restore it."), i18n ("Flush output?"));
 	if (res==KMessageBox::Yes) {
 		QFile out_file (RKSettingsModuleGeneral::filesPath () + "/rk_out.html");
-		QDir out_dir = QFileInfo (out_file).dir (true);
+		QDir out_dir = QFileInfo (out_file).absoluteDir ();
 		out_file.remove ();
 
 		// remove all the graphs
-		out_dir.setNameFilter ("graph*.png");
+		out_dir.setNameFilters (QStringList ("graph*.png"));
 		QStringList graph_files = out_dir.entryList ();
 		for (QStringList::const_iterator it = graph_files.constBegin (); it != graph_files.constEnd (); ++it) {
 			QFile file (out_dir.absoluteFilePath (*it));
@@ -405,7 +405,7 @@
 	setComponentData (KGlobal::mainComponent ());
 
 	// strip down the khtmlpart's GUI. remove some stuff we definitely don't need.
-	RKCommonFunctions::removeContainers (khtmlpart, QStringList::split (',', "tools,security,extraToolBar,saveBackground,saveDocument,saveFrame,printFrame,kget_menu"), true);
+	RKCommonFunctions::removeContainers (khtmlpart, QString ("tools,security,extraToolBar,saveBackground,saveDocument,saveFrame,printFrame,kget_menu").split ('.'), true);
 
 	back = actionCollection ()->addAction (KStandardAction::Back, "help_back", this, SLOT (slotBack()));
 	back->setEnabled (false);
@@ -493,7 +493,7 @@
 			if (element.isNull ()) break;
 			help_file_name = component_xml->getStringAttribute (element, "file", QString::null, DL_ERROR);
 			if (help_file_name.isNull ()) break;
-			help_file_name = QFileInfo (chandle->getFilename ()).dir (true).filePath (help_file_name);
+			help_file_name = QFileInfo (chandle->getFilename ()).absoluteDir ().filePath (help_file_name);
 		} else {
 			help_file_name = help_base_dir + url.path () + ".rkh";
 		}
@@ -640,7 +640,7 @@
 
 	// render to string
 	QString ret;
-	QTextOStream stream (&ret);
+	QTextStream stream (&ret, QIODevice::WriteOnly);
 	for (QDomNode node = fragment.firstChild (); !node.isNull (); node = node.nextSibling ()) {
 		node.save (stream, 0);
 	}
@@ -692,7 +692,7 @@
 RKComponentHandle *RKHelpWindow::componentPathToHandle (QString path) {
 	RK_TRACE (APP);
 
-	QStringList path_segments = QStringList::split ('/', path);
+	QStringList path_segments = path.split ('/');
 	if (path_segments.count () > 2) return 0;
 	if (path_segments.count () < 1) return 0;
 	if (path_segments.count () == 1) path_segments.push_front ("rkward");

Modified: branches/KDE4_port/rkward/windows/rkmdiwindow.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkmdiwindow.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/windows/rkmdiwindow.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -33,7 +33,8 @@
 
 #include "../debug.h"
 
-RKMDIWindow::RKMDIWindow (QWidget *parent, int type, bool tool_window, const char *name) : QFrame (parent, name) {
+// TODO: remove name parameter
+RKMDIWindow::RKMDIWindow (QWidget *parent, int type, bool tool_window, const char *) : QFrame (parent) {
 	RK_TRACE (APP);
 
 	if (tool_window) {
@@ -63,13 +64,12 @@
 //virtual
 QString RKMDIWindow::shortCaption () {
 	RK_TRACE (APP);
-	return caption ();
+	return windowTitle ();
 }
 
-// virtual from QWidget
 void RKMDIWindow::setCaption (const QString &caption) {
 	RK_TRACE (APP);
-	QWidget::setCaption (caption);
+	QWidget::setWindowTitle (caption);
 	emit (captionChanged (this));
 }
 
@@ -98,7 +98,7 @@
 
 	if (with_focus) {
 		if (old_focus) old_focus->clearFocus ();
-		topLevelWidget ()->setActiveWindow ();
+		topLevelWidget ()->activateWindow ();
 		setFocus();
 	} else {
 		if (old_focus) old_focus->setFocus ();
@@ -120,7 +120,16 @@
 		return true;
 	}
 
-	return QWidget::close (also_delete);
+// TODO: can the also_delete parameter be removed? If the asserts never trigger, likely so.
+	if (also_delete) {
+		RK_ASSERT (testAttribute (Qt::WA_DeleteOnClose));
+		bool closed = QWidget::close ();
+//		if (closed) deleteLater ();
+		return closed;
+	} else {
+		RK_ASSERT (!testAttribute (Qt::WA_DeleteOnClose));
+		return QWidget::close ();
+	}
 }
 
 void RKMDIWindow::prepareToBeAttached () {

Modified: branches/KDE4_port/rkward/windows/rktoolwindowbar.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rktoolwindowbar.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/windows/rktoolwindowbar.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -100,7 +100,7 @@
 
 	if (!pos) {		// collapsed. Hide it properly.
 		for (QMap<RKMDIWindow*, int>::const_iterator it = widget_to_id.constBegin (); it != widget_to_id.constEnd (); ++it) {
-			if (isTabRaised (it.data ())) {
+			if (isTabRaised (it.value ())) {
 				hideWidget (it.key ());
 				break;
 			}
@@ -195,6 +195,7 @@
 		}
 	}
 
+	widget->show ();
 	if (widget->isAttached ()) {
 		setTab (id, true);
 		container->show ();
@@ -204,7 +205,6 @@
 		widget->topLevelWidget ()->raise ();
 	}
 	widget->active = true;
-	widget->show ();
 }
 
 void RKToolWindowBar::hideWidget (RKMDIWindow *widget) {
@@ -221,7 +221,7 @@
 	}
 
 	widget->active = false;
-	widget->close (false);
+	widget->hide ();
 
 	setTab (id, false);
 

Modified: branches/KDE4_port/rkward/windows/rkwindowcatcher.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkwindowcatcher.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/windows/rkwindowcatcher.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -148,7 +148,8 @@
 
 	if (dynamic_size_action->isChecked ()) {
 		scroll_widget->takeWidget ();
-		xembed_container->reparent (box_widget, QPoint (0, 0), true);
+		xembed_container->setParent (box_widget);
+		xembed_container->show ();
 		scroll_widget->hide ();
 		box_widget->show ();
 		xembed_container->setMinimumSize (5, 5);

Modified: branches/KDE4_port/rkward/windows/rkworkplace.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkworkplace.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/windows/rkworkplace.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -127,7 +127,7 @@
 
 void RKWorkplace::attachWindow (RKMDIWindow *window) {
 	RK_TRACE (APP);
-	RK_ASSERT (windows.find (window) != windows.end ());		// This should not happen for now.
+	RK_ASSERT (windows.contains (window));		// This should not happen for now.
 
 	if (!window->isAttached ()) window->prepareToBeAttached ();
 
@@ -138,7 +138,7 @@
 	} else {
 		view ()->addPage (window);
 		view ()->topLevelWidget ()->raise ();
-		view ()->topLevelWidget ()->setActiveWindow ();
+		view ()->topLevelWidget ()->activateWindow ();
 	}
 
 	RK_ASSERT (window->getPart ());
@@ -148,7 +148,7 @@
 void RKWorkplace::detachWindow (RKMDIWindow *window, bool was_attached) {
 	RK_TRACE (APP);
 	if (!window) return;
-	RK_ASSERT (windows.find (window) != windows.end ());		// Can't detach a window that is not registered
+	RK_ASSERT (windows.contains (window));		// Can't detach a window that is not registered
 
 	window->prepareToBeDetached ();
 	window->state = RKMDIWindow::Detached;
@@ -178,7 +178,7 @@
 
 	RK_ASSERT (window->isToolWindow ());
 	tool_window_bars[position]->addWidget (window);
-	if (windows.find (window) == windows.end ()) {	// must be new
+	if (!windows.contains (window)) {	// must be new
 		addWindow (window, true);
 		RKWardMainWindow::getMain ()->partManager ()->addPart (window->getPart ());
 	}
@@ -242,7 +242,7 @@
 	RK_TRACE (APP);
 
 	RKOutputWindow::refreshOutput (true, true, false);
-	if (windows.find (RKOutputWindow::getCurrentOutput ()) == windows.end ()) {
+	if (!windows.contains (RKOutputWindow::getCurrentOutput ())) {
 		addWindow (RKOutputWindow::getCurrentOutput ());
 	}
 }
@@ -251,7 +251,7 @@
 	RK_TRACE (APP);
 	RKOutputWindow *window = RKOutputWindow::refreshOutput (RKSettingsModuleOutput::autoShow (), RKSettingsModuleOutput::autoRaise (), only_if_modified);
 	if (window) {
-		if (windows.find (window) == windows.end ()) {
+		if (!windows.contains (window)) {
 			addWindow (window);
 		}
 	}
@@ -349,7 +349,7 @@
 
 void RKWorkplace::closeWindow (RKMDIWindow *window) {
 	RK_TRACE (APP);
-	RK_ASSERT (windows.find (window) != windows.end ());
+	RK_ASSERT (windows.contains (window));
 
 	bool tool_window = window->isToolWindow ();
 	window->close (true);		// all the rest should happen in windowDestroyed ()
@@ -394,8 +394,8 @@
 
 	// WARNING: the window is dead. Don't call any functions on it.
 
-	RK_ASSERT (windows.find (window) != windows.end ());
-	windows.remove (window);		// do this first! view()->removePage will call activePage() indirectly from setCaption, causing us to iterate over all known windows!
+	RK_ASSERT (windows.contains (window));
+	windows.removeAll (window);		// do this first! view()->removePage will call activePage() indirectly from setCaption, causing us to iterate over all known windows!
 	if (view ()->hasPage (window)) view ()->removePage (window, true);
 
 	windowRemoved ();
@@ -495,7 +495,7 @@
 void RKWorkplace::restoreWorkplace (const QString &description) {
 	RK_TRACE (APP);
 
-	QStringList list = QStringList::split ("\n", description);
+	QStringList list = description.split ("\n");
 	for (QStringList::const_iterator it = list.constBegin (); it != list.constEnd (); ++it) {
 		restoreWorkplaceItem (*it);
 	}
@@ -578,7 +578,7 @@
 	if (window->isToolWindow ()) return;		// exclude tool windows for now. Make configurable?
 
 	// update lists
-	back_list.remove (window);		// remove dupes
+	back_list.removeAll (window);		// remove dupes
 	forward_list.clear ();
 	if (current) back_list.append (current);
 	current = window;
@@ -641,8 +641,8 @@
 void RKMDIWindowHistory::windowDestroyed (QObject *window) {
 	RK_TRACE (APP);
 
-	back_list.remove (static_cast<RKMDIWindow *> (window));
-	forward_list.remove (static_cast<RKMDIWindow *> (window));
+	back_list.removeAll (static_cast<RKMDIWindow *> (window));
+	forward_list.removeAll (static_cast<RKMDIWindow *> (window));
 	if (current == window) current = 0;
 	updateActions ();
 }

Modified: branches/KDE4_port/rkward/windows/rkworkplaceview.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkworkplaceview.cpp	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/windows/rkworkplaceview.cpp	2007-11-16 15:10:26 UTC (rev 2230)
@@ -88,14 +88,13 @@
 
 	int id = -1;
 	setUpdatesEnabled (false);
-	if (widget->icon ()) {
-		id = addTab (widget, *(widget->icon ()), widget->shortCaption ());
-	} else if (widget->topLevelWidget ()->icon ()) {
-		id = addTab (widget, *(widget->topLevelWidget ()->icon ()), widget->shortCaption ());
-	} else {
-		RK_ASSERT (false);
-		id = addTab (widget, widget->shortCaption ());
-	}
+
+	QIcon icon = widget->windowIcon ();
+	if (icon.isNull ()) icon = widget->topLevelWidget ()->windowIcon ();
+	if (icon.isNull ()) RK_ASSERT (false);
+
+	id = addTab (widget, icon, widget->shortCaption ());
+
 	connect (widget, SIGNAL (captionChanged (RKMDIWindow *)), this, SLOT (childCaptionChanged (RKMDIWindow *)));
 	widget->show ();
 
@@ -150,16 +149,6 @@
 	return (dynamic_cast<RKMDIWindow *> (w));
 }
 
-// KDE4: Where is this called from? do we still need it?
-void RKWorkplaceView::closePage (int index) {
-	RK_TRACE (APP);
-
-	QWidget *w = widget (index);
-	RK_ASSERT (w);
-
-	w->close (true);
-}
-
 void RKWorkplaceView::childCaptionChanged (RKMDIWindow *widget) {
 	RK_TRACE (APP);
 
@@ -172,7 +161,7 @@
 void RKWorkplaceView::setCaption (const QString &caption) {
 	RK_TRACE (APP);
 
-	QWidget::setCaption (caption);
+	QWidget::setWindowTitle (caption);
 	emit (captionChanged (caption));
 }
 

Modified: branches/KDE4_port/rkward/windows/rkworkplaceview.h
===================================================================
--- branches/KDE4_port/rkward/windows/rkworkplaceview.h	2007-11-16 00:41:58 UTC (rev 2229)
+++ branches/KDE4_port/rkward/windows/rkworkplaceview.h	2007-11-16 15:10:26 UTC (rev 2230)
@@ -64,7 +64,6 @@
 	void currentPageChanged (int page);
 /** called when the caption of a window changes. Updates the tab-label, and - if appropriate - the caption of this widget */
 	void childCaptionChanged (RKMDIWindow *widget);
-	void closePage (int index);
 /** Active the page left of the current tab */
 	void pageLeft ();
 /** Active the page right of the current tab */


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