- Removed some useless debug in downloadThread and added a little more interesting one

- Updated TODO
This commit is contained in:
Christophe Dumez 2007-07-22 04:14:44 +00:00
parent e1e28fa9ff
commit d3793d180c
3 changed files with 6 additions and 12 deletions

4
TODO
View File

@ -39,10 +39,10 @@
- Fix all (or almost all) opened bugs in bug tracker - Fix all (or almost all) opened bugs in bug tracker
- Fix column sorting with Qt 4.3 - Reported to Trolltech, waiting for their fix - Fix column sorting with Qt 4.3 - Reported to Trolltech, waiting for their fix
- update sorting when a new torrent is added? - update sorting when a new torrent is added?
- Allow to hide columns (gtsoul?) - Allow to hide columns?
- Complete documentation and english translation - Complete documentation and english translation
* beta3 * beta3
- Windows port (Chris - GTSoul - Peerkoel) - Windows port (Chris - Peerkoel)
- Translations update - Translations update
* beta2 * beta2
- Improve RSS code + cleanup (chris) - Improve RSS code + cleanup (chris)

View File

@ -68,11 +68,8 @@ class downloadThread : public QThread {
void downloadUrl(const QString& url){ void downloadUrl(const QString& url){
QMutexLocker locker(&mutex); QMutexLocker locker(&mutex);
qDebug("In Download thread function, mutex locked");
url_list << url; url_list << url;
qDebug("In Download thread function, mutex unlocked (url added)");
if(!isRunning()){ if(!isRunning()){
qDebug("In Download thread function, Launching thread (was stopped)");
start(); start();
}else{ }else{
condition.wakeOne(); condition.wakeOne();
@ -112,11 +109,9 @@ class downloadThread : public QThread {
if(abort) if(abort)
return; return;
mutex.lock(); mutex.lock();
qDebug("In Download thread RUN, mutex locked");
if(url_list.size() != 0){ if(url_list.size() != 0){
QString url = url_list.takeFirst(); QString url = url_list.takeFirst();
mutex.unlock(); mutex.unlock();
qDebug("In Download thread RUN, mutex unlocked (got url)");
// XXX: Trick to get a unique filename // XXX: Trick to get a unique filename
QString filePath; QString filePath;
QTemporaryFile *tmpfile = new QTemporaryFile(); QTemporaryFile *tmpfile = new QTemporaryFile();
@ -151,12 +146,10 @@ class downloadThread : public QThread {
dest_file.close(); dest_file.close();
url_stream.close(); url_stream.close();
emit downloadFinished(url, filePath); emit downloadFinished(url, filePath);
qDebug("In Download thread RUN, signal emitted"); qDebug("download completed here: %s", (const char*)filePath.toUtf8());
}else{ }else{
qDebug("In Download thread RUN, mutex still locked (no urls) -> sleeping");
condition.wait(&mutex); condition.wait(&mutex);
mutex.unlock(); mutex.unlock();
qDebug("In Download thread RUN, woke up, mutex unlocked");
} }
} }
} }

View File

@ -149,6 +149,7 @@ class RssStream : public QObject{
// display the icon in the rss window // display the icon in the rss window
void displayIcon(const QString&, const QString& file_path) { void displayIcon(const QString&, const QString& file_path) {
iconPath = file_path; iconPath = file_path;
qDebug("Icon tmp path is %s", (const char*) file_path.toUtf8());
openIcon(); openIcon();
emit refreshFinished(url, ICON); emit refreshFinished(url, ICON);
} }
@ -175,7 +176,7 @@ class RssStream : public QObject{
delete downloaderIcon; delete downloaderIcon;
if(QFile::exists(filePath)) if(QFile::exists(filePath))
QFile::remove(filePath); QFile::remove(filePath);
if(QFile::exists(iconPath) && iconPath!=":/Icons/rss.png") if(QFile::exists(iconPath) && !iconPath.startsWith(":/"))
QFile::remove(iconPath); QFile::remove(iconPath);
} }