summaryrefslogtreecommitdiffstats
path: root/amarok/src/contextbrowser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'amarok/src/contextbrowser.cpp')
-rw-r--r--amarok/src/contextbrowser.cpp395
1 files changed, 198 insertions, 197 deletions
diff --git a/amarok/src/contextbrowser.cpp b/amarok/src/contextbrowser.cpp
index b03685fa..ee3b30bc 100644
--- a/amarok/src/contextbrowser.cpp
+++ b/amarok/src/contextbrowser.cpp
@@ -75,29 +75,29 @@ namespace Amarok
{
TQString escapeHTML( const TQString &s )
{
- return TQString(s).replace( "&", "&amp;" ).replace( "<", "&lt;" ).replace( ">", "&gt;" );
- // .replace( "%", "%25" ) has to be the first(!) one, otherwise we would do things like converting spaces into %20 and then convert them into %25%20
+ return TQString(s).tqreplace( "&", "&amp;" ).tqreplace( "<", "&lt;" ).tqreplace( ">", "&gt;" );
+ // .tqreplace( "%", "%25" ) has to be the first(!) one, otherwise we would do things like converting spaces into %20 and then convert them into %25%20
}
TQString escapeHTMLAttr( const TQString &s )
{
- return TQString(s).replace( "%", "%25" ).replace( "'", "%27" ).replace( "\"", "%22" ).replace( "#", "%23" ).replace( "?", "%3F" );
+ return TQString(s).tqreplace( "%", "%25" ).tqreplace( "'", "%27" ).tqreplace( "\"", "%22" ).tqreplace( "#", "%23" ).tqreplace( "?", "%3F" );
}
TQString unescapeHTMLAttr( const TQString &s )
{
- return TQString(s).replace( "%3F", "?" ).replace( "%23", "#" ).replace( "%22", "\"" ).replace( "%27", "'" ).replace( "%25", "%" );
+ return TQString(s).tqreplace( "%3F", "?" ).tqreplace( "%23", "#" ).tqreplace( "%22", "\"" ).tqreplace( "%27", "'" ).tqreplace( "%25", "%" );
}
TQString verboseTimeSince( const TQDateTime &datetime )
{
- const TQDateTime now = TQDateTime::currentDateTime();
+ const TQDateTime now = TQDateTime::tqcurrentDateTime();
const int datediff = datetime.daysTo( now );
if( datediff >= 6*7 /*six weeks*/ ) { // return absolute month/year
const KCalendarSystem *cal = KGlobal::locale()->calendar();
const TQDate date = datetime.date();
- return i18n( "monthname year", "%1 %2" ).arg( cal->monthName(date), cal->yearString(date, false) );
+ return i18n( "monthname year", "%1 %2" ).tqarg( cal->monthName(date), cal->yearString(date, false) );
}
//TODO "last week" = maybe within 7 days, but prolly before last sunday
@@ -146,7 +146,7 @@ namespace Amarok
*/
void albumArtistTrackFromUrl( TQString url, TQString &artist, TQString &album, TQString &detail )
{
- if ( !url.contains("@@@") ) return;
+ if ( !url.tqcontains("@@@") ) return;
//KHTML removes the trailing space!
if ( url.endsWith( " @@@" ) )
url += ' ';
@@ -165,7 +165,7 @@ namespace Amarok
}
-using Amarok::QStringx;
+using Amarok::TQStringx;
using Amarok::escapeHTML;
using Amarok::escapeHTMLAttr;
using Amarok::unescapeHTMLAttr;
@@ -175,7 +175,7 @@ static
TQString albumImageTooltip( const TQString &albumImage, int size )
{
if ( albumImage == CollectionDB::instance()->notAvailCover( false, size ) )
- return escapeHTMLAttr( i18n( "Click to fetch cover from amazon.%1, right-click for menu." ).arg( CoverManager::amazonTld() ) );
+ return escapeHTMLAttr( i18n( "Click to fetch cover from amazon.%1, right-click for menu." ).tqarg( CoverManager::amazonTld() ) );
return escapeHTMLAttr( i18n( "Click for information from Amazon, right-click for menu." ) );
}
@@ -259,7 +259,7 @@ ContextBrowser::ContextBrowser( const char *name )
connect ( m_lyricsSearchText, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(lyricsSearchText(const TQString & )) );
connect ( m_lyricsSearchText, TQT_SIGNAL(returnPressed()), this, (TQT_SLOT(lyricsSearchTextNext())) );
Amarok::actionCollection()->setAutoConnectShortcuts ( true );
- new KAction( i18n("Search text in lyrics"), KShortcut("/"), this,TQT_SLOT( lyricsSearchTextShow() ), Amarok::actionCollection(), "search_text_lyric");
+ new KAction( i18n("Search text in lyrics"), KShortcut("/"), TQT_TQOBJECT(this),TQT_SLOT( lyricsSearchTextShow() ), Amarok::actionCollection(), "search_text_lyric");
Amarok::actionCollection()->setAutoConnectShortcuts ( false );
}
@@ -267,7 +267,7 @@ ContextBrowser::ContextBrowser( const char *name )
m_lyricsPage = new HTMLView( m_lyricsTab, "lyrics_page", true /* DNDEnabled */, false /* JScriptEnabled*/ );
m_lyricsTextEdit = new KTextEdit ( m_lyricsTab, "lyrics_text_edit");
- m_lyricsTextEdit->setTextFormat( Qt::PlainText );
+ m_lyricsTextEdit->setTextFormat( TQt::PlainText );
m_lyricsTextEdit->hide();
m_wikiTab = new TQVBox(this, "wiki_tab");
@@ -429,7 +429,7 @@ void ContextBrowser::openURLRequest( const KURL &url )
if ( url.hasHTMLRef() )
{
KURL base = url;
- base.setRef(TQString::null);
+ base.setRef(TQString());
// Wikipedia also has links to otherpages with Anchors, so we have to check if it's for the current one
if ( m_wikiCurrentUrl == base.url() ) {
m_wikiPage->gotoAnchor( url.htmlRef() );
@@ -438,14 +438,14 @@ void ContextBrowser::openURLRequest( const KURL &url )
}
// new page
m_dirtyWikiPage = true;
- m_wikiCurrentEntry = TQString::null;
+ m_wikiCurrentEntry = TQString();
showWikipedia( url.url() );
}
else if ( url.protocol() == "show" )
{
- if ( url.path().contains( "suggestLyric-" ) )
+ if ( url.path().tqcontains( "suggestLyric-" ) )
{
- TQString _url = url.url().mid( url.url().find( TQString( "-" ) ) +1 );
+ TQString _url = url.url().mid( url.url().tqfind( TQString( "-" ) ) +1 );
debug() << "Clicked lyrics URL: " << _url << endl;
m_dirtyLyricsPage = true;
showLyrics( _url );
@@ -497,13 +497,13 @@ void ContextBrowser::openURLRequest( const KURL &url )
else if ( url.protocol() == "musicbrainz" )
{
const TQString url = "http://www.musicbrainz.org/taglookup.html?artist=%1&album=%2&track=%3";
- Amarok::invokeBrowser( url.arg( KURL::encode_string_no_slash( artist, 106 /*utf-8*/ ),
+ Amarok::invokeBrowser( url.tqarg( KURL::encode_string_no_slash( artist, 106 /*utf-8*/ ),
KURL::encode_string_no_slash( album, 106 /*utf-8*/ ),
KURL::encode_string_no_slash( track, 106 /*utf-8*/ ) ) );
}
else if ( url.protocol() == "externalurl" )
- Amarok::invokeBrowser( url.url().replace( TQRegExp( "^externalurl:" ), "http:") );
+ Amarok::invokeBrowser( url.url().tqreplace( TQRegExp( "^externalurl:" ), "http:") );
else if ( url.protocol() == "lastfm" )
{
@@ -547,7 +547,7 @@ void ContextBrowser::openURLRequest( const KURL &url )
else if( url.protocol() == "ggartist" )
{
const TQString url2 = TQString( "http://www.google.com/musicsearch?q=%1&res=artist" )
- .arg( KURL::encode_string_no_slash( unescapeHTMLAttr( url.path() ).replace( " ", "+" ), 106 /*utf-8*/ ) );
+ .tqarg( KURL::encode_string_no_slash( unescapeHTMLAttr( url.path() ).tqreplace( " ", "+" ), 106 /*utf-8*/ ) );
Amarok::invokeBrowser( url2 );
}
@@ -558,7 +558,7 @@ void ContextBrowser::openURLRequest( const KURL &url )
else if( url.protocol() == "stream" )
{
- Playlist::instance()->insertMedia( KURL::fromPathOrURL( url.url().replace( TQRegExp( "^stream:" ), "http:" ) ), Playlist::DefaultOptions );
+ Playlist::instance()->insertMedia( KURL::fromPathOrURL( url.url().tqreplace( TQRegExp( "^stream:" ), "http:" ) ), Playlist::DefaultOptions );
}
else if( url.protocol() == "compilationdisc" || url.protocol() == "albumdisc" )
@@ -639,10 +639,10 @@ void ContextBrowser::engineNewMetaData( const MetaBundle& bundle, bool trackChan
if ( MetaBundle( m_currentURL ).artist() != bundle.artist() )
m_dirtyWikiPage = true;
// Prepend stream metadata history item to list
- if ( !m_metadataHistory.first().contains( bundle.prettyTitle() ) )
+ if ( !m_metadataHistory.first().tqcontains( bundle.prettyTitle() ) )
{
newMetaData = true;
- const TQString timeString = KGlobal::locale()->formatTime( TQTime::currentTime() ).replace(" ", "&nbsp;"); // don't break over lines
+ const TQString timeString = KGlobal::locale()->formatTime( TQTime::currentTime() ).tqreplace(" ", "&nbsp;"); // don't break over lines
m_metadataHistory.prepend( TQString( "<td valign='top'>" + timeString + "&nbsp;</td><td align='left'>" + escapeHTML( bundle.prettyTitle() ) + "</td>" ) );
}
@@ -676,7 +676,7 @@ void ContextBrowser::engineNewMetaData( const MetaBundle& bundle, bool trackChan
// look for the cue file that matches the media file played first
TQString path = bundle.url().path();
- TQString cueFile = path.left( path.findRev('.') ) + ".cue";
+ TQString cueFile = path.left( path.tqfindRev('.') ) + ".cue";
m_cuefile->setCueFileName( cueFile );
@@ -709,11 +709,11 @@ void ContextBrowser::engineNewMetaData( const MetaBundle& bundle, bool trackChan
{
line = stream.readLine().simplifyWhiteSpace();
- if( line.startsWith( "file", false ) )
+ if( line.tqstartsWith( "file", false ) )
{
line = line.mid( 5 ).remove( '"' );
- if ( line.contains( bundle.filename(), false ) )
+ if ( line.tqcontains( bundle.filename(), false ) )
{
cueFile = dir.filePath(*it);
foundCueFile = true;
@@ -799,10 +799,10 @@ void ContextBrowser::saveHtmlData()
TQTextStream stream( &exportedDocument );
stream.setEncoding( TQTextStream::UnicodeUTF8 );
stream << m_HTMLSource // the pure html data..
- .replace( "<html>",
+ .tqreplace( "<html>",
TQString( "<html><head><style type=\"text/css\">"
"%1</style></head>" )
- .arg( HTMLView::loadStyleSheet() ) ); // and the
+ .tqarg( HTMLView::loadStyleSheet() ) ); // and the
// stylesheet
// code
exportedDocument.close();
@@ -931,7 +931,7 @@ void ContextBrowser::slotContextMenu( const TQString& urlString, const TQPoint&
}
else if( url.protocol() == "stream" )
{
- url = KURL::fromPathOrURL( url.url().replace( TQRegExp( "^stream:" ), "http:" ) );
+ url = KURL::fromPathOrURL( url.url().tqreplace( TQRegExp( "^stream:" ), "http:" ) );
urls = KURL::List( url );
menu.insertTitle( i18n("Podcast"), TITLE );
menu.insertItem( SmallIconSet( Amarok::icon( "files" ) ), i18n( "&Load" ), MAKE );
@@ -1102,9 +1102,9 @@ void ContextBrowser::slotContextMenu( const TQString& urlString, const TQPoint&
class CurrentTrackJob : public ThreadManager::DependentJob
{
public:
- CurrentTrackJob( ContextBrowser *parent )
- : ThreadManager::DependentJob( parent, "CurrentTrackJob" )
- , b( parent )
+ CurrentTrackJob( ContextBrowser *tqparent )
+ : ThreadManager::DependentJob( TQT_TQOBJECT(tqparent), "CurrentTrackJob" )
+ , b( tqparent )
, m_currentTrack( TQDeepCopy<MetaBundle>( EngineController::instance()->bundle() ) )
, m_isStream( EngineController::engine()->isStream() )
{
@@ -1190,8 +1190,8 @@ ContextBrowser::showContext( const KURL &url, bool fromHistory )
{
m_browseArtists = false;
m_browseLabels = false;
- m_label = TQString::null;
- m_artist = TQString::null;
+ m_label = TQString();
+ m_artist = TQString();
m_contextBackHistory.clear();
m_contextBackHistory.push_back( "current://track" );
}
@@ -1199,14 +1199,14 @@ ContextBrowser::showContext( const KURL &url, bool fromHistory )
{
m_browseArtists = true;
m_browseLabels = false;
- m_label = TQString::null;
+ m_label = TQString();
m_artist = unescapeHTMLAttr( url.path() );
}
else if( url.protocol() == "showlabel" )
{
m_browseLabels = true;
m_browseArtists = false;
- m_artist = TQString::null;
+ m_artist = TQString();
m_label = unescapeHTMLAttr( url.path() );
}
@@ -1243,7 +1243,7 @@ void ContextBrowser::showCurrentTrack() //SLOT
debug() << "current browser is not context, aborting showCurrentTrack()" << endl;
m_dirtyCurrentTrackPage = true;
m_currentTrackPage->set( TQString( "<html><body><div class='box-body'>%1</div></body></html>" )
- .arg( i18n( "Updating..." ) ) );
+ .tqarg( i18n( "Updating..." ) ) );
return;
}
#endif
@@ -1271,7 +1271,7 @@ void ContextBrowser::showCurrentTrack() //SLOT
if( !m_dirtyCurrentTrackPage )
return;
m_currentURL = EngineController::instance()->bundle().url();
- m_currentTrackPage->write( TQString::null );
+ m_currentTrackPage->write( TQString() );
ThreadManager::instance()->onlyOneJob( new CurrentTrackJob( this ) );
}
@@ -1325,7 +1325,7 @@ void CurrentTrackJob::showHome()
TQString playTime = MetaBundle::fuzzyTime( a[0].toInt() );
m_HTMLSource.append(
- QStringx(
+ TQStringx(
"<div id='introduction_box' class='box'>\n"
"<div id='introduction_box-header-title' class='box-header'>\n"
"<span id='introduction_box-header-title' class='box-header-title'>\n"
@@ -1397,7 +1397,7 @@ CurrentTrackJob::constructHTMLAlbums( const TQStringList &reqResult, TQString &h
for ( uint j = 0; j < albumValues.count(); j += qb.countReturnValues())
if ( albumValues[j + 3] != albumYear || albumYear == "0" )
{
- albumYear = TQString::null;
+ albumYear = TQString();
break;
}
}
@@ -1408,7 +1408,7 @@ CurrentTrackJob::constructHTMLAlbums( const TQStringList &reqResult, TQString &h
TQString albumLength = ( i_albumLength==0 ? i18n( "Unknown" ) : MetaBundle::prettyTime( i_albumLength, true ) );
- htmlCode.append( QStringx (
+ htmlCode.append( TQStringx (
"<tr class='" + TQString( (i % 4) ? "box-row-alt" : "box-row" ) + "'>\n"
"<td>\n"
"<div class='album-header' onClick=\"toggleBlock('IDA%1')\">\n"
@@ -1425,7 +1425,7 @@ CurrentTrackJob::constructHTMLAlbums( const TQStringList &reqResult, TQString &h
TQString albumImageTitleAttr = albumImageTooltip( albumImage, 50 );
// Album image
- htmlCode.append( QStringx (
+ htmlCode.append( TQStringx (
"<td width='1'>\n"
"<a href='fetchcover:%1 @@@ %2'>\n"
"<img class='album-image' align='left' vspace='2' hspace='2' title='%3' src='%4'/>\n"
@@ -1451,7 +1451,7 @@ CurrentTrackJob::constructHTMLAlbums( const TQStringList &reqResult, TQString &h
<< albumName ) );
// Tracks number, year and length
- htmlCode.append( QStringx (
+ htmlCode.append( TQStringx (
"<span class='album-info'>%1</span> "
"<br />\n"
"<span class='album-year'>%2</span>\n"
@@ -1463,7 +1463,7 @@ CurrentTrackJob::constructHTMLAlbums( const TQStringList &reqResult, TQString &h
<< albumLength) );
// Begining of the 'toggleable div' that contains the songs
- htmlCode.append( QStringx (
+ htmlCode.append( TQStringx (
"</tr>\n"
"</table>\n"
"</div>\n"
@@ -1482,7 +1482,7 @@ CurrentTrackJob::constructHTMLAlbums( const TQStringList &reqResult, TQString &h
if( discNumber != newDiscNumber && newDiscNumber.toInt() > 0)
{
discNumber = newDiscNumber;
- htmlCode.append( QStringx (
+ htmlCode.append( TQStringx (
"<div class='disc-separator'>\n"
"<a href=\"albumdisc: %1 @@@ %2 @@@ %3\">\n"
"%4"
@@ -1492,7 +1492,7 @@ CurrentTrackJob::constructHTMLAlbums( const TQStringList &reqResult, TQString &h
<< albumValues[6]
<< reqResult[ i + 1 ] //album.id
<< escapeHTMLAttr( discNumber )
- << i18n( "Disc %1" ).arg( discNumber ) ) );
+ << i18n( "Disc %1" ).tqarg( discNumber ) ) );
}
TQString track = albumValues[j + 2].stripWhiteSpace();
if( track.length() > 0 )
@@ -1527,7 +1527,7 @@ CurrentTrackJob::constructHTMLAlbums( const TQStringList &reqResult, TQString &h
// return list of albums shown
-QStringList
+TQStringList
CurrentTrackJob::showHomeByAlbums()
{
QueryBuilder qb;
@@ -1576,9 +1576,9 @@ CurrentTrackJob::showHomeByAlbums()
date = ep.dateTime().toString();
TQString image = CollectionDB::instance()->podcastImage( pcb.imageURL().url(), true, 50 );
- TQString imageAttr = escapeHTMLAttr( i18n( "Click to go to podcast website: %1." ).arg( pcb.link().prettyURL() ) );
+ TQString imageAttr = escapeHTMLAttr( i18n( "Click to go to podcast website: %1." ).tqarg( pcb.link().prettyURL() ) );
- m_HTMLSource.append( QStringx (
+ m_HTMLSource.append( TQStringx (
"<tr class='" + TQString( (i % 2) ? "box-row-alt" : "box-row" ) + "'>\n"
"<td>\n"
"<div class='album-header' onClick=\"toggleBlock('IDP%1')\">\n"
@@ -1601,13 +1601,13 @@ CurrentTrackJob::showHomeByAlbums()
"<div class='album-body' style='display:%9;' id='IDP%10'>\n" )
.args( TQStringList()
<< TQString::number( i )
- << pcb.link().url().replace( TQRegExp( "^http:" ), "externalurl:" )
+ << pcb.link().url().tqreplace( TQRegExp( "^http:" ), "externalurl:" )
<< escapeHTMLAttr( imageAttr )
<< escapeHTMLAttr( image )
<< escapeHTML( ep.duration() ? MetaBundle::prettyTime( ep.duration() ) : TQString( "" ) )
<< ( ep.localUrl().isValid()
? ep.localUrl().url()
- : ep.url().url().replace( TQRegExp( "^http:" ), "stream:" ) )
+ : ep.url().url().tqreplace( TQRegExp( "^http:" ), "stream:" ) )
<< escapeHTML( pcb.title() + ": " + ep.title() )
<< escapeHTML( date )
<< "none"
@@ -1615,7 +1615,7 @@ CurrentTrackJob::showHomeByAlbums()
)
);
- m_HTMLSource.append( QStringx ( "<p>%1</p>\n" ).arg( ep.description() ) );
+ m_HTMLSource.append( TQStringx ( "<p>%1</p>\n" ).tqarg( ep.description() ) );
m_HTMLSource.append(
"</div>\n"
@@ -1772,14 +1772,14 @@ void CurrentTrackJob::showLastFm( const MetaBundle &currentTrack )
newUrls.append( &titleUrl );
for ( TQString* url = newUrls.first(); url; url = newUrls.next() )
- url->replace( TQRegExp( "^http:" ), "externalurl:" );
+ url->tqreplace( TQRegExp( "^http:" ), "externalurl:" );
const TQString skipIcon = KGlobal::iconLoader()->iconPath( Amarok::icon("next"), -KIcon::SizeSmallMedium );
const TQString loveIcon = KGlobal::iconLoader()->iconPath( Amarok::icon("love"), -KIcon::SizeSmallMedium );
const TQString banIcon = KGlobal::iconLoader()->iconPath( Amarok::icon("remove"), -KIcon::SizeSmallMedium );
- m_HTMLSource.append( QStringx(
+ m_HTMLSource.append( TQStringx(
"<div id='current_box' class='box'>\n"
"<div id='current_box-header' class='box-header'>\n"
"<span id='current_box-header-stream' class='box-header-title'>%1</span> "
@@ -1878,7 +1878,7 @@ void CurrentTrackJob::showLastFm( const MetaBundle &currentTrack )
void CurrentTrackJob::showStream( const MetaBundle &currentTrack )
{
- m_HTMLSource.append( QStringx(
+ m_HTMLSource.append( TQStringx(
"<div id='current_box' class='box'>\n"
"<div id='current_box-header' class='box-header'>\n"
"<span id='current_box-header-stream' class='box-header-title'>%1</span> "
@@ -1929,7 +1929,7 @@ void CurrentTrackJob::addMetaHistory()
for ( uint i = 0; i < m_metadataHistory.count(); ++i )
{
const TQString &str = m_metadataHistory[i];
- m_HTMLSource.append( QStringx( "<tr class='box-row'><td>%1</td></tr>\n" ).arg( str ) );
+ m_HTMLSource.append( TQStringx( "<tr class='box-row'><td>%1</td></tr>\n" ).tqarg( str ) );
}
m_HTMLSource.append(
@@ -1946,7 +1946,7 @@ void CurrentTrackJob::showPodcast( const MetaBundle &currentTrack )
PodcastEpisodeBundle peb = *currentTrack.podcastBundle();
PodcastChannelBundle pcb;
bool channelInDB = true;
- if( !CollectionDB::instance()->getPodcastChannelBundle( peb.parent(), &pcb ) )
+ if( !CollectionDB::instance()->getPodcastChannelBundle( peb.tqparent(), &pcb ) )
{
pcb.setTitle( i18n( "Unknown Channel (not in Database)" ) );
channelInDB = false;
@@ -1959,11 +1959,11 @@ void CurrentTrackJob::showPodcast( const MetaBundle &currentTrack )
image = CollectionDB::instance()->notAvailCover( true );
TQString imageAttr = escapeHTMLAttr( pcb.link().isValid()
- ? i18n( "Click to go to podcast website: %1." ).arg( pcb.link().prettyURL() )
+ ? i18n( "Click to go to podcast website: %1." ).tqarg( pcb.link().prettyURL() )
: i18n( "No podcast website." )
);
- m_HTMLSource.append( QStringx(
+ m_HTMLSource.append( TQStringx(
"<div id='current_box' class='box'>\n"
"<div id='current_box-header' class='box-header'>\n"
"<span id='current_box-header-artist' class='box-header-title'>%1</span> "
@@ -1988,13 +1988,13 @@ void CurrentTrackJob::showPodcast( const MetaBundle &currentTrack )
<< escapeHTML( pcb.title() )
<< escapeHTML( peb.title() )
<< ( pcb.link().isValid()
- ? pcb.link().url().replace( TQRegExp( "^http:" ), "externalurl:" )
+ ? pcb.link().url().tqreplace( TQRegExp( "^http:" ), "externalurl:" )
: "current://track" )
<< image
<< imageAttr
<< escapeHTML( peb.author().isEmpty()
? i18n( "Podcast" )
- : i18n( "Podcast by %1" ).arg( peb.author() ) )
+ : i18n( "Podcast by %1" ).tqarg( peb.author() ) )
<< ( peb.localUrl().isValid()
? "<br />\n" + escapeHTML( i18n( "(Cached)" ) )
: "" )
@@ -2011,7 +2011,7 @@ void CurrentTrackJob::showPodcast( const MetaBundle &currentTrack )
for ( uint i = 0; i < m_metadataHistory.count(); ++i )
{
const TQString &str = m_metadataHistory[i];
- m_HTMLSource.append( QStringx( "<tr class='box-row'><td>%1</td></tr>\n" ).arg( str ) );
+ m_HTMLSource.append( TQStringx( "<tr class='box-row'><td>%1</td></tr>\n" ).tqarg( str ) );
}
m_HTMLSource.append(
@@ -2024,7 +2024,7 @@ void CurrentTrackJob::showPodcast( const MetaBundle &currentTrack )
"<div id='albums_box-header' class='box-header'>\n"
"<span id='albums_box-header-title' class='box-header-title'>\n"
+ ( channelInDB
- ? i18n( "Episodes from %1" ).arg( escapeHTML( pcb.title() ) )
+ ? i18n( "Episodes from %1" ).tqarg( escapeHTML( pcb.title() ) )
: i18n( "Episodes from this Channel" )
)
+ "</span>\n"
@@ -2032,7 +2032,7 @@ void CurrentTrackJob::showPodcast( const MetaBundle &currentTrack )
"<table id='albums_box-body' class='box-body' width='100%' border='0' cellspacing='0' cellpadding='0'>\n" );
uint i = 0;
- TQValueList<PodcastEpisodeBundle> episodes = CollectionDB::instance()->getPodcastEpisodes( peb.parent() );
+ TQValueList<PodcastEpisodeBundle> episodes = CollectionDB::instance()->getPodcastEpisodes( peb.tqparent() );
while( !episodes.isEmpty() )
{
PodcastEpisodeBundle &ep = episodes.back();
@@ -2042,7 +2042,7 @@ void CurrentTrackJob::showPodcast( const MetaBundle &currentTrack )
date = ep.date() :
date = ep.dateTime().toString();
- m_HTMLSource.append( QStringx (
+ m_HTMLSource.append( TQStringx (
"<tr class='" + TQString( (i % 2) ? "box-row-alt" : "box-row" ) + "'>\n"
"<td>\n"
"<div class='album-header' onClick=\"toggleBlock('IDE%1')\">\n"
@@ -2064,7 +2064,7 @@ void CurrentTrackJob::showPodcast( const MetaBundle &currentTrack )
<< escapeHTML( ep.duration() ? MetaBundle::prettyTime( ep.duration() ) : TQString( "" ) )
<< ( ep.localUrl().isValid()
? ep.localUrl().url()
- : ep.url().url().replace( TQRegExp( "^http:" ), "stream:" ) )
+ : ep.url().url().tqreplace( TQRegExp( "^http:" ), "stream:" ) )
<< escapeHTML( ep.title() )
<< escapeHTML( date )
<< (peb.url() == ep.url() ? "block" : "none" )
@@ -2072,7 +2072,7 @@ void CurrentTrackJob::showPodcast( const MetaBundle &currentTrack )
)
);
- m_HTMLSource.append( QStringx ( "<p>%1</p>\n" ).arg( ep.description() ) );
+ m_HTMLSource.append( TQStringx ( "<p>%1</p>\n" ).tqarg( ep.description() ) );
m_HTMLSource.append(
"</div>\n"
@@ -2106,9 +2106,9 @@ void CurrentTrackJob::showBrowseArtistHeader( const TQString &artist )
"<td><div id='current_box-header-nav' class='box-header-nav'>%3</div></td>\n"
"</tr></table>\n"
"</div>\n" )
- .arg( escapeHTML( artist ) )
- .arg( escapeHTML( i18n( "Browse Artist" ) ) )
- .arg( back ) );
+ .tqarg( escapeHTML( artist ) )
+ .tqarg( escapeHTML( i18n( "Browse Artist" ) ) )
+ .tqarg( back ) );
m_HTMLSource.append(
"<table id='current_box-table' class='box-body' width='100%' cellpadding='0' cellspacing='0'>\n"
);
@@ -2126,16 +2126,16 @@ void CurrentTrackJob::showBrowseArtistHeader( const TQString &artist )
m_HTMLSource.append(
"<tr>\n"
"<td id='artist-wikipedia'>\n"
- + TQString( "<a id='artist-wikipedia-a' href='wikipedia:%1'>\n" ).arg( escapeHTMLAttr( artist + b->wikiArtistPostfix() ) )
- + i18n( "Wikipedia Information for %1" ).arg( escapeHTML( artist ) ) +
+ + TQString( "<a id='artist-wikipedia-a' href='wikipedia:%1'>\n" ).tqarg( escapeHTMLAttr( artist + b->wikiArtistPostfix() ) )
+ + i18n( "Wikipedia Information for %1" ).tqarg( escapeHTML( artist ) ) +
"</a>\n"
"</td>\n"
"</tr>\n");
m_HTMLSource.append(
"<tr>\n"
"<td id='artist-google'>\n"
- + TQString( "<a id='artist-google-a' href='ggartist:%1'>\n" ).arg( escapeHTMLAttr( artist ) )
- + i18n( "Google Musicsearch for %1" ).arg( escapeHTML( artist ) ) +
+ + TQString( "<a id='artist-google-a' href='ggartist:%1'>\n" ).tqarg( escapeHTMLAttr( artist ) )
+ + i18n( "Google Musicsearch for %1" ).tqarg( escapeHTML( artist ) ) +
"</a>\n"
"</td>\n"
"</tr>\n"
@@ -2170,9 +2170,9 @@ CurrentTrackJob::showBrowseLabelHeader( const TQString &label )
"<td><div id='current_box-header-nav' class='box-header-nav'>%3</div></td>\n"
"</tr></table>\n"
"</div>\n" )
- .arg( escapeHTML( label ) )
- .arg( escapeHTML( i18n( "Browse Label" ) ) )
- .arg( back ) );
+ .tqarg( escapeHTML( label ) )
+ .tqarg( escapeHTML( i18n( "Browse Label" ) ) )
+ .tqarg( back ) );
m_HTMLSource.append(
"<table id='current_box-table' class='box-body' width='100%' cellpadding='0' cellspacing='0'>\n"
);
@@ -2190,8 +2190,8 @@ CurrentTrackJob::showBrowseLabelHeader( const TQString &label )
m_HTMLSource.append(
"<tr>\n"
"<td id='label-lastfm'>\n"
- + TQString( "<a id='label-lastfm-a' href='externalurl://www.last.fm/tag/%1'>\n" ).arg( escapeHTMLAttr( label ) )
- + i18n( "Last.fm Information for %1" ).arg( escapeHTML( label ) ) +
+ + TQString( "<a id='label-lastfm-a' href='externalurl://www.last.fm/tag/%1'>\n" ).tqarg( escapeHTMLAttr( label ) )
+ + i18n( "Last.fm Information for %1" ).tqarg( escapeHTML( label ) ) +
"</a>\n"
"</td>\n"
"</tr>\n");
@@ -2235,7 +2235,7 @@ void CurrentTrackJob::showCurrentArtistHeader( const MetaBundle &currentTrack )
"<div id='current_box-header' class='box-header'>\n"
// Show "Title - Artist \n Album", or only "PrettyTitle" if there's no title tag
+ ( !currentTrack.title().isEmpty()
- ? QStringx(
+ ? TQStringx(
"<span id='current_box-header-songname' class='box-header-title'>%1</span> "
"<span id='current_box-header-separator' class='box-header-title'>-</span> "
"<span id='current_box-header-artist' class='box-header-title'>%2</span>\n"
@@ -2281,11 +2281,11 @@ void CurrentTrackJob::showCurrentArtistHeader( const MetaBundle &currentTrack )
"</td>\n"
"<td id='current_box-information-td' align='right'>\n"
)
- .arg( escapeHTML( currentTrack.prettyTitle() ) )
- .arg( escapeHTMLAttr( currentTrack.artist() ) )
- .arg( escapeHTMLAttr( currentTrack.album() ) )
- .arg( escapeHTMLAttr( albumImage ) )
- .arg( albumImageTitleAttr )
+ .tqarg( escapeHTML( currentTrack.prettyTitle() ) )
+ .tqarg( escapeHTMLAttr( currentTrack.artist() ) )
+ .tqarg( escapeHTMLAttr( currentTrack.album() ) )
+ .tqarg( escapeHTMLAttr( albumImage ) )
+ .tqarg( albumImageTitleAttr )
) );
if ( !values.isEmpty() && values[2].toInt() )
@@ -2299,18 +2299,18 @@ void CurrentTrackJob::showCurrentArtistHeader( const MetaBundle &currentTrack )
const uint score = static_cast<uint>( values[3].toFloat() );
const uint rating = values[4].toInt();
- //SAFE = .arg( x, y )
- //UNSAFE = .arg( x ).arg( y )
+ //SAFE = .tqarg( x, y )
+ //UNSAFE = .tqarg( x ).tqarg( y )
m_HTMLSource.append( TQString(
"<span>%1</span><br />\n"
"<div>%2</div>\n"
"<span>%3</span><br />\n"
"<span>%4</span>\n"
)
- .arg( i18n( "Track played once", "Track played %n times", playtimes ),
+ .tqarg( i18n( "Track played once", "Track played %n times", playtimes ),
statsHTML( score, rating, false ),
- i18n( "Last played: %1" ).arg( Amarok::verboseTimeSince( lastPlay ) ),
- i18n( "First played: %1" ).arg( Amarok::verboseTimeSince( firstPlay ) ) ) );
+ i18n( "Last played: %1" ).tqarg( Amarok::verboseTimeSince( lastPlay ) ),
+ i18n( "First played: %1" ).tqarg( Amarok::verboseTimeSince( firstPlay ) ) ) );
}
else
m_HTMLSource.append( i18n( "Never played before" ) );
@@ -2391,7 +2391,7 @@ void CurrentTrackJob::showRelatedArtists( const TQString &artist, const TQString
"<span id='related_box-header-title' class='box-header-title'>%1</span>\n"
"</div>\n"
"<table class='box-body' id='T_RA' width='100%' border='0' cellspacing='0' cellpadding='1'>\n" )
- .arg( i18n( "Artists Related to %1" ).arg( escapeHTML( artist ) ) ) );
+ .tqarg( i18n( "Artists Related to %1" ).tqarg( escapeHTML( artist ) ) ) );
m_HTMLSource.append( "<tr><td>\n" );
for ( uint i = 0; i < relArtists.count(); i += 1 )
{
@@ -2492,7 +2492,7 @@ CurrentTrackJob::showSongsWithLabel( const TQString &label )
"<div id='suggested_box' class='box'>\n"
"<div id='suggested_box-header' class='box-header' onClick=\"toggleBlock('T_SS'); window.location.href='togglebox:ss';\" style='cursor: pointer;'>\n"
"<span id='suggested_box-header-title' class='box-header-title'>\n"
- + i18n( "Songs with label %1" ).arg( label ) +
+ + i18n( "Songs with label %1" ).tqarg( label ) +
"</span>\n"
"</div>\n"
"<table class='box-body' id='T_' width='100%' border='0' cellspacing='0' cellpadding='0'>\n" );
@@ -2540,7 +2540,7 @@ CurrentTrackJob::showUserLabels( const MetaBundle &currentTrack )
"<div id='songlabels_box' class='box'>\n"
"<div id='songlabels-header' class='box-header' onCLick=\"toggleBlock('T_SL');window.location.href='togglebox:sl';\" style='cursor: pointer;'>\n"
"<span id='songlabels_box-header-title' class='box-header-title'>\n"
- + i18n( " Labels for %1 " ).arg( escapeHTML( title ) ) +
+ + i18n( " Labels for %1 " ).tqarg( escapeHTML( title ) ) +
"</span>\n"
"</div>\n"
"<table class='box-body' id='T_SL' width='100%' border='0' cellspacing='0' cellpadding='1'>\n" );
@@ -2555,7 +2555,7 @@ CurrentTrackJob::showUserLabels( const MetaBundle &currentTrack )
}
}
m_HTMLSource.append( "</td></tr>\n" );
- m_HTMLSource.append( "<tr><td><a id='songlabels_box_addlabel' href='show:editLabels'>" + i18n( "Add labels to %1" ).arg( escapeHTML( title ) ) + "</a></td></tr>\n" );
+ m_HTMLSource.append( "<tr><td><a id='songlabels_box_addlabel' href='show:editLabels'>" + i18n( "Add labels to %1" ).tqarg( escapeHTML( title ) ) + "</a></td></tr>\n" );
m_HTMLSource.append(
"</table>\n"
"</div>\n" );
@@ -2588,7 +2588,7 @@ void CurrentTrackJob::showArtistsFaves( const TQString &artist, uint artist_id )
"<div id='favoritesby_box' class='box'>\n"
"<div id='favoritesby-header' class='box-header' onClick=\"toggleBlock('T_FT'); window.location.href='togglebox:ft';\" style='cursor: pointer;'>\n"
"<span id='favoritesby_box-header-title' class='box-header-title'>\n"
- + i18n( "Favorite Tracks by %1" ).arg( artistName ) +
+ + i18n( "Favorite Tracks by %1" ).tqarg( artistName ) +
"</span>\n"
"</div>\n"
"<table class='box-body' id='T_FT' width='100%' border='0' cellspacing='0' cellpadding='0'>\n" );
@@ -2642,7 +2642,7 @@ void CurrentTrackJob::showArtistsAlbums( const TQString &artist, uint artist_id,
"<div id='albums_box' class='box'>\n"
"<div id='albums_box-header' class='box-header'>\n"
"<span id='albums_box-header-title' class='box-header-title'>\n"
- + i18n( "Albums by %1" ).arg( artistName ) +
+ + i18n( "Albums by %1" ).tqarg( artistName ) +
"</span>\n"
"</div>\n"
"<table id='albums_box-body' class='box-body' width='100%' border='0' cellspacing='0' cellpadding='0'>\n" );
@@ -2676,7 +2676,7 @@ void CurrentTrackJob::showArtistsAlbums( const TQString &artist, uint artist_id,
for ( uint j = 0; j < albumValues.count(); j += qb.countReturnValues() )
if ( albumValues[j + 3] != albumYear || albumYear == "0" )
{
- albumYear = TQString::null;
+ albumYear = TQString();
break;
}
}
@@ -2689,7 +2689,7 @@ void CurrentTrackJob::showArtistsAlbums( const TQString &artist, uint artist_id,
TQString albumImage = ContextBrowser::getEncodedImage( CollectionDB::instance()->albumImage( artist, values[ i ], true, 50 ) );
TQString albumImageTitleAttr = albumImageTooltip( albumImage, 50 );
- m_HTMLSource.append( QStringx (
+ m_HTMLSource.append( TQStringx (
"<tr class='" + TQString( (i % 4) ? "box-row-alt" : "box-row" ) + "'>\n"
"<td>\n"
"<div class='album-header' onClick=\"toggleBlock('IDA%1')\">\n"
@@ -2734,7 +2734,7 @@ void CurrentTrackJob::showArtistsAlbums( const TQString &artist, uint artist_id,
if( discNumber != newDiscNumber && newDiscNumber.toInt() > 0)
{
discNumber = newDiscNumber;
- m_HTMLSource.append( QStringx (
+ m_HTMLSource.append( TQStringx (
"<div class='disc-separator'>\n"
"<a href=\"albumdisc: %1 @@@ %2 @@@ %3\">\n"
"%4"
@@ -2744,7 +2744,7 @@ void CurrentTrackJob::showArtistsAlbums( const TQString &artist, uint artist_id,
<< TQString::number( artist_id )
<< values[ i + 1 ] //album.id
<< escapeHTMLAttr( discNumber )
- << i18n( "Disc %1" ).arg( discNumber ) ) );
+ << i18n( "Disc %1" ).tqarg( discNumber ) ) );
}
TQString track = albumValues[j + 2].stripWhiteSpace();
if( track.length() > 0 ) {
@@ -2806,7 +2806,7 @@ void CurrentTrackJob::showArtistsCompilations( const TQString &artist, uint arti
"<div id='albums_box' class='box'>\n"
"<div id='albums_box-header' class='box-header'>\n"
"<span id='albums_box-header-title' class='box-header-title'>\n"
- + i18n( "Compilations with %1" ).arg( artistName ) +
+ + i18n( "Compilations with %1" ).tqarg( artistName ) +
"</span>\n"
"</div>\n"
"<table id='albums_box-body' class='box-body' width='100%' border='0' cellspacing='0' cellpadding='0'>\n" );
@@ -2839,7 +2839,7 @@ void CurrentTrackJob::showArtistsCompilations( const TQString &artist, uint arti
for ( uint j = 0; j < albumValues.count(); j += qb.countReturnValues() )
if ( albumValues[j + 3] != albumYear || albumYear == "0" )
{
- albumYear = TQString::null;
+ albumYear = TQString();
break;
}
}
@@ -2852,7 +2852,7 @@ void CurrentTrackJob::showArtistsCompilations( const TQString &artist, uint arti
TQString albumImage = ContextBrowser::getEncodedImage( CollectionDB::instance()->albumImage( artist, values[ i ], true, 50 ) );
TQString albumImageTitleAttr = albumImageTooltip( albumImage, 50 );
- m_HTMLSource.append( QStringx (
+ m_HTMLSource.append( TQStringx (
"<tr class='" + TQString( (i % 4) ? "box-row-alt" : "box-row" ) + "'>\n"
"<td>\n"
"<div class='album-header' onClick=\"toggleBlock('IDA%1')\">\n"
@@ -2895,7 +2895,7 @@ void CurrentTrackJob::showArtistsCompilations( const TQString &artist, uint arti
if( discNumber != newDiscNumber && newDiscNumber.toInt() > 0)
{
discNumber = newDiscNumber;
- m_HTMLSource.append( QStringx (
+ m_HTMLSource.append( TQStringx (
"<div class='disc-separator'>\n"
"<a href=\"compilationdisc: __discard__ @@@ %1 @@@ %2\">\n"
"%3"
@@ -2904,7 +2904,7 @@ void CurrentTrackJob::showArtistsCompilations( const TQString &artist, uint arti
.args( TQStringList()
<< values[ i + 1 ] //album.id
<< escapeHTMLAttr( discNumber )
- << i18n( "Disc %1" ).arg( discNumber ) ) );
+ << i18n( "Disc %1" ).tqarg( discNumber ) ) );
}
TQString track = albumValues[j + 2].stripWhiteSpace();
@@ -2921,7 +2921,7 @@ void CurrentTrackJob::showArtistsCompilations( const TQString &artist, uint arti
TQString tracktitle_formated;
TQString tracktitle;
- tracktitle = escapeHTML( i18n("%1 - %2").arg( albumValues[j + 5], albumValues[j] ) );
+ tracktitle = escapeHTML( i18n("%1 - %2").tqarg( albumValues[j + 5], albumValues[j] ) );
tracktitle_formated = "<span class='album-song-title'>\n";
if( i==vectorPlace && albumValues[j + 2].toInt() == m_currentTrack.track() && discNumber.toInt() == m_currentTrack.discNumber() )
tracktitle_formated += "<i>\n";
@@ -2966,11 +2966,11 @@ TQString CurrentTrackJob::statsHTML( int score, int rating, bool statsbox ) //st
rating = 10;
TQString table = TQString( "<table %1 align='right' border='0' cellspacing='0' cellpadding='0' width='100%'>%2</table>\n" )
- .arg( statsbox ? "class='statsBox'" : "" );
+ .tqarg( statsbox ? "class='statsBox'" : "" );
TQString contents;
if( AmarokConfig::useScores() )
- contents += TQString( "<tr title='%1'>\n" ).arg( i18n( "Score: %1" ).arg( score ) ) +
+ contents += TQString( "<tr title='%1'>\n" ).tqarg( i18n( "Score: %1" ).tqarg( score ) ) +
"<td class='sbtext' width='100%' align='right'>\n" + TQString::number( score ) + "</td>\n"
"<td align='left' width='1'>\n"
"<div class='sbouter'>\n"
@@ -2982,8 +2982,8 @@ TQString CurrentTrackJob::statsHTML( int score, int rating, bool statsbox ) //st
if( AmarokConfig::useRatings() )
{
- contents += TQString( "<tr title='%1'>\n" ).arg( i18n( "Rating: %1" )
- .arg( MetaBundle::ratingDescription( rating ) ) ) +
+ contents += TQString( "<tr title='%1'>\n" ).tqarg( i18n( "Rating: %1" )
+ .tqarg( MetaBundle::ratingDescription( rating ) ) ) +
"<td class='ratingBox' align='right' colspan='2'>\n";
if( rating )
{
@@ -2995,14 +2995,14 @@ TQString CurrentTrackJob::statsHTML( int score, int rating, bool statsbox ) //st
fullStarIO.setFormat( "PNG" );
TQBuffer fullStarBuf;
fullStarBuf.open( IO_WriteOnly );
- fullStarIO.setIODevice( &fullStarBuf );
+ fullStarIO.setIODevice( TQT_TQIODEVICE(&fullStarBuf) );
fullStarIO.write();
fullStarBuf.close();
TQCString fullStar = KCodecs::base64Encode( fullStarBuf.buffer(), true );
const TQString img = "<img src='%1' height='13px' class='ratingStar'></img>\n";
for( int i = 0, n = rating / 2; i < n; ++i )
- contents += img.arg( "data:image/png;base64," + fullStar );
+ contents += img.tqarg( TQString("data:image/png;base64," + fullStar) );
if( rating % 2 )
{
TQImageIO halfStarIO;
@@ -3010,11 +3010,11 @@ TQString CurrentTrackJob::statsHTML( int score, int rating, bool statsbox ) //st
halfStarIO.setFormat( "PNG" );
TQBuffer halfStarBuf;
halfStarBuf.open( IO_WriteOnly );
- halfStarIO.setIODevice( &halfStarBuf );
+ halfStarIO.setIODevice( TQT_TQIODEVICE(&halfStarBuf) );
halfStarIO.write();
halfStarBuf.close();
TQCString halfStar = KCodecs::base64Encode( halfStarBuf.buffer(), true );
- contents += img.arg( "data:image/png;base64," + halfStar );
+ contents += img.tqarg( TQString("data:image/png;base64," + halfStar) );
}
contents += "</nobr>\n";
}
@@ -3024,7 +3024,7 @@ TQString CurrentTrackJob::statsHTML( int score, int rating, bool statsbox ) //st
"</tr>\n";
}
- return table.arg( contents );
+ return table.tqarg( contents );
}
bool CurrentTrackJob::doJob()
@@ -3080,7 +3080,7 @@ bool CurrentTrackJob::doJob()
if( artist == m_currentTrack.artist() )
{
b->m_browseArtists = false;
- b->m_artist = TQString::null;
+ b->m_artist = TQString();
b->m_contextBackHistory.clear();
b->m_contextBackHistory.push_back( "current://track" );
}
@@ -3146,7 +3146,7 @@ void ContextBrowser::showIntroduction()
}
// Do we have to rebuild the page? I don't care
- m_HTMLSource = TQString::null;
+ m_HTMLSource = TQString();
m_HTMLSource.append(
"<html><body>\n"
"<div id='introduction_box' class='box'>\n"
@@ -3206,21 +3206,21 @@ void ContextBrowser::showScanning()
saveHtmlData(); // Send html code to file
}
-QString
+TQString
ContextBrowser::getEncodedImage( const TQString &imageUrl )
{
// Embed cover image in html (encoded string), to get around khtml's caching
//debug() << "Encoding imageUrl: " << imageUrl << endl;
- qApp->lock();
+ tqApp->lock();
const TQImage img( imageUrl, "PNG" );
- qApp->unlock();
+ tqApp->unlock();
TQByteArray ba;
TQBuffer buffer( ba );
buffer.open( IO_WriteOnly );
- qApp->lock();
+ tqApp->lock();
img.save( &buffer, "PNG" ); // writes image into ba in PNG format
- qApp->unlock();
- const TQString coverImage = TQString( "data:image/png;base64,%1" ).arg( KCodecs::base64Encode( ba ) );
+ tqApp->unlock();
+ const TQString coverImage = TQString( "data:image/png;base64,%1" ).tqarg( KCodecs::base64Encode( ba ).data() );
//debug() << "Encoded imageUrl: " << coverImage << endl;
return coverImage;
}
@@ -3256,9 +3256,9 @@ void ContextBrowser::showLyrics( const TQString &url )
TQString title = EngineController::instance()->bundle().title();
TQString artist = EngineController::instance()->bundle().artist();
- if( title.contains("PREVIEW: buy it at www.magnatune.com", true) >= 1 )
+ if( title.tqcontains("PREVIEW: buy it at www.magnatune.com", true) >= 1 )
title = title.remove(" (PREVIEW: buy it at www.magnatune.com)");
- if( artist.contains("PREVIEW: buy it at www.magnatune.com", true) >= 1 )
+ if( artist.tqcontains("PREVIEW: buy it at www.magnatune.com", true) >= 1 )
artist = artist.remove(" (PREVIEW: buy it at www.magnatune.com)");
if ( title.isEmpty() ) {
@@ -3266,15 +3266,15 @@ void ContextBrowser::showLyrics( const TQString &url )
The fact that it often (but not always) has artist name together, can be bad,
but at least the user will hopefully get nice suggestions. */
TQString prettyTitle = EngineController::instance()->bundle().prettyTitle();
- int h = prettyTitle.find( '-' );
+ int h = prettyTitle.tqfind( '-' );
if ( h != -1 )
{
title = prettyTitle.mid( h+1 ).stripWhiteSpace();
- if( title.contains("PREVIEW: buy it at www.magnatune.com", true) >= 1 )
+ if( title.tqcontains("PREVIEW: buy it at www.magnatune.com", true) >= 1 )
title = title.remove(" (PREVIEW: buy it at www.magnatune.com)");
if ( artist.isEmpty() ) {
artist = prettyTitle.mid( 0, h ).stripWhiteSpace();
- if( artist.contains("PREVIEW: buy it at www.magnatune.com", true) >= 1 )
+ if( artist.tqcontains("PREVIEW: buy it at www.magnatune.com", true) >= 1 )
artist = artist.remove(" (PREVIEW: buy it at www.magnatune.com)");
}
@@ -3282,7 +3282,7 @@ void ContextBrowser::showLyrics( const TQString &url )
}
m_lyricSearchUrl = TQString( "http://www.google.com/search?ie=UTF-8&q=lyrics+%1+%2" )
- .arg( KURL::encode_string_no_slash( '"' + artist + '"', 106 /*utf-8*/ ),
+ .tqarg( KURL::encode_string_no_slash( '"' + artist + '"', 106 /*utf-8*/ ),
KURL::encode_string_no_slash( '"' + title + '"', 106 /*utf-8*/ ) );
m_lyricsToolBar->getButton( LYRICS_BROWSER )->setEnabled(false);
@@ -3294,7 +3294,7 @@ void ContextBrowser::showLyrics( const TQString &url )
"<br /><div class='info'>\n"+
i18n( "Available Lyrics Scripts:" ) + "<br />\n";
foreach ( scripts ) {
- lyrics += TQString( "<a href=\"runscript:%1\">%2</a><br />\n" ).arg( *it, *it );
+ lyrics += TQString( "<a href=\"runscript:%1\">%2</a><br />\n" ).tqarg( *it, *it );
}
lyrics += "<br />\n" + i18n( "Click on one of the scripts to run it, or use the Script Manager, to be able"
" to see all the scripts, and download new ones from the Web." );
@@ -3399,10 +3399,10 @@ ContextBrowser::lyricsResult( TQCString cXmlDoc, bool cached ) //SLOT
if ( el.attribute( "add_url" ).isEmpty() )
{
m_lyricAddUrl = spec.readPathEntry( "add_url" );
- m_lyricAddUrl.replace( "MAGIC_ARTIST", KURL::encode_string_no_slash( EngineController::instance()->bundle().artist() ) );
- m_lyricAddUrl.replace( "MAGIC_TITLE", KURL::encode_string_no_slash( EngineController::instance()->bundle().title() ) );
- m_lyricAddUrl.replace( "MAGIC_ALBUM", KURL::encode_string_no_slash( EngineController::instance()->bundle().album() ) );
- m_lyricAddUrl.replace( "MAGIC_YEAR", KURL::encode_string_no_slash( TQString::number( EngineController::instance()->bundle().year() ) ) );
+ m_lyricAddUrl.tqreplace( "MAGIC_ARTIST", KURL::encode_string_no_slash( EngineController::instance()->bundle().artist() ) );
+ m_lyricAddUrl.tqreplace( "MAGIC_TITLE", KURL::encode_string_no_slash( EngineController::instance()->bundle().title() ) );
+ m_lyricAddUrl.tqreplace( "MAGIC_ALBUM", KURL::encode_string_no_slash( EngineController::instance()->bundle().album() ) );
+ m_lyricAddUrl.tqreplace( "MAGIC_YEAR", KURL::encode_string_no_slash( TQString::number( EngineController::instance()->bundle().year() ) ) );
}
else
m_lyricAddUrl = el.attribute( "add_url" );
@@ -3425,16 +3425,16 @@ ContextBrowser::lyricsResult( TQCString cXmlDoc, bool cached ) //SLOT
const TQString artist = l.item( i ).toElement().attribute( "artist" );
const TQString title = l.item( i ).toElement().attribute( "title" );
- lyrics += "<a href='show:suggestLyric-" + url + "'>\n" + i18n("%1 - %2").arg( artist, title );
+ lyrics += "<a href='show:suggestLyric-" + url + "'>\n" + i18n("%1 - %2").tqarg( artist, title );
lyrics += "</a><br/>\n";
}
}
lyrics += i18n( "<p>You can <a href=\"%1\">search for the lyrics</a> on the Web.</p>" )
- .arg( TQString( m_lyricSearchUrl ).replace( TQRegExp( "^http:" ), "externalurl:" ) );
+ .tqarg( TQString( m_lyricSearchUrl ).tqreplace( TQRegExp( "^http:" ), "externalurl:" ) );
}
else {
lyrics = el.text();
- lyrics.replace( "\n", "<br/>\n" ); // Plaintext -> HTML
+ lyrics.tqreplace( "\n", "<br/>\n" ); // Plaintext -> HTML
const TQString title = el.attribute( "title" );
const TQString artist = el.attribute( "artist" );
@@ -3444,7 +3444,7 @@ ContextBrowser::lyricsResult( TQCString cXmlDoc, bool cached ) //SLOT
lyrics.prepend( "<font size='2'><b>\n" + title + "</b><br/><u>\n" + artist+ "</font></u></font><br/>\n" );
if( !cached ) {
- lyrics.append( "<br/><br/><i>\n" + i18n( "Powered by %1 (%2)" ).arg( site, site_url ) + "</i>\n" );
+ lyrics.append( "<br/><br/><i>\n" + i18n( "Powered by %1 (%2)" ).tqarg( site, site_url ) + "</i>\n" );
CollectionDB::instance()->setLyrics( EngineController::instance()->bundle().url().path(), xmldoc, EngineController::instance()->bundle().uniqueId() );
}
}
@@ -3502,7 +3502,7 @@ ContextBrowser::lyricsEditToggle() //SLOT
if( doc.setContent( xml ) )
lyrics = doc.documentElement().text();
else
- lyrics = TQString::null;
+ lyrics = TQString();
m_lyricsTextEdit->setText( lyrics );
m_lyricsPage->hide();
m_lyricsTextEdit->show();
@@ -3587,7 +3587,7 @@ ContextBrowser::lyricsSearchTextToggle() //SLOT
// Wikipedia-Tab
//////////////////////////////////////////////////////////////////////////////////////////
-QString
+TQString
ContextBrowser::wikiArtistPostfix() const
{
if( wikiLocale() == "en" )
@@ -3598,7 +3598,7 @@ ContextBrowser::wikiArtistPostfix() const
return "";
}
-QString
+TQString
ContextBrowser::wikiAlbumPostfix() const
{
if( wikiLocale() == "en" )
@@ -3607,7 +3607,7 @@ ContextBrowser::wikiAlbumPostfix() const
return "";
}
-QString
+TQString
ContextBrowser::wikiTrackPostfix() const
{
if( wikiLocale() == "en" )
@@ -3720,7 +3720,7 @@ ContextBrowser::wikiConfig() // SLOT
delete m_wikiConfigDialog;
}
-QString
+TQString
ContextBrowser::wikiLocale()
{
if( s_wikiLocale.isEmpty() )
@@ -3736,13 +3736,13 @@ ContextBrowser::setWikiLocale( const TQString &locale )
s_wikiLocale = locale;
}
-QString
+TQString
ContextBrowser::wikiURL( const TQString &item )
{
// add any special characters to be replaced here
- TQString wStr = TQString(item).replace( "/", " " );
+ TQString wStr = TQString(item).tqreplace( "/", " " );
- return TQString( "http://%1.wikipedia.org/wiki/" ).arg( wikiLocale() )
+ return TQString( "http://%1.wikipedia.org/wiki/" ).tqarg( wikiLocale() )
+ KURL::encode_string_no_slash( wStr, 106 /*utf-8*/ );
}
@@ -3768,7 +3768,7 @@ ContextBrowser::showLabelsDialog()
TQStringList allLabels = CollectionDB::instance()->labelList();
TQStringList trackLabels = CollectionDB::instance()->getLabels( currentUrl.path(), CollectionDB::typeUser );
debug() << "Showing add label dialog" << endl;
- KDialogBase *dialog = new KDialogBase( this, 0, false, TQString::null, KDialogBase::Ok|KDialogBase::Cancel );
+ KDialogBase *dialog = new KDialogBase( this, 0, false, TQString(), KDialogBase::Ok|KDialogBase::Cancel );
dialog->makeVBoxMainWidget();
TQLabel *labelText = new TQLabel( i18n(
@@ -3783,13 +3783,13 @@ ContextBrowser::showLabelsDialog()
m_labelListView = new TQListView( dialog->mainWidget() );
m_labelListView->addColumn( i18n( "Label" ) );
- m_labelListView->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding );
+ m_labelListView->tqsetSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding );
m_labelListView->setColumnWidthMode( 0, TQListView::Maximum );
foreach( allLabels )
{
TQCheckListItem *item = new TQCheckListItem( m_labelListView, *it, TQCheckListItem::CheckBox );
- item->setOn( trackLabels.contains( *it ) );
+ item->setOn( trackLabels.tqcontains( *it ) );
}
if( dialog->exec() == TQDialog::Accepted )
{
@@ -3815,7 +3815,7 @@ ContextBrowser::showLabelsDialog()
showCurrentTrack();
}
}
- delete dialog; //deletes children
+ delete dialog; //deletes tqchildren
m_addLabelEdit = 0;
m_labelListView = 0;
}
@@ -3826,9 +3826,9 @@ ContextBrowser::eventFilter( TQObject *o, TQEvent *e )
switch( e->type() )
{
case 6/*TQEvent::KeyPress*/:
- #define e static_cast<TQKeyEvent*>(e)
+ #define e TQT_TQKEYEVENT(e)
- if( o == m_addLabelEdit ) //the add label lineedit
+ if( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_addLabelEdit) ) //the add label lineedit
{
switch( e->key() )
{
@@ -3845,7 +3845,8 @@ ContextBrowser::eventFilter( TQObject *o, TQEvent *e )
return false;
}
}
- if (o == m_lyricsSearchText)
+
+ if (TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_lyricsSearchText))
{
switch ( e->key() )
{
@@ -3863,7 +3864,7 @@ ContextBrowser::eventFilter( TQObject *o, TQEvent *e )
break;
}
- return KTabWidget::eventFilter( o, e );
+ return KTabWidget::eventFilter( TQT_TQOBJECT(o), TQT_TQEVENT(e) );
}
void ContextBrowser::showWikipedia( const TQString &url, bool fromHistory, bool replaceHistory )
@@ -3935,9 +3936,9 @@ void ContextBrowser::showWikipedia( const TQString &url, bool fromHistory, bool
}
//Hack to make wiki searches work with magnatune preview tracks
- if (tmpWikiStr.contains( "PREVIEW: buy it at www.magnatune.com" ) >= 1 ) {
+ if (tmpWikiStr.tqcontains( "PREVIEW: buy it at www.magnatune.com" ) >= 1 ) {
tmpWikiStr = tmpWikiStr.remove(" (PREVIEW: buy it at www.magnatune.com)" );
- int index = tmpWikiStr.find( '-' );
+ int index = tmpWikiStr.tqfind( '-' );
if ( index != -1 ) {
tmpWikiStr = tmpWikiStr.left (index - 1);
}
@@ -3987,7 +3988,7 @@ void ContextBrowser::showWikipedia( const TQString &url, bool fromHistory, bool
m_wikiToolBar->setItemEnabled( WIKI_BACK, m_wikiBackHistory.size() > 1 );
m_wikiToolBar->setItemEnabled( WIKI_FORWARD, m_wikiForwardHistory.size() > 0 );
- m_wikiBaseUrl = m_wikiCurrentUrl.mid(0 , m_wikiCurrentUrl.find("wiki/"));
+ m_wikiBaseUrl = m_wikiCurrentUrl.mid(0 , m_wikiCurrentUrl.tqfind("wiki/"));
m_wikiJob = KIO::storedGet( m_wikiCurrentUrl, false, false );
Amarok::StatusBar::instance()->newProgressOperation( m_wikiJob )
@@ -4008,7 +4009,7 @@ ContextBrowser::wikiHistoryBack() //SLOT
m_wikiBackHistory.pop_back();
m_dirtyWikiPage = true;
- m_wikiCurrentEntry = TQString::null;
+ m_wikiCurrentEntry = TQString();
showWikipedia( m_wikiBackHistory.last(), true );
}
@@ -4024,7 +4025,7 @@ ContextBrowser::wikiHistoryForward() //SLOT
m_wikiForwardHistory.pop_back();
m_dirtyWikiPage = true;
- m_wikiCurrentEntry = TQString::null;
+ m_wikiCurrentEntry = TQString();
showWikipedia( m_wikiBackHistory.last(), true );
}
@@ -4042,7 +4043,7 @@ ContextBrowser::wikiBackPopupActivated( int id ) //SLOT
} while( id >= 0 );
m_dirtyWikiPage = true;
- m_wikiCurrentEntry = TQString::null;
+ m_wikiCurrentEntry = TQString();
showWikipedia( m_wikiBackHistory.last(), true );
}
@@ -4060,7 +4061,7 @@ ContextBrowser::wikiForwardPopupActivated( int id ) //SLOT
} while( id >= 0 );
m_dirtyWikiPage = true;
- m_wikiCurrentEntry = TQString::null;
+ m_wikiCurrentEntry = TQString();
showWikipedia( m_wikiBackHistory.last(), true );
}
@@ -4135,11 +4136,11 @@ ContextBrowser::wikiResult( KIO::Job* job ) //SLOT
m_wikiToolBar->setItemEnabled( WIKI_BROWSER, true );
// FIXME: Get a safer Regexp here, to match only inside of <head> </head> at least.
- if ( m_wiki.contains( "charset=utf-8" ) ) {
+ if ( m_wiki.tqcontains( "charset=utf-8" ) ) {
m_wiki = TQString::fromUtf8( storedJob->data().data(), storedJob->data().size() );
}
- if( m_wiki.find( "var wgArticleId = 0" ) != -1 )
+ if( m_wiki.tqfind( "var wgArticleId = 0" ) != -1 )
{
debug() << "Article not found." << endl;
@@ -4165,65 +4166,65 @@ ContextBrowser::wikiResult( KIO::Job* job ) //SLOT
}
//remove the new-lines and tabs(replace with spaces IS needed).
- m_wiki.replace( "\n", " " );
- m_wiki.replace( "\t", " " );
+ m_wiki.tqreplace( "\n", " " );
+ m_wiki.tqreplace( "\t", " " );
- m_wikiLanguages = TQString::null;
+ m_wikiLanguages = TQString();
// Get the available language list
- if ( m_wiki.find("<div id=\"p-lang\" class=\"portlet\">") != -1 )
+ if ( m_wiki.tqfind("<div id=\"p-lang\" class=\"portlet\">") != -1 )
{
- m_wikiLanguages = m_wiki.mid( m_wiki.find("<div id=\"p-lang\" class=\"portlet\">") );
- m_wikiLanguages = m_wikiLanguages.mid( m_wikiLanguages.find("<ul>") );
- m_wikiLanguages = m_wikiLanguages.mid( 0, m_wikiLanguages.find( "</div>" ) );
+ m_wikiLanguages = m_wiki.mid( m_wiki.tqfind("<div id=\"p-lang\" class=\"portlet\">") );
+ m_wikiLanguages = m_wikiLanguages.mid( m_wikiLanguages.tqfind("<ul>") );
+ m_wikiLanguages = m_wikiLanguages.mid( 0, m_wikiLanguages.tqfind( "</div>" ) );
}
TQString copyright;
TQString copyrightMark = "<li id=\"f-copyright\">";
- if ( m_wiki.find( copyrightMark ) != -1 )
+ if ( m_wiki.tqfind( copyrightMark ) != -1 )
{
- copyright = m_wiki.mid( m_wiki.find(copyrightMark) + copyrightMark.length() );
- copyright = copyright.mid( 0, copyright.find( "</li>" ) );
- copyright.replace( "<br />", TQString::null );
+ copyright = m_wiki.mid( m_wiki.tqfind(copyrightMark) + copyrightMark.length() );
+ copyright = copyright.mid( 0, copyright.tqfind( "</li>" ) );
+ copyright.tqreplace( "<br />", TQString() );
//only one br at the beginning
copyright.prepend( "<br />" );
}
// Ok lets remove the top and bottom parts of the page
- m_wiki = m_wiki.mid( m_wiki.find( "<h1 id=\"firstHeading\" class=\"firstHeading\">" ) );
- m_wiki = m_wiki.mid( 0, m_wiki.find( "<div class=\"printfooter\">" ) );
+ m_wiki = m_wiki.mid( m_wiki.tqfind( "<h1 id=\"firstHeading\" class=\"firstHeading\">" ) );
+ m_wiki = m_wiki.mid( 0, m_wiki.tqfind( "<div class=\"printfooter\">" ) );
// Adding back license information
m_wiki += copyright;
m_wiki.append( "</div>" );
- m_wiki.replace( TQRegExp("<h3 id=\"siteSub\">[^<]*</h3>"), TQString::null );
+ m_wiki.tqreplace( TQRegExp("<h3 id=\"siteSub\">[^<]*</h3>"), TQString() );
- m_wiki.replace( TQRegExp( "<span class=\"editsection\"[^>]*>[^<]*<[^>]*>[^<]*<[^>]*>[^<]*</span>" ), TQString::null );
+ m_wiki.tqreplace( TQRegExp( "<span class=\"editsection\"[^>]*>[^<]*<[^>]*>[^<]*<[^>]*>[^<]*</span>" ), TQString() );
- m_wiki.replace( TQRegExp( "<a href=\"[^\"]*\" class=\"new\"[^>]*>([^<]*)</a>" ), "\\1" );
+ m_wiki.tqreplace( TQRegExp( "<a href=\"[^\"]*\" class=\"new\"[^>]*>([^<]*)</a>" ), "\\1" );
// Remove anything inside of a class called urlexpansion, as it's pointless for us
- m_wiki.replace( TQRegExp( "<span class= *'urlexpansion'>[^(]*[(][^)]*[)]</span>" ), TQString::null );
+ m_wiki.tqreplace( TQRegExp( "<span class= *'urlexpansion'>[^(]*[(][^)]*[)]</span>" ), TQString() );
// Remove hidden table rows as well
TQRegExp hidden( "<tr *class= *[\"\']hiddenStructure[\"\']>.*</tr>", false );
hidden.setMinimal( true ); //greedy behaviour wouldn't be any good!
- m_wiki.replace( hidden, TQString::null );
+ m_wiki.tqreplace( hidden, TQString() );
// we want to keep our own style (we need to modify the stylesheet a bit to handle things nicely)
- m_wiki.replace( TQRegExp( "style= *\"[^\"]*\"" ), TQString::null );
- m_wiki.replace( TQRegExp( "class= *\"[^\"]*\"" ), TQString::null );
+ m_wiki.tqreplace( TQRegExp( "style= *\"[^\"]*\"" ), TQString() );
+ m_wiki.tqreplace( TQRegExp( "class= *\"[^\"]*\"" ), TQString() );
// let's remove the form elements, we don't want them.
- m_wiki.replace( TQRegExp( "<input[^>]*>" ), TQString::null );
- m_wiki.replace( TQRegExp( "<select[^>]*>" ), TQString::null );
- m_wiki.replace( "</select>\n" , TQString::null );
- m_wiki.replace( TQRegExp( "<option[^>]*>" ), TQString::null );
- m_wiki.replace( "</option>\n" , TQString::null );
- m_wiki.replace( TQRegExp( "<textarea[^>]*>" ), TQString::null );
- m_wiki.replace( "</textarea>" , TQString::null );
+ m_wiki.tqreplace( TQRegExp( "<input[^>]*>" ), TQString() );
+ m_wiki.tqreplace( TQRegExp( "<select[^>]*>" ), TQString() );
+ m_wiki.tqreplace( "</select>\n" , TQString() );
+ m_wiki.tqreplace( TQRegExp( "<option[^>]*>" ), TQString() );
+ m_wiki.tqreplace( "</option>\n" , TQString() );
+ m_wiki.tqreplace( TQRegExp( "<textarea[^>]*>" ), TQString() );
+ m_wiki.tqreplace( "</textarea>" , TQString() );
//first we convert all the links with protocol to external, as they should all be External Links.
- m_wiki.replace( TQRegExp( "href= *\"http:" ), "href=\"externalurl:" );
- m_wiki.replace( TQRegExp( "href= *\"/" ), "href=\"" +m_wikiBaseUrl );
- m_wiki.replace( TQRegExp( "href= *\"#" ), "href=\"" +m_wikiCurrentUrl + '#' );
+ m_wiki.tqreplace( TQRegExp( "href= *\"http:" ), "href=\"externalurl:" );
+ m_wiki.tqreplace( TQRegExp( "href= *\"/" ), "href=\"" +m_wikiBaseUrl );
+ m_wiki.tqreplace( TQRegExp( "href= *\"#" ), "href=\"" +m_wikiCurrentUrl + '#' );
m_HTMLSource = "<html><body>\n";
m_HTMLSource.append(
@@ -4270,7 +4271,7 @@ ContextBrowser::coverFetched( const TQString &artist, const TQString &album ) //
!m_browseArtists )
{
m_dirtyCurrentTrackPage = true;
- if( m_shownAlbums.contains( album ) )
+ if( m_shownAlbums.tqcontains( album ) )
showCurrentTrack();
return;
}
@@ -4296,7 +4297,7 @@ ContextBrowser::coverRemoved( const TQString &artist, const TQString &album ) //
!m_browseArtists )
{
m_dirtyCurrentTrackPage = true;
- if( m_shownAlbums.contains( album ) )
+ if( m_shownAlbums.tqcontains( album ) )
showCurrentTrack();
return;
}
@@ -4332,7 +4333,7 @@ ContextBrowser::imageFetched( const TQString &url ) //SLOT
if( CollectionDB::instance()->getPodcastEpisodeBundle( currentTrack.url(), &peb ) )
{
PodcastChannelBundle pcb;
- if( CollectionDB::instance()->getPodcastChannelBundle( peb.parent(), &pcb ) )
+ if( CollectionDB::instance()->getPodcastChannelBundle( peb.tqparent(), &pcb ) )
{
if( pcb.imageURL().url() == url )
{
@@ -4362,7 +4363,7 @@ void ContextBrowser::tagsChanged( const MetaBundle &bundle ) //SLOT
{
const MetaBundle &currentTrack = EngineController::instance()->bundle();
- if( !m_shownAlbums.contains( bundle.album() ) && m_artist != bundle.artist() )
+ if( !m_shownAlbums.tqcontains( bundle.album() ) && m_artist != bundle.artist() )
{
if( currentTrack.artist().isEmpty() && currentTrack.album().isEmpty() )
return;
@@ -4378,7 +4379,7 @@ void ContextBrowser::tagsChanged( const TQString &oldArtist, const TQString &old
{
const MetaBundle &currentTrack = EngineController::instance()->bundle();
- if( !m_shownAlbums.contains( oldAlbum ) && m_artist != oldArtist )
+ if( !m_shownAlbums.tqcontains( oldAlbum ) && m_artist != oldArtist )
{
if( currentTrack.artist().isEmpty() && currentTrack.album().isEmpty() )
return;
@@ -4491,7 +4492,7 @@ ContextBrowser::expandURL( const KURL &url )
}
else if( protocol == "stream" ) {
- urls += KURL::fromPathOrURL( url.url().replace( TQRegExp( "^stream:" ), "http:" ) );
+ urls += KURL::fromPathOrURL( url.url().tqreplace( TQRegExp( "^stream:" ), "http:" ) );
}
return urls;