Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
JuK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
JuK
Commits
6b804079
Commit
6b804079
authored
Aug 25, 2017
by
Michael Pyne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port away from kDebug.
parent
8e49c93e
Changes
33
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
230 additions
and
148 deletions
+230
-148
CMakeLists.txt
CMakeLists.txt
+1
-0
actioncollection.cpp
actioncollection.cpp
+4
-2
cache.cpp
cache.cpp
+12
-10
collectionlist.cpp
collectionlist.cpp
+15
-14
coverdialog.cpp
coverdialog.cpp
+3
-2
coverinfo.cpp
coverinfo.cpp
+2
-1
covermanager.cpp
covermanager.cpp
+18
-17
coverproxy.cpp
coverproxy.cpp
+4
-2
dbuscollectionproxy.cpp
dbuscollectionproxy.cpp
+2
-1
filehandle.cpp
filehandle.cpp
+6
-5
filerenamer.cpp
filerenamer.cpp
+13
-12
juk.cpp
juk.cpp
+7
-6
juk_debug.cpp
juk_debug.cpp
+21
-0
juk_debug.h
juk_debug.h
+26
-0
ktrm.cpp
ktrm.cpp
+11
-11
lyricswidget.cpp
lyricswidget.cpp
+5
-4
mediafiles.cpp
mediafiles.cpp
+3
-1
nowplaying.cpp
nowplaying.cpp
+3
-2
playermanager.cpp
playermanager.cpp
+4
-3
playlist.cpp
playlist.cpp
+4
-3
playlistbox.cpp
playlistbox.cpp
+8
-7
playlistsplitter.cpp
playlistsplitter.cpp
+3
-2
scrobbleconfigdlg.cpp
scrobbleconfigdlg.cpp
+3
-2
scrobbler.cpp
scrobbler.cpp
+7
-6
searchplaylist.cpp
searchplaylist.cpp
+2
-1
svghandler.cpp
svghandler.cpp
+3
-2
tag.cpp
tag.cpp
+6
-5
tagrenameroptions.cpp
tagrenameroptions.cpp
+4
-2
tagtransactionmanager.cpp
tagtransactionmanager.cpp
+4
-3
tracksequenceiterator.cpp
tracksequenceiterator.cpp
+6
-5
treeviewitemplaylist.cpp
treeviewitemplaylist.cpp
+2
-1
viewmode.cpp
viewmode.cpp
+3
-2
webimagefetcher.cpp
webimagefetcher.cpp
+15
-14
No files found.
CMakeLists.txt
View file @
6b804079
...
...
@@ -91,6 +91,7 @@ set(juk_SRCS ${tunepimp_SRCS}
webimagefetcher.cpp
historyplaylist.cpp
juk.cpp
juk_debug.cpp
keydialog.cpp
lyricswidget.cpp
main.cpp
...
...
actioncollection.cpp
View file @
6b804079
...
...
@@ -15,11 +15,13 @@
*/
#include "actioncollection.h"
#include "juk.h"
#include <kactioncollection.h>
#include <kdebug.h>
#include "juk.h"
#include "juk_debug.h"
namespace
ActionCollection
{
KActionCollection
*
actions
()
...
...
@@ -43,7 +45,7 @@ namespace ActionCollection
#ifndef NO_DEBUG
QAction
*
a
=
actions
()
->
action
(
key
);
if
(
!
a
)
kWarning
(
)
<<
"KAction
\"
"
<<
key
<<
"
\"
is not defined yet."
;
qCWarning
(
JUK_LOG
)
<<
"KAction
\"
"
<<
key
<<
"
\"
is not defined yet."
;
return
a
;
#else
return
actions
()
->
action
(
key
);
...
...
cache.cpp
View file @
6b804079
...
...
@@ -37,6 +37,8 @@
#include "folderplaylist.h"
#include "playlistcollection.h"
#include "actioncollection.h"
#include "juk.h"
#include "juk_debug.h"
using
namespace
ActionCollection
;
...
...
@@ -76,7 +78,7 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
qint32
version
;
fs
>>
version
;
kDebug
(
)
<<
"Playlists file is version"
<<
version
;
qCDebug
(
JUK_LOG
)
<<
"Playlists file is version"
<<
version
;
switch
(
version
)
{
case
3
:
...
...
@@ -183,7 +185,7 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
}
// try
catch
(
BICStreamException
&
)
{
kError
(
)
<<
"Exception loading playlists - binary incompatible stream."
;
qCCritical
(
JUK_LOG
)
<<
"Exception loading playlists - binary incompatible stream."
;
// Delete created playlists which probably have junk now.
foreach
(
Playlist
*
p
,
createdPlaylists
)
...
...
@@ -191,7 +193,7 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
createdPlaylists
.
clear
();
if
(
dataStreamVersion
==
QDataStream
::
Qt_3_3
)
{
kError
(
)
<<
"Attempting other binary protocol - Qt 4.3"
;
qCCritical
(
JUK_LOG
)
<<
"Attempting other binary protocol - Qt 4.3"
;
dataStreamVersion
=
QDataStream
::
Qt_4_3
;
break
;
// escape from while(!s.atEnd()) to try again
...
...
@@ -199,14 +201,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
(
)
<<
"Attempting other binary protocol - Qt 4.4"
;
qCCritical
(
JUK_LOG
)
<<
"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
(
)
<<
"Unable to recover, no playlists will be loaded."
;
qCCritical
(
JUK_LOG
)
<<
"Unable to recover, no playlists will be loaded."
;
return
;
}
// catch
}
// while dataStreamVersion != -1
...
...
@@ -238,7 +240,7 @@ void Cache::savePlaylists(const PlaylistList &playlists)
KSaveFile
f
(
playlistsFile
);
if
(
!
f
.
open
(
QIODevice
::
WriteOnly
))
{
kError
(
)
<<
"Error saving collection:"
<<
f
.
errorString
();
qCCritical
(
JUK_LOG
)
<<
"Error saving collection:"
<<
f
.
errorString
();
return
;
}
...
...
@@ -283,7 +285,7 @@ void Cache::savePlaylists(const PlaylistList &playlists)
f
.
close
();
if
(
!
f
.
finalize
())
kError
(
)
<<
"Error saving collection:"
<<
f
.
errorString
();
qCCritical
(
JUK_LOG
)
<<
"Error saving collection:"
<<
f
.
errorString
();
}
bool
Cache
::
cacheFileExists
()
// static
...
...
@@ -338,7 +340,7 @@ bool Cache::prepareToLoadCachedItems()
if
(
m_loadDataStream
.
status
()
!=
CacheDataStream
::
Ok
||
checksum
!=
checksumExpected
)
{
kError
(
)
<<
"Music cache checksum expected to get"
<<
checksumExpected
<<
qCCritical
(
JUK_LOG
)
<<
"Music cache checksum expected to get"
<<
checksumExpected
<<
"actually was"
<<
checksum
;
KMessageBox
::
sorry
(
0
,
i18n
(
"The music data cache has been corrupted. JuK "
"needs to rescan it now. This may take some time."
));
...
...
@@ -364,12 +366,12 @@ bool Cache::prepareToLoadCachedItems()
FileHandle
Cache
::
loadNextCachedItem
()
{
if
(
!
m_loadFile
.
isOpen
()
||
!
m_loadDataStream
.
device
())
{
kWarning
(
)
<<
"Already completed reading cache file."
;
qCWarning
(
JUK_LOG
)
<<
"Already completed reading cache file."
;
return
FileHandle
::
null
();
}
if
(
m_loadDataStream
.
status
()
==
QDataStream
::
ReadCorruptData
)
{
kError
(
)
<<
"Attempted to read file handle from corrupt cache file."
;
qCCritical
(
JUK_LOG
)
<<
"Attempted to read file handle from corrupt cache file."
;
return
FileHandle
::
null
();
}
...
...
collectionlist.cpp
View file @
6b804079
...
...
@@ -47,6 +47,7 @@
#include "actioncollection.h"
#include "tag.h"
#include "viewmode.h"
#include "juk_debug.h"
using
ActionCollection
::
action
;
...
...
@@ -68,17 +69,17 @@ void CollectionList::startLoadingCachedItems()
if
(
!
m_list
)
return
;
kDebug
(
)
<<
"Starting to load cached items"
;
qCDebug
(
JUK_LOG
)
<<
"Starting to load cached items"
;
stopwatch
.
start
();
if
(
!
Cache
::
instance
()
->
prepareToLoadCachedItems
())
{
kError
(
)
<<
"Unable to setup to load cache... perhaps it doesn't exist?"
;
qCCritical
(
JUK_LOG
)
<<
"Unable to setup to load cache... perhaps it doesn't exist?"
;
completedLoadingCachedItems
();
return
;
}
kDebug
(
)
<<
"Kicked off first batch"
;
qCDebug
(
JUK_LOG
)
<<
"Kicked off first batch"
;
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
loadNextBatchCachedItems
()));
}
...
...
@@ -126,8 +127,8 @@ void CollectionList::completedLoadingCachedItems()
SplashScreen
::
finishedLoading
();
kDebug
(
)
<<
"Finished loading cached items, took"
<<
stopwatch
.
elapsed
()
<<
"ms"
;
kDebug
(
)
<<
m_itemsDict
.
size
()
<<
"items are in the CollectionList"
;
qCDebug
(
JUK_LOG
)
<<
"Finished loading cached items, took"
<<
stopwatch
.
elapsed
()
<<
"ms"
;
qCDebug
(
JUK_LOG
)
<<
m_itemsDict
.
size
()
<<
"items are in the CollectionList"
;
emit
cachedItemsLoaded
();
}
...
...
@@ -162,7 +163,7 @@ CollectionListItem *CollectionList::createItem(const FileHandle &file, QTreeWidg
CollectionListItem
*
item
=
new
CollectionListItem
(
this
,
file
);
if
(
!
item
->
isValid
())
{
kError
(
)
<<
"CollectionList::createItem() -- A valid tag was not created for
\"
"
qCCritical
(
JUK_LOG
)
<<
"CollectionList::createItem() -- A valid tag was not created for
\"
"
<<
file
.
absFilePath
()
<<
"
\"
"
<<
endl
;
delete
item
;
return
0
;
...
...
@@ -186,7 +187,7 @@ void CollectionList::setupTreeViewEntries(ViewMode *viewMode) const
{
TreeViewMode
*
treeViewMode
=
dynamic_cast
<
TreeViewMode
*>
(
viewMode
);
if
(
!
treeViewMode
)
{
kWarning
(
)
<<
"Can't setup entries on a non-tree-view mode!
\n
"
;
qCWarning
(
JUK_LOG
)
<<
"Can't setup entries on a non-tree-view mode!
\n
"
;
return
;
}
...
...
@@ -238,7 +239,7 @@ void CollectionList::slotDeleteItem(const KFileItem &item)
void
CollectionList
::
saveItemsToCache
()
const
{
kDebug
(
)
<<
"Saving collection list to cache"
;
qCDebug
(
JUK_LOG
)
<<
"Saving collection list to cache"
;
QString
cacheFileName
=
KGlobal
::
dirs
()
->
saveLocation
(
"appdata"
)
%
QLatin1String
(
"cache"
);
...
...
@@ -246,7 +247,7 @@ void CollectionList::saveItemsToCache() const
KSaveFile
f
(
cacheFileName
);
if
(
!
f
.
open
(
QIODevice
::
WriteOnly
))
{
kError
(
)
<<
"Error saving cache:"
<<
f
.
errorString
();
qCCritical
(
JUK_LOG
)
<<
"Error saving cache:"
<<
f
.
errorString
();
return
;
}
...
...
@@ -271,7 +272,7 @@ void CollectionList::saveItemsToCache() const
f
.
close
();
if
(
!
f
.
finalize
())
kError
(
)
<<
"Error saving cache:"
<<
f
.
errorString
();
qCCritical
(
JUK_LOG
)
<<
"Error saving cache:"
<<
f
.
errorString
();
}
////////////////////////////////////////////////////////////////////////////////
...
...
@@ -300,7 +301,7 @@ void CollectionList::clear()
void
CollectionList
::
slotCheckCache
()
{
PlaylistItemList
invalidItems
;
kDebug
(
)
<<
"Starting to check cached items for consistency"
;
qCDebug
(
JUK_LOG
)
<<
"Starting to check cached items for consistency"
;
stopwatch
.
start
();
int
i
=
0
;
...
...
@@ -308,12 +309,12 @@ void CollectionList::slotCheckCache()
if
(
!
item
->
checkCurrent
())
invalidItems
.
append
(
item
);
if
(
++
i
==
(
m_itemsDict
.
size
()
/
2
))
kDebug
(
)
<<
"Checkpoint"
;
qCDebug
(
JUK_LOG
)
<<
"Checkpoint"
;
}
clearItems
(
invalidItems
);
kDebug
(
)
<<
"Finished consistency check, took"
<<
stopwatch
.
elapsed
()
<<
"ms"
;
qCDebug
(
JUK_LOG
)
<<
"Finished consistency check, took"
<<
stopwatch
.
elapsed
()
<<
"ms"
;
}
void
CollectionList
::
slotRemoveItem
(
const
QString
&
file
)
...
...
@@ -562,7 +563,7 @@ CollectionListItem::CollectionListItem(CollectionList *parent, const FileHandle
parent
->
dataChanged
();
}
else
{
kError
(
)
<<
"CollectionListItem::CollectionListItem() -- Tag() could not be created."
<<
endl
;
qCCritical
(
JUK_LOG
)
<<
"CollectionListItem::CollectionListItem() -- Tag() could not be created."
<<
endl
;
}
SplashScreen
::
increment
();
...
...
coverdialog.cpp
View file @
6b804079
...
...
@@ -27,6 +27,7 @@
#include "covericonview.h"
#include "covermanager.h"
#include "collectionlist.h"
#include "juk_debug.h"
using
CoverUtility
::
CoverIconViewItem
;
...
...
@@ -198,12 +199,12 @@ void CoverDialog::removeSelectedCover()
CoverIconViewItem
*
coverItem
=
m_covers
->
currentItem
();
if
(
!
coverItem
||
!
coverItem
->
isSelected
())
{
kWarning
(
)
<<
"No item selected for removeSelectedCover.
\n
"
;
qCWarning
(
JUK_LOG
)
<<
"No item selected for removeSelectedCover.
\n
"
;
return
;
}
if
(
!
CoverManager
::
removeCover
(
coverItem
->
id
()))
kError
(
)
<<
"Unable to remove selected cover: "
<<
coverItem
->
id
()
<<
endl
;
qCCritical
(
JUK_LOG
)
<<
"Unable to remove selected cover: "
<<
coverItem
->
id
()
<<
endl
;
else
delete
coverItem
;
}
...
...
coverinfo.cpp
View file @
6b804079
...
...
@@ -53,6 +53,7 @@
#include "playlistsearch.h"
#include "playlistitem.h"
#include "tag.h"
#include "juk_debug.h"
struct
CoverPopup
:
public
QWidget
{
...
...
@@ -283,7 +284,7 @@ bool CoverInfo::hasEmbeddedAlbumArt() const
TagLib
::
ID3v2
::
Tag
*
id3tag
=
mpegFile
->
ID3v2Tag
(
false
);
if
(
!
id3tag
)
{
kError
(
)
<<
m_file
.
absFilePath
()
<<
"seems to have invalid ID3 tag"
;
qCCritical
(
JUK_LOG
)
<<
m_file
.
absFilePath
()
<<
"seems to have invalid ID3 tag"
;
return
false
;
}
...
...
covermanager.cpp
View file @
6b804079
...
...
@@ -38,6 +38,7 @@
#include "juk.h"
#include "coverproxy.h"
#include "juk_debug.h"
// This is a dictionary to map the track path to their ID. Otherwise we'd have
// to store this info with each CollectionListItem, which would break the cache
...
...
@@ -194,10 +195,10 @@ void CoverManagerPrivate::saveCovers() const
QFile
file
(
coverLocation
());
kDebug
(
)
<<
"Opening covers db: "
<<
coverLocation
();
qCDebug
(
JUK_LOG
)
<<
"Opening covers db: "
<<
coverLocation
();
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
))
{
kError
(
)
<<
"Unable to save covers to disk!
\n
"
;
qCCritical
(
JUK_LOG
)
<<
"Unable to save covers to disk!
\n
"
;
return
;
}
...
...
@@ -206,7 +207,7 @@ void CoverManagerPrivate::saveCovers() const
// Write out the version and count
out
<<
quint32
(
0
)
<<
quint32
(
covers
.
size
());
kDebug
(
)
<<
"Writing out"
<<
covers
.
size
()
<<
"covers."
;
qCDebug
(
JUK_LOG
)
<<
"Writing out"
<<
covers
.
size
()
<<
"covers."
;
// Write out the data
for
(
const
auto
&
it
:
covers
)
{
...
...
@@ -217,7 +218,7 @@ void CoverManagerPrivate::saveCovers() const
// Now write out the track mapping.
out
<<
quint32
(
tracks
.
count
());
kDebug
(
)
<<
"Writing out"
<<
tracks
.
count
()
<<
"tracks."
;
qCDebug
(
JUK_LOG
)
<<
"Writing out"
<<
tracks
.
count
()
<<
"tracks."
;
TrackLookupMap
::
ConstIterator
trackMapIt
=
tracks
.
constBegin
();
while
(
trackMapIt
!=
tracks
.
constEnd
())
{
...
...
@@ -242,8 +243,8 @@ void CoverManagerPrivate::loadCovers()
// Only version 0 is defined for now.
in
>>
version
;
if
(
version
>
0
)
{
kError
(
)
<<
"Cover database was created by a higher version of JuK,
\n
"
;
kError
(
)
<<
"I don't know what to do with it.
\n
"
;
qCCritical
(
JUK_LOG
)
<<
"Cover database was created by a higher version of JuK,
\n
"
;
qCCritical
(
JUK_LOG
)
<<
"I don't know what to do with it.
\n
"
;
return
;
}
...
...
@@ -251,7 +252,7 @@ void CoverManagerPrivate::loadCovers()
// Read in the count next, then the data.
in
>>
count
;
kDebug
(
)
<<
"Loading"
<<
count
<<
"covers."
;
qCDebug
(
JUK_LOG
)
<<
"Loading"
<<
count
<<
"covers."
;
for
(
quint32
i
=
0
;
i
<
count
;
++
i
)
{
// Read the id, and 3 QStrings for every 1 of the count.
quint32
id
;
...
...
@@ -265,7 +266,7 @@ void CoverManagerPrivate::loadCovers()
}
in
>>
count
;
kDebug
(
)
<<
"Loading"
<<
count
<<
"tracks"
;
qCDebug
(
JUK_LOG
)
<<
"Loading"
<<
count
<<
"tracks"
;
for
(
quint32
i
=
0
;
i
<
count
;
++
i
)
{
QString
path
;
quint32
id
;
...
...
@@ -282,7 +283,7 @@ void CoverManagerPrivate::loadCovers()
}
}
kDebug
(
)
<<
"Tracks hash table has"
<<
tracks
.
size
()
<<
"entries."
;
qCDebug
(
JUK_LOG
)
<<
"Tracks hash table has"
<<
tracks
.
size
()
<<
"entries."
;
}
QString
CoverManagerPrivate
::
coverLocation
()
const
...
...
@@ -404,16 +405,16 @@ QPixmap CoverManager::coverFromData(const CoverData &coverData, Size size)
coverKey
CoverManager
::
addCover
(
const
QPixmap
&
large
,
const
QString
&
artist
,
const
QString
&
album
)
{
kDebug
(
)
<<
"Adding new pixmap to cover database.
\n
"
;
qCDebug
(
JUK_LOG
)
<<
"Adding new pixmap to cover database.
\n
"
;
if
(
large
.
isNull
())
{
kDebug
(
)
<<
"The pixmap you're trying to add is NULL!
\n
"
;
qCDebug
(
JUK_LOG
)
<<
"The pixmap you're trying to add is NULL!
\n
"
;
return
NoMatch
;
}
KTemporaryFile
tempFile
;
if
(
!
tempFile
.
open
())
{
kError
(
)
<<
"Unable to open file for pixmap cover, unable to add cover to DB
\n
"
;
qCCritical
(
JUK_LOG
)
<<
"Unable to open file for pixmap cover, unable to add cover to DB
\n
"
;
return
NoMatch
;
}
...
...
@@ -421,7 +422,7 @@ coverKey CoverManager::addCover(const QPixmap &large, const QString &artist, con
// to save the pixmap as a .png.
if
(
!
large
.
save
(
tempFile
.
fileName
(),
"PNG"
))
{
kError
(
)
<<
"Unable to save pixmap to "
<<
tempFile
.
fileName
()
<<
endl
;
qCCritical
(
JUK_LOG
)
<<
"Unable to save pixmap to "
<<
tempFile
.
fileName
()
<<
endl
;
return
NoMatch
;
}
...
...
@@ -445,7 +446,7 @@ coverKey CoverManager::addCover(const KUrl &path, const QString &artist, const Q
QString
ext
=
QString
(
"/coverdb/coverID-%1%2"
).
arg
(
id
).
arg
(
fileNameExt
);
coverData
.
path
=
KGlobal
::
dirs
()
->
saveLocation
(
"appdata"
)
+
ext
;
kDebug
(
)
<<
"Saving pixmap to "
<<
coverData
.
path
;
qCDebug
(
JUK_LOG
)
<<
"Saving pixmap to "
<<
coverData
.
path
;
data
()
->
createDataDir
();
coverData
.
artist
=
artist
.
toLower
();
...
...
@@ -487,13 +488,13 @@ void CoverManager::jobComplete(KJob *job, bool completedSatisfactory)
id
=
data
()
->
downloadJobs
[
job
];
if
(
id
==
NoMatch
)
{
kError
(
)
<<
"No information on what download job"
<<
job
<<
"is."
;
qCCritical
(
JUK_LOG
)
<<
"No information on what download job"
<<
job
<<
"is."
;
data
()
->
downloadJobs
.
remove
(
job
);
return
;
}
if
(
!
completedSatisfactory
)
{
kError
(
)
<<
"Job"
<<
job
<<
"failed, but not handled yet."
;
qCCritical
(
JUK_LOG
)
<<
"Job"
<<
job
<<
"failed, but not handled yet."
;
removeCover
(
id
);
data
()
->
downloadJobs
.
remove
(
job
);
JuK
::
JuKInstance
()
->
coverDownloaded
(
QPixmap
());
...
...
@@ -595,7 +596,7 @@ void CoverManager::setIdForTrack(const QString &path, coverKey id)
data
()
->
tracks
.
remove
(
path
);
if
(
data
()
->
covers
[
oldId
].
refCount
==
0
)
{
kDebug
(
)
<<
"Cover "
<<
oldId
<<
" is unused, removing.
\n
"
;
qCDebug
(
JUK_LOG
)
<<
"Cover "
<<
oldId
<<
" is unused, removing.
\n
"
;
removeCover
(
oldId
);
}
}
...
...
coverproxy.cpp
View file @
6b804079
...
...
@@ -15,11 +15,13 @@
*/
#include "coverproxy.h"
#include "covermanager.h"
#include <kdebug.h>
#include <kio/job.h>
#include "covermanager.h"
#include "juk_debug.h"
CoverProxy
::
CoverProxy
(
QObject
*
parent
)
:
QObject
(
parent
)
{
...
...
@@ -28,7 +30,7 @@ CoverProxy::CoverProxy(QObject *parent) :
void
CoverProxy
::
handleResult
(
KJob
*
job
)
{
if
(
job
->
error
())
{
kError
(
)
<<
"Cover download job failed with the following error:"
<<
job
->
errorString
();
qCCritical
(
JUK_LOG
)
<<
"Cover download job failed with the following error:"
<<
job
->
errorString
();
CoverManager
::
jobComplete
(
job
,
false
);
}
else
{
...
...
dbuscollectionproxy.cpp
View file @
6b804079
...
...
@@ -30,6 +30,7 @@
#include "collectionlist.h"
#include "coverinfo.h"
#include "filehandle.h"
#include "juk_debug.h"
DBusCollectionProxy
::
DBusCollectionProxy
(
QObject
*
parent
,
PlaylistCollection
*
collection
)
:
QObject
(
parent
),
m_collection
(
collection
)
...
...
@@ -141,7 +142,7 @@ QString DBusCollectionProxy::trackCover(const QString &track)
tempFile
.
setAutoRemove
(
false
);
if
(
!
tempFile
.
open
())
{
kError
(
)
<<
"Unable to open temporary file for embedded cover art."
;
qCCritical
(
JUK_LOG
)
<<
"Unable to open temporary file for embedded cover art."
;
return
QString
();
}
...
...
filehandle.cpp
View file @
6b804079
...
...
@@ -27,6 +27,7 @@
#include "tag.h"
#include "cache.h"
#include "coverinfo.h"
#include "juk_debug.h"
AddProperty
(
Title
,
tag
()
->
title
())
AddProperty
(
Artist
,
tag
()
->
artist
())
...
...
@@ -102,7 +103,7 @@ FileHandle::FileHandle(const FileHandle &f) :
d
(
f
.
d
)
{
if
(
!
d
)
{
kDebug
(
)
<<
"The source FileHandle was not initialized."
;
qCDebug
(
JUK_LOG
)
<<
"The source FileHandle was not initialized."
;
d
=
null
().
d
;
}
d
->
ref
();
...
...
@@ -124,7 +125,7 @@ FileHandle::FileHandle(const QString &path, CacheDataStream &s)
{
d
=
new
FileHandlePrivate
;
if
(
!
QFile
::
exists
(
path
))
{
kWarning
(
)
<<
"File"
<<
path
<<
"no longer exists!"
;
qCWarning
(
JUK_LOG
)
<<
"File"
<<
path
<<
"no longer exists!"
;
return
;
}
d
->
fileInfo
=
QFileInfo
(
path
);
...
...
@@ -148,12 +149,12 @@ void FileHandle::refresh()
void
FileHandle
::
setFile
(
const
QString
&
path
)
{
if
(
path
.
isEmpty
())
{
kError
(
)
<<
"trying to set an empty path"
<<
endl
;
qCCritical
(
JUK_LOG
)
<<
"trying to set an empty path"
<<
endl
;
return
;
}
if
(
!
QFile
::
exists
(
path
))
{
kError
(
)
<<
"trying to set non-existent file: "
<<
path
<<
endl
;
qCCritical
(
JUK_LOG
)
<<
"trying to set non-existent file: "
<<
path
<<
endl
;
return
;
}
...
...
@@ -284,7 +285,7 @@ void FileHandle::setup(const QFileInfo &info, const QString &path)
d
->
absFilePath
=
resolveSymLinks
(
fileName
);
d
->
modificationTime
=
info
.
lastModified
();
if
(
!
info
.
exists
())
kWarning
(
)
<<
"File"
<<
path
<<
"no longer exists!"
;
qCWarning
(
JUK_LOG
)
<<
"File"
<<
path
<<
"no longer exists!"
;
}
////////////////////////////////////////////////////////////////////////////////
...
...
filerenamer.cpp
View file @
6b804079
...
...
@@ -56,6 +56,7 @@
#include "playlistitem.h"
#include "playlist.h" // processEvents()
#include "coverinfo.h"
#include "juk_debug.h"
class
ConfirmationDialog
:
public
KDialog
{
...
...
@@ -416,12 +417,12 @@ void FileRenamerWidget::moveSignalMappings(int oldId, int newId)
bool
FileRenamerWidget
::
removeRow
(
int
id
)
{
if
(
id
>=
m_rows
.
count
())
{
kWarning
(
)
<<
"Trying to remove row, but "
<<
id
<<
" is out-of-range.
\n
"
;
qCWarning
(
JUK_LOG
)
<<
"Trying to remove row, but "
<<
id
<<
" is out-of-range.
\n
"
;
return
false
;
}
if
(
m_rows
.
count
()
==
1
)
{
kError
(
)
<<
"Can't remove last row of File Renamer.
\n
"
;
qCCritical
(
JUK_LOG
)
<<
"Can't remove last row of File Renamer.
\n
"
;
return
false
;
}
...
...
@@ -543,12 +544,12 @@ void FileRenamerWidget::createTagRows()
for
(;
it
!=
categoryOrder
.
constEnd
();
++
it
)
{
if
(
*
it
<
StartTag
||
*
it
>=
NumTypes
)
{
kError
(
)
<<
"Invalid category encountered in file renamer configuration.
\n
"
;
qCCritical
(
JUK_LOG
)
<<
"Invalid category encountered in file renamer configuration.
\n
"
;
continue
;
}
if
(
m_rows
.
count
()
==
MAX_CATEGORIES
)
{
kError
(
)
<<
"Maximum number of File Renamer tags reached, bailing.
\n
"
;
qCCritical
(
JUK_LOG
)
<<
"Maximum number of File Renamer tags reached, bailing.
\n
"
;
break
;
}
...
...
@@ -729,7 +730,7 @@ void FileRenamerWidget::moveItem(int id, MovementDirection direction)
int
FileRenamerWidget
::
idOfPosition
(
int
position
)
const
{
if
(
position
>=
m_rows
.
count
())
{
kError
(
)
<<
"Search for position "
<<
position
<<
" out-of-range.
\n
"
;
qCCritical
(
JUK_LOG
)
<<
"Search for position "
<<
position
<<
" out-of-range.
\n
"
;
return
-
1
;
}
...
...
@@ -737,7 +738,7 @@ int FileRenamerWidget::idOfPosition(int position) const
if
(
m_rows
[
i
].
position
==
position
)
return
i
;
kError
(
)
<<
"Unable to find identifier for position "
<<
position
<<
endl
;
qCCritical
(
JUK_LOG
)
<<
"Unable to find identifier for position "
<<
position
<<
endl
;
return
-
1
;
}
...
...
@@ -747,7 +748,7 @@ int FileRenamerWidget::findIdentifier(const CategoryID &category) const
if
(
m_rows
[
index
].
category
==
category
)
return
index
;
kError
(
)
<<
"Unable to find match for category "
<<
qCCritical
(
JUK_LOG
)
<<
"Unable to find match for category "
<<
TagRenamerOptions
::
tagTypeText
(
category
.
category
)
<<
", number "
<<
category
.
categoryNumber
<<
endl
;
...
...
@@ -797,7 +798,7 @@ void FileRenamerWidget::insertCategory()
{
TagType
category
=
static_cast
<
TagType
>
(
m_ui
->
m_category
->
currentIndex
());
if
(
m_ui
->
m_category
->
currentIndex
()
<
0
||
category
>=
NumTypes
)
{
kError
(
)
<<
"Trying to add unknown category somehow.
\n
"
;
qCCritical
(
JUK_LOG
)
<<
"Trying to add unknown category somehow.
\n
"
;
return
;
}
...
...
@@ -859,7 +860,7 @@ void FileRenamerWidget::slotRemoveRow(int id)
{
// Remove the given identified row.
if
(
!
removeRow
(
id
))
kError
(
)
<<
"Unable to remove row "
<<
id
<<
endl
;
qCCritical
(
JUK_LOG
)
<<
"Unable to remove row "
<<
id
<<
endl
;
}
//
...
...
@@ -923,7 +924,7 @@ void FileRenamer::rename(const PlaylistItemList &items)
bool
FileRenamer
::
moveFile
(
const
QString
&
src
,
const
QString
&
dest
)
{
kDebug
(
)
<<
"Moving file "
<<
src
<<
" to "
<<
dest
;
qCDebug
(
JUK_LOG
)
<<
"Moving file "
<<
src
<<
" to "
<<
dest
;
if
(
src
==
dest
)
return
false
;
...
...
@@ -947,7 +948,7 @@ bool FileRenamer::moveFile(const QString &src, const QString &dest)
// Create the directory.
if
(
!
KStandardDirs
::
exists
(
dir
.
path
()))
if
(
!
KStandardDirs
::
makeDir
(
dir
.
path
()))
{
kError
(
)
<<
"Unable to create directory "
<<
dir
.
path
()
<<
endl
;
qCCritical
(
JUK_LOG
)
<<
"Unable to create directory "
<<
dir
.
path
()
<<
endl
;
return
false
;
}
...
...
@@ -975,7 +976,7 @@ void FileRenamer::setFolderIcon(const KUrl &dst, const PlaylistItem *item)
for
(
QStringList
::
ConstIterator
it
=
elements
.
constBegin
();
it
!=
elements
.
constEnd
();
++
it
)
{
path
.
append
(
'/'
+
(
*
it
));
kDebug
(
)
<<
"Checking path: "
<<
path
;
qCDebug
(
JUK_LOG
)
<<
"Checking path: "
<<
path
;
if
((
*
it
).
contains
(
item
->
file
().
tag
()
->
album
()
)
&&
!
QFile
::
exists
(
path
+
"/.directory"
))
{
...
...
juk.cpp
View file @
6b804079
...
...
@@ -57,6 +57,7 @@
#include "collectionlist.h"
#include "covermanager.h"
#include "tagtransactionmanager.h"
#include "juk_debug.h"
using
namespace
ActionCollection
;
...
...
@@ -173,7 +174,7 @@ void JuK::setupLayout()
{
new
TagTransactionManager
(
this
);
kDebug
(
)
<<
"Creating GUI"
;
qCDebug
(
JUK_LOG
)
<<
"Creating GUI"
;
QTime
stopwatch
;
stopwatch
.
start
();
...
...
@@ -188,7 +189,7 @@ void JuK::setupLayout()
m_splitter
->
setFocus
();
kDebug
(
)
<<
"GUI created in"
<<
stopwatch
.
elapsed
()
<<
"ms"
;
qCDebug
(
JUK_LOG
)
<<
"GUI created in"
<<
stopwatch
.
elapsed
()
<<
"ms"
;
}
void
JuK
::
setupActions
()
...
...
@@ -344,14 +345,14 @@ void JuK::setupActions()
void
JuK
::
slotSetupSystemTray
()
{
if
(
m_toggleSystemTrayAction
&&
m_toggleSystemTrayAction
->
isChecked
())
{
kDebug
(
)
<<
"Setting up systray"
;
qCDebug
(
JUK_LOG
)
<<
"Setting up systray"
;
QTime
stopwatch
;
stopwatch
.
start
();
m_systemTray
=
new
SystemTray
(
m_player
,
this
);
m_systemTray
->
setObjectName
(
QLatin1String
(
"systemTray"
));
m_toggleDockOnCloseAction
->
setEnabled
(
true
);
m_togglePopupsAction
->
setEnabled
(
true
);
kDebug
(
)
<<
"Finished setting up systray, took"
<<
stopwatch
.
elapsed
()
<<
"ms"
;