Thread: [Commits] : Tuxbox-GIT: apps branch master updated. CVS-Final-435-g8f9abfa
Tuxbox Sources
Brought to you by:
dbt1
|
From: GetAway <tux...@ne...> - 2014-11-07 15:46:49
|
Project "Tuxbox-GIT: apps":
The branch, master has been updated
via 8f9abfa8c0b426b42231f8ede21d3a434ec12e65 (commit)
via 8d7215d40fa907d95568e6852d54b21af02ea8a0 (commit)
via 155e42daa74ea4e5e1ca4ab789430c0056f904dc (commit)
via 35e42b607dd140eb2a990be519b093af6c99f776 (commit)
via 2ccff82fe9c1f58060487e74c0e29049d848368c (commit)
via 74a24e3364a44c5d17f21bf1560ba056a4e571e4 (commit)
via ec1bb8bcdd17a86ff34df8694dbd5221e36031a1 (commit)
via ae16f57cc525556d829511166b2ca058a6ddcc62 (commit)
via bd7b8acdcb425b48d278c893bf709ccc0cbd9359 (commit)
via bc5228d81bb23518a182db94c6df0287bc3fdfd9 (commit)
via 27260ea172d037de57fa691c5c670ddfe85cf897 (commit)
via ad2ecda9e11da3ca2cb6f38e4229a214d58568bd (commit)
via adf6297278c2de1f7758e98151e2bfb9fcf8bb90 (commit)
via a726e172299ec8521db9f8d636dc7aa7420a9ed7 (commit)
via 02873f78090484613c7e632844dbbca8cc1ea7a8 (commit)
from 8cade3ffa8084dba2171ab4cabb90065fb692659 (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 8f9abfa8c0b426b42231f8ede21d3a434ec12e65
Author: Christian Schuett <Gau...@ho...>
Date: Sun Nov 2 20:53:20 2014 +0100
nhttpd controlapi: allow zapping to subchannels
based on idea by Moritz Venn <mor...@fr...>
Signed-off-by: Christian Schuett <Gau...@ho...>
Signed-off-by: GetAway <get...@t-...>
diff --git a/tuxbox/neutrino/daemons/nhttpd/doc/nhttpd_controlapi.html b/tuxbox/neutrino/daemons/nhttpd/doc/nhttpd_controlapi.html
index 62cdf55..3a7748e 100644
--- a/tuxbox/neutrino/daemons/nhttpd/doc/nhttpd_controlapi.html
+++ b/tuxbox/neutrino/daemons/nhttpd/doc/nhttpd_controlapi.html
@@ -800,6 +800,20 @@ Beispiel:<br>
>>>http://dbox/control/zapto?name=Das%20Erste<br>
ok <br>
</div>
+<br>
+<b>Parameter:</b> subchannel=<channel_id> (64 bit, hexidecimal value)<br>
+<b>Rueckgabe:</b><br>
+<br>
+Zappt auf den angegebenen Unterkanal.<br>
+Als Rueckgabe ist im Erfolgsfall ok zu erwarten.<br>
+<br>
+<b>Rueckgabe-Format:</b> ok / error<br>
+<div class="example">
+Beispiel:<br>
+<br>
+>>>http://dbox/control/zapto?subchannel=1008500d4<br>
+ok <br>
+</div>
<!-- *********************************************************** -->
<div class="title1"><a name="setmode"></a>7. Radio/TV, Record Mode</div>
diff --git a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp
index f2a7188..d6f825b 100644
--- a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp
@@ -1428,7 +1428,8 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh)
CSectionsdClient::LinkageDescriptorList desc;
CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo;
bool has_current_next = NeutrinoAPI->Sectionsd->getCurrentNextServiceKey(current_channel, currentNextInfo);
- if (has_current_next && NeutrinoAPI->Sectionsd->getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey, desc))
+ if (has_current_next && currentNextInfo.flags & CSectionsdClient::epgflags::current_has_linkagedescriptors &&
+ NeutrinoAPI->Sectionsd->getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey, desc))
{
for(unsigned int i=0;i< desc.size();i++)
{
@@ -1454,6 +1455,19 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh)
else
hh->SendError();
}
+ else if (!hh->ParamList["subchannel"].empty())
+ {
+ t_channel_id current_channel = NeutrinoAPI->Zapit->getCurrentServiceID();
+ CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo;
+ bool has_current_next = NeutrinoAPI->Sectionsd->getCurrentNextServiceKey(current_channel, currentNextInfo);
+ if (has_current_next && currentNextInfo.flags & CSectionsdClient::epgflags::current_has_linkagedescriptors)
+ {
+ NeutrinoAPI->ZapToSubService(hh->ParamList["subchannel"].c_str());
+ hh->SendOk();
+ }
+ else
+ hh->SendError();
+ }
else
{
NeutrinoAPI->ZapTo(hh->ParamList["1"].c_str());
commit 8d7215d40fa907d95568e6852d54b21af02ea8a0
Author: Christian Schuett <Gau...@ho...>
Date: Sun Nov 2 17:27:15 2014 +0100
nhttpd helper: pass std::string by reference if possible
Signed-off-by: Christian Schuett <Gau...@ho...>
Signed-off-by: GetAway <get...@t-...>
diff --git a/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/helper.cpp b/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/helper.cpp
index 471eb23..8e17c03 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/helper.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/helper.cpp
@@ -92,7 +92,7 @@ std::string string_printf(const char *fmt, ...)
// ySplitString: spit string "str" in two strings "left" and "right" at
// one of the chars in "delimiter" returns true if delimiter found
//-------------------------------------------------------------------------
-bool ySplitString(std::string str, std::string delimiter, std::string& left, std::string& right)
+bool ySplitString(const std::string &str, const std::string &delimiter, std::string &left, std::string &right)
{
std::string::size_type pos;
if ((pos = str.find_first_of(delimiter)) != std::string::npos)
@@ -111,7 +111,7 @@ bool ySplitString(std::string str, std::string delimiter, std::string& left, std
// ySplitString: spit string "str" in two strings "left" and "right" at
// one of the chars in "delimiter" returns true if delimiter found
//-------------------------------------------------------------------------
-bool ySplitStringExact(std::string str, std::string delimiter, std::string& left, std::string& right)
+bool ySplitStringExact(const std::string &str, const std::string &delimiter, std::string &left, std::string &right)
{
std::string::size_type pos;
if ((pos = str.find(delimiter)) != std::string::npos)
@@ -130,7 +130,7 @@ bool ySplitStringExact(std::string str, std::string delimiter, std::string& left
// ySplitStringRight: spit string "str" in two strings "left" and "right" at
// one of the chars in "delimiter" returns true if delimiter found
//-------------------------------------------------------------------------
-bool ySplitStringLast(std::string str, std::string delimiter, std::string& left, std::string& right)
+bool ySplitStringLast(const std::string &str, const std::string &delimiter, std::string &left, std::string &right)
{
std::string::size_type pos;
if ((pos = str.find_last_of(delimiter)) != std::string::npos)
@@ -148,7 +148,7 @@ bool ySplitStringLast(std::string str, std::string delimiter, std::string& left,
//-------------------------------------------------------------------------
// ySplitStringVector: spit string "str" and build vector of strings
//-------------------------------------------------------------------------
-CStringArray ySplitStringVector(std::string str, std::string delimiter)
+CStringArray ySplitStringVector(const std::string &str, const std::string &delimiter)
{
std::string left, right, rest;
bool found;
@@ -203,7 +203,7 @@ bool nocase_compare (char c1, char c2)
//-----------------------------------------------------------------------------
// Decode URLEncoded std::string
//-----------------------------------------------------------------------------
-std::string decodeString(std::string encodedString)
+std::string decodeString(const std::string &encodedString)
{
const char *string = encodedString.c_str();
unsigned int count=0;
@@ -239,7 +239,7 @@ std::string decodeString(std::string encodedString)
//-----------------------------------------------------------------------------
// HTMLEncode std::string
//-----------------------------------------------------------------------------
-std::string encodeString(std::string decodedString)
+std::string encodeString(const std::string &decodedString)
{
unsigned int len = sizeof(char) * decodedString.length()*5 + 1;
std::string result( len, '\0' );
@@ -279,7 +279,7 @@ std::string string_tolower(std::string str)
//-----------------------------------------------------------------------------
// write string to a file
//-----------------------------------------------------------------------------
-bool write_to_file(std::string filename, std::string content)
+bool write_to_file(const std::string &filename, const std::string &content)
{
FILE *fd = NULL;
if((fd = fopen(filename.c_str(),"w")) != NULL) // open file
diff --git a/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/helper.h b/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/helper.h
index 2d570ac..2b22c66 100644
--- a/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/helper.h
+++ b/tuxbox/neutrino/daemons/nhttpd/yhttpd_core/helper.h
@@ -21,8 +21,8 @@ void correctTime(struct tm *zt);
//-----------------------------------------------------------------------------
std::string itoa(unsigned int conv);
std::string itoh(unsigned int conv);
-std::string decodeString(std::string encodedString);
-std::string encodeString(std::string decodedString);
+std::string decodeString(const std::string &encodedString);
+std::string encodeString(const std::string &decodedString);
std::string string_tolower(std::string str);
//-----------------------------------------------------------------------------
@@ -31,12 +31,12 @@ std::string string_tolower(std::string str);
std::string trim(std::string const& source, char const* delims = " \t\r\n");
void replace(std::string &str, const std::string &find_what, const std::string &replace_with);
std::string string_printf(const char *fmt, ...);
-bool ySplitString(std::string str, std::string delimiter, std::string& left, std::string& right);
-bool ySplitStringExact(std::string str, std::string delimiter, std::string& left, std::string& right);
-bool ySplitStringLast(std::string str, std::string delimiter, std::string& left, std::string& right);
-CStringArray ySplitStringVector(std::string str, std::string delimiter);
+bool ySplitString(const std::string &str, const std::string &delimiter, std::string &left, std::string &right);
+bool ySplitStringExact(const std::string &str, const std::string &delimiter, std::string &left, std::string &right);
+bool ySplitStringLast(const std::string &str, const std::string &delimiter, std::string &left, std::string &right);
+CStringArray ySplitStringVector(const std::string &str, const std::string &delimiter);
bool nocase_compare (char c1, char c2);
std::string timeString(time_t time);
-bool write_to_file(std::string filename, std::string content);
+bool write_to_file(const std::string &filename, const std::string &content);
#endif /* __yhttpd_helper_h__ */
commit 155e42daa74ea4e5e1ca4ab789430c0056f904dc
Author: GetAway <get...@t-...>
Date: Sat Nov 1 19:13:18 2014 +0100
tuxmaild: fix mail header parsing version bump 1.51C
Signed-off-by: GetAway <get...@t-...>
diff --git a/tuxbox/plugins/tuxmail/daemon/tuxmaild.c b/tuxbox/plugins/tuxmail/daemon/tuxmaild.c
index 5069113..06af926 100644
--- a/tuxbox/plugins/tuxmail/daemon/tuxmaild.c
+++ b/tuxbox/plugins/tuxmail/daemon/tuxmaild.c
@@ -829,7 +829,7 @@ int DecodeHeader(char *encodedstring)
{
char *ptrS, *ptrE;
- if((ptrS = strstr(encodedstring, "?B?")))
+ if((ptrS = strstr(encodedstring, "?B?")) || (ptrS = strstr(encodedstring, "?b?")))
{
ptrS += 3;
@@ -840,7 +840,7 @@ int DecodeHeader(char *encodedstring)
return ptrE+2 - encodedstring;
}
}
- else if((ptrS = strstr(encodedstring, "?Q?")))
+ else if((ptrS = strstr(encodedstring, "?Q?")) || (ptrS = strstr(encodedstring, "?q?")))
{
ptrS += 3;
@@ -4800,7 +4800,7 @@ void SigHandler(int signal)
int main(int argc, char **argv)
{
- char cvs_revision[] = "$Revision: 1.51B $";
+ char cvs_revision[] = "$Revision: 1.51C $";
int param, nodelay = 0, account, mailstatus, unread_mailstatus;
pthread_t thread_id;
void *thread_result = 0;
commit 35e42b607dd140eb2a990be519b093af6c99f776
Author: Christian Schuett <Gau...@ho...>
Date: Fri Oct 31 18:12:37 2014 +0100
Neutrino: check emptiness of strings with empty()
Signed-off-by: Christian Schuett <Gau...@ho...>
Signed-off-by: GetAway <get...@t-...>
diff --git a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp
index cdaeadd..f2a7188 100644
--- a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp
@@ -51,7 +51,7 @@ CControlAPI::CControlAPI(CNeutrinoAPI *_NeutrinoAPI)
//-----------------------------------------------------------------------------
void CControlAPI::init(CyhookHandler *hh)
{
- if(PLUGIN_DIRS[0] == "")
+ if(PLUGIN_DIRS[0].empty())
{ // given in nhttpd.conf
PLUGIN_DIRS[0]=hh->WebserverConfigList["PublicDocumentRoot"];
PLUGIN_DIRS[0].append("/scripts");
@@ -226,7 +226,7 @@ void CControlAPI::Execute(CyhookHandler *hh)
else if(std::string(yCgiCallList[index].mime_type) == "") // decide in function
;
else if(std::string(yCgiCallList[index].mime_type) == "+xml") // Parameter xml?
- if (hh->ParamList["xml"] != "")
+ if (!hh->ParamList["xml"].empty())
hh->SetHeader(HTTP_OK, "text/xml; charset=iso-8859-1");
else
hh->SetHeader(HTTP_OK, "text/html; charset=iso-8859-1");
@@ -264,7 +264,7 @@ void CControlAPI::TimerCGI(CyhookHandler *hh)
NeutrinoAPI->Timerd->removeTimerEvent(removeId);
hh->SendOk();
}
- else if(hh->ParamList["get"] != "")
+ else if(!hh->ParamList["get"].empty())
{
int pre=0,post=0;
NeutrinoAPI->Timerd->getRecordingSafety(pre,post);
@@ -807,11 +807,11 @@ void CControlAPI::RCEmCGI(CyhookHandler *hh)
}
unsigned int repeat = 1;
unsigned int delay = 250;
- if (hh->ParamList["delay"] != "")
+ if (!hh->ParamList["delay"].empty())
delay = atoi(hh->ParamList["delay"].c_str());
- if (hh->ParamList["duration"] != "")
+ if (!hh->ParamList["duration"].empty())
repeat = atoi(hh->ParamList["duration"].c_str())*1000/delay;
- if (hh->ParamList["repeat"] != "")
+ if (!hh->ParamList["repeat"].empty())
repeat = atoi(hh->ParamList["repeat"].c_str());
int evd = open(EVENTDEV, O_RDWR);
@@ -973,7 +973,7 @@ void CControlAPI::VolumeCGI(CyhookHandler *hh)
{
hh->Write((char *) (NeutrinoAPI->Controld->getMute() ? "1" : "0")); // mute
}
- else if(hh->ParamList["1"]!="")
+ else if(!hh->ParamList["1"].empty())
{ //set volume
char vol = atol( hh->ParamList["1"].c_str() );
NeutrinoAPI->Controld->setVolume(vol);
@@ -1198,7 +1198,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh)
}
}
}
- else if (hh->ParamList["eventid"] != "")
+ else if (!hh->ParamList["eventid"].empty())
{
//special epg query
unsigned long long epgid;
@@ -1211,9 +1211,9 @@ void CControlAPI::EpgCGI(CyhookHandler *hh)
hh->WriteLn(epg.info2);
}
}
- else if (hh->ParamList["eventid2fsk"] != "")
+ else if (!hh->ParamList["eventid2fsk"].empty())
{
- if (hh->ParamList["starttime"] != "")
+ if (!hh->ParamList["starttime"].empty())
{
unsigned long long epgid;
time_t starttime;
@@ -1442,7 +1442,7 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh)
}
}
}
- else if (hh->ParamList["name"] != "")
+ else if (!hh->ParamList["name"].empty())
{
t_channel_id channel_id;
channel_id = NeutrinoAPI->ChannelNameToChannelId(hh->ParamList["name"]);
@@ -1472,7 +1472,7 @@ void CControlAPI::StartPluginCGI(CyhookHandler *hh)
std::string pluginname;
if (!(hh->ParamList.empty()))
{
- if (hh->ParamList["name"] != "")
+ if (!hh->ParamList["name"].empty())
{
pluginname = hh->ParamList["name"];
//pluginname=decodeString(pluginname);
@@ -1517,21 +1517,21 @@ void CControlAPI::LCDAction(CyhookHandler *hh)
return;
}
- if (hh->ParamList["lock"] != "")
+ if (!hh->ParamList["lock"].empty())
if(sscanf( hh->ParamList["lock"].c_str(), "%d", &tval))
NeutrinoAPI->LcdAPI->LockDisplay(tval);
else
error=1;
- if (hh->ParamList["clear"] != "")
+ if (!hh->ParamList["clear"].empty())
if(sscanf( hh->ParamList["clear"].c_str(), "%d", &tval))
if(tval)
NeutrinoAPI->LcdAPI->Clear();
else
error=1;
- if (hh->ParamList["png"] != "")
+ if (!hh->ParamList["png"].empty())
if(! NeutrinoAPI->LcdAPI->ShowPng((char*)hh->ParamList["png"].c_str()))
error=1;
- if (hh->ParamList["raw"] != "")
+ if (!hh->ParamList["raw"].empty())
{
char *sptr=strdup((char*)hh->ParamList["raw"].c_str()),*pptr;
int loop=4;
@@ -1550,44 +1550,44 @@ void CControlAPI::LCDAction(CyhookHandler *hh)
if(sptr)
free(sptr);
}
- if (hh->ParamList["line"] != "")
+ if (!hh->ParamList["line"].empty())
if(sscanf( hh->ParamList["line"].c_str(), "%d,%d,%d,%d,%d",&x1,&y1,&x2,&y2,&coll)==5)
NeutrinoAPI->LcdAPI->DrawLine(x1,y1,x2,y2,coll);
else
error=1;
- if (hh->ParamList["rect"] != "")
+ if (!hh->ParamList["rect"].empty())
if(sscanf( hh->ParamList["rect"].c_str(), "%d,%d,%d,%d,%d,%d",&x1,&y1,&x2,&y2,&coll,&colf)==6)
NeutrinoAPI->LcdAPI->DrawRect(x1,y1,x2,y2,coll,colf);
else
error=1;
- if (hh->ParamList["xpos"] != "")
+ if (!hh->ParamList["xpos"].empty())
if(sscanf( hh->ParamList["xpos"].c_str(), "%d", &tval))
xpos=tval;
else
error=1;
- if (hh->ParamList["ypos"] != "")
+ if (!hh->ParamList["ypos"].empty())
if(sscanf( hh->ParamList["ypos"].c_str(), "%d", &tval))
ypos=tval;
else
error=1;
- if (hh->ParamList["size"] != "")
+ if (!hh->ParamList["size"].empty())
if(sscanf( hh->ParamList["size"].c_str(), "%d", &tval))
size=tval;
else
error=1;
- if (hh->ParamList["color"] != "")
+ if (!hh->ParamList["color"].empty())
if(sscanf( hh->ParamList["color"].c_str(), "%d", &tval))
color=tval;
else
error=1;
- if (hh->ParamList["font"] != "")
+ if (!hh->ParamList["font"].empty())
if(sscanf( hh->ParamList["font"].c_str(), "%d", &tval) && tval>=0 && tval<3)
font=tval;
else
error=1;
- if (hh->ParamList["text"] != "")
+ if (!hh->ParamList["text"].empty())
NeutrinoAPI->LcdAPI->DrawText(xpos, ypos, size, color, font, (char*)hh->ParamList["text"].c_str());
- if (hh->ParamList["update"] != "")
+ if (!hh->ParamList["update"].empty())
if(sscanf( hh->ParamList["update"].c_str(), "%d", &tval))
if(tval)
NeutrinoAPI->LcdAPI->Update();
@@ -2194,7 +2194,7 @@ void CControlAPI::YWebCGI(CyhookHandler *hh)
{
bool status=true;
int para;
- if (hh->ParamList["video_stream_pids"] != "")
+ if (!hh->ParamList["video_stream_pids"].empty())
{
para=0;
sscanf( hh->ParamList["video_stream_pids"].c_str(), "%d", ¶);
@@ -2221,7 +2221,7 @@ void CControlAPI::YWeb_SendVideoStreamingPids(CyhookHandler *hh, int apid_no)
apid_idx=apid_no;
if(!pids.APIDs.empty())
apid = pids.APIDs[apid_idx].pid;
- if(hh->ParamList["no_commas"] != "")
+ if(!hh->ParamList["no_commas"].empty())
{
hh->printf("0x%04x 0x%04x 0x%04x",pids.PIDs.pmtpid,pids.PIDs.vpid,apid);
if (pids.PIDs.pcrpid != 0 && pids.PIDs.pcrpid != pids.PIDs.vpid)
@@ -2316,17 +2316,17 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
int alHour=0;
// if alarm given then in parameters im time_t format
- if(hh->ParamList["alarm"] != "")
+ if(!hh->ParamList["alarm"].empty())
{
alarmTimeT = atoi(hh->ParamList["alarm"].c_str());
- if(hh->ParamList["stop"] != "")
+ if(!hh->ParamList["stop"].empty())
stopTimeT = atoi(hh->ParamList["stop"].c_str());
- if(hh->ParamList["announce"] != "")
+ if(!hh->ParamList["announce"].empty())
announceTimeT = atoi(hh->ParamList["announce"].c_str());
else
announceTimeT = alarmTimeT;
}
- else if(hh->ParamList["alDate"] != "") //given formatted
+ else if(!hh->ParamList["alDate"].empty()) //given formatted
{
// Alarm Date - Format exact! DD.MM.YYYY
tnull = time(NULL);
@@ -2339,7 +2339,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
}
// Alarm Time - Format exact! HH:MM
- if(hh->ParamList["alTime"] != "")
+ if(!hh->ParamList["alTime"].empty())
sscanf(hh->ParamList["alTime"].c_str(),"%2d.%2d",&(alarmTime->tm_hour), &(alarmTime->tm_min));
alHour = alarmTime->tm_hour;
correctTime(alarmTime);
@@ -2348,11 +2348,11 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
struct tm *stopTime = localtime(&alarmTimeT);
stopTime->tm_sec = 0;
// Stop Time - Format exact! HH:MM
- if(hh->ParamList["stTime"] != "")
+ if(!hh->ParamList["stTime"].empty())
sscanf(hh->ParamList["stTime"].c_str(),"%2d.%2d",&(stopTime->tm_hour), &(stopTime->tm_min));
// Stop Date - Format exact! DD.MM.YYYY
- if(hh->ParamList["stDate"] != "")
+ if(!hh->ParamList["stDate"].empty())
if(sscanf(hh->ParamList["stDate"].c_str(),"%2d.%2d.%4d",&(stopTime->tm_mday), &(stopTime->tm_mon), &(stopTime->tm_year)) == 3)
{
stopTime->tm_mon -= 1;
@@ -2360,7 +2360,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
}
correctTime(stopTime);
stopTimeT = mktime(stopTime);
- if(hh->ParamList["stDate"] == "" && alHour > stopTime->tm_hour)
+ if(hh->ParamList["stDate"].empty() && alHour > stopTime->tm_hour)
stopTimeT += 24* 60 * 60; // add 1 Day
}
else // alarm/stop time given in pieces
@@ -2368,15 +2368,15 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
// alarm time
time_t now = time(NULL);
struct tm *alarmTime=localtime(&now);
- if(hh->ParamList["ad"] != "")
+ if(!hh->ParamList["ad"].empty())
alarmTime->tm_mday = atoi(hh->ParamList["ad"].c_str());
- if(hh->ParamList["amo"] != "")
+ if(!hh->ParamList["amo"].empty())
alarmTime->tm_mon = atoi(hh->ParamList["amo"].c_str())-1;
- if(hh->ParamList["ay"] != "")
+ if(!hh->ParamList["ay"].empty())
alarmTime->tm_year = atoi(hh->ParamList["ay"].c_str())-1900;
- if(hh->ParamList["ah"] != "")
+ if(!hh->ParamList["ah"].empty())
alarmTime->tm_hour = atoi(hh->ParamList["ah"].c_str());
- if(hh->ParamList["ami"] != "")
+ if(!hh->ParamList["ami"].empty())
alarmTime->tm_min = atoi(hh->ParamList["ami"].c_str());
alarmTime->tm_sec = 0;
correctTime(alarmTime);
@@ -2385,15 +2385,15 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
// stop time
struct tm *stopTime = alarmTime;
- if(hh->ParamList["sd"] != "")
+ if(!hh->ParamList["sd"].empty())
stopTime->tm_mday = atoi(hh->ParamList["sd"].c_str());
- if(hh->ParamList["smo"] != "")
+ if(!hh->ParamList["smo"].empty())
stopTime->tm_mon = atoi(hh->ParamList["smo"].c_str())-1;
- if(hh->ParamList["sy"] != "")
+ if(!hh->ParamList["sy"].empty())
stopTime->tm_year = atoi(hh->ParamList["sy"].c_str())-1900;
- if(hh->ParamList["sh"] != "")
+ if(!hh->ParamList["sh"].empty())
stopTime->tm_hour = atoi(hh->ParamList["sh"].c_str());
- if(hh->ParamList["smi"] != "")
+ if(!hh->ParamList["smi"].empty())
stopTime->tm_min = atoi(hh->ParamList["smi"].c_str());
stopTime->tm_sec = 0;
correctTime(stopTime);
@@ -2404,22 +2404,22 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
announceTimeT -= 60;
CTimerd::CTimerEventTypes type;
- if(hh->ParamList["type"] != "")
+ if(!hh->ParamList["type"].empty())
type = (CTimerd::CTimerEventTypes) atoi(hh->ParamList["type"].c_str());
else // default is: record
type = CTimerd::TIMER_RECORD;
// repeat
- if(hh->ParamList["repcount"] != "")
+ if(!hh->ParamList["repcount"].empty())
{
repCount = atoi(hh->ParamList["repcount"].c_str());
}
CTimerd::CTimerEventRepeat rep;
- if(hh->ParamList["rep"] != "")
+ if(!hh->ParamList["rep"].empty())
rep = (CTimerd::CTimerEventRepeat) atoi(hh->ParamList["rep"].c_str());
else // default: no repeat
rep = (CTimerd::CTimerEventRepeat)0;
- if(((int)rep) >= ((int)CTimerd::TIMERREPEAT_WEEKDAYS) && hh->ParamList["wd"] != "")
+ if(((int)rep) >= ((int)CTimerd::TIMERREPEAT_WEEKDAYS) && !hh->ParamList["wd"].empty())
NeutrinoAPI->Timerd->getWeekdaysFromStr((int*)&rep, hh->ParamList["wd"].c_str());
// apids
@@ -2457,7 +2457,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
eventinfo.recordingSafety = (hh->ParamList["rs"] == "1");
// channel by Id or name
- if(hh->ParamList["channel_id"] != "")
+ if(!hh->ParamList["channel_id"].empty())
sscanf(hh->ParamList["channel_id"].c_str(),
SCANF_CHANNEL_ID_TYPE,
&eventinfo.channel_id);
@@ -2477,7 +2477,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
data= &eventinfo;
else if (type==CTimerd::TIMER_RECORD)
{
- if(_rec_dir == "")
+ if(_rec_dir.empty())
{
// get Default Recordingdir
CConfigFile *Config = new CConfigFile(',');
@@ -2508,7 +2508,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
// update or add timer
if(hh->ParamList["update"]=="1")
{
- if(hh->ParamList["id"] != "")
+ if(!hh->ParamList["id"].empty())
{
unsigned modyId = atoi(hh->ParamList["id"].c_str());
if(type == CTimerd::TIMER_RECORD)
@@ -2551,7 +2551,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
//-------------------------------------------------------------------------
void CControlAPI::setBouquetCGI(CyhookHandler *hh)
{
- if (hh->ParamList["selected"] != "") {
+ if (!hh->ParamList["selected"].empty()) {
int selected = atoi(hh->ParamList["selected"].c_str());
if(hh->ParamList["action"].compare("hide") == 0)
NeutrinoAPI->Zapit->setBouquetHidden(selected - 1,true);
@@ -2576,7 +2576,7 @@ void CControlAPI::saveBouquetCGI(CyhookHandler *hh)
//-------------------------------------------------------------------------
void CControlAPI::moveBouquetCGI(CyhookHandler *hh)
{
- if (hh->ParamList["selected"] != "" && (
+ if (!hh->ParamList["selected"].empty() && (
hh->ParamList["action"] == "up" ||
hh->ParamList["action"] == "down"))
{
@@ -2598,7 +2598,7 @@ void CControlAPI::deleteBouquetCGI(CyhookHandler *hh)
{
int selected = -1;
- if (hh->ParamList["selected"] != "") {
+ if (!hh->ParamList["selected"].empty()) {
selected = atoi(hh->ParamList["selected"].c_str());
NeutrinoAPI->Zapit->deleteBouquet(selected - 1);
hh->SendOk();
@@ -2624,9 +2624,9 @@ void CControlAPI::addBouquetCGI(CyhookHandler *hh)
//-------------------------------------------------------------------------
void CControlAPI::renameBouquetCGI(CyhookHandler *hh)
{
- if (hh->ParamList["selected"] != "")
+ if (!hh->ParamList["selected"].empty())
{
- if (hh->ParamList["nameto"] != "")
+ if (!hh->ParamList["nameto"].empty())
{
if (NeutrinoAPI->Zapit->existsBouquet((hh->ParamList["nameto"]).c_str()) == -1)
{
@@ -2667,7 +2667,7 @@ void CControlAPI::changeBouquetCGI(CyhookHandler *hh)
NeutrinoAPI->Zapit->renumChannellist();
NeutrinoAPI->UpdateBouquets();
- if(hh->ParamList["redirect"] != "")
+ if(!hh->ParamList["redirect"].empty())
hh->SendRewrite(hh->ParamList["redirect"]);
else
hh->SendOk();
@@ -2695,7 +2695,7 @@ void CControlAPI::build_live_url(CyhookHandler *hh)
int apid=0,apid_no=0,apid_idx=0;
pids.PIDs.vpid=0;
- if(hh->ParamList["audio_no"] !="")
+ if(!hh->ParamList["audio_no"].empty())
apid_no = atoi(hh->ParamList["audio_no"].c_str());
NeutrinoAPI->Zapit->getPIDS(pids);
@@ -2722,14 +2722,14 @@ void CControlAPI::build_live_url(CyhookHandler *hh)
hh->SendError();
// build url
std::string url = "";
- if(hh->ParamList["host"] !="")
+ if(!hh->ParamList["host"].empty())
url = "http://"+hh->ParamList["host"];
else
url = "http://"+hh->HeaderList["Host"];
url += (mode == CZapitClient::MODE_TV) ? ":31339/0," : ":31338/";
url += xpids;
// response url
- if(hh->ParamList["vlc_link"] !="")
+ if(!hh->ParamList["vlc_link"].empty())
{
write_to_file("/tmp/vlc.m3u", url);
hh->SendRedirect("/tmp/vlc.m3u");
diff --git a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp
index 38542af..ef59fbe 100644
--- a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp
@@ -157,7 +157,7 @@ std::string CNeutrinoYParser::func_mount_get_list(CyhookHandler */*hh*/, std::s
yip = Config->getString("network_nfs_ip_"+ynr,"");
ydir = Config->getString("network_nfs_dir_"+ynr,"");
ylocal_dir = Config->getString("network_nfs_local_dir_"+ynr,"");
- if(ydir != "")
+ if(!ydir.empty())
ydir="("+ydir+")";
yresult += string_printf("<input type='radio' name='R1' value='%d' %s />%d %s - %s %s %s<br/>",
@@ -201,7 +201,7 @@ std::string CNeutrinoYParser::func_get_bouquets_as_dropdown(CyhookHandler */*hh
unsigned int nr=1;
ySplitString(para," ",nr_str, do_show_hidden);
- if(nr_str != "")
+ if(!nr_str.empty())
nr = atoi(nr_str.c_str());
for (unsigned int i = 0; i < NeutrinoAPI->BouquetList.size();i++)
@@ -268,7 +268,7 @@ std::string CNeutrinoYParser::func_get_channels_as_dropdown(CyhookHandler */*hh
int mode = CZapitClient::MODE_CURRENT;
ySplitString(para," ",abouquet, achannel_id);
- if(abouquet != "")
+ if(!abouquet.empty())
bnumber = atoi(abouquet.c_str());
if(bnumber != 0) //Bouquet View
@@ -300,7 +300,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
CZapitClient::BouquetChannelList *channellist;
ySplitString(para," ",abnumber, tmp);
- if(abnumber != "")
+ if(!abnumber.empty())
BouquetNr = atoi(abnumber.c_str());
if (BouquetNr > 0)
channellist = NeutrinoAPI->GetBouquet(BouquetNr, CZapitClient::MODE_CURRENT);
@@ -317,7 +317,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
std::string timestr;
bool have_logos = false;
- if(hh->WebserverConfigList["TUXBOX_LOGOS_URL"] != "")
+ if(!hh->WebserverConfigList["TUXBOX_LOGOS_URL"].empty())
have_logos = true;
CZapitClient::BouquetChannelList::iterator channel = channellist->begin();
for (; channel != channellist->end(); ++channel)
@@ -482,7 +482,7 @@ std::string CNeutrinoYParser::func_get_video_pids(CyhookHandler */*hh*/, std::s
int apid=0,apid_no=0,apid_idx=0;
pids.PIDs.vpid=0;
- if(para != "")
+ if(!para.empty())
apid_no = atoi(para.c_str());
NeutrinoAPI->Zapit->getPIDS(pids);
@@ -641,7 +641,7 @@ std::string CNeutrinoYParser::func_get_partition_list(CyhookHandler */*hh*/, ...
[truncated message content] |