This forum has been archived. All content is frozen. Please use KDE Discuss instead.

help on tweaking the lyrics page

Tags: None
(comma "," separated)
diogo86
Karma
0

help on tweaking the lyrics page

Thu Jan 12, 2006 7:54 pm
Hi.

I\'m trying to tweak the lyrics page to fetch my own URL. I changed it in contextbrowser.cpp and it\'s working just fine.

However I also want it to browse the links on it. So i had to remove those regular expressions that strip HTML tags and to comment the connection between m_lyricsPage->browserExtension() and openURLRequest (because there is no need to have special treatment with the links).

The links are shown correctly but nothing happens when I click on it. I also enabled javascript and tried to redirect with window.location and it\'s not working (besides javascript is working fine).

I know it\'s not exactly related to amaroK but KDE development. I\'d aprecciate any help.


d.

diff amarok-1.3.7/amarok/src/contextbrowser.cpp
[code:1]
125d124
< m_lyricsPage->setJScriptEnabled( false );
176,177c175,176
< connect( m_lyricsPage->browserExtension(), SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ),
< this, SLOT( openURLRequest( const KURL & ) ) );
---
> // connect( m_lyricsPage->browserExtension(), SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ),
> // this, SLOT( openURLRequest( const KURL & ) ) );
2423,2431c2422,2426
< if ( !hash.isEmpty() && hash != QString( \"reload\" ) )
< m_lyricCurrentUrl = QString( \"http://lyrc.com.ar/en/tema1en.php?hash=%1\" )
< .arg( hash );
< else
< m_lyricCurrentUrl = QString( \"http://lyrc.com.ar/en/tema1en.php?artist=%1&songname=%2\" )
< .arg(
< KURL::encode_string_no_slash( EngineController::instance()->bundle().artist() ),
< KURL::encode_string_no_slash( title ) );
<
---
> m_lyricCurrentUrl = QString( \"http://osiris/letras/amarok.php?artist=%1&songname=%2\" )
> .arg(
> KURL::encode_string_no_slash( EngineController::instance()->bundle().artist() ),
> KURL::encode_string_no_slash( title ) );
>
2434,2442c2429,2442
< m_lyricAddUrl = QString( \"http://lyrc.com.ar/en/add/add.php?grupo=%1&tema=%2&disco=%3&ano=%4\" ).arg(
< KURL::encode_string_no_slash( EngineController::instance()->bundle().artist() ),
< KURL::encode_string_no_slash( title ),
< KURL::encode_string_no_slash( EngineController::instance()->bundle().album() ),
< KURL::encode_string_no_slash( EngineController::instance()->bundle().year() ) );
< m_lyricSearchUrl = QString( \"http://www.google.com/search?ie=UTF-8&q=lyrics %1 %2\" )
< .arg( KURL::encode_string_no_slash( \'\"\'+EngineController::instance()->bundle().artist()+\'\"\', 106 /*utf-8*/ ),
< KURL::encode_string_no_slash( \'\"\'+title+\'\"\', 106 /*utf-8*/ ) );
<
---
> m_lyricAddUrl = QString( \"http://osiris/letras/amarokadd.php?artist=%1&songname=%2\" )
> .arg(
> KURL::encode_string_no_slash( EngineController::instance()->bundle().artist() ),
> KURL::encode_string_no_slash( title ) );
> m_lyricSearchUrl = QString( \"http://osiris/letras/amaroksearch.php?artist=%1&songname=%2\" )
> .arg(
> KURL::encode_string_no_slash( EngineController::instance()->bundle().artist() ),
> KURL::encode_string_no_slash( title ) );
> //m_lyricFullUrl was defined in contextbrowser.h as QString
> m_lyricFullUrl = QString( \"http://osiris/letras/amarokfull.php?artist=%1&songname=%2\" )
> .arg(
> KURL::encode_string_no_slash( EngineController::instance()->bundle().artist() ),
> KURL::encode_string_no_slash( title ) );
>
2447,2460c2447
< m_HTMLSource = QString (
< \"\"
< \"
\"
< \"
\"
< \"\"
< + i18n( \"Cached Lyrics\" ) +
< \"
\"
< \"
\"
< \"
\"
< + m_lyrics +
< \"
\"
< \"
\"
< \"\"
< );
---
> m_HTMLSource = QString ( m_lyrics );
2532,2550c2519
< /* We don\'t want to display any links or images in our lyrics */
< m_lyrics.replace( QRegExp(\"<[aA][^>]*>[^<]*[aA]>\"«»), QString::null );
< m_lyrics.replace( QRegExp(\"<[iI][mM][gG][^>]*>\"«»), QString::null );
< m_lyrics.replace( QRegExp(\"<[sS][cC][rR][iI][pP][tT][^>]*>[^<]*(

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

© Copyright 2012-2022 KDE Community Forum Team. All rights reserved.
KDE Community Forums has no liability for any content or post. All messages belong to and are the opinion of their respective authors.
KDE and K Desktop Environment are trademarks of KDE e.V. •