Skip to content

Commit 4533d9c

Browse files
committed
Add workaround to enable last.fm debugging.
liblastfm checks QCoreApplication::arguments() for "--debug". That's not easy to avoid, so add a synonym debug flag "--debug-last-fm" which has identical functionality in Amarok, but doesn't trigger the non-functional last.fm debug mode. This is not pretty, but it is pretty contained and makes reasonable last.fm bughunting possible. Should lastfm/liblastfm#37 ever get merged, this commit can be reverted, but that might not happen anytime soon as the PR has been pending for 4 years and latest liblastfm release was almost 10 years ago. BUG: 485415
1 parent 27b57f4 commit 4533d9c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/App.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,8 @@ App::initCliArgs(QCommandLineParser *parser)
371371
options.append(QCommandLineOption("queue", i18n("Queue URLs after the currently playing track")));
372372
options.append(QCommandLineOption(QStringList() << "l" << "load", i18n("Load URLs, replacing current playlist")));
373373
options.append(QCommandLineOption(QStringList() << "d" << "debug", i18n("Print verbose debugging information")));
374+
// HACK should https://github.com/lastfm/liblastfm/pull/37 ever get merged, this option can be removed
375+
options.append(QCommandLineOption("debug-with-lastfm", i18n("Print verbose debugging information")));
374376
options.append(QCommandLineOption("debug-audio", i18n("Print verbose debugging information from the audio system")));
375377
options.append(QCommandLineOption(QStringList() << "c" << "coloroff", i18n("Disable colorization for debug output.")));
376378
options.append(QCommandLineOption(QStringList() << "m" << "multipleinstances", i18n("Allow running multiple Amarok instances")));

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ int main( int argc, char *argv[] )
347347
&app, &App::activateRequested);
348348

349349
const bool debugColorsEnabled = !parser.isSet( "coloroff" );
350-
const bool debugEnabled = parser.isSet( "debug" );
350+
const bool debugEnabled = parser.isSet( "debug" ) || parser.isSet( "debug-with-lastfm" ); // HACK see App::initCliArgs
351351

352352
Debug::setDebugEnabled( debugEnabled );
353353
Debug::setColoredDebug( debugColorsEnabled );

0 commit comments

Comments
 (0)