Merge branch 'dvbsi++' of coolstreamtech.de:cst-public-gui-neutrino into dvbsi++

This commit is contained in:
[CST] Focus
2012-06-18 20:04:58 +04:00
9 changed files with 34 additions and 32 deletions

View File

@@ -387,7 +387,7 @@ std::string CUPnPDevice::HTTP(std::string url, std::string post, std::string act
} }
path = url.substr(pos2); path = url.substr(pos2);
if (post.size()) if (!post.empty())
command << "POST " << path << " HTTP/1.0\r\n"; command << "POST " << path << " HTTP/1.0\r\n";
else else
command << "GET " << path << " HTTP/1.0\r\n"; command << "GET " << path << " HTTP/1.0\r\n";
@@ -397,18 +397,18 @@ std::string CUPnPDevice::HTTP(std::string url, std::string post, std::string act
command << "Accept: text/xml\r\n"; command << "Accept: text/xml\r\n";
command << "Connection: Close\r\n"; command << "Connection: Close\r\n";
if (post.size()) if (!post.empty())
{ {
command << "Content-Length: " << post.size() << "\r\n"; command << "Content-Length: " << post.size() << "\r\n";
command << "Content-Type: text/xml\r\n"; command << "Content-Type: text/xml\r\n";
} }
if (action.size()) if (!action.empty())
command << "SOAPAction: \"" << action << "\"\r\n"; command << "SOAPAction: \"" << action << "\"\r\n";
command << "\r\n"; command << "\r\n";
if (post.size()) if (!post.empty())
command << post; command << post;
t_socket = socket(PF_INET, SOCK_STREAM, 0); t_socket = socket(PF_INET, SOCK_STREAM, 0);

View File

@@ -247,7 +247,7 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data,
//printf("[CTimerdClient] checking for overlapping timers\n"); //printf("[CTimerdClient] checking for overlapping timers\n");
CTimerd::TimerList overlappingTimer; CTimerd::TimerList overlappingTimer;
overlappingTimer = getOverlappingTimers(alarmtime, stoptime); overlappingTimer = getOverlappingTimers(alarmtime, stoptime);
if (overlappingTimer.size() > 0) if (!overlappingTimer.empty())
{ {
// timerd starts eventID at 0 so we can return -1 // timerd starts eventID at 0 so we can return -1
return -1; return -1;

View File

@@ -1473,7 +1473,7 @@ bool CRecordManager::CutBackNeutrino(const t_channel_id channel_id, const int mo
if(SAME_TRANSPONDER(live_channel_id, channel_id)) { if(SAME_TRANSPONDER(live_channel_id, channel_id)) {
printf("%s zapTo_record channel_id %llx\n", __FUNCTION__, channel_id); printf("%s zapTo_record channel_id %llx\n", __FUNCTION__, channel_id);
ret = g_Zapit->zapTo_record(channel_id) > 0; ret = g_Zapit->zapTo_record(channel_id) > 0;
} else if(recmap.size()) { } else if(!recmap.empty()) {
ret = false; ret = false;
} else { } else {
if (mode != last_mode && (last_mode != NeutrinoMessages::mode_standby || mode != CNeutrinoApp::getInstance()->getLastMode())) { if (mode != last_mode && (last_mode != NeutrinoMessages::mode_standby || mode != CNeutrinoApp::getInstance()->getLastMode())) {

View File

@@ -215,7 +215,7 @@ static bool deleteEvent(const event_id_t uniqueKey)
MySIeventsOrderUniqueKey::iterator e = mySIeventsOrderUniqueKey.find(uniqueKey); MySIeventsOrderUniqueKey::iterator e = mySIeventsOrderUniqueKey.find(uniqueKey);
if (e != mySIeventsOrderUniqueKey.end()) { if (e != mySIeventsOrderUniqueKey.end()) {
if (e->second->times.size()) { if (!e->second->times.empty()) {
mySIeventsOrderFirstEndTimeServiceIDEventUniqueKey.erase(e->second); mySIeventsOrderFirstEndTimeServiceIDEventUniqueKey.erase(e->second);
mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.erase(e->second); mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.erase(e->second);
} }

View File

@@ -2086,8 +2086,8 @@ void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler)
m_vMovieInfo.erase( (std::vector<MI_MOVIE_INFO>::iterator)&movieSelectionHandler); m_vMovieInfo.erase( (std::vector<MI_MOVIE_INFO>::iterator)&movieSelectionHandler);
TRACE("List size: %d\n", m_vMovieInfo.size()); TRACE("List size: %d\n", m_vMovieInfo.size());
//if(m_vMovieInfo.size() == 0) fileInfoStale(); //if(m_vMovieInfo.empty()) fileInfoStale();
//if(m_vMovieInfo.size() == 0) onSetGUIWindow(m_settings.gui); //if(m_vMovieInfo.empty()) onSetGUIWindow(m_settings.gui);
updateSerienames(); updateSerienames();
refreshBrowserList(); refreshBrowserList();
refreshLastPlayList(); refreshLastPlayList();
@@ -2399,7 +2399,7 @@ void CMovieBrowser::loadAllTsFileNamesFromStorage(void)
TRACE("[mb] Dir%d, Files:%d \r\n",m_dirNames.size(),m_vMovieInfo.size()); TRACE("[mb] Dir%d, Files:%d \r\n",m_dirNames.size(),m_vMovieInfo.size());
/* /*
if(m_vMovieInfo.size() == 0) if(m_vMovieInfo.empty())
{ {
std::string msg = g_Locale->getText(LOCALE_MOVIEBROWSER_ERROR_NO_MOVIES); std::string msg = g_Locale->getText(LOCALE_MOVIEBROWSER_ERROR_NO_MOVIES);
DisplayErrorMessage(msg.c_str()); DisplayErrorMessage(msg.c_str());

View File

@@ -253,7 +253,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
g_Zapit->setScanBouquetMode( (CZapitClient::bouquetMode)scansettings.bouquetMode); g_Zapit->setScanBouquetMode( (CZapitClient::bouquetMode)scansettings.bouquetMode);
/* send satellite list to zapit */ /* send satellite list to zapit */
if(satList.size()) if(!satList.empty())
g_Zapit->setScanSatelliteList( satList); g_Zapit->setScanSatelliteList( satList);
tuned = -1; tuned = -1;

View File

@@ -618,7 +618,7 @@ void CScanSetup::fillSatSelect()
if(CFEManager::getInstance()->getMode() != CFEManager::FE_MODE_ALONE) if(CFEManager::getInstance()->getMode() != CFEManager::FE_MODE_ALONE)
break; break;
} }
if(!sfound && satpos.size()) { if(!sfound && !satpos.empty()) {
tmpit = satpos.begin(); tmpit = satpos.begin();
std::string satname = CServiceManager::getInstance()->GetSatelliteName(*tmpit); std::string satname = CServiceManager::getInstance()->GetSatelliteName(*tmpit);
snprintf(scansettings.satNameNoDiseqc, sizeof(scansettings.satNameNoDiseqc), "%s", satname.c_str()); snprintf(scansettings.satNameNoDiseqc, sizeof(scansettings.satNameNoDiseqc), "%s", satname.c_str());
@@ -649,7 +649,7 @@ void CScanSetup::fillCableSelect()
dprintf(DEBUG_DEBUG, "got scanprovider (cable): %s\n", sit->second.name.c_str()); dprintf(DEBUG_DEBUG, "got scanprovider (cable): %s\n", sit->second.name.c_str());
} }
if (!sfound && satmap.size()) { if (!sfound && !satmap.empty()) {
sat_iterator_t sit = satmap.begin(); sat_iterator_t sit = satmap.begin();
snprintf(scansettings.satNameNoDiseqc, sizeof(scansettings.satNameNoDiseqc), "%s", sit->second.name.c_str()); snprintf(scansettings.satNameNoDiseqc, sizeof(scansettings.satNameNoDiseqc), "%s", sit->second.name.c_str());
} }
@@ -678,7 +678,7 @@ int CScanSetup::showScanMenuSatFind()
feSatSelect->addOption(satname.c_str()); feSatSelect->addOption(satname.c_str());
if (!sfound && strcmp(scansettings.satNameNoDiseqc, satname.c_str()) == 0) if (!sfound && strcmp(scansettings.satNameNoDiseqc, satname.c_str()) == 0)
sfound = true; sfound = true;
if (!sfound && !firstname.size()) if (!sfound && firstname.empty())
firstname = satname; firstname = satname;
count++; count++;
} }

View File

@@ -389,7 +389,7 @@ void CUpnpBrowserGui::selectDevice()
m_devices = m_socket->Discover("urn:schemas-upnp-org:service:ContentDirectory:1"); m_devices = m_socket->Discover("urn:schemas-upnp-org:service:ContentDirectory:1");
scanBox->hide(); scanBox->hide();
if (!m_devices.size()) if (m_devices.empty())
{ {
ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_UPNPBROWSER_NOSERVERS, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_UPNPBROWSER_NOSERVERS, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO);
delete scanBox; delete scanBox;
@@ -456,7 +456,7 @@ void CUpnpBrowserGui::selectDevice()
#endif #endif
m_devices = m_socket->Discover("urn:schemas-upnp-org:service:ContentDirectory:1"); m_devices = m_socket->Discover("urn:schemas-upnp-org:service:ContentDirectory:1");
scanBox->hide(); scanBox->hide();
if (!m_devices.size()) if (m_devices.empty())
{ {
ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_UPNPBROWSER_NOSERVERS, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_UPNPBROWSER_NOSERVERS, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO);
delete scanBox; delete scanBox;

View File

@@ -217,24 +217,26 @@ void CNetworkConfig::commitConfig(void)
int mysystem(char * cmd, char * arg1, char * arg2) int mysystem(char * cmd, char * arg1, char * arg2)
{ {
int pid, i; int i;
switch (pid = fork()) pid_t pid;
{ int maxfd = getdtablesize();// sysconf(_SC_OPEN_MAX);
case -1: /* can't fork */ switch (pid = vfork())
perror("fork"); {
return -1; case -1: /* can't fork */
perror("vfork");
return -1;
case 0: /* child process */ case 0: /* child process */
for(i = 3; i < 256; i++) for(i = 3; i < maxfd; i++)
close(i); close(i);
if(execlp(cmd, cmd, arg1, arg2, NULL)) if(execlp(cmd, cmd, arg1, arg2, NULL))
{ {
perror("exec"); perror("exec");
} }
exit(0); exit(0);
default: /* parent returns to calling process */ default: /* parent returns to calling process */
break; break;
} }
waitpid(pid, 0, 0); waitpid(pid, 0, 0);
return 0; return 0;
} }