gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog plugin/plugin.cpp


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog plugin/plugin.cpp
Date: Fri, 25 Apr 2008 19:21:03 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/04/25 19:21:02

Modified files:
        .              : ChangeLog 
        plugin         : plugin.cpp 

Log message:
        * plugin/plugin.cpp: append ~/.gnashpluginrc to GNASHRC env (creating
          that var if non-existing); use a static variable to tell if the
          plugin was initialized already or not: this is as epiphany keeps
          calling NS_PluginInitialize even if not supposed to (in a single
          session). Tests highly welcome.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6397&r2=1.6398
http://cvs.savannah.gnu.org/viewcvs/gnash/plugin/plugin.cpp?cvsroot=gnash&r1=1.103&r2=1.104

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6397
retrieving revision 1.6398
diff -u -b -r1.6397 -r1.6398
--- ChangeLog   25 Apr 2008 18:14:03 -0000      1.6397
+++ ChangeLog   25 Apr 2008 19:21:00 -0000      1.6398
@@ -1,5 +1,10 @@
 2008-04-25 Sandro Santilli <address@hidden>
 
+       * plugin/plugin.cpp: append ~/.gnashpluginrc to GNASHRC env (creating
+         that var if non-existing); use a static variable to tell if the
+         plugin was initialized already or not: this is as epiphany keeps
+         calling NS_PluginInitialize even if not supposed to (in a single
+         session). Tests highly welcome.
        * libbase/rc.cpp (loadFiles): allow GNASHRC env variable to be
          a comma-separate list of rcfiles to parse.
 

Index: plugin/plugin.cpp
===================================================================
RCS file: /sources/gnash/gnash/plugin/plugin.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -b -r1.103 -r1.104
--- plugin/plugin.cpp   4 Apr 2008 14:23:45 -0000       1.103
+++ plugin/plugin.cpp   25 Apr 2008 19:21:02 -0000      1.104
@@ -113,6 +113,14 @@
 NPError
 NS_PluginInitialize()
 {
+       if ( plugInitialized )
+       {
+               cout << "NS_PluginInitialize called, but ignored (we already 
initialized)" << endl;
+               return NPERR_NO_ERROR;
+       }
+
+       cout << "NS_PluginInitialize call 
---------------------------------------------------" << endl;
+
 
        /* Browser Functionality Checks */
 
@@ -178,6 +186,37 @@
 
        }
 
+       // Append ~/.gnashpluginrc to GNASHRC
+       do {
+               std::string newGnashRc;
+               bool changed = false;
+               char *gnashrc = getenv("GNASHRC");
+               if ( gnashrc )
+               {
+                       newGnashRc.assign(gnashrc);
+                       newGnashRc.append(":");
+               }
+
+               char *home = getenv("HOME");
+               if ( home )
+               {
+                       newGnashRc.append(home);
+                       newGnashRc.append("/.gnashpluginrc");
+               }
+               else
+               {
+                       cerr << "WARNING: NPAPI plugin could not find user home 
dir" << endl;
+                       break;
+               }
+
+               if ( setenv("GNASHRC", newGnashRc.c_str(), 1) )
+               {
+                       cerr << "WARNING: NPAPI plugin could not append to the 
GNASHRC env variable" << endl;
+               }
+
+       } while (0);
+
+
        /* Success */
 
        plugInitialized = TRUE;
@@ -194,6 +233,7 @@
 void
 NS_PluginShutdown()
 {
+#if 0
        if (!plugInitialized)
        {
                cout << "Plugin already shut down" << endl;
@@ -201,6 +241,7 @@
        }
 
        plugInitialized = FALSE;
+#endif
 }
 
 
@@ -312,6 +353,7 @@
                cerr << "PARAM: " << name << " = " << val << endl;
                _params[name] = val;
        }
+
 }
 
 /// \brief Destructor




reply via email to

[Prev in Thread] Current Thread [Next in Thread]