1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 11:19:18 +01:00

Fix a bounds check in PlaylistTabBar, convert a couple more things to use qLog()

This commit is contained in:
David Sansome 2011-04-22 17:07:57 +00:00
parent 3eedc916ad
commit df05bf1195
3 changed files with 9 additions and 5 deletions

View File

@ -19,6 +19,7 @@
#include "albumcoverfetchersearch.h"
#include "coverprovider.h"
#include "coverproviders.h"
#include "core/logging.h"
#include <QMutexLocker>
#include <QNetworkReply>
@ -87,8 +88,10 @@ void AlbumCoverFetcherSearch::ProviderSearchFinished() {
results_.append(partial_results);
} else {
QString contents(reply->readAll());
qDebug() << "CoverProvider\'s request error - summary:\n" << reply->errorString()
<< "\nCoverProvider\'s request error - contents:\n" << contents;
qLog(Debug) << "CoverProvider's request error - summary:";
qLog(Debug) << reply->errorString();
qLog(Debug) << "CoverProvider's request error - contents:";
qLog(Debug) << contents;
}
// do we have more providers left?

View File

@ -20,6 +20,7 @@
#include "playlisttabbar.h"
#include "playlistview.h"
#include "songmimedata.h"
#include "core/logging.h"
#include "radio/radiomimedata.h"
#include "ui/iconloader.h"
#include "widgets/renametablineedit.h"
@ -178,8 +179,8 @@ void PlaylistTabBar::set_current_id(int id) {
}
int PlaylistTabBar::id_of(int index) const {
if (index<0 || index>count()) {
qWarning() << "Playlist tab index requested is out of bounds!";
if (index < 0 || index >= count()) {
qLog(Warning) << "Playlist tab index requested is out of bounds!";
return 0;
}
return tabData(index).toInt();

View File

@ -391,7 +391,7 @@ void LastFMService::StreamMetadataReady() {
}
void LastFMService::TunerError(lastfm::ws::Error error) {
qDebug() << "Last.fm error" << error;
qLog(Warning) << "Last.fm error" << error;
if (!initial_tune_)
return;