[PATCH] Fix 49564 - please review

Ravikiran Rajagopal ravi at ee.eng.ohio-state.edu
Mon Mar 10 19:00:24 GMT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
  The following patch fixes bug 49564, which actually has been reported 
atleast 5 times to my knowledge (since KDE 2.0 days!). Thanks to David Faure 
for pointing out that KProcess is safe to use within the KApplication 
constructor. Is it ok to commit? To both branches?

Ravi

Index: kapplication.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kapplication.cpp,v
retrieving revision 1.572
diff -u -p -r1.572 kapplication.cpp
- --- kapplication.cpp    5 Mar 2003 04:45:19 -0000       1.572
+++ kapplication.cpp    10 Mar 2003 18:56:01 -0000
@@ -671,6 +671,21 @@ void KApplication::init(bool GUIenabled)

   KConfig* config = KGlobal::config();
   d->actionRestrictions = config->hasGroup("KDE Action Restrictions" );
+#ifdef Q_WS_X11
+  // For brain-dead configurations where the user's local config file is not 
writable.
+  if (!(d->actionRestrictions) && config->isReadOnly())
+  {
+    QString cmdToExec = KStandardDirs::findExe(QString("kdialog"));
+    if (!cmdToExec.isEmpty())
+    {
+      // Make life easier for the translators :-)
+      QString msgString( i18n("Cannot save options. Please contact your 
systems administrator.") );
+      KProcess lprocess;
+      lprocess << cmdToExec << "--title" << instanceName() << "--msgbox" << 
msgString;
+      lprocess.start( KProcess::Block );
+    }
+  }
+#endif

   if (GUIenabled)
   {
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+bODIbI8Y8y0oVXcRAkcUAJ9lzPbQCtnD1QBWwPlBh0MgQd8LrwCfdr4J
DC+KmHU48AzpUXdTUc7rzag=
=LEXv
-----END PGP SIGNATURE-----





More information about the kde-core-devel mailing list