You've already forked qBittorrent
mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-10-19 05:12:18 +02:00
Compare commits
1 Commits
release-2.
...
release-2.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e9da810eae |
@@ -1,10 +1,3 @@
|
||||
* Wed Jul 21 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.11
|
||||
- BUGFIX: Fix parsing of program arguments with spaces
|
||||
- BUGFIX: Fix possible crash when using alternative speed limits (#598272)
|
||||
- BUGFIX: Fix possible crash on exit when using
|
||||
- BUGFIX: Require GTK+ headers on compilation when libnotify is used
|
||||
- BUGFIX: Added configure flag to avoid using the shipped qtsingleapplication
|
||||
|
||||
* Wed Jun 23 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.10
|
||||
- BUGFIX: Fix Web UI in qBittorrent nox version
|
||||
- BUGFIX: Improved ETA display (more user friendly)
|
||||
|
84
configure
vendored
84
configure
vendored
@@ -18,24 +18,15 @@ Main options:
|
||||
--help This help text.
|
||||
|
||||
Dependency options:
|
||||
--disable-gui Disable qBittorrent
|
||||
Graphical user interface for
|
||||
headless running
|
||||
--with-libboost-inc=[path] Path to libboost include
|
||||
files
|
||||
--with-libboost-lib=[path] Path to libboost library
|
||||
files
|
||||
--disable-libnotify Disable use of libnotify
|
||||
--disable-geoip-database Disable use of geoip-database
|
||||
--with-geoip-database-embedded Geoip Database will be
|
||||
embedded in qBittorrent
|
||||
executable (please follow
|
||||
instructions in
|
||||
src/geoip/README)
|
||||
--disable-qtsingleapplication Disable use of libboost
|
||||
--with-qtsingleapplication=[system|shipped] Use the shipped
|
||||
qtsingleapplication library
|
||||
or the system one
|
||||
--disable-gui Disable qBittorrent Graphical user
|
||||
interface for headless running
|
||||
--with-libboost-inc=[path] Path to libboost include files
|
||||
--with-libboost-lib=[path] Path to libboost library files
|
||||
--disable-libnotify Disable use of libnotify
|
||||
--disable-geoip-database Disable use of geoip-database
|
||||
--with-geoip-database-embedded Geoip Database will be embedded in
|
||||
qBittorrent executable (please follow
|
||||
instructions in src/geoip/README)
|
||||
|
||||
EOT
|
||||
}
|
||||
@@ -182,16 +173,6 @@ while [ $# -gt 0 ]; do
|
||||
shift
|
||||
;;
|
||||
|
||||
--disable-qtsingleapplication)
|
||||
QC_DISABLE_qtsingleapplication="Y"
|
||||
shift
|
||||
;;
|
||||
|
||||
--with-qtsingleapplication=*)
|
||||
QC_WITH_QTSINGLEAPPLICATION=$optarg
|
||||
shift
|
||||
;;
|
||||
|
||||
--verbose)
|
||||
QC_VERBOSE="Y"
|
||||
shift
|
||||
@@ -219,8 +200,6 @@ echo QC_WITH_LIBBOOST_LIB=$QC_WITH_LIBBOOST_LIB
|
||||
echo QC_DISABLE_libnotify=$QC_DISABLE_libnotify
|
||||
echo QC_DISABLE_geoip_database=$QC_DISABLE_geoip_database
|
||||
echo QC_WITH_GEOIP_DATABASE_EMBEDDED=$QC_WITH_GEOIP_DATABASE_EMBEDDED
|
||||
echo QC_DISABLE_qtsingleapplication=$QC_DISABLE_qtsingleapplication
|
||||
echo QC_WITH_QTSINGLEAPPLICATION=$QC_WITH_QTSINGLEAPPLICATION
|
||||
echo
|
||||
fi
|
||||
|
||||
@@ -550,21 +529,10 @@ public:
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
QStringList incs3;
|
||||
QString req_ver3 = "2.0";
|
||||
QString version3, libs3, other3;
|
||||
if(conf->findPkgConfig("gtk+-2.0", mode, req_ver3, &version3, &incs3, &libs3, &other3)) {
|
||||
for(int n = 0; n < incs3.count(); ++n)
|
||||
conf->addIncludePath(incs3[n]);
|
||||
if(!libs3.isEmpty())
|
||||
conf->addLib(libs3);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -606,33 +574,6 @@ public:
|
||||
#endif
|
||||
}
|
||||
};
|
||||
#line 1 "qtsingleapplication.qcm"
|
||||
/*
|
||||
-----BEGIN QCMOD-----
|
||||
name: libboost
|
||||
arg: with-qtsingleapplication=[system|shipped], Use the shipped qtsingleapplication library or the system one
|
||||
-----END QCMOD-----
|
||||
*/
|
||||
class qc_qtsingleapplication : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_qtsingleapplication(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "qtsingleapplication library"; }
|
||||
QString shortname() const { return "qtsingleapplication"; }
|
||||
|
||||
bool exec(){
|
||||
QString s;
|
||||
s = conf->getenv("QC_WITH_QTSINGLEAPPLICATION");
|
||||
if(s.compare("system", Qt::CaseInsensitive) == 0) {
|
||||
// System
|
||||
conf->addDefine("USE_SYSTEM_QTSINGLEAPPLICATION");
|
||||
printf(" [system] ");
|
||||
} else {
|
||||
printf(" [shipped] ");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
EOT
|
||||
cat >$1/modules_new.cpp <<EOT
|
||||
@@ -654,9 +595,6 @@ cat >$1/modules_new.cpp <<EOT
|
||||
o = new qc_geoip_database(conf);
|
||||
o->required = false;
|
||||
o->disabled = false;
|
||||
o = new qc_qtsingleapplication(conf);
|
||||
o->required = false;
|
||||
o->disabled = false;
|
||||
|
||||
EOT
|
||||
cat >$1/conf4.h <<EOT
|
||||
@@ -1608,8 +1546,6 @@ export QC_WITH_LIBBOOST_LIB
|
||||
export QC_DISABLE_libnotify
|
||||
export QC_DISABLE_geoip_database
|
||||
export QC_WITH_GEOIP_DATABASE_EMBEDDED
|
||||
export QC_DISABLE_qtsingleapplication
|
||||
export QC_WITH_QTSINGLEAPPLICATION
|
||||
export QC_VERBOSE
|
||||
rm -rf .qconftemp
|
||||
(
|
||||
|
@@ -19,6 +19,4 @@
|
||||
</dep>
|
||||
<dep type='geoip-database'>
|
||||
</dep>
|
||||
<dep type='qtsingleapplication'>
|
||||
</dep>
|
||||
</qconf>
|
||||
|
@@ -40,21 +40,10 @@ public:
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
QStringList incs3;
|
||||
QString req_ver3 = "2.0";
|
||||
QString version3, libs3, other3;
|
||||
if(conf->findPkgConfig("gtk+-2.0", mode, req_ver3, &version3, &incs3, &libs3, &other3)) {
|
||||
for(int n = 0; n < incs3.count(); ++n)
|
||||
conf->addIncludePath(incs3[n]);
|
||||
if(!libs3.isEmpty())
|
||||
conf->addLib(libs3);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
@@ -270,7 +270,10 @@ GUI::~GUI() {
|
||||
delete BTSession;
|
||||
// Deleting remaining top level widgets
|
||||
qDebug("Deleting remaining top level widgets");
|
||||
|
||||
foreach (QWidget *win, QApplication::topLevelWidgets()) {
|
||||
if(win && win != this)
|
||||
delete win;
|
||||
}
|
||||
// May freeze for a few seconds after the next line
|
||||
// because the Bittorrent session proxy will
|
||||
// actually be deleted now and destruction
|
||||
@@ -668,7 +671,7 @@ void GUI::on_actionOpen_triggered() {
|
||||
// the right addTorrent function, considering
|
||||
// the parameter type.
|
||||
void GUI::processParams(const QString& params_str) {
|
||||
processParams(params_str.split("|", QString::SkipEmptyParts));
|
||||
processParams(params_str.split(" ", QString::SkipEmptyParts));
|
||||
}
|
||||
|
||||
void GUI::processParams(const QStringList& params) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[Desktop Entry]
|
||||
Categories=Qt;Network;P2P;
|
||||
Comment=V2.2.11
|
||||
Comment=V2.2.10
|
||||
Exec=qbittorrent %f
|
||||
GenericName=Bittorrent client
|
||||
GenericName[ar]=العميل Bittorrent
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 80 KiB |
@@ -47,7 +47,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>2.2.11</string>
|
||||
<string>2.2.10</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
|
@@ -637,20 +637,8 @@ void Bittorrent::useAlternativeSpeedsLimit(bool alternative) {
|
||||
s->set_download_rate_limit(Preferences::getAltGlobalDownloadLimit()*1024);
|
||||
s->set_upload_rate_limit(Preferences::getAltGlobalUploadLimit()*1024);
|
||||
} else {
|
||||
int down_limit = Preferences::getGlobalDownloadLimit();
|
||||
if(down_limit <= 0) {
|
||||
down_limit = -1;
|
||||
} else {
|
||||
down_limit *= 1024;
|
||||
}
|
||||
s->set_download_rate_limit(down_limit);
|
||||
int up_limit = Preferences::getGlobalUploadLimit();
|
||||
if(up_limit <= 0) {
|
||||
up_limit = -1;
|
||||
} else {
|
||||
up_limit *= 1024;
|
||||
}
|
||||
s->set_upload_rate_limit(up_limit);
|
||||
s->set_download_rate_limit(Preferences::getGlobalDownloadLimit()*1024);
|
||||
s->set_upload_rate_limit(Preferences::getGlobalUploadLimit()*1024);
|
||||
}
|
||||
emit alternativeSpeedsModeChanged(alternative);
|
||||
}
|
||||
@@ -1064,7 +1052,7 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
|
||||
//Getting fast resume data if existing
|
||||
std::vector<char> buf;
|
||||
if(resumed) {
|
||||
const QString fastresume_path = torrentBackup.absoluteFilePath(hash+QString(".fastresume"));
|
||||
const QString fastresume_path = torrentBackup.path()+QDir::separator()+hash+QString(".fastresume");
|
||||
qDebug("Trying to load fastresume data: %s", qPrintable(fastresume_path));
|
||||
if (load_file(fastresume_path.toLocal8Bit().constData(), buf) == 0) {
|
||||
fastResume = true;
|
||||
@@ -1878,8 +1866,13 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
||||
default:
|
||||
qDebug("Disabling HTTP communications proxy");
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef MINGW
|
||||
putenv("http_proxy=");
|
||||
putenv("sock_proxy=");
|
||||
#else
|
||||
SetEnvironmentVariableA("http_proxy", "");
|
||||
SetEnvironmentVariableA("sock_proxy", "");
|
||||
#endif
|
||||
#else
|
||||
unsetenv("http_proxy");
|
||||
unsetenv("sock_proxy");
|
||||
@@ -1893,8 +1886,12 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
||||
type_str = "sock_proxy";
|
||||
else
|
||||
type_str = "http_proxy";
|
||||
#ifdef MINGW
|
||||
QString tmp = type_str+"="+proxy_str;
|
||||
putenv(tmp.toLocal8Bit().constData());
|
||||
#else
|
||||
SetEnvironmentVariableA(type_str.toLocal8Bit().constData(), proxy_str.toLocal8Bit().constData());
|
||||
#endif
|
||||
#else
|
||||
qDebug("HTTP communications proxy string: %s", qPrintable(proxy_str));
|
||||
if(proxySettings.type == proxy_settings::socks5 || proxySettings.type == proxy_settings::socks5_pw)
|
||||
|
154
src/main.cpp
154
src/main.cpp
@@ -64,6 +64,16 @@
|
||||
#include "misc.h"
|
||||
#include "preferences.h"
|
||||
|
||||
#ifdef DISABLE_GUI
|
||||
QtSingleCoreApplication *app;
|
||||
#else
|
||||
#ifndef Q_WS_MAC
|
||||
QtSingleApplication *app;
|
||||
#else
|
||||
QMacApplication *app;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
class UsageDisplay: public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
@@ -122,13 +132,13 @@ public:
|
||||
void sigintHandler(int) {
|
||||
signal(SIGINT, 0);
|
||||
qDebug("Catching SIGINT, exiting cleanly");
|
||||
qApp->exit();
|
||||
app->exit();
|
||||
}
|
||||
|
||||
void sigtermHandler(int) {
|
||||
signal(SIGTERM, 0);
|
||||
qDebug("Catching SIGTERM, exiting cleanly");
|
||||
qApp->exit();
|
||||
app->exit();
|
||||
}
|
||||
void sigsegvHandler(int) {
|
||||
signal(SIGABRT, 0);
|
||||
@@ -149,11 +159,12 @@ void sigabrtHandler(int) {
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
void useStyle(QString style){
|
||||
void useStyle(QApplication *app, QString style){
|
||||
Q_UNUSED(app);
|
||||
if(!style.isEmpty()) {
|
||||
QApplication::setStyle(QStyleFactory::create(style));
|
||||
}
|
||||
Preferences::setStyle(QApplication::style()->objectName());
|
||||
Preferences::setStyle(app->style()->objectName());
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -161,18 +172,18 @@ void useStyle(QString style){
|
||||
int main(int argc, char *argv[]){
|
||||
// Create Application
|
||||
QString uid = misc::getUserIDString();
|
||||
#ifdef DISABLE_GUI
|
||||
QtSingleCoreApplication app("qBittorrent-"+uid, argc, argv);
|
||||
#else
|
||||
#ifndef Q_WS_MAC
|
||||
QtSingleApplication app("qBittorrent-"+uid, argc, argv);
|
||||
#else
|
||||
QMacApplication app("qBittorrent-"+uid, argc, argv);
|
||||
#endif
|
||||
#endif
|
||||
#ifdef DISABLE_GUI
|
||||
app = new QtSingleCoreApplication("qBittorrent-"+uid, argc, argv);
|
||||
#else
|
||||
#ifndef Q_WS_MAC
|
||||
app = new QtSingleApplication("qBittorrent-"+uid, argc, argv);
|
||||
#else
|
||||
app = new QMacApplication("qBittorrent-"+uid, argc, argv);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Check if qBittorrent is already running for this user
|
||||
if(app.isRunning()) {
|
||||
if(app->isRunning()) {
|
||||
qDebug("qBittorrent is already running for this user.");
|
||||
//Pass program parameters if any
|
||||
QString message;
|
||||
@@ -181,12 +192,11 @@ int main(int argc, char *argv[]){
|
||||
if(p.startsWith("--")) continue;
|
||||
message += argv[a];
|
||||
if (a < argc-1)
|
||||
message += "|";
|
||||
message += " ";
|
||||
}
|
||||
if(!message.isEmpty()) {
|
||||
qDebug("Passing program parameters to running instance...");
|
||||
qDebug("Message: %s", qPrintable(message));
|
||||
app.sendMessage(message);
|
||||
app->sendMessage(message);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -209,25 +219,27 @@ int main(int argc, char *argv[]){
|
||||
}else{
|
||||
qDebug("%s locale unrecognized, using default (en_GB).", qPrintable(locale));
|
||||
}
|
||||
app.installTranslator(&translator);
|
||||
app->installTranslator(&translator);
|
||||
#ifndef DISABLE_GUI
|
||||
if(locale.startsWith("ar")) {
|
||||
qDebug("Right to Left mode");
|
||||
app.setLayoutDirection(Qt::RightToLeft);
|
||||
app->setLayoutDirection(Qt::RightToLeft);
|
||||
} else {
|
||||
app.setLayoutDirection(Qt::LeftToRight);
|
||||
app->setLayoutDirection(Qt::LeftToRight);
|
||||
}
|
||||
#endif
|
||||
app.setApplicationName(QString::fromUtf8("qBittorrent"));
|
||||
app->setApplicationName(QString::fromUtf8("qBittorrent"));
|
||||
|
||||
// Check for executable parameters
|
||||
if(argc > 1){
|
||||
if(QString::fromLocal8Bit(argv[1]) == QString::fromUtf8("--version")){
|
||||
std::cout << "qBittorrent " << VERSION << '\n';
|
||||
delete app;
|
||||
return 0;
|
||||
}
|
||||
if(QString::fromLocal8Bit(argv[1]) == QString::fromUtf8("--help")){
|
||||
UsageDisplay::displayUsage(argv[0]);
|
||||
delete app;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -259,58 +271,80 @@ int main(int argc, char *argv[]){
|
||||
}
|
||||
#endif
|
||||
// Set environment variable
|
||||
if(putenv((char*)"QBITTORRENT="VERSION)) {
|
||||
std::cerr << "Couldn't set environment variable...\n";
|
||||
}
|
||||
#if defined(Q_WS_WIN) && !defined(MINGW)
|
||||
if(SetEnvironmentVariableA("QBITTORRENT", VERSION)) {
|
||||
#else
|
||||
if(putenv((char*)"QBITTORRENT="VERSION)) {
|
||||
#endif
|
||||
std::cerr << "Couldn't set environment variable...\n";
|
||||
}
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
useStyle(settings.value("Preferences/General/Style", "").toString());
|
||||
app.setStyleSheet("QStatusBar::item { border-width: 0; }");
|
||||
QSplashScreen *splash = 0;
|
||||
if(!no_splash) {
|
||||
splash = new QSplashScreen(QPixmap(QString::fromUtf8(":/Icons/skin/splash.png")));
|
||||
splash->show();
|
||||
}
|
||||
useStyle(app, settings.value("Preferences/General/Style", "").toString());
|
||||
app->setStyleSheet("QStatusBar::item { border-width: 0; }");
|
||||
QSplashScreen *splash = 0;
|
||||
if(!no_splash) {
|
||||
splash = new QSplashScreen(QPixmap(QString::fromUtf8(":/Icons/skin/splash.png")));
|
||||
splash->show();
|
||||
}
|
||||
#endif
|
||||
|
||||
if(!LegalNotice::userAgreesWithNotice()) {
|
||||
if(!LegalNotice::userAgreesWithNotice()) {
|
||||
#ifndef DISABLE_GUI
|
||||
delete splash;
|
||||
delete splash;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
delete app;
|
||||
return 0;
|
||||
}
|
||||
#ifndef DISABLE_GUI
|
||||
app.setQuitOnLastWindowClosed(false);
|
||||
app->setQuitOnLastWindowClosed(false);
|
||||
#endif
|
||||
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
|
||||
signal(SIGABRT, sigabrtHandler);
|
||||
signal(SIGTERM, sigtermHandler);
|
||||
signal(SIGINT, sigintHandler);
|
||||
signal(SIGSEGV, sigsegvHandler);
|
||||
signal(SIGABRT, sigabrtHandler);
|
||||
signal(SIGTERM, sigtermHandler);
|
||||
signal(SIGINT, sigintHandler);
|
||||
signal(SIGSEGV, sigsegvHandler);
|
||||
#endif
|
||||
// Read torrents given on command line
|
||||
QStringList torrentCmdLine = app.arguments();
|
||||
// Remove first argument (program name)
|
||||
torrentCmdLine.removeFirst();
|
||||
// Read torrents given on command line
|
||||
QStringList torrentCmdLine = app->arguments();
|
||||
// Remove first argument (program name)
|
||||
torrentCmdLine.removeFirst();
|
||||
#ifndef DISABLE_GUI
|
||||
GUI window(0, torrentCmdLine);
|
||||
if(!no_splash) {
|
||||
splash->finish(&window);
|
||||
delete splash;
|
||||
}
|
||||
QObject::connect(&app, SIGNAL(messageReceived(const QString&)),
|
||||
&window, SLOT(processParams(const QString&)));
|
||||
app.setActivationWindow(&window);
|
||||
GUI *window = new GUI(0, torrentCmdLine);
|
||||
if(!no_splash) {
|
||||
splash->finish(window);
|
||||
delete splash;
|
||||
}
|
||||
QObject::connect(app, SIGNAL(messageReceived(const QString&)),
|
||||
window, SLOT(processParams(const QString&)));
|
||||
app->setActivationWindow(window);
|
||||
#else
|
||||
// Load Headless class
|
||||
HeadlessLoader loader(torrentCmdLine);
|
||||
QObject::connect(&app, SIGNAL(messageReceived(const QString&)),
|
||||
&loader, SLOT(processParams(const QString&)));
|
||||
// Load Headless class
|
||||
HeadlessLoader *loader = new HeadlessLoader(torrentCmdLine);
|
||||
QObject::connect(app, SIGNAL(messageReceived(const QString&)),
|
||||
loader, SLOT(processParams(const QString&)));
|
||||
#endif
|
||||
int ret = app->exec();
|
||||
|
||||
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
|
||||
// Application has exited, stop catching SIGINT and SIGTERM
|
||||
signal(SIGINT, 0);
|
||||
signal(SIGTERM, 0);
|
||||
#endif
|
||||
|
||||
int ret = app.exec();
|
||||
|
||||
return ret;
|
||||
}
|
||||
#ifndef DISABLE_GUI
|
||||
delete window;
|
||||
qDebug("GUI was deleted!");
|
||||
#else
|
||||
delete loader;
|
||||
#endif
|
||||
qDebug("Deleting app...");
|
||||
#ifndef Q_WS_WIN
|
||||
// XXX: Why does it crash on Windows in QWindowsVistaStyle destructor!?
|
||||
delete app;
|
||||
#endif
|
||||
qDebug("App was deleted! All good.");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -310,10 +310,7 @@ public:
|
||||
|
||||
static int getAltGlobalDownloadLimit() {
|
||||
QSettings settings("qBittorrent", "qBittorrent");
|
||||
int ret = settings.value(QString::fromUtf8("Preferences/Connection/GlobalDLLimitAlt"), 10).toInt();
|
||||
if(ret <= 0)
|
||||
ret = 10;
|
||||
return ret;
|
||||
return settings.value(QString::fromUtf8("Preferences/Connection/GlobalDLLimitAlt"), 10).toInt();
|
||||
}
|
||||
|
||||
static void setAltGlobalDownloadLimit(int limit) {
|
||||
@@ -324,10 +321,7 @@ public:
|
||||
|
||||
static int getAltGlobalUploadLimit() {
|
||||
QSettings settings("qBittorrent", "qBittorrent");
|
||||
int ret = settings.value(QString::fromUtf8("Preferences/Connection/GlobalUPLimitAlt"), 10).toInt();
|
||||
if(ret <= 0)
|
||||
ret = 10;
|
||||
return ret;
|
||||
return settings.value(QString::fromUtf8("Preferences/Connection/GlobalUPLimitAlt"), 10).toInt();
|
||||
}
|
||||
|
||||
static void setAltGlobalUploadLimit(int limit) {
|
||||
@@ -945,30 +939,24 @@ public:
|
||||
static QString getPythonPath() {
|
||||
QSettings reg_python("HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore", QSettings::NativeFormat);
|
||||
QStringList versions = reg_python.childGroups();
|
||||
if(versions.isEmpty()) {
|
||||
reg_python = QSettings("HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore", QSettings::NativeFormat);
|
||||
versions = reg_python.childGroups();
|
||||
}
|
||||
qDebug("Python versions nb: %d", versions.size());
|
||||
versions = versions.filter(QRegExp("2\\..*"));
|
||||
versions.sort();
|
||||
while(!versions.empty()) {
|
||||
const QString version = versions.takeLast();
|
||||
qDebug("Detected possible Python v%s location", qPrintable(version));
|
||||
QString path = reg_python.value(version+"\\InstallPath\\Default", "").toString().replace("/", "\\");
|
||||
if(path.isEmpty())
|
||||
path = reg_python.value(version+"/InstallPath/Default", "").toString().replace("/", "\\");
|
||||
QString path = reg_python.value(version+"/InstallPath/Default", "").toString().replace("/", "\\");
|
||||
if(!path.isEmpty() && QDir(path).exists("python.exe")) {
|
||||
qDebug("Found python.exe at %s", qPrintable(path));
|
||||
return path;
|
||||
}
|
||||
}
|
||||
if(QFile::exists("C:/Python26/python.exe")) {
|
||||
reg_python.setValue("2.6\\InstallPath\\Default", "C:\\Python26");
|
||||
reg_python.setValue("2.6/InstallPath/Default", "C:\\Python26");
|
||||
return "C:\\Python26";
|
||||
}
|
||||
if(QFile::exists("C:/Python25/python.exe")) {
|
||||
reg_python.setValue("2.5\\InstallPath\\Default", "C:\\Python26");
|
||||
reg_python.setValue("2.5/InstallPath/Default", "C:\\Python26");
|
||||
return "C:\\Python25";
|
||||
}
|
||||
return QString::null;
|
||||
@@ -986,14 +974,12 @@ public:
|
||||
|
||||
static bool isFileAssocOk() {
|
||||
QSettings settings("HKEY_CLASSES_ROOT", QSettings::NativeFormat);
|
||||
if(settings.value(".torrent\\Default").toString() != "qBittorrent" && settings.value(".torrent/Default").toString() != "qBittorrent") {
|
||||
if(settings.value(".torrent\\Default").toString() != "qBittorrent") {
|
||||
qDebug(".torrent != qBittorrent");
|
||||
return false;
|
||||
}
|
||||
qDebug("Checking shell command");
|
||||
QString shell_command = settings.value("qBittorrent\\shell\\open\\command\\Default", "").toString();
|
||||
if(shell_command.isEmpty())
|
||||
shell_command = settings.value("qBittorrent/shell/open/command/Default", "").toString();
|
||||
qDebug("Shell command is: %s", qPrintable(shell_command));
|
||||
QRegExp exe_reg("\"([^\"]+)\".*");
|
||||
if(exe_reg.indexIn(shell_command) < 0)
|
||||
@@ -1004,8 +990,6 @@ public:
|
||||
return false;
|
||||
// Check magnet link assoc
|
||||
shell_command = settings.value("Magnet\\shell\\open\\command\\Default", "").toString();
|
||||
if(shell_command.isEmpty())
|
||||
shell_command = settings.value("Magnet/shell/open/command/Default", "").toString();
|
||||
if(exe_reg.indexIn(shell_command) < 0)
|
||||
return false;
|
||||
assoc_exe = exe_reg.cap(1);
|
||||
|
@@ -740,7 +740,7 @@ void PropertiesWidget::renameSelectedFile() {
|
||||
}else{
|
||||
dir = QFileDialog::getExistingDirectory(this, tr("Choose save path"), QDir::homePath());
|
||||
}
|
||||
if(!dir.isEmpty()){
|
||||
if(!dir.isNull()){
|
||||
// Check if savePath exists
|
||||
QDir savePath(misc::expandPath(dir));
|
||||
if(!savePath.exists()){
|
||||
|
@@ -120,8 +120,12 @@ bool SearchEngine::addPythonPathToEnv() {
|
||||
}
|
||||
path_envar = python_path+";"+path_envar;
|
||||
qDebug("New PATH envvar is: %s", qPrintable(path_envar));
|
||||
#ifdef MINGW
|
||||
QString envar = "PATH="+path_envar;
|
||||
putenv(envar.toLocal8Bit().data());
|
||||
#else
|
||||
SetEnvironmentVariableA("PATH", path_envar.toLocal8Bit().constData());
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
18
src/src.pro
18
src/src.pro
@@ -12,13 +12,13 @@ CONFIG += qt \
|
||||
|
||||
# Update this VERSION for each release
|
||||
os2 {
|
||||
DEFINES += VERSION=\'\"v2.2.11\"\'
|
||||
DEFINES += VERSION=\'\"v2.2.10\"\'
|
||||
} else {
|
||||
DEFINES += VERSION=\\\"v2.2.11\\\"
|
||||
DEFINES += VERSION=\\\"v2.2.10\\\"
|
||||
}
|
||||
DEFINES += VERSION_MAJOR=2
|
||||
DEFINES += VERSION_MINOR=2
|
||||
DEFINES += VERSION_BUGFIX=11
|
||||
DEFINES += VERSION_BUGFIX=10
|
||||
|
||||
win32 {
|
||||
# Adapt these paths on Windows
|
||||
@@ -360,16 +360,10 @@ contains(DEFINES, DISABLE_GUI) {
|
||||
ui/confirmdeletiondlg.ui
|
||||
}
|
||||
|
||||
contains(DEFINES, USE_SYSTEM_QTSINGLEAPPLICATION) {
|
||||
message("Using the system's qtsingleapplication library")
|
||||
CONFIG += qtsingleapplication
|
||||
contains(DEFINES, DISABLE_GUI) {
|
||||
include(qtsingleapp/qtsinglecoreapplication.pri)
|
||||
} else {
|
||||
message("Using the shipped qtsingleapplication library")
|
||||
contains(DEFINES, DISABLE_GUI) {
|
||||
include(qtsingleapp/qtsinglecoreapplication.pri)
|
||||
} else {
|
||||
include(qtsingleapp/qtsingleapplication.pri)
|
||||
}
|
||||
include(qtsingleapp/qtsingleapplication.pri)
|
||||
}
|
||||
|
||||
SOURCES += main.cpp \
|
||||
|
@@ -556,7 +556,7 @@ QGroupBox {
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>632</width>
|
||||
<height>686</height>
|
||||
<height>684</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_17">
|
||||
@@ -729,6 +729,18 @@ QGroupBox {
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderDefaultSectionSize">
|
||||
<number>80</number>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@@ -1099,8 +1111,8 @@ QGroupBox {
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>524</width>
|
||||
<height>398</height>
|
||||
<width>447</width>
|
||||
<height>288</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_28">
|
||||
@@ -1344,8 +1356,8 @@ QGroupBox {
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>524</width>
|
||||
<height>406</height>
|
||||
<width>364</width>
|
||||
<height>328</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_33">
|
||||
@@ -1759,8 +1771,8 @@ QGroupBox {
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>506</width>
|
||||
<height>413</height>
|
||||
<width>459</width>
|
||||
<height>407</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_20">
|
||||
@@ -2048,6 +2060,11 @@ QGroupBox {
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignHCenter</set>
|
||||
</property>
|
||||
@@ -2097,6 +2114,11 @@ QGroupBox {
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignHCenter</set>
|
||||
</property>
|
||||
|
Reference in New Issue
Block a user