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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Sun Nov 25 21:30:01 UTC 2007


Revision: 2271
          http://rkward.svn.sourceforge.net/rkward/?rev=2271&view=rev
Author:   tfry
Date:     2007-11-25 13:30:01 -0800 (Sun, 25 Nov 2007)

Log Message:
-----------
silence some -Woverloaded-virtual warnings, and more correct caption setting

Modified Paths:
--------------
    branches/KDE4_port/rkward/rbackend/rinterface.cpp
    branches/KDE4_port/rkward/rkward.cpp
    branches/KDE4_port/rkward/rkward.h
    branches/KDE4_port/rkward/windows/rkhtmlwindow.cpp
    branches/KDE4_port/rkward/windows/rkworkplace.cpp
    branches/KDE4_port/rkward/windows/rkworkplace.h
    branches/KDE4_port/rkward/windows/rkworkplaceview.cpp
    branches/KDE4_port/rkward/windows/rkworkplaceview.h

Modified: branches/KDE4_port/rkward/rbackend/rinterface.cpp
===================================================================
--- branches/KDE4_port/rkward/rbackend/rinterface.cpp	2007-11-22 23:58:10 UTC (rev 2270)
+++ branches/KDE4_port/rkward/rbackend/rinterface.cpp	2007-11-25 21:30:01 UTC (rev 2271)
@@ -185,9 +185,9 @@
 		}
 		command->finished ();
 		if (command->type () & RCommand::DirectToOutput) {
-			RKWorkplace::mainWorkplace ()->newOutput (false);
+			RKWorkplace::mainWorkplace ()->refreshOutputWindow ();
 		} else if (command->type () & RCommand::User) {
-			RKWorkplace::mainWorkplace ()->newOutput (true);
+			RKWorkplace::mainWorkplace ()->refreshOutputWindow ();
 		}
 		delete command;
 	} else if ((ev->etype () == RKRBackendEvent::RIdle)) {

Modified: branches/KDE4_port/rkward/rkward.cpp
===================================================================
--- branches/KDE4_port/rkward/rkward.cpp	2007-11-22 23:58:10 UTC (rev 2270)
+++ branches/KDE4_port/rkward/rkward.cpp	2007-11-25 21:30:01 UTC (rev 2271)
@@ -681,7 +681,7 @@
 	QString wcaption = RObjectList::getObjectList ()->getWorkspaceURL ().fileName ();
 	if (wcaption.isEmpty ()) wcaption = RObjectList::getObjectList ()->getWorkspaceURL ().prettyUrl ();
 	if (wcaption.isEmpty ()) wcaption = i18n ("[Unnamed Workspace]");
-	RKMDIWindow *window = RKWorkplace::mainWorkplace ()->activeWindow (RKMDIWindow::Attached);
+	RKMDIWindow *window = RKWorkplace::mainWorkplace ()->view ()->activePage ();
 	if (window) wcaption.append (" - " + window->fullCaption ());
 	KParts::MainWindow::setCaption (wcaption);
 }

Modified: branches/KDE4_port/rkward/rkward.h
===================================================================
--- branches/KDE4_port/rkward/rkward.h	2007-11-22 23:58:10 UTC (rev 2270)
+++ branches/KDE4_port/rkward/rkward.h	2007-11-25 21:30:01 UTC (rev 2271)
@@ -165,11 +165,10 @@
 /** detach current window (Windows->Detach) */
 	void slotDetachWindow ();
 
-/** reimplemented from KMainWindow, to additionally include the workspace url. Actually, we also ignore the caption-parameter, as it sometimes is not the one we want. Rather we create one according to the active view */
-	void setCaption (const QString &caption);
-/** a view has been activated or deactivated. We should make sure to update the main caption to fix strange quirks */
-// KDE4: do we still need this?	void viewChanged (KMdiChildView *) { setCaption (QString::null); };
-
+/** reimplemented from KMainWindow, to additionally include the workspace url. Parameters are ignored. Rather we create a caption according to the active view */
+	void setCaption (const QString &);
+/** HACK this is only to make the compiler happy with -Woverloaded-virtual */
+	void setCaption (const QString &dummy, bool) { setCaption (dummy); };
 /** connected to m_manager->partAdded (). Connects statusbar notifications */
 	void partAdded (KParts::Part *part);
 /** connected to m_manager->partAdded (). Disconnects statusbar notifications */

Modified: branches/KDE4_port/rkward/windows/rkhtmlwindow.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkhtmlwindow.cpp	2007-11-22 23:58:10 UTC (rev 2270)
+++ branches/KDE4_port/rkward/windows/rkhtmlwindow.cpp	2007-11-25 21:30:01 UTC (rev 2271)
@@ -330,7 +330,7 @@
 
 	if (only_if_modified) {
 		QFileInfo out_file (RKSettingsModuleGeneral::filesPath () + "/rk_out.html");
-		if (out_file.lastModified () <= last_refresh_time) return current_output;
+		if (last_refresh_time.isValid () && (out_file.lastModified () <= last_refresh_time)) return current_output;
 	}
 
 	if (current_output) {

Modified: branches/KDE4_port/rkward/windows/rkworkplace.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkworkplace.cpp	2007-11-22 23:58:10 UTC (rev 2270)
+++ branches/KDE4_port/rkward/windows/rkworkplace.cpp	2007-11-25 21:30:01 UTC (rev 2271)
@@ -136,7 +136,7 @@
 	if (window->isToolWindow ()) {
 		window->tool_window_bar->reclaimDetached (window);
 	} else {
-		view ()->addPage (window);
+		view ()->addWindow (window);
 		view ()->topLevelWidget ()->raise ();
 		view ()->topLevelWidget ()->activateWindow ();
 	}
@@ -156,7 +156,7 @@
 	RK_ASSERT (window->getPart ());
 	if (was_attached) {
 		RKWardMainWindow::getMain ()->partManager ()->removePart (window->getPart ());
-		if (!window->isToolWindow ()) view ()->removePage (window);
+		if (!window->isToolWindow ()) view ()->removeWindow (window);
 	}
 
 	DetachedWindowContainer *detached = new DetachedWindowContainer (window);
@@ -247,9 +247,9 @@
 	}
 }
 
