[rkward-cvs] SF.net SVN: rkward-code:[4570] trunk/rkward

tfry at users.sf.net tfry at users.sf.net
Thu Mar 7 16:11:21 UTC 2013


Revision: 4570
          http://sourceforge.net/p/rkward/code/4570
Author:   tfry
Date:     2013-03-07 16:11:20 +0000 (Thu, 07 Mar 2013)
Log Message:
-----------
Fix crash when trying to print, and neither okular, nor kpdf are available

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/agents/rkprintagent.cpp

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2013-03-07 15:53:05 UTC (rev 4569)
+++ trunk/rkward/ChangeLog	2013-03-07 16:11:20 UTC (rev 4570)
@@ -1,3 +1,4 @@
+- Fix crash when trying to print, and neither okular, nor kpdf are available
 - Added support for loaded namespaces that are not attached to a loaded package
 - Pluginmaps can specify their "priority". Pluginmaps with low priority will not be added automatically, when found.
 - Pluginmaps can <require> other pluginmaps based on their id (for cross-package inclusion)

Modified: trunk/rkward/rkward/agents/rkprintagent.cpp
===================================================================
--- trunk/rkward/rkward/agents/rkprintagent.cpp	2013-03-07 15:53:05 UTC (rev 4569)
+++ trunk/rkward/rkward/agents/rkprintagent.cpp	2013-03-07 16:11:20 UTC (rev 4570)
@@ -46,9 +46,11 @@
 
 	KService::Ptr service = KService::serviceByDesktopPath ("okular_part.desktop");
 	if (!service) service = KService::serviceByDesktopPath ("kpdf_part.desktop");
-	if (!service) RK_DEBUG (APP, DL_WARNING, "No KDE service found for postscript printing");
 
-	KParts::ReadOnlyPart *provider = service->createInstance<KParts::ReadOnlyPart> (0);
+	KParts::ReadOnlyPart *provider = 0;
+	if (service) provider = service->createInstance<KParts::ReadOnlyPart> (0);
+	else RK_DEBUG (APP, DL_WARNING, "No KDE service found for postscript printing");
+
 	QAction *printaction = 0;
 	if (provider) {
 		printaction = provider->action ("print");





More information about the rkward-tracker mailing list