[Commits] : Tuxbox-GIT: apps branch master updated. CVS-Final-600-g6a2e3ec
Tuxbox Sources
Brought to you by:
dbt1
|
From: GetAway <tux...@ne...> - 2015-06-13 17:54:35
|
Project "Tuxbox-GIT: apps":
The branch, master has been updated
via 6a2e3ec0bead9e2f42fec81248b1c94bc345462f (commit)
from af19455866e85fb7a5a27ccf6a735e05e888c261 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6a2e3ec0bead9e2f42fec81248b1c94bc345462f
Author: GetAway <get...@t-...>
Date: Sat Jun 13 19:53:59 2015 +0200
plugins.cpp: use file_exists
Signed-off-by: GetAway <get...@t-...>
diff --git a/tuxbox/neutrino/src/gui/plugins.cpp b/tuxbox/neutrino/src/gui/plugins.cpp
index 7b236d2..06f3708 100644
--- a/tuxbox/neutrino/src/gui/plugins.cpp
+++ b/tuxbox/neutrino/src/gui/plugins.cpp
@@ -51,6 +51,8 @@
#include <global.h>
#include <neutrino.h>
+#include <system/helper.h>
+
#include <zapit/client/zapittools.h>
#include <daemonc/remotecontrol.h>
@@ -75,19 +77,6 @@ int CPlugins::find_plugin(const std::string & filename)
return -1;
}
-bool CPlugins::pluginfile_exists(const std::string & filename)
-{
- FILE *file = fopen(filename.c_str(),"r");
- if (file != NULL)
- {
- fclose(file);
- return true;
- } else
- {
- return false;
- }
-}
-
void CPlugins::scanDir(const char *dir)
{
struct dirent **namelist;
@@ -309,7 +298,7 @@ void CPlugins::startScriptPlugin(int number)
{
const char *script = plugin_list[number].pluginfile.c_str();
printf("[CPlugins] executing %s\n",script);
- if (!pluginfile_exists(plugin_list[number].pluginfile))
+ if (!file_exists(script))
{
printf("[CPlugins] could not find %s,\nperhaps wrong plugin type in %s\n",
script, plugin_list[number].cfgfile.c_str());
@@ -343,7 +332,7 @@ void CPlugins::startPlugin(int number, int param, int param2)
startScriptPlugin(number);
return;
}
- if (!pluginfile_exists(plugin_list[number].pluginfile))
+ if (!file_exists(plugin_list[number].pluginfile.c_str()))
{
printf("[CPlugins] could not find %s,\nperhaps wrong plugin type in %s\n",
plugin_list[number].pluginfile.c_str(), plugin_list[number].cfgfile.c_str());
@@ -566,7 +555,7 @@ bool CPlugins::hasPlugin(const char * const filename)
it != plugin_list.end(); ++it)
{
if (it->filename.compare(filename) == 0)
- return pluginfile_exists(it->pluginfile);
+ return file_exists(it->pluginfile.c_str());
}
return false;
}
diff --git a/tuxbox/neutrino/src/gui/plugins.h b/tuxbox/neutrino/src/gui/plugins.h
index 0cb6461..02753b2 100644
--- a/tuxbox/neutrino/src/gui/plugins.h
+++ b/tuxbox/neutrino/src/gui/plugins.h
@@ -51,7 +51,7 @@ class CPlugins
P_TYPE_DISABLED = 0x1,
P_TYPE_GAME = 0x2,
P_TYPE_TOOL = 0x4,
- P_TYPE_SCRIPT = 0x8,
+ P_TYPE_SCRIPT = 0x8
}
p_type_t;
@@ -98,7 +98,6 @@ class CPlugins
void scanDir(const char *dir);
bool plugin_exists(const std::string & filename);
int find_plugin(const std::string & filename);
- bool pluginfile_exists(const std::string & filename);
CPlugins::p_type_t getPluginType(int type);
public:
-----------------------------------------------------------------------
Summary of changes:
tuxbox/neutrino/src/gui/plugins.cpp | 21 +++++----------------
tuxbox/neutrino/src/gui/plugins.h | 3 +--
2 files changed, 6 insertions(+), 18 deletions(-)
--
Tuxbox-GIT: apps
|