1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-22 12:34:19 +00:00

- Use int instead of short where possible

This commit is contained in:
Christophe Dumez 2007-08-28 16:55:14 +00:00
parent 6ecb45d661
commit 01df4d3c81
3 changed files with 4 additions and 4 deletions

View File

@ -1135,7 +1135,7 @@ void bittorrent::reloadTorrent(const QTorrentHandle &h) {
// Remove torrent // Remove torrent
s->remove_torrent(h.get_torrent_handle()); s->remove_torrent(h.get_torrent_handle());
// Add torrent again to session // Add torrent again to session
unsigned short timeout = 0; unsigned int timeout = 0;
while(h.is_valid() && timeout < 6) { while(h.is_valid() && timeout < 6) {
SleeperThread::msleep(1000); SleeperThread::msleep(1000);
++timeout; ++timeout;

View File

@ -114,7 +114,7 @@ void DownloadingTorrents::notifyTorrentDoubleClicked(const QModelIndex& index) {
} }
void DownloadingTorrents::addLogPeerBlocked(QString ip) { void DownloadingTorrents::addLogPeerBlocked(QString ip) {
static unsigned short nbLines = 0; static unsigned int nbLines = 0;
++nbLines; ++nbLines;
if(nbLines > 200) { if(nbLines > 200) {
textBlockedUsers->clear(); textBlockedUsers->clear();
@ -184,7 +184,7 @@ void DownloadingTorrents::deleteTorrent(QString hash) {
// Update Info Bar information // Update Info Bar information
void DownloadingTorrents::setInfoBar(QString info, QString color) { void DownloadingTorrents::setInfoBar(QString info, QString color) {
static unsigned short nbLines = 0; static unsigned int nbLines = 0;
++nbLines; ++nbLines;
// Check log size, clear it if too big // Check log size, clear it if too big
if(nbLines > 200) { if(nbLines > 200) {

View File

@ -114,7 +114,7 @@ class misc : public QObject{
return tr("Unknown", "Unknown (size)"); return tr("Unknown", "Unknown (size)");
} }
const QString units[4] = {tr("B", "bytes"), tr("KiB", "kibibytes (1024 bytes)"), tr("MiB", "mebibytes (1024 kibibytes)"), tr("GiB", "gibibytes (1024 mibibytes)")}; const QString units[4] = {tr("B", "bytes"), tr("KiB", "kibibytes (1024 bytes)"), tr("MiB", "mebibytes (1024 kibibytes)"), tr("GiB", "gibibytes (1024 mibibytes)")};
for(unsigned short i=0; i<5; ++i) { for(unsigned int i=0; i<5; ++i) {
if (val < 1024.) { if (val < 1024.) {
snprintf(tmp, MAX_CHAR_TMP, "%.1f", val); snprintf(tmp, MAX_CHAR_TMP, "%.1f", val);
return QString::fromUtf8(tmp) + QString::fromUtf8(" ") + units[i]; return QString::fromUtf8(tmp) + QString::fromUtf8(" ") + units[i];