mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-09 14:27:56 +00:00
Merge latest msvc fixes from stable branch
This commit is contained in:
parent
8ec1621334
commit
4805690dbe
@ -1856,8 +1856,13 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
|||||||
default:
|
default:
|
||||||
qDebug("Disabling HTTP communications proxy");
|
qDebug("Disabling HTTP communications proxy");
|
||||||
#ifdef Q_WS_WIN
|
#ifdef Q_WS_WIN
|
||||||
|
#ifdef MINGW
|
||||||
putenv("http_proxy=");
|
putenv("http_proxy=");
|
||||||
putenv("sock_proxy=");
|
putenv("sock_proxy=");
|
||||||
|
#else
|
||||||
|
SetEnvironmentVariableA("http_proxy", "");
|
||||||
|
SetEnvironmentVariableA("sock_proxy", "");
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
unsetenv("http_proxy");
|
unsetenv("http_proxy");
|
||||||
unsetenv("sock_proxy");
|
unsetenv("sock_proxy");
|
||||||
@ -1866,12 +1871,17 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
|||||||
}
|
}
|
||||||
// We need this for urllib in search engine plugins
|
// We need this for urllib in search engine plugins
|
||||||
#ifdef Q_WS_WIN
|
#ifdef Q_WS_WIN
|
||||||
QString proxyStr;
|
QString type_str;
|
||||||
if(proxySettings.type == proxy_settings::socks5 || proxySettings.type == proxy_settings::socks5_pw)
|
if(proxySettings.type == proxy_settings::socks5 || proxySettings.type == proxy_settings::socks5_pw)
|
||||||
proxyStr = "sock_proxy=" + proxy_str;
|
type_str = "sock_proxy";
|
||||||
else
|
else
|
||||||
proxyStr = "http_proxy=" + proxy_str;
|
type_str = "http_proxy";
|
||||||
putenv(proxyStr.toLocal8Bit().constData());
|
#ifdef MINGW
|
||||||
|
QString tmp = type_str+"="+proxy_str;
|
||||||
|
putenv(tmp.toLocal8Bit().constData());
|
||||||
|
#else
|
||||||
|
SetEnvironmentVariableA(type_str.toLocal8Bit().constData(), proxy_str.toLocal8Bit().constData());
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
qDebug("HTTP communications proxy string: %s", qPrintable(proxy_str));
|
qDebug("HTTP communications proxy string: %s", qPrintable(proxy_str));
|
||||||
if(proxySettings.type == proxy_settings::socks5 || proxySettings.type == proxy_settings::socks5_pw)
|
if(proxySettings.type == proxy_settings::socks5 || proxySettings.type == proxy_settings::socks5_pw)
|
||||||
|
@ -283,7 +283,11 @@ int main(int argc, char *argv[]){
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// Set environment variable
|
// Set environment variable
|
||||||
|
#if defined(Q_WS_WIN) && !defined(MINGW)
|
||||||
|
if(SetEnvironmentVariableA("QBITTORRENT", VERSION)) {
|
||||||
|
#else
|
||||||
if(putenv((char*)"QBITTORRENT="VERSION)) {
|
if(putenv((char*)"QBITTORRENT="VERSION)) {
|
||||||
|
#endif
|
||||||
std::cerr << "Couldn't set environment variable...\n";
|
std::cerr << "Couldn't set environment variable...\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline sha1_hash QStringToSha1(const QString& s) {
|
static inline sha1_hash QStringToSha1(const QString& s) {
|
||||||
std::istringstream i(s.toStdString());
|
std::string str(s.toLocal8Bit().data());
|
||||||
|
std::istringstream i(str);
|
||||||
|
std::cout << "lol" << std::endl;
|
||||||
sha1_hash x;
|
sha1_hash x;
|
||||||
i>>x;
|
i>>x;
|
||||||
return x;
|
return x;
|
||||||
|
@ -536,7 +536,7 @@ void PropertiesWidget::openDoubleClickedFile(QModelIndex index) {
|
|||||||
|
|
||||||
void PropertiesWidget::displayFilesListMenu(const QPoint&){
|
void PropertiesWidget::displayFilesListMenu(const QPoint&){
|
||||||
QMenu myFilesLlistMenu;
|
QMenu myFilesLlistMenu;
|
||||||
const QModelIndexList &selectedRows = filesList->selectionModel()->selectedRows(0);
|
QModelIndexList selectedRows = filesList->selectionModel()->selectedRows(0);
|
||||||
QAction *actRename = 0;
|
QAction *actRename = 0;
|
||||||
if(selectedRows.size() == 1) {
|
if(selectedRows.size() == 1) {
|
||||||
actRename = myFilesLlistMenu.addAction(QIcon(QString::fromUtf8(":/Icons/oxygen/edit_clear.png")), tr("Rename..."));
|
actRename = myFilesLlistMenu.addAction(QIcon(QString::fromUtf8(":/Icons/oxygen/edit_clear.png")), tr("Rename..."));
|
||||||
|
@ -120,8 +120,12 @@ bool SearchEngine::addPythonPathToEnv() {
|
|||||||
}
|
}
|
||||||
path_envar = python_path+";"+path_envar;
|
path_envar = python_path+";"+path_envar;
|
||||||
qDebug("New PATH envvar is: %s", qPrintable(path_envar));
|
qDebug("New PATH envvar is: %s", qPrintable(path_envar));
|
||||||
|
#ifdef MINGW
|
||||||
QString envar = "PATH="+path_envar;
|
QString envar = "PATH="+path_envar;
|
||||||
putenv(envar.toLocal8Bit().data());
|
putenv(envar.toLocal8Bit().data());
|
||||||
|
#else
|
||||||
|
SetEnvironmentVariableA("PATH", path_envar.toLocal8Bit().constData());
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
90
src/src.pro
90
src/src.pro
@ -3,7 +3,7 @@ LANG_PATH = lang
|
|||||||
ICONS_PATH = Icons
|
ICONS_PATH = Icons
|
||||||
|
|
||||||
# Set the following variable to 1 to enable debug
|
# Set the following variable to 1 to enable debug
|
||||||
DEBUG_MODE = 1
|
DEBUG_MODE = 0
|
||||||
|
|
||||||
# Global
|
# Global
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
@ -23,21 +23,32 @@ DEFINES += VERSION_BUGFIX=0
|
|||||||
win32 {
|
win32 {
|
||||||
# Adapt these paths on Windows
|
# Adapt these paths on Windows
|
||||||
INCLUDEPATH += $$quote(C:/qbittorrent/msvc/boost_1_42_0)
|
INCLUDEPATH += $$quote(C:/qbittorrent/msvc/boost_1_42_0)
|
||||||
#INCLUDEPATH += $$quote(C:/qbittorrent/msvc/libtorrent-rasterbar-0.14.10/include)
|
INCLUDEPATH += $$quote(C:/qbittorrent/msvc/libtorrent-rasterbar-0.14.10/include)
|
||||||
#INCLUDEPATH += $$quote(C:/qbittorrent/msvc/libtorrent-rasterbar-0.14.10/zlib)
|
INCLUDEPATH += $$quote(C:/qbittorrent/msvc/libtorrent-rasterbar-0.14.10/zlib)
|
||||||
INCLUDEPATH += $$quote(C:/qbittorrent/msvc/RC_0_15/include)
|
|
||||||
INCLUDEPATH += $$quote(C:/qbittorrent/msvc/RC_0_15/zlib)
|
|
||||||
#DEFINES += LIBTORRENT_0_15
|
|
||||||
|
|
||||||
LIBS += -LC:/OpenSSL/lib/VC
|
LIBS += -LC:/OpenSSL/lib/VC
|
||||||
LIBS += -LC:/qbittorrent/msvc/boost_1_42_0/stage/lib
|
|
||||||
|
|
||||||
DEFINES += _WIN32_WINNT=0x0601
|
#DEFINES += _WIN32_WINNT=0x0601
|
||||||
DEFINES += _WIN32_IE=0x0400
|
#DEFINES += _WIN32_IE=0x0400
|
||||||
DEFINES += _WIN32_WINDOWS
|
#DEFINES += _WIN32_WINDOWS
|
||||||
|
|
||||||
QMAKE_CXXFLAGS_STL_ON = -EHa
|
#QMAKE_CXXFLAGS_STL_ON = -EHs
|
||||||
QMAKE_CXXFLAGS_EXCEPTIONS_ON = -EHa
|
#QMAKE_CXXFLAGS_EXCEPTIONS_ON = -EHs
|
||||||
|
|
||||||
|
DEFINES += BOOST_ALL_NO_LIB BOOST_ASIO_HASH_MAP_BUCKETS=1021 BOOST_EXCEPTION_DISABLE
|
||||||
|
DEFINES += BOOST_FILESYSTEM_STATIC_LINK=1 BOOST_MULTI_INDEX_DISABLE_SERIALIZATION
|
||||||
|
DEFINES += BOOST_SYSTEM_STATIC_LINK=1 BOOST_THREAD_USE_LIB BOOST_THREAD_USE_LIB=1
|
||||||
|
DEFINES += TORRENT_USE_OPENSSL UNICODE WIN32 WIN32_LEAN_AND_MEAN
|
||||||
|
DEFINES += _CRT_SECURE_NO_DEPRECATE _FILE_OFFSET_BITS=64 _SCL_SECURE_NO_DEPRECATE
|
||||||
|
DEFINES += _UNICODE _WIN32 _WIN32_WINNT=0x0500 __USE_W32_SOCKETS
|
||||||
|
|
||||||
|
contains(DEBUG_MODE, 1) {
|
||||||
|
DEFINES += TORRENT_DEBUG
|
||||||
|
}
|
||||||
|
|
||||||
|
contains(DEBUG_MODE, 0) {
|
||||||
|
DEFINES += NDEBUG
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# NORMAL,ALPHA,BETA,RELEASE_CANDIDATE,DEVEL
|
# NORMAL,ALPHA,BETA,RELEASE_CANDIDATE,DEVEL
|
||||||
@ -138,50 +149,31 @@ DEFINES += QT_NO_CAST_TO_ASCII
|
|||||||
DEFINES += QT_USE_FAST_CONCATENATION QT_USE_FAST_OPERATOR_PLUS
|
DEFINES += QT_USE_FAST_CONCATENATION QT_USE_FAST_OPERATOR_PLUS
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
# usually built as static
|
|
||||||
# win32:LIBS += -ltorrent -lboost_system
|
|
||||||
# win32:LIBS += -lz ?
|
|
||||||
win32 {
|
win32 {
|
||||||
RC_FILE = qbittorrent.rc
|
RC_FILE = qbittorrent.rc
|
||||||
|
|
||||||
LIBS += "/nodefaultlib:"msvcrt.lib"
|
#LIBS += "/nodefaultlib:"msvcrt.lib"
|
||||||
LIBS += "/nodefaultlib:"msvcrtd.lib"
|
#LIBS += "/nodefaultlib:"msvcrtd.lib"
|
||||||
contains(DEBUG_MODE, 1) {
|
#contains(DEBUG_MODE, 1) {
|
||||||
LIBS += "/nodefaultlib:"libcmt.lib"
|
# LIBS += "/nodefaultlib:"libcmt.lib"
|
||||||
}
|
#}
|
||||||
|
|
||||||
# Adapt these paths on Windows
|
# Adapt these paths on Windows
|
||||||
contains(DEBUG_MODE, 1) {
|
contains(DEBUG_MODE, 1) {
|
||||||
LIBS += C:/qbittorrent/msvc/libs/libtorrent-0.15d.lib
|
LIBS += C:/qbittorrent/msvc/libs/libtorrentd.lib \
|
||||||
} else {
|
C:/qbittorrent/msvc/libs/libboost_system-vc90-mt-gd.lib \
|
||||||
LIBS += C:/qbittorrent/msvc/libs/libtorrent.lib
|
C:/qbittorrent/msvc/libs/libboost_filesystem-vc90-mt-gd.lib \
|
||||||
}
|
C:/qbittorrent/msvc/libs/libboost_thread-vc90-mt-gd.lib
|
||||||
#LIBS += C:/qbittorrent/msvc/libs/libtorrent.lib #\
|
}
|
||||||
#C:/qbittorrent/msvc/libs/libboost_system-vc90-mt-s.lib \
|
contains(DEBUG_MODE, 0) {
|
||||||
#C:/qbittorrent/msvc/libs/libboost_filesystem-vc90-mt-s.lib \
|
LIBS += C:/qbittorrent/msvc/libs/libtorrent.lib \
|
||||||
#C:/qbittorrent/msvc/libs/libboost_thread-vc90-mt-s.lib \
|
C:/qbittorrent/msvc/libs/libboost_system-vc90-mt.lib \
|
||||||
#C:/qbittorrent/msvc/libs/libboost_date_time-vc90-mt-s.lib \
|
C:/qbittorrent/msvc/libs/libboost_filesystem-vc90-mt.lib \
|
||||||
#C:/Qt/2010.02.1/mingw/lib/libwsock32.a \
|
C:/qbittorrent/msvc/libs/libboost_thread-vc90-mt.lib
|
||||||
#C:/Qt/2010.02.1/mingw/lib/libws2_32.a \
|
}
|
||||||
# C:/OpenSSL/lib/MinGW/ssleay32.a \
|
|
||||||
# C:/OpenSSL/lib/MinGW/libeay32.a \
|
|
||||||
# -LC:/Qt/2010.02.1/mingw/lib/
|
|
||||||
# C:/Qt/2010.02.1/mingw/lib/libadvapi32.a \
|
|
||||||
# C:/Qt/2010.02.1/mingw/lib/libwinmm.a \
|
|
||||||
# C:/Qt/2010.02.1/mingw/lib/libgdi32.a \
|
|
||||||
|
|
||||||
# Dynamic linking against SSL since QtNetwork requires it at runtime anyway
|
|
||||||
#LIBS += -lws2_32 \
|
|
||||||
# -lwsock32 \
|
|
||||||
# -ladvapi32 \
|
|
||||||
# -lwinmm \
|
|
||||||
# -lssleay32MT \
|
|
||||||
# -llibeay32MT
|
|
||||||
# -lshell32 \
|
|
||||||
|
|
||||||
#LIBS += gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib winspool.lib ws2_32.lib ole32.lib user32.lib advapi32.lib shell32.lib kernel32.lib uuid.lib
|
|
||||||
LIBS += advapi32.lib shell32.lib
|
LIBS += advapi32.lib shell32.lib
|
||||||
LIBS += libeay32MT.lib ssleay32MT.lib
|
LIBS += libeay32MD.lib ssleay32MD.lib
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user