- tmdb: cleanup from unused code

This commit is contained in:
svenhoefer
2016-08-09 17:48:56 +02:00
parent 34b03c246f
commit 81fa43435e
2 changed files with 0 additions and 63 deletions

View File

@@ -54,19 +54,8 @@
cTmdb::cTmdb(std::string epgtitle) cTmdb::cTmdb(std::string epgtitle)
{ {
frameBuffer = CFrameBuffer::getInstance();
minfo.epgtitle = epgtitle; minfo.epgtitle = epgtitle;
curl_handle = curl_easy_init(); curl_handle = curl_easy_init();
form = NULL;
ox = frameBuffer->getScreenWidthRel(false);
oy = frameBuffer->getScreenHeightRel(false);
int buttonheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6;
toph = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getHeight() + 6;
sx = getScreenStartX(ox);
sy = getScreenStartY(oy + buttonheight); /* button box is handled separately (why?) */
#ifdef TMDB_API_KEY #ifdef TMDB_API_KEY
key = TMDB_API_KEY; key = TMDB_API_KEY;
@@ -91,7 +80,6 @@ cTmdb::cTmdb(std::string epgtitle)
cTmdb::~cTmdb() cTmdb::~cTmdb()
{ {
curl_easy_cleanup(curl_handle); curl_easy_cleanup(curl_handle);
delete form;
} }
size_t cTmdb::CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data) size_t cTmdb::CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data)
@@ -306,48 +294,3 @@ std::string cTmdb::CreateEPGText()
epgtext += (std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ACTORS)+":\n"+ minfo.cast+"\n"; epgtext += (std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ACTORS)+":\n"+ minfo.cast+"\n";
return epgtext; return epgtext;
} }
void cTmdb::exec()
{
neutrino_msg_t msg;
neutrino_msg_data_t data;
if (form == NULL)
form = new CComponentsForm();
form->setDimensionsAll(sx, sy, ox, oy);
CComponentsHeader *header = new CComponentsHeader(0, 0, ox, toph);
CComponentsText *headerText = new CComponentsText(15, 0, ox-15, toph, getTitle(), CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]);;
headerText->doPaintBg(false);
headerText->setTextColor(COL_MENUHEAD_TEXT);
form->addCCItem(header);
form->addCCItem(headerText);
CComponentsPicture *ptmp = new CComponentsPicture(5, toph+5, "/tmp/tmdb.jpg");
ptmp->setWidth(342);
ptmp->setHeight(513);
ptmp->setColorBody(COL_BLUE);
ptmp->setCorner(RADIUS_MID, CORNER_TOP_LEFT);
form->addCCItem(ptmp);
CComponentsText *des = new CComponentsText(ptmp->getWidth()+10, toph+5, form->getWidth()-ptmp->getWidth()-10, form->getHeight(), CreateEPGText(), CTextBox::AUTO_LINEBREAK_NO_BREAKCHARS | CTextBox::TOP);
des->setCorner(RADIUS_MID, CORNER_BOTTOM_RIGHT);
des->setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]);
form->addCCItem(des);
form->paint();
frameBuffer->blit();
while (1) {
g_RCInput->getMsg(&msg, &data, 100);
if (msg == CRCInput::RC_home)
break;
}
if (form->isPainted()) {
form->hide();
delete form;
form = NULL;
}
}

View File

@@ -24,7 +24,6 @@
#include <curl/easy.h> #include <curl/easy.h>
#include <string> #include <string>
#include <gui/components/cc.h>
typedef struct { typedef struct {
std::string epgtitle; std::string epgtitle;
@@ -49,12 +48,8 @@ class cTmdb
{ {
private: private:
CURL *curl_handle; CURL *curl_handle;
CComponentsForm *form;
tmdbinfo minfo; tmdbinfo minfo;
CFrameBuffer *frameBuffer;
int ox, oy, sx, sy, toph;
static size_t CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data); static size_t CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data);
std::string encodeUrl(std::string txt); std::string encodeUrl(std::string txt);
std::string decodeUrl(std::string url); std::string decodeUrl(std::string url);
@@ -66,7 +61,6 @@ class cTmdb
public: public:
cTmdb(std::string epgtitle); cTmdb(std::string epgtitle);
~cTmdb(); ~cTmdb();
void exec();
std::string CreateEPGText(); std::string CreateEPGText();
std::string getTitle() { return minfo.epgtitle;} std::string getTitle() { return minfo.epgtitle;}