diff --git a/AUTHORS b/AUTHORS index 3cf1df748..8fa498f68 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,6 +9,7 @@ Contributors: * Arnaud Demaizière * Grigis Gaëtan * Christian Kandeler +* Silvan Scherrer Code from other projects: * files src/qtsingleapp/* diff --git a/Changelog b/Changelog index cfa0205bc..f968176b7 100644 --- a/Changelog +++ b/Changelog @@ -7,6 +7,7 @@ - BUGFIX: Use busy cursor for search plugin updates - BUGFIX: Free disk space calculation now works if destination folder does not exist - BUGFIX: Fix "append .!qB extension to incomplete files" feature + - BUGFIX: Several OS/2 fixes by Silvan Scherrer - COSMETIC: Display "Alternative speed limits" button as pressed when enabled * Sun Jun 13 2010 - Christophe Dumez - v2.2.9 diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 0bc3834f5..da87624ce 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -1548,7 +1548,7 @@ void Bittorrent::addConsoleMessage(QString msg, QString) { if(consoleMessages.size() > 100) { consoleMessages.removeFirst(); } -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) msg = msg.replace("/", "\\"); #endif consoleMessages.append(QString::fromUtf8("")+ QDateTime::currentDateTime().toString(QString::fromUtf8("dd/MM/yyyy hh:mm:ss")) + QString::fromUtf8(" - ") + msg + QString::fromUtf8("")); diff --git a/src/createtorrent_imp.cpp b/src/createtorrent_imp.cpp index b82554e6e..2d1ad25de 100644 --- a/src/createtorrent_imp.cpp +++ b/src/createtorrent_imp.cpp @@ -82,7 +82,7 @@ createtorrent::~createtorrent() { void createtorrent::on_addFolder_button_clicked(){ QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder to add to the torrent"), QDir::homePath(), QFileDialog::ShowDirsOnly); if(!dir.isEmpty()) { -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) dir = dir.replace("/", "\\"); #endif textInputPath->setText(dir); @@ -92,7 +92,7 @@ void createtorrent::on_addFolder_button_clicked(){ void createtorrent::on_addFile_button_clicked(){ QString file = QFileDialog::getOpenFileName(this, tr("Select a file to add to the torrent"), QDir::homePath()); if(!file.isEmpty()) { -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) file = file.replace("/", "\\"); #endif textInputPath->setText(file); diff --git a/src/options_imp.cpp b/src/options_imp.cpp index 65febc0b7..368b65f3a 100644 --- a/src/options_imp.cpp +++ b/src/options_imp.cpp @@ -401,13 +401,13 @@ void options_imp::saveOptions(){ // Downloads preferences settings.beginGroup("Downloads"); QString save_path = getSavePath(); -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) save_path = save_path.replace("\\", "/"); #endif settings.setValue(QString::fromUtf8("SavePath"), save_path); settings.setValue(QString::fromUtf8("TempPathEnabled"), isTempPathEnabled()); QString temp_path = getTempPath(); -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) temp_path = temp_path.replace("\\", "/"); #endif settings.setValue(QString::fromUtf8("TempPath"), temp_path); @@ -421,7 +421,7 @@ void options_imp::saveOptions(){ ScanFoldersModel::instance()->makePersistent(settings); addedScanDirs.clear(); QString export_dir = getExportDir(); -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) export_dir = export_dir.replace("\\", "/"); #endif Preferences::setExportDir(export_dir); @@ -511,7 +511,7 @@ void options_imp::saveOptions(){ settings.setValue(QString::fromUtf8("Enabled"), isFilteringEnabled()); if(isFilteringEnabled()){ QString filter_path = textFilterPath->text(); -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) filter_path = filter_path.replace("\\", "/"); #endif settings.setValue(QString::fromUtf8("File"), filter_path); @@ -634,7 +634,7 @@ void options_imp::loadOptions(){ // End General preferences // Downloads preferences QString save_path = Preferences::getSavePath(); -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) save_path = save_path.replace("/", "\\"); #endif textSavePath->setText(save_path); @@ -647,7 +647,7 @@ void options_imp::loadOptions(){ enableTempPathInput(checkTempFolder->isChecked()); } QString temp_path = Preferences::getTempPath(); -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) temp_path = temp_path.replace("/", "\\"); #endif textTempPath->setText(temp_path); @@ -667,7 +667,7 @@ void options_imp::loadOptions(){ } else { // enable checkExportDir->setChecked(true); -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) strValue = strValue.replace("/", "\\"); #endif textExportDir->setText(strValue); @@ -1063,7 +1063,7 @@ float options_imp::getDeleteRatio() const{ QString options_imp::getSavePath() const{ if(textSavePath->text().trimmed().isEmpty()){ QString save_path = Preferences::getSavePath(); -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) save_path = save_path.replace("/", "\\"); #endif textSavePath->setText(save_path); @@ -1462,7 +1462,7 @@ void options_imp::on_browseExportDirButton_clicked() { dir = QFileDialog::getExistingDirectory(this, tr("Choose export directory"), QDir::homePath()); } if(!dir.isNull()){ -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) dir = dir.replace("/", "\\"); #endif textExportDir->setText(dir); @@ -1479,7 +1479,7 @@ void options_imp::on_browseFilterButton_clicked() { ipfilter = QFileDialog::getOpenFileName(this, tr("Choose an ip filter file"), QDir::homePath(), tr("Filters")+QString(" (*.dat *.p2p *.p2b)")); } if(!ipfilter.isNull()){ -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) ipfilter = ipfilter.replace("/", "\\"); #endif textFilterPath->setText(ipfilter); @@ -1497,7 +1497,7 @@ void options_imp::on_browseSaveDirButton_clicked(){ dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::homePath()); } if(!dir.isNull()){ -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) dir = dir.replace("/", "\\"); #endif textSavePath->setText(dir); @@ -1514,7 +1514,7 @@ void options_imp::on_browseTempDirButton_clicked(){ dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::homePath()); } if(!dir.isNull()){ -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) dir = dir.replace("/", "\\"); #endif textTempPath->setText(dir); diff --git a/src/propertieswidget.cpp b/src/propertieswidget.cpp index 4f6ff793e..3ad2d66fa 100644 --- a/src/propertieswidget.cpp +++ b/src/propertieswidget.cpp @@ -212,7 +212,7 @@ void PropertiesWidget::updateSavePath(QTorrentHandle& _h) { QString p = TorrentPersistentData::getSavePath(h.hash()); if(p.isEmpty()) p = h.save_path(); -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) p = p.replace("/", "\\"); #endif save_path->setText(p); @@ -233,7 +233,7 @@ void PropertiesWidget::loadTorrentInfos(QTorrentHandle &_h) { QString p = TorrentPersistentData::getSavePath(h.hash()); if(p.isEmpty()) p = h.save_path(); -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) p = p.replace("/", "\\"); #endif save_path->setText(p); @@ -754,7 +754,7 @@ void PropertiesWidget::renameSelectedFile() { h.move_storage(savePath.absolutePath()); // Update save_path in dialog QString display_path = savePath.absolutePath(); -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) display_path = display_path.replace("/", "\\"); #endif save_path->setText(display_path); diff --git a/src/qbittorrent_os2.ico b/src/qbittorrent_os2.ico new file mode 100644 index 000000000..caf387921 Binary files /dev/null and b/src/qbittorrent_os2.ico differ diff --git a/src/qbittorrent_os2.rc b/src/qbittorrent_os2.rc new file mode 100644 index 000000000..3781f15e6 --- /dev/null +++ b/src/qbittorrent_os2.rc @@ -0,0 +1 @@ +ICON 1 DISCARDABLE "qbittorrent_os2.ico" diff --git a/src/qtsingleapp/qtlocalpeer.cpp b/src/qtsingleapp/qtlocalpeer.cpp index dab21e0eb..b329e9147 100644 --- a/src/qtsingleapp/qtlocalpeer.cpp +++ b/src/qtsingleapp/qtlocalpeer.cpp @@ -58,6 +58,9 @@ static PProcessIdToSessionId pProcessIdToSessionId = 0; #if defined(Q_OS_UNIX) #include #endif +#if defined(Q_OS_OS2) +#include +#endif #include diff --git a/src/src.pro b/src/src.pro index 4b265f938..2adcbe933 100644 --- a/src/src.pro +++ b/src/src.pro @@ -12,7 +12,7 @@ CONFIG += qt \ # Update this VERSION for each release os2 { - DEFINES += VERSION=\'\"v2.2.9\'\" + DEFINES += VERSION=\'\"v2.2.9\"\' } else { DEFINES += VERSION=\\\"v2.2.9\\\" } @@ -191,12 +191,16 @@ win32 { } -os2:LIBS += -ltorrent-rasterbar \ +os2 { + LIBS += -ltorrent-rasterbar \ -lboost_thread \ -lboost_system \ -lboost_filesystem \ -lssl -lcrypto -lidn -lpthread + RC_FILE = qbittorrent_os2.rc +} + !contains(DEFINES, DISABLE_GUI) { win32 { DEFINES += WITH_GEOIP_EMBEDDED diff --git a/src/torrentadditiondlg.h b/src/torrentadditiondlg.h index d3a94cabe..85fedb4e8 100644 --- a/src/torrentadditiondlg.h +++ b/src/torrentadditiondlg.h @@ -94,7 +94,7 @@ public: readSettings(); //torrentContentList->header()->setResizeMode(0, QHeaderView::Stretch); QString display_path = Preferences::getSavePath(); -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) display_path = display_path.replace("/", "\\"); #endif savePathTxt->setText(display_path); @@ -414,7 +414,7 @@ public slots: void on_browseButton_clicked(){ QString dir; QString save_path = savePathTxt->text(); -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) save_path = save_path.replace("\\", "/"); #endif save_path = misc::expandPath(save_path); @@ -425,7 +425,7 @@ public slots: dir = QFileDialog::getExistingDirectory(this, tr("Choose save path"), QDir::homePath()); } if(!dir.isNull()){ -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) dir = dir.replace("/", "\\"); #endif savePathTxt->setText(dir); @@ -452,7 +452,7 @@ public slots: return; } QString save_path = savePathTxt->text(); -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_OS2) save_path = save_path.replace("\\", "/"); #endif QDir savePath(misc::expandPath(save_path));