Changeset 2476

Show
Ignore:
Timestamp:
08/19/07 14:23:50 (1 year ago)
Author:
paule
Message:

Rename url parameter to hostname (since it's not actually a URL)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/opie-sync/src/opie-sync

    r2440 r2476  
    33  <username>root</username> 
    44  <password>rootme</password> 
    5   <url>192.168.0.202</url
     5  <hostname>192.168.0.202</hostname
    66  <device>opie</device> 
    77  <port>4242</port> 
  • plugins/opie-sync/src/opie_comms.c

    r2474 r2476  
    554554        CURLcode res; 
    555555 
    556         if (env->url && env->username && env->password ) 
     556        if (env->host && env->username && env->password ) 
    557557        { 
    558558                char* separator_path; 
     
    576576                                          env->username, 
    577577                                          env->password, 
    578                                           env->url
     578                                          env->host
    579579                                          env->device_port, 
    580580                                          separator_path, 
     
    645645        gchar **direntries; 
    646646 
    647         if (env->url && env->username && env->password ) 
     647        if (env->host && env->username && env->password ) 
    648648        { 
    649649                char* separator_path; 
     
    666666                                                 env->username, 
    667667                                                 env->password, 
    668                                                  env->url
     668                                                 env->host
    669669                                                 env->device_port, 
    670670                                                 separator_path); 
     
    753753        char *ftpurl; 
    754754         
    755         if (env->url && env->username && env->password ) 
     755        if (env->host && env->username && env->password ) 
    756756        { 
    757757                if ( env->use_qcop )  
     
    788788                                                                        env->username, 
    789789                                                                        env->password, 
    790                                                                         env->url
     790                                                                        env->host
    791791                                                                        env->device_port, 
    792792                                                                        separator_path); 
     
    803803                                                                        env->username, 
    804804                                                                        env->password, 
    805                                                                         env->url
     805                                                                        env->host
    806806                                                                        env->device_port, 
    807807                                                                        separator_path, 
     
    971971        char* separator_path; 
    972972         
    973         if (env->url && env->username && env->password ) 
     973        if (env->host && env->username && env->password ) 
    974974        { 
    975975                if ( env->use_qcop )  
     
    991991                                          env->username, 
    992992                                          env->password, 
    993                                           env->url
     993                                          env->host
    994994                                          env->device_port, 
    995995                                          separator_path, 
     
    10541054        TempFile *tmpfile = NULL; 
    10551055         
    1056         if(env->url && env->device_port && env->username) { 
     1056        if(env->host && env->device_port && env->username) { 
    10571057                /* We have to close the temp file, because we want  
    10581058                                scp to be able to write to it */ 
     
    10661066                scpcommand = g_strdup_printf("ssh -o BatchMode=yes %s@%s \"ls %s > /dev/null\"", 
    10671067                                                                                                                                env->username, 
    1068                                                                                                                                 env->url
     1068                                                                                                                                env->host
    10691069                                                                                                                                remotefile); 
    10701070                 
     
    10831083                        scpcommand = g_strdup_printf("scp -q -B %s@%s:%s %s", 
    10841084                                                                                                                                        env->username, 
    1085                                                                                                                                         env->url
     1085                                                                                                                                        env->host
    10861086                                                                                                                                        remotefile, 
    10871087                                                                                                                                        tmpfile->filename); 
     
    11701170                scpcommand = g_strdup_printf("ssh -o BatchMode=yes %s@%s \"mkdir -p %s\"", 
    11711171                                                                                                                                env->username, 
    1172                                                                                                                                 env->url
     1172                                                                                                                                env->host
    11731173                                                                                                                                dirname); 
    11741174                g_free(dirname); 
     
    11871187                                                                                                                                tmpfile->filename, 
    11881188                                                                                                                                env->username, 
    1189                                                                                                                                 env->url
     1189                                                                                                                                env->host
    11901190                                                                                                                                remotefile); 
    11911191                 
     
    12341234        int scpretval, scpexitstatus; 
    12351235         
    1236         if(env->url && env->device_port && env->username) { 
     1236        if(env->host && env->device_port && env->username) { 
    12371237                char* separator_path; 
    12381238                if ( env->use_qcop )  
     
    12681268                scpcommand = g_strdup_printf("ssh -o BatchMode=yes %s@%s \"ls %s*.txt > /dev/null\"", 
    12691269                                                                                                                                env->username, 
    1270                                                                                                                                 env->url
     1270                                                                                                                                env->host
    12711271                                                                                                                                separator_path); 
    12721272                 
     
    12851285                        scpcommand = g_strdup_printf("scp -p -q -B %s@%s:%s*.txt %s", 
    12861286                                                                                                                                        env->username, 
    1287                                                                                                                                         env->url
     1287                                                                                                                                        env->host
    12881288                                                                                                                                        separator_path, 
    12891289                                                                                                                                        temppath); 
     
    13331333        char *separator_path = NULL; 
    13341334         
    1335         if(env->url && env->device_port && env->username) { 
     1335        if(env->host && env->device_port && env->username) { 
    13361336                if ( env->use_qcop )  
    13371337                { 
     
    13701370                scpcommand = g_strdup_printf("ssh -o BatchMode=yes %s@%s \"mkdir -p %s\"", 
    13711371                                                                                                                                env->username, 
    1372                                                                                                                                 env->url
     1372                                                                                                                                env->host
    13731373                                                                                                                                separator_path); 
    13741374                 
     
    13871387                                                                                                                                temppath, 
    13881388                                                                                                                                env->username, 
    1389                                                                                                                                 env->url
     1389                                                                                                                                env->host
    13901390                                                                                                                                separator_path); 
    13911391                 
     
    14251425                        scpcommand = g_strdup_printf("ssh -o BatchMode=yes %s@%s \"cd %s && rm -f %s\"", 
    14261426                                                                                                                                        env->username, 
    1427                                                                                                                                         env->url
     1427                                                                                                                                        env->host
    14281428                                                                                                                                        separator_path, 
    14291429                                                                                                                                        deletedfiles->str); 
  • plugins/opie-sync/src/opie_sync.c

    r2472 r2476  
    5454        env->username = g_strdup("root"); 
    5555        env->password = g_strdup("rootme"); 
    56         env->url = g_strdup("192.168.0.202"); 
     56        env->host = g_strdup("192.168.0.202"); 
    5757        env->device_type = OPIE_SYNC_OPIE; 
    5858        env->conn_type = OPIE_CONN_FTP; 
     
    9393                                        g_free(env->password); 
    9494                                        env->password = g_strdup(str); 
     95                                } else if (!xmlStrcmp(cur->name, (const xmlChar *)"hostname")) { 
     96                                        g_free(env->host); 
     97                                        env->host = g_strdup(str); 
    9598                                } else if (!xmlStrcmp(cur->name, (const xmlChar *)"url")) { 
    96                                         g_free(env->url); 
    97                                         env->url = g_strdup(str); 
     99                                        osync_trace(TRACE_INTERNAL, "The 'url' configuration parameter is deprecated - please use 'hostname' instead"); 
     100                                        g_free(env->host); 
     101                                        env->host = g_strdup(str); 
    98102                                } else if (!xmlStrcmp(cur->name, (const xmlChar *)"port")) { 
    99103                                        env->device_port = atoi(str); 
     
    159163                /* Connect to QCopBridgeServer to lock GUI and get root path */ 
    160164                osync_trace(TRACE_INTERNAL, "qcop_connect"); 
    161                 env->qcopconn = qcop_connect(env->url
     165                env->qcopconn = qcop_connect(env->host
    162166                                             env->username, 
    163167                                             env->password); 
     
    257261                char *errmsg; 
    258262                device_disconnect(env->plugin_env, &error); 
    259                 errmsg = g_strdup_printf("Failed to load data from device %s", env->plugin_env->url); 
     263                errmsg = g_strdup_printf("Failed to load data from device %s", env->plugin_env->host); 
    260264                osync_error_set(&error, OSYNC_ERROR_GENERIC, errmsg); 
    261265                g_free(errmsg); 
     
    522526        if ( !opie_put_sink(env) ) { 
    523527                osync_trace( TRACE_INTERNAL, "opie_connect_and_put failed" ); 
    524                 char *errmsg = g_strdup_printf( "Failed to send data to device %s", env->plugin_env->url ); /* FIXME specify which data */ 
     528                char *errmsg = g_strdup_printf( "Failed to send data to device %s", env->plugin_env->host ); /* FIXME specify which data */ 
    525529                osync_error_set(&error, OSYNC_ERROR_GENERIC, errmsg); 
    526530                g_free(errmsg); 
     
    669673        g_free(env->username); 
    670674        g_free(env->password); 
    671         g_free(env->url); 
     675        g_free(env->host); 
    672676        g_free(env->localdir); 
    673677        g_free(env); 
  • plugins/opie-sync/src/opie_sync.h

    r2472 r2476  
    6262        gchar*            username; 
    6363        gchar*            password; 
    64         gchar*            url
     64        gchar*            host
    6565        unsigned int      device_port; 
    6666        OPIE_CONN_TYPE    conn_type;