Changeset 6319
- Timestamp:
- Jul 11, 2008, 4:07:14 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.am
r6286 r6319 32 32 33 33 EXTRA_DIST = \ 34 web \ 34 35 NEWS \ 35 36 AUTHORS \ … … 39 40 intltool-extract.in \ 40 41 intltool-merge.in \ 41 intltool-update.in 42 intltool-update.in 43 44 clutchdir = $(datadir)/transmission/web 45 clutch_DATA = \ 46 web/index.html \ 47 web/LICENSE 48 49 clutch_cssdir = $(clutchdir)/stylesheets 50 clutch_css_DATA = \ 51 web/stylesheets/iphone.css \ 52 web/stylesheets/common.css 53 54 clutch_jsdir = $(clutchdir)/javascript 55 clutch_js_DATA = \ 56 web/javascript/menu.js \ 57 web/javascript/dialog.js \ 58 web/javascript/transmission.js \ 59 web/javascript/transmission.remote.js \ 60 web/javascript/common.js \ 61 web/javascript/torrent.js 62 63 clutch_jquerydir = $(clutch_jsdir)/jquery 64 clutch_jquery_DATA = \ 65 web/javascript/jquery \ 66 web/javascript/jquery/json.min.js \ 67 web/javascript/jquery/jquery.contextmenu.min.js \ 68 web/javascript/jquery/jquery.min.js \ 69 web/javascript/jquery/jquery.form.min.js \ 70 web/javascript/jquery/jquery.transmenu.min.js \ 71 web/javascript/jquery/jquery-dimensions.min.js 72 73 clutch_imagesdir = $(clutchdir)/images 74 clutch_images_DATA = \ 75 web/images/favicon.ico \ 76 web/images/webclip-icon.png 77 78 clutch_graphicsdir = $(clutch_imagesdir)/graphics 79 clutch_graphics_DATA = \ 80 web/images/graphics/browser_firefox.gif \ 81 web/images/graphics/logo.png \ 82 web/images/graphics/chrome.png \ 83 web/images/graphics/iphone_chrome.png \ 84 web/images/graphics/browser_opera.gif \ 85 web/images/graphics/filter_bar.png \ 86 web/images/graphics/transfer_arrows.png \ 87 web/images/graphics/browser_safari.gif 88 89 clutch_progressdir = $(clutch_imagesdir)/progress 90 clutch_progress_DATA = \ 91 web/images/progress/progress.png 92 93 clutch_buttonsdir = $(clutch_imagesdir)/buttons 94 clutch_buttons_DATA = \ 95 web/images/buttons/tab_backgrounds.png \ 96 web/images/buttons/toolbar_buttons.png \ 97 web/images/buttons/info_general.png \ 98 web/images/buttons/torrent_buttons.png \ 99 web/images/buttons/info_activity.png 42 100 43 101 DISTCLEANFILES = \ … … 45 103 intltool-merge \ 46 104 intltool-update 47 -
trunk/libtransmission/platform.c
r5843 r6319 51 51 52 52 #include "transmission.h" 53 #include "list.h" 53 54 #include "platform.h" 54 55 #include "utils.h" … … 509 510 ***/ 510 511 512 static int 513 isClutchDir( const char * path ) 514 { 515 struct stat sb; 516 char tmp[MAX_PATH_LENGTH]; 517 tr_buildPath( tmp, sizeof( tmp ), path, "javascript", "transmission.js", NULL ); 518 fprintf( stderr, "path is [%s]; testing [%s] for clutch\n", path, tmp ); 519 return !stat( tmp, &sb ); 520 } 521 522 const char * 523 tr_getClutchDir( const tr_session * session UNUSED ) 524 { 525 static char * s = NULL; 526 527 if( !s ) 528 { 529 char path[MAX_PATH_LENGTH]; 530 531 if(( s = getenv( "CLUTCH_HOME" ))) 532 { 533 snprintf( path, sizeof( path ), s ); 534 } 535 else 536 { 537 #ifdef SYS_DARWIN 538 #error not implemented 539 #elif defined(WIN32) 540 #warning hey win32 people is this good or is there a better implementation of the next four lines 541 char appdata[MAX_PATH_LENGTH]; 542 SHGetFolderPath( NULL, CSIDL_APPDATA, NULL, 0, appdata ); 543 tr_buildPath( path, sizeof( path ), 544 appdata, "Transmission", NULL ); 545 #else 546 tr_list *candidates=NULL, *l; 547 548 /* XDG_DATA_HOME should be the first in the list of candidates */ 549 s = getenv( "XDG_DATA_HOME" ); 550 if( s && *s ) 551 tr_list_append( &candidates, tr_strdup( s ) ); 552 else { 553 char tmp[MAX_PATH_LENGTH]; 554 tr_buildPath( tmp, sizeof( tmp ), getHomeDir(), ".local", "share", NULL ); 555 tr_list_append( &candidates, tr_strdup( tmp ) ); 556 } 557 558 /* XDG_DATA_DIRS are the backup directories */ 559 s = getenv( "XDG_DATA_DIRS" ); 560 if( !s || !*s ) 561 s = "/usr/local/share/:/usr/share/"; 562 while( s && *s ) { 563 char * end = strchr( s, ':' ); 564 if( end ) { 565 tr_list_append( &candidates, tr_strndup( s, end-s ) ); 566 s = end + 1; 567 } else { 568 tr_list_append( &candidates, tr_strdup( s ) ); 569 break; 570 } 571 } 572 573 for( l=candidates; l; l=l->next ) { 574 tr_buildPath( path, sizeof( path ), l->data, "transmission", "clutch", NULL ); 575 if( isClutchDir( path ) ) 576 break; 577 *path = '\0'; 578 } 579 580 tr_list_free( &candidates, tr_free ); 581 #endif 582 } 583 584 if( !*path ) 585 { 586 tr_err( _( "Unable to find web interface files" ) ); 587 tr_strlcpy( path, "/dev/null", sizeof( path ) ); 588 } 589 590 s = tr_strdup( path ); 591 } 592 593 return s; 594 } 595 596 597 /*** 598 **** 599 ***/ 600 511 601 int 512 602 tr_lockfile( const char * filename ) -
trunk/libtransmission/platform.h
r5645 r6319 45 45 const char * tr_getTorrentDir ( const struct tr_handle * ); 46 46 47 const char * tr_getClutchDir ( const struct tr_handle * ); 48 49 47 50 tr_thread* tr_threadNew ( void (*func)(void *), void * arg, const char * name ); 48 51 int tr_amInThread ( const tr_thread * ); -
trunk/libtransmission/rpc-server.c
r6275 r6319 25 25 #include "transmission.h" 26 26 #include "bencode.h" 27 #include "platform.h" 27 28 #include "rpc.h" 28 29 #include "rpc-server.h" … … 252 253 char ports[128]; 253 254 char passwd[MAX_PATH_LENGTH]; 254 c har clutchDir[MAX_PATH_LENGTH];255 char * clutchAlias ;255 const char * clutchDir = tr_getClutchDir( server->session ); 256 char * clutchAlias = tr_strdup_printf( "%s=%s", "/transmission/clutch", clutchDir ); 256 257 struct timeval tv = tr_timevalMsec( UNUSED_INTERVAL_MSEC ); 257 258 258 tr_buildPath( clutchDir, sizeof( clutchDir ), tr_sessionGetConfigDir( server->session ), "clutch", NULL ); 259 clutchAlias = tr_strdup_printf( "%s=%s", "/transmission/clutch", clutchDir ); 260 259 fprintf( stderr, "clutchAlias is [%s]\n", clutchAlias ); 261 260 getPasswordFile( server, passwd, sizeof( passwd ) ); 262 261 if( !server->isPasswordEnabled )
Note: See TracChangeset
for help on using the changeset viewer.