-void RKWorkplace::newOutput (bool only_if_modified) {
+void RKWorkplace::refreshOutputWindow () {
 	RK_TRACE (APP);
-	RKOutputWindow *window = RKOutputWindow::refreshOutput (RKSettingsModuleOutput::autoShow (), RKSettingsModuleOutput::autoRaise (), only_if_modified);
+	RKOutputWindow *window = RKOutputWindow::refreshOutput (RKSettingsModuleOutput::autoShow (), RKSettingsModuleOutput::autoRaise (), false);
 	if (window) {
 		if (!windows.contains (window)) {
 			addWindow (window);
@@ -395,8 +395,8 @@
 	// WARNING: the window is dead. Don't call any functions on it.
 
 	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);
+	windows.removeAll (window);		// do this first! view()->removeWindow will call activePage() indirectly from setCaption, causing us to iterate over all known windows!
+	if (view ()->hasWindow (window)) view ()->removeWindow (window, true);
 
 	windowRemoved ();
 }

Modified: branches/KDE4_port/rkward/windows/rkworkplace.h
===================================================================
--- branches/KDE4_port/rkward/windows/rkworkplace.h	2007-11-22 23:58:10 UTC (rev 2270)
+++ branches/KDE4_port/rkward/windows/rkworkplace.h	2007-11-25 21:30:01 UTC (rev 2271)
@@ -106,7 +106,7 @@
 	void openOutputWindow (const KUrl &url=KUrl ());
 /** signal there was new output, show/raise/refresh the output window as appropriate.
 TODO: this should be obsoleted somehow */
-	void newOutput (bool only_if_modified);
+	void refreshOutputWindow ();
 
 	void newX11Window (WId window_to_embed, int device_number);
 	void newObjectViewer (RObject *object);

Modified: branches/KDE4_port/rkward/windows/rkworkplaceview.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkworkplaceview.cpp	2007-11-22 23:58:10 UTC (rev 2270)
+++ branches/KDE4_port/rkward/windows/rkworkplaceview.cpp	2007-11-25 21:30:01 UTC (rev 2271)
@@ -90,7 +90,7 @@
 	setCurrentIndex (index + 1);
 }
 
-void RKWorkplaceView::addPage (RKMDIWindow *widget) {
+void RKWorkplaceView::addWindow (RKMDIWindow *widget) {
 	RK_TRACE (APP);
 
 	int id = -1;
@@ -112,17 +112,17 @@
 	setUpdatesEnabled (true);
 }
 
-bool RKWorkplaceView::hasPage (RKMDIWindow *widget) {
+bool RKWorkplaceView::hasWindow (RKMDIWindow *widget) {
 	return (indexOf (widget) != -1);
 }
 
-void RKWorkplaceView::removePage (RKMDIWindow *widget, bool destroyed) {
+void RKWorkplaceView::removeWindow (RKMDIWindow *widget, bool destroyed) {
 	RK_TRACE (APP);
 
 	setUpdatesEnabled (false);
 
 	int id = indexOf (widget);		// which page is it?
-	RK_DO (if (id == -1) qDebug ("did not find page in RKWorkplaceView::removePage"), APP, DL_WARNING);
+	RK_DO (if (id == -1) qDebug ("did not find page in RKWorkplaceView::removeWindow"), APP, DL_WARNING);
 	if (!destroyed) disconnect (widget, SIGNAL (captionChanged (RKMDIWindow *)), this, SLOT (childCaptionChanged (RKMDIWindow *)));
 
 	removeTab (id);

Modified: branches/KDE4_port/rkward/windows/rkworkplaceview.h
===================================================================
--- branches/KDE4_port/rkward/windows/rkworkplaceview.h	2007-11-22 23:58:10 UTC (rev 2270)
+++ branches/KDE4_port/rkward/windows/rkworkplaceview.h	2007-11-25 21:30:01 UTC (rev 2271)
@@ -38,12 +38,12 @@
 	~RKWorkplaceView ();
 
 /** add the given window to the view */
-	void addPage (RKMDIWindow *widget);
+	void addWindow (RKMDIWindow *widget);
 /** remove the given window to the view
 @param destroyed if the window is already destroyed, set this to true */
-	void removePage (RKMDIWindow *widget, bool destroyed=false);
+	void removeWindow (RKMDIWindow *widget, bool destroyed=false);
 /** does this window exist in the view? */
-	bool hasPage (RKMDIWindow *widget);
+	bool hasWindow (RKMDIWindow *widget);
 
 /** activate the given window */
 	void setActivePage (RKMDIWindow *widget);


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