Browse Source

- Use int instead of short where possible

adaptive-webui-19844
Christophe Dumez 17 years ago
parent
commit
01df4d3c81
  1. 2
      src/bittorrent.cpp
  2. 4
      src/downloadingTorrents.cpp
  3. 2
      src/misc.h

2
src/bittorrent.cpp

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

4
src/downloadingTorrents.cpp

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

2
src/misc.h

@ -114,7 +114,7 @@ class misc : public QObject{ @@ -114,7 +114,7 @@ class misc : public QObject{
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)")};
for(unsigned short i=0; i<5; ++i) {
for(unsigned int i=0; i<5; ++i) {
if (val < 1024.) {
snprintf(tmp, MAX_CHAR_TMP, "%.1f", val);
return QString::fromUtf8(tmp) + QString::fromUtf8(" ") + units[i];

Loading…
Cancel
Save