Changeset 14525
- Timestamp:
- May 9, 2015, 8:37:55 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/conf.c
r14095 r14525 173 173 bool boolVal; 174 174 175 tr_variantDictFindBool (getPrefs (), key, &boolVal); 175 if (!tr_variantDictFindBool (getPrefs (), key, &boolVal)) 176 boolVal = false; 176 177 177 178 return boolVal != 0; -
trunk/gtk/tr-prefs.c
r14241 r14525 971 971 char buf[128]; 972 972 GtkTreeIter iter; 973 struct tm tm; 974 tm.tm_hour = i / 60; 975 tm.tm_min = i % 60; 976 tm.tm_sec = 0; 977 strftime (buf, sizeof (buf), "%H:%M", &tm); 973 g_snprintf (buf, sizeof (buf), "%02d:%02d", i / 60, i % 60); 978 974 gtk_list_store_append (store, &iter); 979 975 gtk_list_store_set (store, &iter, 0, i, 1, buf, -1); -
trunk/gtk/util.c
r14241 r14525 432 432 GtkCellRenderer * r; 433 433 GtkListStore * store; 434 va_list vl;435 434 const char * text; 436 va_start (vl, text_1);437 435 438 436 store = gtk_list_store_new (2, G_TYPE_INT, G_TYPE_STRING); 439 437 440 438 text = text_1; 441 if (text != NULL) do 442 { 443 const int val = va_arg (vl, int); 444 gtk_list_store_insert_with_values (store, NULL, INT_MAX, 0, val, 1, text, -1); 445 text = va_arg (vl, const char *); 446 } 447 while (text != NULL); 439 if (text != NULL) 440 { 441 va_list vl; 442 443 va_start (vl, text_1); 444 do 445 { 446 const int val = va_arg (vl, int); 447 gtk_list_store_insert_with_values (store, NULL, INT_MAX, 0, val, 1, text, -1); 448 text = va_arg (vl, const char *); 449 } 450 while (text != NULL); 451 va_end (vl); 452 } 448 453 449 454 w = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store)); -
trunk/libtransmission/announcer.c
r14521 r14525 1146 1146 /* if the tracker included scrape fields in its announce response, 1147 1147 then a separate scrape isn't needed */ 1148 if ( (scrape_fields >= 3) || (!tracker->scrape && (scrape_fields >= 1)))1148 if (scrape_fields >= 3 || (scrape_fields >= 1 && tracker->scrape != NULL)) 1149 1149 { 1150 1150 tr_logAddTorDbg (tier->tor, "Announce response contained scrape info; " -
trunk/libtransmission/peer-mgr.c
r14483 r14525 878 878 /* we consider ourselves to be in endgame if the number of bytes 879 879 we've got requested is >= the number of bytes left to download */ 880 return ( s->requestCount * s->tor->blockSize)880 return ((uint64_t) s->requestCount * s->tor->blockSize) 881 881 >= tr_torrentGetLeftUntilDone (s->tor); 882 882 } … … 1995 1995 ensureAtomExists (s, addr, port, 0, -1, TR_PEER_FROM_INCOMING); 1996 1996 atom = getExistingAtom (s, addr); 1997 1998 assert (atom != NULL); 1999 1997 2000 atom->time = tr_time (); 1998 2001 atom->piece_data_time = 0; -
trunk/libtransmission/peer-msgs.c
r14473 r14525 1952 1952 1953 1953 data = tr_torrentGetMetadataPiece (msgs->torrent, piece, &dataLen); 1954 if ( (dataLen > 0) && (data != NULL))1954 if (data != NULL) 1955 1955 { 1956 1956 tr_variant tmp; -
trunk/libtransmission/rpc-server.c
r14493 r14525 501 501 webClientDir, 502 502 TR_PATH_DELIMITER_STR, 503 subpath && *subpath? subpath : "index.html");503 *subpath != '\0' ? subpath : "index.html"); 504 504 serve_file (req, server, filename); 505 505 tr_free (filename); … … 614 614 size_t plen; 615 615 char * p = tr_base64_decode_str (auth + 6, &plen); 616 if (p && plen && ((pass = strchr (p, ':'))))616 if (p != NULL) 617 617 { 618 user = p; 619 *pass++ = '\0'; 618 if (plen > 0 && (pass = strchr (p, ':')) != NULL) 619 { 620 user = p; 621 *pass++ = '\0'; 622 } 623 else 624 { 625 tr_free (p); 626 } 620 627 } 621 628 } -
trunk/libtransmission/torrent-magnet.c
r14491 r14525 193 193 } 194 194 195 assert (ret == NULL || *len > 0); 196 195 197 return ret; 196 198 } -
trunk/libtransmission/torrent.c
r14491 r14525 2094 2094 torrentCallScript (const tr_torrent * tor, const char * script) 2095 2095 { 2096 char timeStr[128] ;2096 char timeStr[128], * newlinePos; 2097 2097 const time_t now = tr_time (); 2098 2098 2099 2099 tr_strlcpy (timeStr, ctime (&now), sizeof (timeStr)); 2100 *strchr (timeStr,'\n') = '\0'; 2100 2101 /* ctime () includes '\n', but it's better to be safe */ 2102 newlinePos = strchr (timeStr, '\n'); 2103 if (newlinePos != NULL) 2104 *newlinePos = '\0'; 2101 2105 2102 2106 if (script && *script) -
trunk/libtransmission/trevent.c
r14479 r14525 285 285 assert (tr_isSession (session)); 286 286 287 if (session->events == NULL) 288 return; 289 287 290 session->events->die = true; 288 291 tr_logAddDeep (__FILE__, __LINE__, NULL, "closing trevent pipe"); -
trunk/libtransmission/upnp.c
r14428 r14525 283 283 errno = 0; 284 284 285 if (!handle->urls.controlURL || !handle->data.first.servicetype)285 if (!handle->urls.controlURL) 286 286 handle->isMapped = 0; 287 287 else -
trunk/qt/details.cc
r14509 r14525 113 113 QTreeWidget * tw (treeWidget ()); 114 114 const int column = tw ? tw->sortColumn () : 0; 115 116 assert (i != nullptr); 117 115 118 switch (column) 116 119 { -
trunk/qt/freespace-label.cc
r14497 r14525 90 90 // update the label 91 91 int64_t bytes = -1; 92 tr_variantDictFindInt (arguments, TR_KEY_size_bytes, &bytes); 93 if (bytes >= 0) 92 if (tr_variantDictFindInt (arguments, TR_KEY_size_bytes, &bytes) && bytes >= 0) 94 93 setText (tr("%1 free").arg(Formatter::sizeToString (bytes))); 95 94 else -
trunk/qt/torrent-filter.cc
r14499 r14525 133 133 if (!val) 134 134 val = -compare (a->queuePosition(), b->queuePosition()); 135 // fall through 135 136 136 137 case SortMode::SORT_BY_RATIO:
Note: See TracChangeset
for help on using the changeset viewer.