X-Git-Url: http://git.maemo.org/git/?p=qtrapids;a=blobdiff_plain;f=src%2Fgui%2FMainWindow.cpp;h=4ccddd9b8a12d9d5e3d97e67ff59c8d78162fb41;hp=d45cc96c211e59190ba728d8851d03f9696c5a7b;hb=f291a99270f6f9ac0f2bd89880a9c27a267a8716;hpb=08828f51a534f17235944d186b8f1b0c69696e1b diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index d45cc96..4ccddd9 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -37,7 +37,8 @@ const QString ABOUT_TEXT = QString(QObject::trUtf8("QtRapids, a simple BitTorrent client based on" "\nQt and Libtorrent." "\n\nURL: http://qtrapids.garage.maemo.org/" - "\n\nAuthor(s):\nLassi Väätämöinen, lassi.vaatamoinen@ixonos.com" + "\n\nAuthors:\nLassi Väätämöinen, lassi.vaatamoinen@ixonos.com" + "\nDenis Zalievsky, denis.zalewsky@ixonos.com" "\n\nIxonos Plc, Finland\n")); @@ -128,7 +129,7 @@ void MainWindow::on_openAction_clicked() void MainWindow::on_removeAction_clicked() { - QTorrentHandle handle = dlView_->removeSelected(); + qtrapids::QTorrentHandle handle = dlView_->removeSelected(); btSession_.removeTorrent(handle); } @@ -161,7 +162,9 @@ void MainWindow::on_aboutQtAction_clicked() void MainWindow::on_downloadItemSelectionChanged() { +#ifdef QTRAPIDS_DEBUG qDebug() << "MainWindow::on_seedItemSelectionChanged():" << dlView_->currentItem(); +#endif if (dlView_->currentItem() != NULL) { emit(itemSelected(true)); } else { @@ -171,7 +174,9 @@ void MainWindow::on_downloadItemSelectionChanged() void MainWindow::on_seedItemSelectionChanged() { +#ifdef QTRAPIDS_DEBUG qDebug() << "MainWindow::on_seedItemSelectionChanged():" << seedView_->currentItem(); +#endif if (seedView_->currentItem() != NULL) { emit(itemSelected(true)); } else { @@ -190,7 +195,9 @@ void MainWindow::handleToolBarAction(QAction* action) void MainWindow::on_torrentFileSelected(const QString& file) { +#ifdef QTRAPIDS_DEBUG qDebug() << " MainWindow::on_torrentFileSelected(): " << file; +#endif // Torrent filename empty, do nothing. if (file == "") { return; @@ -205,24 +212,30 @@ void MainWindow::on_torrentFileSelected(const QString& file) // save_path is the only mandatory parameter, rest are optional. addParams.save_path = boost::filesystem::path(settings_.value("download/directory").toString().toStdString()); //addParams.storage_mode = libtorrent::storage_mode_allocate; - QTorrentHandle handle = btSession_.addTorrent(addParams); + qtrapids::QTorrentHandle handle = btSession_.addTorrent(addParams); dlView_->newItem(handle); // torrentHandles_.push_back(handlePtr); +#ifdef QTRAPIDS_DEBUG qDebug() << "Is valid: " << handle.isValid(); +#endif } void MainWindow::on_alert(std::auto_ptr al) { + + if (al.get() != NULL) { - qDebug() - << "MainWindow::on_torrentAlert(): " - << QString::fromStdString(al->message()); - +// qDebug() +// << "MainWindow::on_torrentAlert(): " +// << QString::fromStdString(al->message()); + TorrentAlert *torrentAlert = dynamic_cast (al.get()); + if (torrentAlert) { - dlView_->updateItem(QTorrentHandle(torrentAlert->handle)); + qtrapids::QTorrentHandle torrentHandle = qtrapids::QTorrentHandle(torrentAlert->handle); + dlView_->updateItem(qtrapids::QTorrentHandle(torrentAlert->handle)); } } @@ -232,7 +245,7 @@ void MainWindow::on_alert(std::auto_ptr al) } /* -bool MainWindow::IsNewTorrent(std::auto_ptr handlePtr) +bool MainWindow::IsNewTorrent(std::auto_ptr handlePtr) { for (unsigned i = 0; i < torrentHandles_.size(); ++i) { if (torrentHandles_.at(i).get() == handlePtr.get()) {