aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Vanek <[email protected]>2013-11-29 12:14:43 +0100
committerJiri Vanek <[email protected]>2013-11-29 12:14:43 +0100
commit9fdd4c8df8db77a810563549debbff9f8a98de9d (patch)
treecf564bbdeb564f8bfa0006860ecc07b6562c1207
parentb734ac62fbdbdaa855983ebea07f7b92d0a02c33 (diff)
Pipes moved into XDG_RUNTIME_DIR
-rw-r--r--ChangeLog11
-rw-r--r--plugin/icedteanp/IcedTeaNPPlugin.cc18
-rw-r--r--plugin/icedteanp/IcedTeaPluginUtils.cc30
-rw-r--r--plugin/icedteanp/IcedTeaPluginUtils.h2
4 files changed, 44 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 269414f..6c38a4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2013-11-29 Jiri Vanek <[email protected]>
+ Pipes moved into XDG_RUNTIME_DIR
+ * plugin/icedteanp/IcedTeaNPPlugin.cc: (initialize_data_directory) logic
+ responsible for tmp dir path moved into (getTmpPath) and (data_directory)
+ initialized from (getRuntimePath) rather.
+ * plugin/icedteanp/IcedTeaPluginUtils.cc: (getTmpPath) new function,
+ provides path to tmp dir. (getRuntimePath) new function resolving
+ XDG_RUNTIME_DIR value, returning (getTmpPath) as fallback.
+ * plugin/icedteanp/IcedTeaPluginUtils.h: declared new two methods.
+
+2013-11-29 Jiri Vanek <[email protected]>
+
Enabled file logging in plugin, user enabled to choose logs dir.
* netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java: added
text-field to show/edit logs' destination. Added reset to default button.
diff --git a/plugin/icedteanp/IcedTeaNPPlugin.cc b/plugin/icedteanp/IcedTeaNPPlugin.cc
index 30ab716..9a0d0c4 100644
--- a/plugin/icedteanp/IcedTeaNPPlugin.cc
+++ b/plugin/icedteanp/IcedTeaNPPlugin.cc
@@ -1787,24 +1787,8 @@ initialize_plugin_table(NPPluginFuncs* pluginTable)
NPError
initialize_data_directory()
{
- const char* tmpdir_env = getenv("TMPDIR");
- if (tmpdir_env != NULL && g_file_test (tmpdir_env,
- (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
- {
- data_directory = tmpdir_env;
- }
- else if (g_file_test (P_tmpdir,
- (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
- {
- data_directory = P_tmpdir;
- }
- else
- {
- // If TMPDIR and P_tmpdir do not exist, try /tmp directly
- data_directory = "/tmp";
- }
- data_directory += "/icedteaplugin-";
+ data_directory = IcedTeaPluginUtilities::getRuntimePath() + "/icedteaplugin-";
if (getenv("USER") != NULL)
data_directory += getenv("USER");
diff --git a/plugin/icedteanp/IcedTeaPluginUtils.cc b/plugin/icedteanp/IcedTeaPluginUtils.cc
index dd2978f..0986aa8 100644
--- a/plugin/icedteanp/IcedTeaPluginUtils.cc
+++ b/plugin/icedteanp/IcedTeaPluginUtils.cc
@@ -1169,6 +1169,36 @@ void IcedTeaPluginUtilities::printDebugStatus(){
}
+std::string IcedTeaPluginUtilities::getTmpPath(){
+ const char* tmpdir_env = getenv("TMPDIR");
+ if (tmpdir_env != NULL && g_file_test (tmpdir_env,
+ (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
+ {
+ return std::string(tmpdir_env);
+ }
+ else if (g_file_test (P_tmpdir,
+ (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
+ {
+ return std::string(P_tmpdir);
+ }
+ else
+ {
+ // If TMPDIR and P_tmpdir do not exist, try /tmp directly
+ return "/tmp";
+ }
+}
+
+std::string IcedTeaPluginUtilities::getRuntimePath(){
+ const char* rntdir_env = getenv("XDG_RUNTIME_DIR");
+ if (rntdir_env != NULL && g_file_test (rntdir_env,
+ (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
+ {
+ return std::string(rntdir_env);
+ }
+ return IcedTeaPluginUtilities::getTmpPath();
+}
+
+
/******************************************
* Begin JavaMessageSender implementation *
******************************************
diff --git a/plugin/icedteanp/IcedTeaPluginUtils.h b/plugin/icedteanp/IcedTeaPluginUtils.h
index c62faba..f0f52d7 100644
--- a/plugin/icedteanp/IcedTeaPluginUtils.h
+++ b/plugin/icedteanp/IcedTeaPluginUtils.h
@@ -387,6 +387,8 @@ class IcedTeaPluginUtilities
static std::string generateLogFileName();
static void initFileLog();
static void printDebugStatus();
+ static std::string getTmpPath();
+ static std::string getRuntimePath();
};
/*