diff --git a/src/downloadingTorrents.cpp b/src/downloadingTorrents.cpp index c70df0e1d..e447da139 100644 --- a/src/downloadingTorrents.cpp +++ b/src/downloadingTorrents.cpp @@ -182,7 +182,7 @@ void DownloadingTorrents::deleteTorrent(QString hash) { } // Update Info Bar information -void DownloadingTorrents::setInfoBar(QString info, QString color) { +void DownloadingTorrents::setInfoBar(QString info, QColor color) { static unsigned int nbLines = 0; ++nbLines; // Check log size, clear it if too big @@ -190,7 +190,7 @@ void DownloadingTorrents::setInfoBar(QString info, QString color) { infoBar->clear(); nbLines = 1; } - infoBar->append(QString::fromUtf8("")+ QTime::currentTime().toString(QString::fromUtf8("hh:mm:ss")) + QString::fromUtf8(" - ") + info + QString::fromUtf8("")); + infoBar->append(QString::fromUtf8("")+ QTime::currentTime().toString(QString::fromUtf8("hh:mm:ss")) + QString::fromUtf8(" - ") + info + QString::fromUtf8("")); } void DownloadingTorrents::addFastResumeRejectedAlert(QString name) { @@ -663,10 +663,10 @@ void DownloadingTorrents::portListeningFailure() { } // Set the color of a row in data model -void DownloadingTorrents::setRowColor(int row, QString color) { +void DownloadingTorrents::setRowColor(int row, QColor color) { unsigned int nbColumns = DLListModel->columnCount()-1; for(unsigned int i=0; isetData(DLListModel->index(row, i), QVariant(QColor(color)), Qt::ForegroundRole); + DLListModel->setData(DLListModel->index(row, i), QVariant(color), Qt::ForegroundRole); } } diff --git a/src/downloadingTorrents.h b/src/downloadingTorrents.h index 4533c862e..9db8a23b5 100644 --- a/src/downloadingTorrents.h +++ b/src/downloadingTorrents.h @@ -76,13 +76,13 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{ void torrentDuplicate(QString path); void torrentCorrupted(QString path); void portListeningFailure(); - void setRowColor(int row, QString color); + void setRowColor(int row, QColor color); void displayDownloadingUrlInfos(QString url); void showProperties(const QModelIndex &index); public slots: void updateDlList(); - void setInfoBar(QString info, QString color="black"); + void setInfoBar(QString info, QColor color=QPalette::WindowText); void pauseTorrent(QString hash); void resumeTorrent(QString hash); void updateRatio();