Changeset 17596 for titan/plugins/hbbtv


Ignore:
Timestamp:
08/28/12 10:48:46 (12 years ago)
Author:
nit
Message:

[titan] make opera vars variable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/hbbtv/hbbtv.h

    r17093 r17596  
    1515#define CONTROL_PIPE_R "/tmp/"NAME"_control_r"
    1616#define RC_TITAN "/tmp/rc_enigma2"
    17 #define OPERA_ROOT "/var/swap/titanplugins/hbbtv/opera"
    18 #define OPERA_BIN OPERA_ROOT"/bin/opera"
    1917
    2018extern struct skin* skin;
     
    361359        char* tmpstr = NULL, *savedir = NULL, *dirbuf = NULL;;
    362360        struct stimerthread* operareceiver = NULL;
     361        char* opera_root, *opera_bin = NULL, *opera_dir = NULL;
     362        char* opera_home = NULL, *opera_fonts = NULL, *opera_widgets = NULL;
     363
     364        if(file_exist("/var/usr/local/share/titan/plugins/hbbtv/opera")
     365                opera_root = ostrcat("/var/usr/local/share/titan/plugins/hbbtv/opera", NULL, 0, 0);
     366        else
     367                opera_root = ostrcat("/var/swap/titanplugins/hbbtv/opera", NULL, 0, 0);
     368
     369        opera_bin = ostrcat(opera_root, "/bin/opera", 0, 0);
     370        opera_dir = ostrcat(opera_root, "/opera_dir", 0, 0);
     371        opera_home = ostrcat(opera_root, "/opera_home/", 0, 0);
     372        opera_fonts = ostrcat(opera_root, "/fonts", 0, 0);
     373        opera_widgets = ostrcat(opera_root, "/widgets", 0, 0);
    363374
    364375        drawscreen(skin, 0, 0);
     
    375386        setenv("OPERA_ESC_EXIT", "YES", 1);
    376387        setenv("FREETYPE_FONT_SET", "YES", 1);
    377         setenv("OPERA_ROOT", OPERA_ROOT, 1);
     388        setenv("OPERA_ROOT", opera_root, 1);
    378389        setenv("OPERA_FB_SIZE", "1280x720", 1);
    379         setenv("OPERA_DIR", OPERA_ROOT"/opera_dir", 1);
    380         setenv("OPERA_HOME", OPERA_ROOT"/opera_home/", 1);
    381         setenv("OPERA_FONTS", OPERA_ROOT"/fonts", 1);
    382         setenv("OPERA_WIDGETS", OPERA_ROOT"/widgets", 1);
    383         setenv("LD_LIBRARY_PATH", OPERA_ROOT, 1); // + ":" + os.environ["LD_LIBRARY_PATH"]
     390        setenv("OPERA_DIR", opera_dir, 1);
     391        setenv("OPERA_HOME", opera_home, 1);
     392        setenv("OPERA_FONTS", opera_fonts, 1);
     393        setenv("OPERA_WIDGETS", opera_widgets, 1);
     394        setenv("LD_LIBRARY_PATH", opera_root, 1); // + ":" + os.environ["LD_LIBRARY_PATH"]
    384395
    385396        unlink(CONTROL_PIPE_W);
     
    413424        {
    414425                savedir = getcwd(dirbuf, PATH_MAX);
    415                 chdir(OPERA_ROOT);
     426                chdir(opera_root);
    416427        }
    417428
    418429        fbsave();
    419430
    420         tmpstr = ostrcat(tmpstr, OPERA_BIN, 1, 0);
     431        tmpstr = ostrcat(tmpstr, opera_bin, 1, 0);
    421432        tmpstr = ostrcat(tmpstr, " -u ", 1, 0);
    422433        tmpstr = ostrcat(tmpstr, url, 1, 0);
     
    424435        system(tmpstr);
    425436        free(tmpstr); tmpstr = NULL;
     437
     438        //free all opera vars
     439        free(opera_root); opera_root = NULL;
     440        free(opera_bin); opera_bin = NULL;
     441        free(opera_dir); opera_dir = NULL;
     442        free(opera_home); opera_home = NULL
     443        free(opera_fonts); opera_fonts = NULL;
     444        free(opera_widgets); opera_widgets = NULL;
    426445
    427446        //reset working dir
Note: See TracChangeset for help on using the changeset viewer.