1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-02-02 18:04:32 +00:00

Fix compilation errors on Windows

This commit is contained in:
Christophe Dumez 2010-11-22 20:27:57 +00:00
parent efe5e7b068
commit b169083fe2
3 changed files with 22 additions and 22 deletions

View File

@ -1229,7 +1229,7 @@ void MainWindow::on_actionDownload_from_URL_triggered() {
#if defined(Q_WS_WIN) || defined(Q_WS_MAC) #if defined(Q_WS_WIN) || defined(Q_WS_MAC)
void GUI::handleUpdateCheckFinished(bool update_available, QString new_version) void MainWindow::handleUpdateCheckFinished(bool update_available, QString new_version)
{ {
if(update_available) { if(update_available) {
if(QMessageBox::question(this, tr("A newer version is available"), if(QMessageBox::question(this, tr("A newer version is available"),
@ -1245,7 +1245,7 @@ void GUI::handleUpdateCheckFinished(bool update_available, QString new_version)
sender()->deleteLater(); sender()->deleteLater();
} }
void GUI::handleUpdateInstalled(QString error_msg) void MainWindow::handleUpdateInstalled(QString error_msg)
{ {
if(!error_msg.isEmpty()) { if(!error_msg.isEmpty()) {
QMessageBox::critical(this, tr("Impossible to update qBittorrent"), tr("qBittorrent failed to update, reason: %1").arg(error_msg)); QMessageBox::critical(this, tr("Impossible to update qBittorrent"), tr("qBittorrent failed to update, reason: %1").arg(error_msg));

View File

@ -909,12 +909,12 @@ public:
static bool isFileAssocOk() { static bool isFileAssocOk() {
QSettings settings("HKEY_CLASSES_ROOT", QIniSettings::NativeFormat); QSettings settings("HKEY_CLASSES_ROOT", QIniSettings::NativeFormat);
if(value(".torrent/Default").toString() != "qBittorrent") { if(settings.value(".torrent/Default").toString() != "qBittorrent") {
qDebug(".torrent != qBittorrent"); qDebug(".torrent != qBittorrent");
return false; return false;
} }
qDebug("Checking shell command"); qDebug("Checking shell command");
QString shell_command = value("qBittorrent/shell/open/command/Default", "").toString(); QString shell_command = settings.value("qBittorrent/shell/open/command/Default", "").toString();
qDebug("Shell command is: %s", qPrintable(shell_command)); qDebug("Shell command is: %s", qPrintable(shell_command));
QRegExp exe_reg("\"([^\"]+)\".*"); QRegExp exe_reg("\"([^\"]+)\".*");
if(exe_reg.indexIn(shell_command) < 0) if(exe_reg.indexIn(shell_command) < 0)
@ -925,10 +925,10 @@ public:
return false; return false;
// Icon // Icon
const QString icon_str = "\""+qApp->applicationFilePath().replace("/", "\\")+"\",1"; const QString icon_str = "\""+qApp->applicationFilePath().replace("/", "\\")+"\",1";
if(value("qBittorrent/DefaultIcon/Default", icon_str).toString().compare(icon_str, Qt::CaseInsensitive) != 0) if(settings.value("qBittorrent/DefaultIcon/Default", icon_str).toString().compare(icon_str, Qt::CaseInsensitive) != 0)
return false; return false;
// Check magnet link assoc // Check magnet link assoc
shell_command = value("Magnet/shell/open/command/Default", "").toString(); shell_command = settings.value("Magnet/shell/open/command/Default", "").toString();
if(exe_reg.indexIn(shell_command) < 0) if(exe_reg.indexIn(shell_command) < 0)
return false; return false;
assoc_exe = exe_reg.cap(1); assoc_exe = exe_reg.cap(1);
@ -941,21 +941,21 @@ public:
static void setFileAssoc() { static void setFileAssoc() {
QSettings settings("HKEY_CLASSES_ROOT", QSettings::NativeFormat); QSettings settings("HKEY_CLASSES_ROOT", QSettings::NativeFormat);
// .Torrent association // .Torrent association
setValue(".torrent/Default", "qBittorrent"); settings.setValue(".torrent/Default", "qBittorrent");
setValue(".torrent/Content Type", "application/x-bittorrent"); settings.setValue(".torrent/Content Type", "application/x-bittorrent");
setValue("qBittorrent/shell/Default", "open"); settings.setValue("qBittorrent/shell/Default", "open");
const QString command_str = "\""+qApp->applicationFilePath().replace("/", "\\")+"\" \"%1\""; const QString command_str = "\""+qApp->applicationFilePath().replace("/", "\\")+"\" \"%1\"";
setValue("qBittorrent/shell/open/command/Default", command_str); settings.setValue("qBittorrent/shell/open/command/Default", command_str);
setValue("qBittorrent/Content Type/Default", "application/x-bittorrent"); settings.setValue("qBittorrent/Content Type/Default", "application/x-bittorrent");
const QString icon_str = "\""+qApp->applicationFilePath().replace("/", "\\")+"\",1"; const QString icon_str = "\""+qApp->applicationFilePath().replace("/", "\\")+"\",1";
setValue("qBittorrent/DefaultIcon/Default", icon_str); settings.setValue("qBittorrent/DefaultIcon/Default", icon_str);
// Magnet association // Magnet association
setValue("Magnet/Default", "Magnet URI"); settings.setValue("Magnet/Default", "Magnet URI");
setValue("Magnet/Content Type", "application/x-magnet"); settings.setValue("Magnet/Content Type", "application/x-magnet");
setValue("Magnet/URL Protocol", ""); settings.setValue("Magnet/URL Protocol", "");
setValue("Magnet/DefaultIcon\\Default", icon_str); settings.setValue("Magnet/DefaultIcon\\Default", icon_str);
setValue("Magnet/shell/Default", "open"); settings.setValue("Magnet/shell/Default", "open");
setValue("Magnet/shell/open/command/Default", command_str); settings.setValue("Magnet/shell/open/command/Default", command_str);
} }
#endif #endif

View File

@ -53,7 +53,7 @@ ProgramUpdater::ProgramUpdater(QObject *parent) :
mp_manager = new QNetworkAccessManager(this); mp_manager = new QNetworkAccessManager(this);
Preferences pref; Preferences pref;
// Proxy support // Proxy support
if(pref.isHTTPProxyEnabled()) { if(pref.isProxyEnabled()) {
QNetworkProxy proxy; QNetworkProxy proxy;
switch(pref.getHTTPProxyType()) { switch(pref.getHTTPProxyType()) {
case Proxy::SOCKS4: case Proxy::SOCKS4:
@ -67,9 +67,9 @@ ProgramUpdater::ProgramUpdater(QObject *parent) :
proxy.setHostName(pref.getHTTPProxyIp()); proxy.setHostName(pref.getHTTPProxyIp());
proxy.setPort(pref.getHTTPProxyPort()); proxy.setPort(pref.getHTTPProxyPort());
// Proxy authentication // Proxy authentication
if(pref.isHTTPProxyAuthEnabled()) { if(pref.isProxyAuthEnabled()) {
proxy.setUser(pref.getHTTPProxyUsername()); proxy.setUser(pref.getProxyUsername());
proxy.setPassword(pref.getHTTPProxyPassword()); proxy.setPassword(pref.getProxyPassword());
} }
mp_manager->setProxy(proxy); mp_manager->setProxy(proxy);
} }