Commit 1982074a authored by Michael Pyne's avatar Michael Pyne
Browse files

Take advantage of dfaure's kdelibs feature to dynamic debug areas by

removing usage of hardcoded debug areas in JuK.

svn path=/trunk/KDE/kdemultimedia/juk/; revision=1012680
parent 5256f08d
......@@ -25,7 +25,6 @@ configure_file (config-juk.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-juk.h )
# hack, should taglib maybe give the .. directory as well in it's config file?
include_directories( ${TAGLIB_INCLUDES} ${TAGLIB_INCLUDES}/.. )
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=65432)
add_definitions(-DQT3_SUPPORT -DQT3_SUPPORT_WARNINGS -DQT_STL)
set(tunepimp_SRCS)
......@@ -136,4 +135,4 @@ install( FILES jukservicemenu.desktop DESTINATION
${SERVICES_INSTALL_DIR}/ServiceMenus )
install( FILES org.kde.juk.collection.xml org.kde.juk.player.xml org.kde.juk.search.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} )
kde4_install_icons( ${ICON_INSTALL_DIR} )
\ No newline at end of file
kde4_install_icons( ${ICON_INSTALL_DIR} )
......@@ -33,7 +33,7 @@ namespace ActionCollection
#ifndef NO_DEBUG
QAction *a = actions()->action(key);
if(!a)
kWarning(65432) << "KAction \"" << key << "\" is not defined yet.";
kWarning() << "KAction \"" << key << "\" is not defined yet.";
return a;
#else
return actions()->action(key);
......
......@@ -78,7 +78,7 @@ void Cache::save()
KSaveFile f(cacheFileName);
if(!f.open(QIODevice::WriteOnly)) {
kError(65432) << "Error saving cache:" << f.errorString();
kError() << "Error saving cache:" << f.errorString();
return;
}
......@@ -102,7 +102,7 @@ void Cache::save()
f.close();
if(!f.finalize())
kError(65432) << "Error saving cache:" << f.errorString();
kError() << "Error saving cache:" << f.errorString();
}
void Cache::loadPlaylists(PlaylistCollection *collection) // static
......@@ -119,7 +119,7 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
qint32 version;
fs >> version;
kDebug(65432) << "Playlists file is version" << version;
kDebug() << "Playlists file is version" << version;
switch(version) {
case 3:
......@@ -218,7 +218,7 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
} // try
catch(BICStreamException &) {
kError(65432) << "Exception loading playlists - binary incompatible stream.";
kError() << "Exception loading playlists - binary incompatible stream.";
// Delete created playlists which probably have junk now.
foreach(Playlist *p, createdPlaylists)
......@@ -226,7 +226,7 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
createdPlaylists.clear();
if(dataStreamVersion == QDataStream::Qt_3_3) {
kError(65432) << "Attempting other binary protocol - Qt 4.3";
kError() << "Attempting other binary protocol - Qt 4.3";
dataStreamVersion = QDataStream::Qt_4_3;
break; // escape from while(!s.atEnd()) to try again
......@@ -234,14 +234,14 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
#if QT_VERSION >= 0x040400
// Unlikely, but maybe user had Qt 4.4 with KDE 4.0.0?
else if(dataStreamVersion == QDataStream::Qt_4_3) {
kError(65432) << "Attempting other binary protocol - Qt 4.4";
kError() << "Attempting other binary protocol - Qt 4.4";
dataStreamVersion = QDataStream::Qt_4_4;
break;
}
#endif
// We tried 3.3 first, if 4.3/4.4 doesn't work who knows...
kError(65432) << "Unable to recover, no playlists will be loaded.";
kError() << "Unable to recover, no playlists will be loaded.";
return;
} // catch
} // while dataStreamVersion != -1
......@@ -273,7 +273,7 @@ void Cache::savePlaylists(const PlaylistList &playlists)
KSaveFile f(playlistsFile);
if(!f.open(QIODevice::WriteOnly)) {
kError(65432) << "Error saving collection:" << f.errorString();
kError() << "Error saving collection:" << f.errorString();
return;
}
......@@ -317,7 +317,7 @@ void Cache::savePlaylists(const PlaylistList &playlists)
f.close();
if(!f.finalize())
kError(65432) << "Error saving collection:" << f.errorString();
kError() << "Error saving collection:" << f.errorString();
}
bool Cache::cacheFileExists() // static
......
......@@ -138,7 +138,7 @@ void CollectionList::setupTreeViewEntries(ViewMode *viewMode) const
{
TreeViewMode *treeViewMode = dynamic_cast<TreeViewMode *>(viewMode);
if(!treeViewMode) {
kWarning(65432) << "Can't setup entries on a non-tree-view mode!\n";
kWarning() << "Can't setup entries on a non-tree-view mode!\n";
return;
}
......@@ -476,7 +476,7 @@ CollectionListItem::CollectionListItem(const FileHandle &file) :
kError() << "CollectionListItem::CollectionListItem() -- Tag() could not be created." << endl;
}
else
kError(65432) << "CollectionListItems should not be created before "
kError() << "CollectionListItems should not be created before "
<< "CollectionList::initialize() has been called." << endl;
SplashScreen::increment();
......
......@@ -153,12 +153,12 @@ void CoverDialog::removeSelectedCover()
CoverIconViewItem *coverItem = m_covers->currentItem();
if(!coverItem || !coverItem->isSelected()) {
kWarning(65432) << "No item selected for removeSelectedCover.\n";
kWarning() << "No item selected for removeSelectedCover.\n";
return;
}
if(!CoverManager::removeCover(coverItem->id()))
kError(65432) << "Unable to remove selected cover: " << coverItem->id() << endl;
kError() << "Unable to remove selected cover: " << coverItem->id() << endl;
else
delete coverItem;
}
......
......@@ -188,8 +188,6 @@ void CoverManagerPrivate::createDataDir() const
void CoverManagerPrivate::saveCovers() const
{
kDebug() ;
// Make sure the directory exists first.
createDataDir();
......@@ -229,8 +227,6 @@ void CoverManagerPrivate::saveCovers() const
void CoverManagerPrivate::loadCovers()
{
kDebug() ;
QFile file(coverLocation());
if(!file.open(QIODevice::ReadOnly)) {
......@@ -609,7 +605,7 @@ void CoverManager::setIdForTrack(const QString &path, coverKey id)
data()->tracks.remove(path);
if(data()->covers[oldId]->refCount == 0) {
kDebug(65432) << "Cover " << oldId << " is unused, removing.\n";
kDebug() << "Cover " << oldId << " is unused, removing.\n";
removeCover(oldId);
}
}
......
......@@ -101,7 +101,7 @@ FileHandle::FileHandle(const FileHandle &f) :
d(f.d)
{
if(!d) {
kDebug(65432) << "The source FileHandle was not initialized.";
kDebug() << "The source FileHandle was not initialized.";
d = null().d;
}
d->ref();
......
......@@ -396,12 +396,12 @@ void FileRenamerWidget::moveSignalMappings(int oldId, int newId)
bool FileRenamerWidget::removeRow(int id)
{
if(id >= m_rows.count()) {
kWarning(65432) << "Trying to remove row, but " << id << " is out-of-range.\n";
kWarning() << "Trying to remove row, but " << id << " is out-of-range.\n";
return false;
}
if(m_rows.count() == 1) {
kError(65432) << "Can't remove last row of File Renamer.\n";
kError() << "Can't remove last row of File Renamer.\n";
return false;
}
......@@ -523,12 +523,12 @@ void FileRenamerWidget::createTagRows()
for(; it != categoryOrder.constEnd(); ++it) {
if(*it < StartTag || *it >= NumTypes) {
kError(65432) << "Invalid category encountered in file renamer configuration.\n";
kError() << "Invalid category encountered in file renamer configuration.\n";
continue;
}
if(m_rows.count() == MAX_CATEGORIES) {
kError(65432) << "Maximum number of File Renamer tags reached, bailing.\n";
kError() << "Maximum number of File Renamer tags reached, bailing.\n";
break;
}
......@@ -709,7 +709,7 @@ void FileRenamerWidget::moveItem(int id, MovementDirection direction)
int FileRenamerWidget::idOfPosition(int position) const
{
if(position >= m_rows.count()) {
kError(65432) << "Search for position " << position << " out-of-range.\n";
kError() << "Search for position " << position << " out-of-range.\n";
return -1;
}
......@@ -717,7 +717,7 @@ int FileRenamerWidget::idOfPosition(int position) const
if(m_rows[i].position == position)
return i;
kError(65432) << "Unable to find identifier for position " << position << endl;
kError() << "Unable to find identifier for position " << position << endl;
return -1;
}
......@@ -727,7 +727,7 @@ int FileRenamerWidget::findIdentifier(const CategoryID &category) const
if(m_rows[index].category == category)
return index;
kError(65432) << "Unable to find match for category " <<
kError() << "Unable to find match for category " <<
TagRenamerOptions::tagTypeText(category.category) <<
", number " << category.categoryNumber << endl;
......@@ -777,7 +777,7 @@ void FileRenamerWidget::insertCategory()
{
TagType category = TagRenamerOptions::tagFromCategoryText(m_ui->m_category->currentText());
if(category == Unknown) {
kError(65432) << "Trying to add unknown category somehow.\n";
kError() << "Trying to add unknown category somehow.\n";
return;
}
......@@ -839,7 +839,7 @@ void FileRenamerWidget::slotRemoveRow(int id)
{
// Remove the given identified row.
if(!removeRow(id))
kError(65432) << "Unable to remove row " << id << endl;
kError() << "Unable to remove row " << id << endl;
}
//
......@@ -903,7 +903,7 @@ void FileRenamer::rename(const PlaylistItemList &items)
bool FileRenamer::moveFile(const QString &src, const QString &dest)
{
kDebug(65432) << "Moving file " << src << " to " << dest;
kDebug() << "Moving file " << src << " to " << dest;
if(src == dest)
return false;
......
......@@ -72,8 +72,6 @@ class PlaylistAction : public KAction
protected slots:
void slotActivated()
{
kDebug(65432) ;
// Determine current playlist, and call its slot.
Playlist *p = PlaylistCollection::instance()->visiblePlaylist();
if(!p)
......
......@@ -196,7 +196,7 @@ protected:
KUrl proxy = KProtocolManager::proxyFor("http");
QString proxyHost = proxy.host();
kDebug(65432) << "Using proxy server " << proxyHost << " for www.musicbrainz.org.\n";
kDebug() << "Using proxy server " << proxyHost << " for www.musicbrainz.org.\n";
tp_SetProxy(m_pimp, proxyHost.toAscii(), short(proxy.port()));
}
}
......
......@@ -151,7 +151,7 @@ QStringList MediaFiles::convertURLsToLocal(const KUrl::List &urlList, QWidget *w
localUrl = KIO::NetAccess::mostLocalUrl(url, w);
if(!localUrl.isLocalFile())
kDebug(65432) << localUrl << " is not a local file, skipping.\n";
kDebug() << localUrl << " is not a local file, skipping.\n";
else
result.append(localUrl.path());
}
......
......@@ -219,12 +219,12 @@ void CoverItem::dropEvent(QDropEvent *e)
update(m_file);
}
else
kError(65432) << "Unable to load image from " << urls.front() << endl;
kError() << "Unable to load image from " << urls.front() << endl;
KIO::NetAccess::removeTempFile(fileName);
}
else
kError(65432) << "Unable to download " << urls.front() << endl;
kError() << "Unable to download " << urls.front() << endl;
}
}
......
......@@ -508,7 +508,7 @@ void PlayerManager::setup()
!action("forward") ||
!action("trackPositionAction"))
{
kWarning(65432) << "Could not find all of the required actions.";
kWarning() << "Could not find all of the required actions.";
return;
}
......
......@@ -769,7 +769,7 @@ void Playlist::slotRefresh()
item->refreshFromDisk();
if(!item->file().tag() || !item->file().fileInfo().exists()) {
kDebug(65432) << "Error while trying to refresh the tag. "
kDebug() << "Error while trying to refresh the tag. "
<< "This file has probably been removed."
<< endl;
delete item->collectionItem();
......@@ -861,7 +861,7 @@ void Playlist::slotAddCover(bool retrieveLocal)
// Called when image fetcher has added a new cover.
void Playlist::slotCoverChanged(int coverId)
{
kDebug(65432) << "Refreshing information for newly changed covers.\n";
kDebug() << "Refreshing information for newly changed covers.\n";
refreshAlbums(selectedItems(), coverId);
}
......@@ -1624,7 +1624,7 @@ CollectionListItem *Playlist::collectionListItem(const FileHandle &file)
// If a valid tag was not created, destroy the CollectionListItem.
if(!item->isValid()) {
kError(65432) << "Playlist::createItem() -- A valid tag was not created for \""
kError() << "Playlist::createItem() -- A valid tag was not created for \""
<< file.absFilePath() << "\"" << endl;
delete item;
return 0;
......@@ -1830,9 +1830,6 @@ void Playlist::calculateColumnWeights()
foreach(int column, m_weightDirty) {
m_columnWeights[column] = int(sqrt(averageWidth[column]) + 0.5);
// kDebug(65432) << "m_columnWeights[" << column << "] == "
// << m_columnWeights[column] << endl;
}
m_weightDirty.clear();
......@@ -1903,7 +1900,7 @@ void Playlist::addFile(const QString &file, FileHandleList &files, bool importPl
::closedir(dir);
}
else {
kWarning(65432) << "Unable to open directory "
kWarning() << "Unable to open directory "
<< fileInfo.filePath()
<< ", make sure it is readable.\n";
}
......@@ -2187,8 +2184,6 @@ void Playlist::slotShowRMBMenu(Q3ListViewItem *item, const QPoint &point, int co
void Playlist::slotRenameTag()
{
// kDebug(65432) << "Playlist::slotRenameTag()";
// setup completions and validators
CollectionList *list = CollectionList::instance();
......
......@@ -389,7 +389,7 @@ void PlaylistBox::setDynamicListsFrozen(bool frozen)
void PlaylistBox::slotSavePlaylists()
{
kDebug(65432) << "Auto-saving playlists.\n";
kDebug() << "Auto-saving playlists.\n";
PlaylistList l;
CollectionList *collection = CollectionList::instance();
......@@ -405,7 +405,7 @@ void PlaylistBox::slotSavePlaylists()
void PlaylistBox::slotShowDropTarget()
{
if(!m_dropItem) {
kError(65432) << "Trying to show the playlist of a null item!\n";
kError() << "Trying to show the playlist of a null item!\n";
return;
}
......
......@@ -353,7 +353,6 @@ void PlaylistCollection::open(const QString &playlist, const QStringList &files)
void PlaylistCollection::addFolder()
{
kDebug(65432) ;
DirectoryList l(m_folderList, m_importPlaylists, JuK::JuKInstance());
DirectoryList::Result result = l.exec();
......
......@@ -72,8 +72,6 @@ void SearchPlaylist::updateItems()
newItems.append(item->collectionItem());
}
// kDebug(65432) << "newItems.size() == " << newItems.size();
foreach(PlaylistItem *item, oldItems)
clearItem(item, false);
......@@ -83,7 +81,7 @@ void SearchPlaylist::updateItems()
createItems(newItems);
if(synchronizePlaying()) {
kDebug(65432) << "synchronizing playing";
kDebug() << "synchronizing playing";
synchronizePlayingItems(m_search.playlists(), true);
}
}
......
......@@ -77,7 +77,7 @@ Tag::Tag(const QString &fileName) :
}
#ifdef TAGLIB_1_3
else if(MediaFiles::isMPC(fileName)) {
kDebug(65432) << "Trying to resolve Musepack file";
kDebug() << "Trying to resolve Musepack file";
TagLib::MPC::File file(QFile::encodeName(fileName).data());
if(file.isValid())
setup(&file);
......@@ -141,7 +141,7 @@ bool Tag::save()
#endif
}
else {
kError(65432) << "Couldn't save file." << endl;
kError() << "Couldn't save file." << endl;
result = false;
}
......
......@@ -72,7 +72,7 @@ TagTransactionManager *TagTransactionManager::instance()
void TagTransactionManager::changeTagOnItem(PlaylistItem *item, Tag *newTag)
{
if(!item) {
kWarning(65432) << "Trying to change tag on null PlaylistItem.\n";
kWarning() << "Trying to change tag on null PlaylistItem.\n";
return;
}
......@@ -111,7 +111,7 @@ void TagTransactionManager::forget()
bool TagTransactionManager::undo()
{
kDebug(65432) << "Undoing " << m_undoList.count() << " changes.\n";
kDebug() << "Undoing " << m_undoList.count() << " changes.\n";
forget(); // Scrap our old changes (although the list should be empty
// anyways.
......@@ -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();
kDebug() << "Renaming " << from.absoluteFilePath() << " to " << to.absoluteFilePath();
QDir currentDir;
return currentDir.rename(from.absoluteFilePath(), to.absoluteFilePath());
}
......
......@@ -111,8 +111,8 @@ void DefaultSequenceIterator::advance()
if(!m_albumSearch.isNull()) {
PlaylistItemList albumMatches = m_albumSearch.matchedItems();
if(albumMatches.isEmpty()) {
kError(65432) << "Unable to initialize album random play.\n";
kError(65432) << "List of potential results is empty.\n";
kError() << "Unable to initialize album random play.\n";
kError() << "List of potential results is empty.\n";
return; // item is still set to random song from a few lines earlier.
}
......@@ -132,7 +132,7 @@ void DefaultSequenceIterator::advance()
}
}
else
kError(65432) << "Unable to perform album random play on " << *item << endl;
kError() << "Unable to perform album random play on " << *item << endl;
}
else
item = m_randomItems[KRandom::random() % m_randomItems.count()];
......@@ -251,7 +251,7 @@ void DefaultSequenceIterator::refillRandomList(Playlist *p)
p = current()->playlist();
if(!p) {
kError(65432) << "Item has no playlist!\n";
kError() << "Item has no playlist!\n";
return;
}
}
......@@ -295,7 +295,7 @@ void DefaultSequenceIterator::initAlbumSearch(PlaylistItem *searchItem)
// search.
if(!searchItem->file().tag()->artist().isEmpty()) {
kDebug(65432) << "Searching both artist and album.\n";
kDebug() << "Searching both artist and album.";
columns[0] = PlaylistItem::ArtistColumn;
m_albumSearch.addComponent(PlaylistSearch::Component(
......
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