mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 12:34:19 +00:00
Several OS/2 fixes from Silvan Scherrer
This commit is contained in:
parent
8ee762695b
commit
778cfff4b3
@ -1565,7 +1565,7 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
|||||||
if(consoleMessages.size() > 100) {
|
if(consoleMessages.size() > 100) {
|
||||||
consoleMessages.removeFirst();
|
consoleMessages.removeFirst();
|
||||||
}
|
}
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
msg = msg.replace("/", "\\");
|
msg = msg.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
consoleMessages.append(QString::fromUtf8("<font color='grey'>")+ QDateTime::currentDateTime().toString(QString::fromUtf8("dd/MM/yyyy hh:mm:ss")) + QString::fromUtf8("</font> - <font color='") + color.name() +QString::fromUtf8("'><i>") + msg + QString::fromUtf8("</i></font>"));
|
consoleMessages.append(QString::fromUtf8("<font color='grey'>")+ QDateTime::currentDateTime().toString(QString::fromUtf8("dd/MM/yyyy hh:mm:ss")) + QString::fromUtf8("</font> - <font color='") + color.name() +QString::fromUtf8("'><i>") + msg + QString::fromUtf8("</i></font>"));
|
||||||
|
@ -82,7 +82,7 @@ createtorrent::~createtorrent() {
|
|||||||
void createtorrent::on_addFolder_button_clicked(){
|
void createtorrent::on_addFolder_button_clicked(){
|
||||||
QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder to add to the torrent"), QDir::homePath(), QFileDialog::ShowDirsOnly);
|
QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder to add to the torrent"), QDir::homePath(), QFileDialog::ShowDirsOnly);
|
||||||
if(!dir.isEmpty()) {
|
if(!dir.isEmpty()) {
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
dir = dir.replace("/", "\\");
|
dir = dir.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
textInputPath->setText(dir);
|
textInputPath->setText(dir);
|
||||||
@ -92,7 +92,7 @@ void createtorrent::on_addFolder_button_clicked(){
|
|||||||
void createtorrent::on_addFile_button_clicked(){
|
void createtorrent::on_addFile_button_clicked(){
|
||||||
QString file = QFileDialog::getOpenFileName(this, tr("Select a file to add to the torrent"), QDir::homePath());
|
QString file = QFileDialog::getOpenFileName(this, tr("Select a file to add to the torrent"), QDir::homePath());
|
||||||
if(!file.isEmpty()) {
|
if(!file.isEmpty()) {
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
file = file.replace("/", "\\");
|
file = file.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
textInputPath->setText(file);
|
textInputPath->setText(file);
|
||||||
|
@ -366,13 +366,13 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
|||||||
// Downloads preferences
|
// Downloads preferences
|
||||||
settings.beginGroup("Downloads");
|
settings.beginGroup("Downloads");
|
||||||
QString save_path = getSavePath();
|
QString save_path = getSavePath();
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
save_path = save_path.replace("\\", "/");
|
save_path = save_path.replace("\\", "/");
|
||||||
#endif
|
#endif
|
||||||
settings.setValue(QString::fromUtf8("SavePath"), save_path);
|
settings.setValue(QString::fromUtf8("SavePath"), save_path);
|
||||||
settings.setValue(QString::fromUtf8("TempPathEnabled"), isTempPathEnabled());
|
settings.setValue(QString::fromUtf8("TempPathEnabled"), isTempPathEnabled());
|
||||||
QString temp_path = getTempPath();
|
QString temp_path = getTempPath();
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
temp_path = temp_path.replace("\\", "/");
|
temp_path = temp_path.replace("\\", "/");
|
||||||
#endif
|
#endif
|
||||||
settings.setValue(QString::fromUtf8("TempPath"), temp_path);
|
settings.setValue(QString::fromUtf8("TempPath"), temp_path);
|
||||||
@ -386,7 +386,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
|||||||
ScanFoldersModel::instance()->makePersistent(settings);
|
ScanFoldersModel::instance()->makePersistent(settings);
|
||||||
addedScanDirs.clear();
|
addedScanDirs.clear();
|
||||||
QString export_dir = getExportDir();
|
QString export_dir = getExportDir();
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
export_dir = export_dir.replace("\\", "/");
|
export_dir = export_dir.replace("\\", "/");
|
||||||
#endif
|
#endif
|
||||||
Preferences::setExportDir(export_dir);
|
Preferences::setExportDir(export_dir);
|
||||||
@ -476,7 +476,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
|||||||
settings.setValue(QString::fromUtf8("Enabled"), isFilteringEnabled());
|
settings.setValue(QString::fromUtf8("Enabled"), isFilteringEnabled());
|
||||||
if(isFilteringEnabled()){
|
if(isFilteringEnabled()){
|
||||||
QString filter_path = textFilterPath->text();
|
QString filter_path = textFilterPath->text();
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
filter_path = filter_path.replace("\\", "/");
|
filter_path = filter_path.replace("\\", "/");
|
||||||
#endif
|
#endif
|
||||||
settings.setValue(QString::fromUtf8("File"), filter_path);
|
settings.setValue(QString::fromUtf8("File"), filter_path);
|
||||||
@ -588,7 +588,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
|||||||
// End General preferences
|
// End General preferences
|
||||||
// Downloads preferences
|
// Downloads preferences
|
||||||
QString save_path = Preferences::getSavePath();
|
QString save_path = Preferences::getSavePath();
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
save_path = save_path.replace("/", "\\");
|
save_path = save_path.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
textSavePath->setText(save_path);
|
textSavePath->setText(save_path);
|
||||||
@ -599,7 +599,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
|||||||
checkTempFolder->setChecked(false);
|
checkTempFolder->setChecked(false);
|
||||||
}
|
}
|
||||||
QString temp_path = Preferences::getTempPath();
|
QString temp_path = Preferences::getTempPath();
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
temp_path = temp_path.replace("/", "\\");
|
temp_path = temp_path.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
textTempPath->setText(temp_path);
|
textTempPath->setText(temp_path);
|
||||||
@ -618,7 +618,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
|||||||
} else {
|
} else {
|
||||||
// enable
|
// enable
|
||||||
checkExportDir->setChecked(true);
|
checkExportDir->setChecked(true);
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
strValue = strValue.replace("/", "\\");
|
strValue = strValue.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
textExportDir->setText(strValue);
|
textExportDir->setText(strValue);
|
||||||
@ -973,7 +973,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
|||||||
QString options_imp::getSavePath() const{
|
QString options_imp::getSavePath() const{
|
||||||
if(textSavePath->text().trimmed().isEmpty()){
|
if(textSavePath->text().trimmed().isEmpty()){
|
||||||
QString save_path = Preferences::getSavePath();
|
QString save_path = Preferences::getSavePath();
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
save_path = save_path.replace("/", "\\");
|
save_path = save_path.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
textSavePath->setText(save_path);
|
textSavePath->setText(save_path);
|
||||||
@ -1307,7 +1307,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
|||||||
dir = QFileDialog::getExistingDirectory(this, tr("Choose export directory"), QDir::homePath());
|
dir = QFileDialog::getExistingDirectory(this, tr("Choose export directory"), QDir::homePath());
|
||||||
}
|
}
|
||||||
if(!dir.isNull()){
|
if(!dir.isNull()){
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
dir = dir.replace("/", "\\");
|
dir = dir.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
textExportDir->setText(dir);
|
textExportDir->setText(dir);
|
||||||
@ -1324,7 +1324,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
|||||||
ipfilter = QFileDialog::getOpenFileName(this, tr("Choose an ip filter file"), QDir::homePath(), tr("Filters")+QString(" (*.dat *.p2p *.p2b)"));
|
ipfilter = QFileDialog::getOpenFileName(this, tr("Choose an ip filter file"), QDir::homePath(), tr("Filters")+QString(" (*.dat *.p2p *.p2b)"));
|
||||||
}
|
}
|
||||||
if(!ipfilter.isNull()){
|
if(!ipfilter.isNull()){
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
ipfilter = ipfilter.replace("/", "\\");
|
ipfilter = ipfilter.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
textFilterPath->setText(ipfilter);
|
textFilterPath->setText(ipfilter);
|
||||||
@ -1342,7 +1342,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
|||||||
dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::homePath());
|
dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::homePath());
|
||||||
}
|
}
|
||||||
if(!dir.isNull()){
|
if(!dir.isNull()){
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
dir = dir.replace("/", "\\");
|
dir = dir.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
textSavePath->setText(dir);
|
textSavePath->setText(dir);
|
||||||
@ -1359,7 +1359,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
|||||||
dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::homePath());
|
dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::homePath());
|
||||||
}
|
}
|
||||||
if(!dir.isNull()){
|
if(!dir.isNull()){
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
dir = dir.replace("/", "\\");
|
dir = dir.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
textTempPath->setText(dir);
|
textTempPath->setText(dir);
|
||||||
|
@ -213,7 +213,7 @@ void PropertiesWidget::updateSavePath(QTorrentHandle& _h) {
|
|||||||
QString p = TorrentPersistentData::getSavePath(h.hash());
|
QString p = TorrentPersistentData::getSavePath(h.hash());
|
||||||
if(p.isEmpty())
|
if(p.isEmpty())
|
||||||
p = h.save_path();
|
p = h.save_path();
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
p = p.replace("/", "\\");
|
p = p.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
save_path->setText(p);
|
save_path->setText(p);
|
||||||
@ -240,7 +240,7 @@ void PropertiesWidget::loadTorrentInfos(QTorrentHandle &_h) {
|
|||||||
QString p = TorrentPersistentData::getSavePath(h.hash());
|
QString p = TorrentPersistentData::getSavePath(h.hash());
|
||||||
if(p.isEmpty())
|
if(p.isEmpty())
|
||||||
p = h.save_path();
|
p = h.save_path();
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
p = p.replace("/", "\\");
|
p = p.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
save_path->setText(p);
|
save_path->setText(p);
|
||||||
@ -763,7 +763,7 @@ void PropertiesWidget::renameSelectedFile() {
|
|||||||
h.move_storage(savePath.absolutePath());
|
h.move_storage(savePath.absolutePath());
|
||||||
// Update save_path in dialog
|
// Update save_path in dialog
|
||||||
QString display_path = savePath.absolutePath();
|
QString display_path = savePath.absolutePath();
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
display_path = display_path.replace("/", "\\");
|
display_path = display_path.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
save_path->setText(display_path);
|
save_path->setText(display_path);
|
||||||
|
BIN
src/qbittorrent_os2.ico
Normal file
BIN
src/qbittorrent_os2.ico
Normal file
Binary file not shown.
1
src/qbittorrent_os2.rc
Normal file
1
src/qbittorrent_os2.rc
Normal file
@ -0,0 +1 @@
|
|||||||
|
ICON 1 DISCARDABLE "qbittorrent_os2.ico"
|
@ -58,6 +58,9 @@ static PProcessIdToSessionId pProcessIdToSessionId = 0;
|
|||||||
#if defined(Q_OS_UNIX)
|
#if defined(Q_OS_UNIX)
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(Q_OS_OS2)
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ CONFIG += qt \
|
|||||||
|
|
||||||
# Update this VERSION for each release
|
# Update this VERSION for each release
|
||||||
os2 {
|
os2 {
|
||||||
DEFINES += VERSION=\'\"v2.3.0beta3\'\"
|
DEFINES += VERSION=\'\"v2.3.0beta3\"\'
|
||||||
} else {
|
} else {
|
||||||
DEFINES += VERSION=\\\"v2.3.0beta3\\\"
|
DEFINES += VERSION=\\\"v2.3.0beta3\\\"
|
||||||
}
|
}
|
||||||
@ -191,12 +191,16 @@ win32 {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
os2:LIBS += -ltorrent-rasterbar \
|
os2 {
|
||||||
|
LIBS += -ltorrent-rasterbar \
|
||||||
-lboost_thread \
|
-lboost_thread \
|
||||||
-lboost_system \
|
-lboost_system \
|
||||||
-lboost_filesystem \
|
-lboost_filesystem \
|
||||||
-lssl -lcrypto -lidn -lpthread
|
-lssl -lcrypto -lidn -lpthread
|
||||||
|
|
||||||
|
RC_FILE = qbittorrent_os2.rc
|
||||||
|
}
|
||||||
|
|
||||||
!contains(DEFINES, DISABLE_GUI) {
|
!contains(DEFINES, DISABLE_GUI) {
|
||||||
win32 {
|
win32 {
|
||||||
DEFINES += WITH_GEOIP_EMBEDDED
|
DEFINES += WITH_GEOIP_EMBEDDED
|
||||||
|
@ -53,7 +53,7 @@ torrentAdditionDialog::torrentAdditionDialog(GUI *parent, Bittorrent* _BTSession
|
|||||||
defaultSavePath = Preferences::getSavePath();
|
defaultSavePath = Preferences::getSavePath();
|
||||||
appendLabelToSavePath = Preferences::appendTorrentLabel();
|
appendLabelToSavePath = Preferences::appendTorrentLabel();
|
||||||
QString display_path = defaultSavePath;
|
QString display_path = defaultSavePath;
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
display_path = display_path.replace("/", "\\");
|
display_path = display_path.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
savePathTxt->setText(display_path);
|
savePathTxt->setText(display_path);
|
||||||
@ -196,7 +196,7 @@ void torrentAdditionDialog::showLoad(QString filePath, QString from_url) {
|
|||||||
}
|
}
|
||||||
QString root_folder = misc::truncateRootFolder(t);
|
QString root_folder = misc::truncateRootFolder(t);
|
||||||
QString save_path = savePathTxt->text();
|
QString save_path = savePathTxt->text();
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
save_path = save_path.replace("/", "\\");
|
save_path = save_path.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
if(!save_path.endsWith(QDir::separator()))
|
if(!save_path.endsWith(QDir::separator()))
|
||||||
@ -208,7 +208,7 @@ void torrentAdditionDialog::showLoad(QString filePath, QString from_url) {
|
|||||||
if(nbFiles == 1) {
|
if(nbFiles == 1) {
|
||||||
// single file torrent
|
// single file torrent
|
||||||
QString single_file_relpath = misc::toQStringU(t->file_at(0).path.string());
|
QString single_file_relpath = misc::toQStringU(t->file_at(0).path.string());
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
single_file_relpath = single_file_relpath.replace("/", "\\");
|
single_file_relpath = single_file_relpath.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
savePathTxt->setText(save_path+single_file_relpath);
|
savePathTxt->setText(save_path+single_file_relpath);
|
||||||
@ -425,7 +425,7 @@ void torrentAdditionDialog::renameSelectedFile() {
|
|||||||
void torrentAdditionDialog::on_browseButton_clicked(){
|
void torrentAdditionDialog::on_browseButton_clicked(){
|
||||||
QString new_path;
|
QString new_path;
|
||||||
QString save_path = savePathTxt->text();
|
QString save_path = savePathTxt->text();
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
save_path = save_path.replace("\\", "/");
|
save_path = save_path.replace("\\", "/");
|
||||||
#endif
|
#endif
|
||||||
save_path = misc::expandPath(save_path);
|
save_path = misc::expandPath(save_path);
|
||||||
@ -440,7 +440,7 @@ void torrentAdditionDialog::renameSelectedFile() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!new_path.isEmpty()){
|
if(!new_path.isEmpty()){
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
new_path = new_path.replace("/", "\\");
|
new_path = new_path.replace("/", "\\");
|
||||||
#endif
|
#endif
|
||||||
savePathTxt->setText(new_path);
|
savePathTxt->setText(new_path);
|
||||||
@ -467,7 +467,7 @@ void torrentAdditionDialog::renameSelectedFile() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QString save_path = savePathTxt->text();
|
QString save_path = savePathTxt->text();
|
||||||
#ifdef Q_WS_WIN
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
save_path = save_path.replace("\\", "/");
|
save_path = save_path.replace("\\", "/");
|
||||||
#endif
|
#endif
|
||||||
save_path = misc::expandPath(save_path);
|
save_path = misc::expandPath(save_path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user