+ 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<Alert> al)
+{
+
+
+ if (al.get() != NULL) {
+// qDebug()
+// << "MainWindow::on_torrentAlert(): "
+// << QString::fromStdString(al->message());
+
+ TorrentAlert *torrentAlert
+ = dynamic_cast<TorrentAlert*> (al.get());
+
+ if (torrentAlert) {
+ QTorrentHandle torrentHandle = QTorrentHandle(torrentAlert->handle);
+ dlView_->updateItem(QTorrentHandle(torrentAlert->handle));
+ }
+
+ }
+
+
+
+}
+
+/*
+bool MainWindow::IsNewTorrent(std::auto_ptr<QTorrentHandle> handlePtr)
+{
+ for (unsigned i = 0; i < torrentHandles_.size(); ++i) {
+ if (torrentHandles_.at(i).get() == handlePtr.get()) {
+ return false;
+ } else {
+ return true;
+ }
+ }