mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
Seed rand only at one place.
This commit is contained in:
parent
9913484f68
commit
be5a1ae272
@ -225,6 +225,7 @@ int main(int argc, char *argv[]) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
srand(time(0));
|
||||||
Preferences pref;
|
Preferences pref;
|
||||||
#ifndef DISABLE_GUI
|
#ifndef DISABLE_GUI
|
||||||
bool no_splash = false;
|
bool no_splash = false;
|
||||||
|
@ -40,8 +40,6 @@
|
|||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
|
|
||||||
#include <libtorrent/version.hpp>
|
#include <libtorrent/version.hpp>
|
||||||
#include <time.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "options_imp.h"
|
#include "options_imp.h"
|
||||||
#include "preferences.h"
|
#include "preferences.h"
|
||||||
@ -780,9 +778,7 @@ void options_imp::loadOptions() {
|
|||||||
domainNameTxt->setText(pref.getDynDomainName());
|
domainNameTxt->setText(pref.getDynDomainName());
|
||||||
DNSUsernameTxt->setText(pref.getDynDNSUsername());
|
DNSUsernameTxt->setText(pref.getDynDNSUsername());
|
||||||
DNSPasswordTxt->setText(pref.getDynDNSPassword());
|
DNSPasswordTxt->setText(pref.getDynDNSPassword());
|
||||||
// End Web UI
|
// End Web UI
|
||||||
// Random stuff
|
|
||||||
srand(time(0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// return min & max ports
|
// return min & max ports
|
||||||
|
@ -35,7 +35,6 @@
|
|||||||
#include <QHostAddress>
|
#include <QHostAddress>
|
||||||
#include <QNetworkAddressEntry>
|
#include <QNetworkAddressEntry>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "smtp.h"
|
#include "smtp.h"
|
||||||
#include "filesystemwatcher.h"
|
#include "filesystemwatcher.h"
|
||||||
@ -290,8 +289,7 @@ void QBtSession::configureSession() {
|
|||||||
const unsigned short new_listenPort = pref.getSessionPort();
|
const unsigned short new_listenPort = pref.getSessionPort();
|
||||||
if (pref.useRandomPort()) { // to check if the randomPort checkbox is selected
|
if (pref.useRandomPort()) { // to check if the randomPort checkbox is selected
|
||||||
if (!m_randomPortEnabled) {
|
if (!m_randomPortEnabled) {
|
||||||
m_randomPortEnabled = true;
|
m_randomPortEnabled = true;
|
||||||
srand(time(0));
|
|
||||||
const unsigned short randomPort = rand() % USHRT_MAX + 1025;
|
const unsigned short randomPort = rand() % USHRT_MAX + 1025;
|
||||||
setListeningPort(randomPort);
|
setListeningPort(randomPort);
|
||||||
addConsoleMessage(tr("qBittorrent is bound to port: TCP/%1", "e.g: qBittorrent is bound to port: 6881").arg(QString::number(getListenPort())));
|
addConsoleMessage(tr("qBittorrent is bound to port: TCP/%1", "e.g: qBittorrent is bound to port: 6881").arg(QString::number(getListenPort())));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user