if (tr_bencDictFindInt (t, "bandwidthPriority", &i))
printf (" Bandwidth Priority: %s\n",
bandwidthPriorityNames[(i + 1) & 3]);
-
+
printf( "\n" );
}
}
fields = tr_bencDictAddList( args, "fields", 0 );
if( tset != 0 ) { addIdArg( tr_bencDictFind( tset, ARGUMENTS ), id ); status |= flush( host, port, &tset ); }
-
+
switch( c )
{
case 'i': tr_bencDictAddInt( top, "tag", TAG_DETAILS );
targs = ensure_tset( &tset );
else
sargs = ensure_sset( &sset );
-
+
switch( c )
{
case 'd': if( targs ) {
args = tr_bencDictFind( tadd, ARGUMENTS );
else
args = ensure_tset( &tset );
-
+
switch( c )
- {
+ {
case 'g': addFiles( args, "files-wanted", optarg );
break;
case 'G': addFiles( args, "files-unwanted", optarg );
if( is_file )
{
struct ActiveData * data = gdata;
-
+
/* active means: if it's selected or any ancestor is selected */
gboolean is_active = gtk_tree_selection_iter_is_selected( data->sel, iter );
builder->fileCount ),
buf, builder->fileCount );
g_string_append( gstr, "; " );
-
+
tr_formatter_mem_B( buf, builder->pieceSize, sizeof( buf ) );
g_string_append_printf( gstr, gtr_ngettext( "%1$'d Piece @ %2$s",
"%1$'d Pieces @ %2$s",
if( x_offset )
*x_offset = cell_area ? cell_area->x : 0;
-
+
if( y_offset )
*y_offset = cell_area ? (int)((cell_area->height - (cell->ypad*2 +h)) / 2.0) : 0;
}
/* Setting the toggle-main-window GtkCheckMenuItem to
make sure its state is correctly set */
action_toggle( "toggle-main-window", TRUE);
-
+
*success = TRUE;
return TRUE;
}
tr_window_set_busy( TrWindow * w, gboolean isBusy )
{
if( w && gtr_widget_get_realized( GTK_WIDGET( w ) ) )
- {
+ {
GdkDisplay * display = gtk_widget_get_display( GTK_WIDGET( w ) );
GdkCursor * cursor = isBusy ? gdk_cursor_new_for_display( display, GDK_WATCH ) : NULL;
gdk_display_flush( display );
if( cursor )
- gdk_cursor_unref( cursor );
+ gdk_cursor_unref( cursor );
}
}
const int64_t ia = (int64_t)(a * pow( 10, decimal_places ) );
const int64_t ib = (int64_t)(b * pow( 10, decimal_places ) );
if( ia < ib ) return -1;
- if( ia > ib ) return 1;
+ if( ia > ib ) return 1;
return 0;
}
/**
* A generic short-term memory object that remembers how many times
* something happened over the last N seconds.
- *
+ *
* For example, it could count how many are bytes transferred
* to estimate the speed over the last N seconds.
*/
const void * b,
TrListCompareFunc compare_func );
-/**
- * @brief Insert in an ordered list
- * @param list pointer to the list
- * @param item the item to be inserted
- * @param compare the comparison function.
- */
+/**
+ * @brief Insert in an ordered list
+ * @param list pointer to the list
+ * @param item the item to be inserted
+ * @param compare the comparison function.
+ */
void tr_list_insert_sorted( tr_list ** list,
void * data,
TrListCompareFunc compare );
most bittorrent clients will reject requests
larger than this size. */
MAX_BLOCK_SIZE = ( 1024 * 16 )
-
};
typedef enum
struct tr_bandwidth * bandwidth;
double desiredRatio;
-
+
uint16_t idleLimitMinutes;
struct tr_bindinfo * public_ipv4;
struct tr_bindsockets * tr_sessionGetBindSockets( tr_session * );
-int tr_sessionCountTorrents( const tr_session * session );
+int tr_sessionCountTorrents( const tr_session * session );
enum
{
uint64_t unused;
tr_file_index_t f;
const tr_info * inf = tr_torrentInfo( tor );
-
- /* if we've never checked this piece, then it needs to be checked */
+
+ /* if we've never checked this piece, then it needs to be checked */
if( !inf->pieces[p].timeChecked ) {
tr_tordbg( tor, "[LAZY] piece %zu needs to be tested because it's never been tested", (size_t)p );
return TRUE;
time_t dhtAnnounce6At;
tr_bool dhtAnnounceInProgress;
tr_bool dhtAnnounce6InProgress;
-
+
time_t lpdAnnounceAt;
uint64_t downloadedCur;
/**
* @brief Test a piece against its info dict checksum
* @return true if the piece's passes the checksum test
- */
+ */
tr_bool tr_torrentCheckPiece( tr_torrent * tor, tr_piece_index_t pieceIndex );
uint64_t tr_torrentGetCurrentSizeOnDisk( const tr_torrent * tor );
int shortWidth,
int argWidth )
{
- int len;
+ int len;
const char * longName = opt->longName ? opt->longName : "";
const char * shortName = opt->shortName ? opt->shortName : "";
const char * arg = getArgName( opt );
/** The last time we uploaded or downloaded piece data on this torrent. */
time_t activityDate;
-
+
/** Number of seconds since the last activity (or since started).
-1 if activity is not seeding or downloading. */
int idleSecs;
if( !hasBeenScanned )
{
hasBeenScanned = true;
-
+
QDir cacheDir( getCacheDir( ) );
cacheDir.mkpath( cacheDir.absolutePath( ) );
}
// handle using the keyboard to toggle the
- // wanted/unwanted state or the file priority
+ // wanted/unwanted state or the file priority
else if( event->type() == QEvent::KeyPress )
{
switch( dynamic_cast<QKeyEvent*>(event)->key() )
/****
*****
-*****
+*****
*****
****/
/****
*****
-*****
+*****
*****
****/
myTrackerCombo = createTrackerCombo( myTrackerModel );
h->addWidget( myTrackerCombo, 1 );
h->addSpacing( hmargin*2 );
-
+
myLineEdit = new QLineEdit( this );
h->addWidget( myLineEdit );
connect( myLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onTextChanged(QString)));
beginRemoveRows( QModelIndex(), row, row );
// make the myIdToRow map consistent with list view/model
- for( QMap<int,int>::iterator i = myIdToRow.begin(); i != myIdToRow.end(); ++i )
+ for( QMap<int,int>::iterator i = myIdToRow.begin(); i != myIdToRow.end(); ++i )
if( i.value() > row )
--i.value();
myIdToRow.remove( id );
Q_UNUSED( option );
QPixmap favicon = info.st.getFavicon( );
-
+
const QString text = TrackerDelegate :: getText( info );
QTextDocument textDoc;
textDoc.setHtml( text );
void setShowMore( bool b );
protected:
- QString getText( const TrackerInfo& ) const;
+ QString getText( const TrackerInfo& ) const;
QSize margin( const QStyle& style ) const;
virtual QSize sizeHint( const QStyleOptionViewItem&, const TrackerInfo& ) const;
void drawTracker( QPainter*, const QStyleOptionViewItem&, const TrackerInfo& ) const;
// meh
static void toStderr( const QString& qstr );
- ///
+ ///
/// URLs
///
}
}
}
-
return changed;
}
#include <time.h>
#define CURL_DISABLE_TYPECHECK /* otherwise -Wunreachable-code goes insane */
-#include <curl/curl.h>
+#include <curl/curl.h>
#include <event.h> /* struct evbuffer */
**/
printf( "\nTRACKERS\n" );
- for( i=0; i<(int)inf->trackerCount; ++i )
+ for( i=0; i<(int)inf->trackerCount; ++i )
{
if( prevTier != inf->trackers[i].tier )
{