Changeset 12564


Ignore:
Timestamp:
12/23/11 23:50:46 (12 years ago)
Author:
nit
Message:

[titan] change feed input for 3 feeds

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/panel/panel_feed.h

    r12373 r12564  
    44void screenpanel_feed()
    55{
    6         char* tmpstr = NULL, *line1 = NULL, *line2 = NULL;
     6        char* tmpstr = NULL, *line = NULL, *lastline = NULL;
    77
    8         line2 = readsys(getconfig("feed", NULL), 2);
    9         line2 = string_replace("src/gz secret http://", "", line2, 1);
     8        lastline = readsys(getconfig("feed", NULL), 3); //line3
     9        lastline = string_replace("src/gz secret http://", "", lastline, 1);
    1010
    11         if(line2 == NULL || ostrcmp(line2, "") == 0 || ostrcmp(line2, "\n") == 0)
    12                 line2 = ostrcat(line2, "00.00.00.00/svn/atemio", 1, 0);
     11        if(lastline == NULL || ostrcmp(lastline, "") == 0 || ostrcmp(lastline, "\n") == 0)
     12                lastline = ostrcat(lastline, "00.00.00.00/svn/atemio", 1, 0);
    1313
    14         line2 = textinput(_("Feed"), line2);
     14        lastline = textinput(_("Feed"), lastline);
    1515       
    16         if(line2 != NULL)
     16        if(lastline != NULL)
    1717        {
    18                 line1 = readsys(getconfig("feed", NULL), 1);
    19                 if(line1 == NULL) line1 = ostrcat("#", NULL, 0, 0);
     18                tmpstr = readsys(getconfig("feed", NULL), 1); //line1
     19                if(tmpstr == NULL || (tmpstr != NULL && strlen(tmpstr) == 0))
     20                        line = ostrcat(line, "#\n", 1, 0);
     21                else
     22                        line = ostrcat(line, tmpstr, 1, 0);
     23                free(tmpstr); tmpstr = NULL;
     24               
     25                tmpstr = readsys(getconfig("feed", NULL), 2); //line2
     26                if(tmpstr == NULL || (tmpstr != NULL && strlen(tmpstr) == 0))
     27                        line = ostrcat(line, "#\n", 1, 0);
     28                else
     29                        line = ostrcat(line, tmpstr, 1, 0);
     30                free(tmpstr); tmpstr = NULL;
    2031
    21                 if(line1[strlen(line1) - 1] == '\n')
    22                         tmpstr = ostrcat(line1, "src/gz secret http://", 0, 0);
     32                if(line[strlen(line) - 1] == '\n')
     33                        tmpstr = ostrcat(line, "src/gz secret http://", 0, 0);
    2334                else
    24                         tmpstr = ostrcat(line1, "\nsrc/gz secret http://", 0, 0);
    25 
    26                 if(tmpstr != NULL && tmpstr[0] == '\n')
    27                         tmpstr = ostrcat("#", tmpstr, 0, 1);
     35                        tmpstr = ostrcat(line, "\nsrc/gz secret http://", 0, 0);
    2836               
    29                 if(strlen(line2) == 0)
     37                if(strlen(lastline) == 0)
    3038                {
    3139                        free(tmpstr);
    32                         tmpstr = ostrcat(line1, NULL, 0, 0);
     40                        tmpstr = ostrcat(line, NULL, 0, 0);
    3341                }
    3442
    35                 tmpstr = ostrcat(tmpstr, line2, 1, 0);
     43                tmpstr = ostrcat(tmpstr, lastline, 1, 0);
    3644                writesys(getconfig("feed", NULL), tmpstr, 0);
    37                 writeconfigtmp();
    3845        }
    3946
    4047        free(tmpstr);
    41         free(line1);
    42         free(line2);
     48        free(line);
     49        free(lastline);
    4350}
    4451
Note: See TracChangeset for help on using the changeset viewer.