1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
diff -ruNp autosort-0.1.3/autogroup.c autosort-0.1.3-patched/autogroup.c
--- autosort-0.1.3/autogroup.c 2007-03-18 13:35:47.000000000 +0100
+++ autosort-0.1.3-patched/autogroup.c 2008-01-17 15:06:59.000000000 +0100
@@ -211,8 +211,7 @@ bool cAutoGroup::Parse(const char *line)
// check for additional config files
char *buf;
-// asprintf(&buf, "%s/%s/%s",cPlugin::ConfigDirectory(),"autosort",name );
- asprintf(&buf, "%s/%s/%s",ConfigDir,"autosort",name );
+ asprintf(&buf, "%s/%s", ConfigDir, name);
if (access(buf, R_OK) == 0) {
@@ -404,8 +403,7 @@ void cAutoGroup::ModifyChannelToGroup (i
if (!Out) { // channel will go into group
if (saveDelete) {
FILE *f;
-// char *fileName = strdup( AddDirectory(cPlugin::ConfigDirectory(), "../channels.deleted"));
- char *fileName = strdup( AddDirectory(ConfigDir, "../channels.deleted"));
+ char *fileName = strdup(AddDirectory(ConfigDir, "../../channels.deleted"));
f = fopen(fileName , "a");
if (!f) {
LOG_ERROR_STR(fileName);
diff -ruNp autosort-0.1.3/autogroups.c autosort-0.1.3-patched/autogroups.c
--- autosort-0.1.3/autogroups.c 2007-02-07 17:22:24.000000000 +0100
+++ autosort-0.1.3-patched/autogroups.c 2008-01-17 15:01:04.000000000 +0100
@@ -72,7 +72,6 @@ bool cAutoGroups::Load(const char *FileN
ReIndex();
return true;
}
-// esyslog("Auto Sort: -ERROR- Can't find %s/autosort.conf -EXITING-",cPlugin::ConfigDirectory());
esyslog("Auto Sort: -ERROR- Can't find %s/autosort.conf -EXITING-",ConfigDir);
esyslog(" !!! Check your autosort.conf !!!");
return false;
diff -ruNp autosort-0.1.3/autosort.c autosort-0.1.3-patched/autosort.c
--- autosort-0.1.3/autosort.c 2007-02-07 17:23:13.000000000 +0100
+++ autosort-0.1.3-patched/autosort.c 2008-01-17 14:23:48.000000000 +0100
@@ -12,6 +12,8 @@ static const char *VERSION = "0.1
static const char *DESCRIPTION = "Channel AutoSort";
static const char *MAINMENUENTRY = "AutoSort Restart";
+char *ConfigDir = NULL;
+
class cPluginAutoSort : public cPlugin {
private:
// Add any member variables or functions you may need here.
@@ -50,6 +52,7 @@ cPluginAutoSort::cPluginAutoSort(void)
cPluginAutoSort::~cPluginAutoSort()
{
// Clean up after yourself!
+ if (ConfigDir) free(ConfigDir);
}
const char *cPluginAutoSort::MainMenuEntry(void)
@@ -81,6 +84,8 @@ bool cPluginAutoSort::Initialize(void)
bool cPluginAutoSort::Start(void)
{
// Start any background activities the plugin shall perform.
+ if (!ConfigDir)
+ ConfigDir = strdup(cPlugin::ConfigDirectory("autosort"));
cAutoSortMainThread::Init();
return true;
}
diff -ruNp autosort-0.1.3/autosort_main_thread.c autosort-0.1.3-patched/autosort_main_thread.c
--- autosort-0.1.3/autosort_main_thread.c 2007-03-18 08:28:37.000000000 +0100
+++ autosort-0.1.3-patched/autosort_main_thread.c 2008-01-17 15:02:17.000000000 +0100
@@ -54,7 +54,6 @@ void cAutoSortMainThread::Stop(void) {
void cAutoSortMainThread::Action(void)
{
OpenGroups.Load();
-// AutoGroups.Load(AddDirectory(cPlugin::ConfigDirectory(), "autosort.conf"), true, true);
AutoGroups.Load(AddDirectory(ConfigDir, "autosort.conf"), true, true);
m_Active = true;
CheckDelimiters();
diff -ruNp autosort-0.1.3/autosort_menu.c autosort-0.1.3-patched/autosort_menu.c
--- autosort-0.1.3/autosort_menu.c 2007-03-18 09:57:10.000000000 +0100
+++ autosort-0.1.3-patched/autosort_menu.c 2008-01-17 14:09:40.000000000 +0100
@@ -35,9 +35,6 @@ int lastDuration = 0;
int averageDuration = 0;
int activeChannel = 0;
-const char *ConfigDir = cPlugin::ConfigDirectory();
-
-
cASInfoItem::cASInfoItem(const char *Text)
{
diff -ruNp autosort-0.1.3/autosort_menu.h autosort-0.1.3-patched/autosort_menu.h
--- autosort-0.1.3/autosort_menu.h 2007-02-07 17:11:00.000000000 +0100
+++ autosort-0.1.3-patched/autosort_menu.h 2008-01-17 14:07:04.000000000 +0100
@@ -37,7 +37,7 @@ extern int lastDuration;
extern int averageDuration;
extern int activeChannel;
-extern const char *ConfigDir;
+extern char *ConfigDir;
/*
diff -ruNp autosort-0.1.3/opengroups.c autosort-0.1.3-patched/opengroups.c
--- autosort-0.1.3/opengroups.c 2007-02-07 17:27:52.000000000 +0100
+++ autosort-0.1.3-patched/opengroups.c 2008-01-17 15:03:17.000000000 +0100
@@ -40,8 +40,7 @@ bool cOpenGroups::Load(void)
{
char *buf;
char *option;
-// asprintf(&buf, "%s/%s/%s",cPlugin::ConfigDirectory(),"autosort","opengroups.conf" );
- asprintf(&buf, "%s/%s/%s",ConfigDir,"autosort","opengroups.conf" );
+ asprintf(&buf, "%s/opengroups.conf", ConfigDir);
if (access(buf, R_OK) == 0) {
dsyslog ("loading %s", buf);
FILE *f = fopen(buf, "r");
|