Commit cbf2fe3d authored by Laurent Montel's avatar Laurent Montel 😁

Adapt to new KWarning/kFatal/kDebug api

svn path=/trunk/KDE/kdemultimedia/juk/; revision=695882
parent bfc1a8f8
......@@ -33,7 +33,7 @@ namespace ActionCollection
#ifndef NO_DEBUG
QAction *a = actions()->action(key);
if(!a)
kWarning(65432) << "KAction \"" << key << "\" is not defined yet." << endl;
kWarning(65432) << "KAction \"" << key << "\" is not defined yet.";
return a;
#else
return actions()->action(key);
......
......@@ -176,7 +176,7 @@ void CoverInfo::applyCoverToWholeAlbum(bool overwriteExistingCovers) const
if(!overwriteExistingCovers && !(*it)->file().coverInfo()->m_needsConverting)
continue;
kDebug(65432) << "Setting cover for: " << *it << endl;
kDebug(65432) << "Setting cover for: " << *it;
(*it)->file().coverInfo()->setCoverId(m_coverKey);
}
}
......@@ -254,7 +254,7 @@ QString CoverInfo::coverLocation(CoverSize size) const
bool CoverInfo::convertOldStyleCover() const
{
// Ah, old-style cover. Let's transfer it to the new system.
kDebug() << "Found old style cover for " << m_file.absFilePath() << endl;
kDebug() << "Found old style cover for " << m_file.absFilePath();
QString artist = m_file.tag()->artist();
QString album = m_file.tag()->album();
......
......@@ -140,14 +140,14 @@ void CoverManagerPrivate::createDataDir() const
void CoverManagerPrivate::saveCovers() const
{
kDebug() << k_funcinfo << endl;
kDebug() << k_funcinfo;
// Make sure the directory exists first.
createDataDir();
QFile file(coverLocation());
kDebug() << "Opening covers db: " << coverLocation() << endl;
kDebug() << "Opening covers db: " << coverLocation();
if(!file.open(QIODevice::WriteOnly)) {
kError() << "Unable to save covers to disk!\n";
......@@ -177,7 +177,7 @@ void CoverManagerPrivate::saveCovers() const
void CoverManagerPrivate::loadCovers()
{
kDebug() << k_funcinfo << endl;
kDebug() << k_funcinfo;
QFile file(coverLocation());
......@@ -385,7 +385,7 @@ QPixmap CoverManager::coverFromData(const CoverData &coverData, Size size)
coverKey CoverManager::addCover(const QPixmap &large, const QString &artist, const QString &album)
{
kDebug() << k_funcinfo << endl;
kDebug() << k_funcinfo;
coverKey id = data()->nextId();
CoverDataPtr coverData(new CoverData);
......@@ -400,7 +400,7 @@ coverKey CoverManager::addCover(const QPixmap &large, const QString &artist, con
QString ext = QString("/coverdb/coverID-%1.png").arg(id);
coverData->path = KGlobal::dirs()->saveLocation("appdata") + ext;
kDebug() << "Saving pixmap to " << coverData->path << endl;
kDebug() << "Saving pixmap to " << coverData->path;
data()->createDataDir();
if(!large.save(coverData->path, "PNG")) {
......
......@@ -101,7 +101,7 @@ FileHandle::FileHandle(const FileHandle &f) :
d(f.d)
{
if(!d) {
kDebug(65432) << "The source FileHandle was not initialized." << endl;
kDebug(65432) << "The source FileHandle was not initialized.";
d = null().d;
}
d->ref();
......
This diff is collapsed.
......@@ -98,7 +98,7 @@ JuK::JuK(QWidget *parent) :
JuK::~JuK()
{
kDebug(65432) << k_funcinfo << endl;
kDebug(65432) << k_funcinfo;
}
KActionCollection *JuK::actionCollection() const
......@@ -436,7 +436,7 @@ bool JuK::queryExit()
{
m_startDocked = !isVisible();
kDebug(65432) << k_funcinfo << endl;
kDebug(65432) << k_funcinfo;
hide();
......@@ -454,7 +454,7 @@ bool JuK::queryExit()
bool JuK::queryClose()
{
kDebug(65432) << k_funcinfo << endl;
kDebug(65432) << k_funcinfo;
if(!m_shuttingDown &&
!kapp->sessionSaving() &&
......@@ -488,7 +488,7 @@ void JuK::slotAboutToQuit()
void JuK::slotQuit()
{
kDebug(65432) << k_funcinfo << endl;
kDebug(65432) << k_funcinfo;
m_shuttingDown = true;
kapp->quit();
......
......@@ -72,7 +72,7 @@ class PlaylistAction : public KAction
protected slots:
void slotActivated()
{
kDebug(65432) << k_funcinfo << endl;
kDebug(65432) << k_funcinfo;
// Determine current playlist, and call its slot.
Playlist *p = PlaylistCollection::instance()->visiblePlaylist();
......
......@@ -493,7 +493,7 @@ int KTRMLookup::fileId() const
void KTRMLookup::recognized()
{
kDebug() << k_funcinfo << d->file << endl;
kDebug() << k_funcinfo << d->file;
d->results.clear();
......@@ -519,7 +519,7 @@ void KTRMLookup::recognized()
void KTRMLookup::unrecognized()
{
kDebug() << k_funcinfo << d->file << endl;
kDebug() << k_funcinfo << d->file;
#if HAVE_TUNEPIMP >= 4
char trm[255];
bool finish = false;
......@@ -550,12 +550,12 @@ void KTRMLookup::unrecognized()
void KTRMLookup::collision()
{
#if HAVE_TUNEPIMP && HAVE_TUNEPIMP < 5
kDebug() << k_funcinfo << d->file << endl;
kDebug() << k_funcinfo << d->file;
track_t track = tp_GetTrack(KTRMRequestHandler::instance()->tunePimp(), d->fileId);
if(track <= 0) {
kDebug() << "invalid track number" << endl;
kDebug() << "invalid track number";
return;
}
......@@ -569,17 +569,17 @@ void KTRMLookup::collision()
switch(type) {
case eNone:
kDebug() << k_funcinfo << "eNone" << endl;
kDebug() << k_funcinfo << "eNone";
break;
case eArtistList:
kDebug() << "eArtistList" << endl;
kDebug() << "eArtistList";
break;
case eAlbumList:
kDebug() << "eAlbumList" << endl;
kDebug() << "eAlbumList";
break;
case eTrackList:
{
kDebug() << "eTrackList" << endl;
kDebug() << "eTrackList";
albumtrackresult_t **tracks = (albumtrackresult_t **) results;
d->results.clear();
......@@ -604,7 +604,7 @@ void KTRMLookup::collision()
break;
}
case eMatchedTrack:
kDebug() << k_funcinfo << "eMatchedTrack" << endl;
kDebug() << k_funcinfo << "eMatchedTrack";
break;
}
......@@ -699,7 +699,7 @@ void KTRMLookup::lookupResult( KJob* job )
void KTRMLookup::error()
{
kDebug() << k_funcinfo << d->file << endl;
kDebug() << k_funcinfo << d->file;
d->results.clear();
finished();
......
......@@ -290,7 +290,7 @@ void PlayerManager::play(const FileHandle &file)
// Make sure that the player() actually starts before doing anything.
if(!playing()) {
kWarning(65432) << "Unable to play " << file.absFilePath() << endl;
kWarning(65432) << "Unable to play " << file.absFilePath();
stop();
return;
}
......@@ -470,7 +470,7 @@ void PlayerManager::slotNeedNextUrl()
FileHandle nextFile = m_playlistInterface->currentFile();
if(!nextFile.isNull())
{
//kDebug() << k_funcinfo << m_file.absFilePath() << endl;
//kDebug() << k_funcinfo << m_file.absFilePath();
m_file = nextFile;
m_media->enqueue(KUrl::fromPath(m_file.absFilePath()));
}
......@@ -481,7 +481,7 @@ void PlayerManager::slotFinished()
{
if(m_file.isNull())
{
//kDebug() << k_funcinfo << "ignoring finished signal" << endl;
//kDebug() << k_funcinfo << "ignoring finished signal";
return;
}
m_playlistInterface->playNext();
......@@ -560,7 +560,7 @@ void PlayerManager::setup()
!action("forward") ||
!action("trackPositionAction"))
{
kWarning(65432) << k_funcinfo << "Could not find all of the required actions." << endl;
kWarning(65432) << k_funcinfo << "Could not find all of the required actions.";
return;
}
......
......@@ -2168,7 +2168,7 @@ void Playlist::slotShowRMBMenu(Q3ListViewItem *item, const QPoint &point, int co
void Playlist::slotRenameTag()
{
// kDebug(65432) << "Playlist::slotRenameTag()" << endl;
// kDebug(65432) << "Playlist::slotRenameTag()";
// setup completions and validators
......
......@@ -355,7 +355,7 @@ void PlaylistCollection::open(const QString &playlist, const QStringList &files)
void PlaylistCollection::addFolder()
{
kDebug(65432) << k_funcinfo << endl;
kDebug(65432) << k_funcinfo;
DirectoryList l(m_folderList, m_importPlaylists, JuK::JuKInstance());
DirectoryList::Result result = l.exec();
......
......@@ -71,7 +71,7 @@ void SearchPlaylist::updateItems()
newItems.append(item->collectionItem());
}
// kDebug(65432) << k_funcinfo << "newItems.size() == " << newItems.size() << endl;
// kDebug(65432) << k_funcinfo << "newItems.size() == " << newItems.size();
foreach(PlaylistItem *item, oldItems)
clearItem(item, false);
......@@ -82,7 +82,7 @@ void SearchPlaylist::updateItems()
createItems(newItems);
if(synchronizePlaying()) {
kDebug(65432) << k_funcinfo << "synchronizing playing" << endl;
kDebug(65432) << k_funcinfo << "synchronizing playing";
synchronizePlayingItems(m_search.playlists(), true);
}
}
......
......@@ -72,7 +72,7 @@ Tag::Tag(const QString &fileName) :
}
#ifdef TAGLIB_1_3
else if(MediaFiles::isMPC(fileName)) {
kDebug(65432) << "Trying to resolve Musepack file" << endl;
kDebug(65432) << "Trying to resolve Musepack file";
TagLib::MPC::File file(QFile::encodeName(fileName).data());
if(file.isValid())
setup(&file);
......
......@@ -98,8 +98,8 @@ QString TagRenamerOptions::tagTypeText(TagType type, bool translate)
};
if(type < StartTag || type >= NumTypes) {
kWarning() << "I don't know what category we're looking up, this is a problem." << endl;
kWarning() << "The category ID is " << (unsigned) type << endl;
kWarning() << "I don't know what category we're looking up, this is a problem.";
kWarning() << "The category ID is " << (unsigned) type;
return translate ? i18n("Unknown") : "Unknown";
}
......
......@@ -141,7 +141,7 @@ bool TagTransactionManager::renameFile(const QFileInfo &from, const QFileInfo &t
i18n("This file already exists.\nDo you want to replace it?"),
i18n("File Exists"),KGuiItem(i18n("Replace"))) == KMessageBox::Continue)
{
kDebug(65432) << "Renaming " << from.absoluteFilePath() << " to " << to.absoluteFilePath() << endl;
kDebug(65432) << "Renaming " << from.absoluteFilePath() << " to " << to.absoluteFilePath();
QDir currentDir;
return currentDir.rename(from.absoluteFilePath(), to.absoluteFilePath());
}
......
......@@ -85,7 +85,7 @@ void TreeViewItemPlaylist::retag(const QStringList &files, Playlist *)
break;
default:
kDebug() << "Unhandled column type editing " << *it << endl;
kDebug() << "Unhandled column type editing " << *it;
}
TagTransactionManager::instance()->changeTagOnItem(item, tag);
......
......@@ -328,7 +328,7 @@ void TreeViewMode::removeItem(const QString &item, unsigned column)
else if(column == PlaylistItem::AlbumColumn)
itemKey = "albums" + item;
else {
kWarning() << k_funcinfo << "Unhandled column type " << column << endl;
kWarning() << k_funcinfo << "Unhandled column type " << column;
return;
}
......@@ -360,7 +360,7 @@ void TreeViewMode::addItems(const QStringList &items, unsigned column)
else if(column == PlaylistItem::AlbumColumn)
searchCategory = "albums";
else {
kWarning() << k_funcinfo << "Unhandled column type " << column << endl;
kWarning() << k_funcinfo << "Unhandled column type " << column;
return;
}
......
......@@ -104,7 +104,7 @@ void WebImageFetcher::slotLoadImageURLs()
url.addQueryItem("query", d->searchString);
url.addQueryItem("results", "25");
kDebug(65432) << "Using request " << url.encodedPathAndQuery() << endl;
kDebug(65432) << "Using request " << url.encodedPathAndQuery();
d->connection = KIO::storedGet(url, true /* reload always */);
connect(d->connection, SIGNAL(result(KJob *)), SLOT(slotWebRequestFinished(KJob *)));
......@@ -114,7 +114,7 @@ void WebImageFetcher::slotLoadImageURLs()
void WebImageFetcher::slotWebRequestFinished(KJob *job)
{
kDebug(65432) << k_funcinfo << endl;
kDebug(65432) << k_funcinfo;
if(job != d->connection)
return;
......@@ -220,7 +220,7 @@ void WebImageFetcher::slotCoverChosen()
return;
}
kDebug(65432) << "Adding new cover for " << d->file.tag()->fileName() << endl;
kDebug(65432) << "Adding new cover for " << d->file.tag()->fileName();
coverKey newId = CoverManager::addCover(pixmap, d->file.tag()->artist(), d->file.tag()->album());
emit signalCoverChanged(newId);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment