Fix cursor problem in torrent addition dialog

This commit is contained in:
Christophe Dumez
2011-02-24 17:17:30 +00:00
parent 64654705ca
commit 01725b1b55
2 changed files with 9 additions and 7 deletions

View File

@@ -3,6 +3,7 @@
- BUGFIX: Fix "append label to save path" (Windows) - BUGFIX: Fix "append label to save path" (Windows)
- BUGFIX: Disable OS cache for aligned files to reduce memory consumption - BUGFIX: Disable OS cache for aligned files to reduce memory consumption
- BUGFIX: Fix torrent upload from Web UI (Windows) - BUGFIX: Fix torrent upload from Web UI (Windows)
- BUGFIX: Fix cursor problem in torrent addition dialog
* Tue Feb 8 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.6.6 * Tue Feb 8 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.6.6
- FEATURE: IP address reported to trackers is now customizable - FEATURE: IP address reported to trackers is now customizable

View File

@@ -67,10 +67,10 @@ public:
public slots: public slots:
void on_uTorrentListButton_clicked() { void on_uTorrentListButton_clicked() {
downloadThread *d = new downloadThread(this); downloadThread *d = new downloadThread(this);
connect(d, SIGNAL(downloadFinished(QString,QString)), this, SLOT(parseUTorrentList(QString,QString))); connect(d, SIGNAL(downloadFinished(QString,QString)), SLOT(parseUTorrentList(QString,QString)));
connect(d, SIGNAL(downloadFailure(QString,QString)), this, SLOT(getTrackerError(QString,QString))); connect(d, SIGNAL(downloadFailure(QString,QString)), SLOT(getTrackerError(QString,QString)));
//Just to show that it takes times //Just to show that it takes times
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); setCursor(Qt::WaitCursor);
d->downloadUrl("http://www.torrentz.com/announce_"+h.hash()); d->downloadUrl("http://www.torrentz.com/announce_"+h.hash());
} }
@@ -78,6 +78,7 @@ public slots:
QFile list_file(path); QFile list_file(path);
if (!list_file.open(QFile::ReadOnly)) { if (!list_file.open(QFile::ReadOnly)) {
QMessageBox::warning(this, tr("I/O Error"), tr("Error while trying to open the downloaded file."), QMessageBox::Ok); QMessageBox::warning(this, tr("I/O Error"), tr("Error while trying to open the downloaded file."), QMessageBox::Ok);
setCursor(Qt::ArrowCursor);
return; return;
} }
QList<QUrl> existingTrackers; QList<QUrl> existingTrackers;
@@ -90,7 +91,7 @@ public slots:
} }
// Load from current user list // Load from current user list
QStringList tmp = trackers_list->toPlainText().split("\n"); QStringList tmp = trackers_list->toPlainText().split("\n");
foreach(QString user_url_str, tmp) { foreach(const QString &user_url_str, tmp) {
QUrl user_url(user_url_str); QUrl user_url(user_url_str);
if(!existingTrackers.contains(user_url)) if(!existingTrackers.contains(user_url))
existingTrackers << user_url; existingTrackers << user_url;
@@ -100,7 +101,7 @@ public slots:
trackers_list->insertPlainText("\n"); trackers_list->insertPlainText("\n");
int nb = 0; int nb = 0;
while (!list_file.atEnd()) { while (!list_file.atEnd()) {
QByteArray line = list_file.readLine().trimmed(); const QByteArray line = list_file.readLine().trimmed();
if(line.isEmpty()) continue; if(line.isEmpty()) continue;
QUrl url(line); QUrl url(line);
if (!existingTrackers.contains(url)) { if (!existingTrackers.contains(url)) {
@@ -112,7 +113,7 @@ public slots:
list_file.close(); list_file.close();
list_file.remove(); list_file.remove();
//To restore the cursor ... //To restore the cursor ...
QApplication::restoreOverrideCursor(); setCursor(Qt::ArrowCursor);
// Display information message if necessary // Display information message if necessary
if(nb == 0) { if(nb == 0) {
QMessageBox::information(this, tr("No change"), tr("No additional trackers were found."), QMessageBox::Ok); QMessageBox::information(this, tr("No change"), tr("No additional trackers were found."), QMessageBox::Ok);
@@ -121,7 +122,7 @@ public slots:
void getTrackerError(QString, QString error) { void getTrackerError(QString, QString error) {
//To restore the cursor ... //To restore the cursor ...
QApplication::restoreOverrideCursor(); setCursor(Qt::ArrowCursor);
QMessageBox::warning(this, tr("Download error"), tr("The trackers list could not be downloaded, reason: %1").arg(error), QMessageBox::Ok); QMessageBox::warning(this, tr("Download error"), tr("The trackers list could not be downloaded, reason: %1").arg(error), QMessageBox::Ok);
} }