summaryrefslogtreecommitdiffstats
path: root/libkcddb/cdinfo.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:43:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:43:15 +0000
commite654398e46e37abf457b2b1122ab898d2c51c49f (patch)
treed39ee6440f3c3663c3ead84a2d4cc2d034667e96 /libkcddb/cdinfo.cpp
parente4f29b18e19394b9352f52a6c0d0d0e3932cf511 (diff)
downloadtdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.tar.gz
tdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1157644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkcddb/cdinfo.cpp')
-rw-r--r--libkcddb/cdinfo.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/libkcddb/cdinfo.cpp b/libkcddb/cdinfo.cpp
index 12009cb8..bf69f853 100644
--- a/libkcddb/cdinfo.cpp
+++ b/libkcddb/cdinfo.cpp
@@ -90,38 +90,38 @@ namespace KCDDB
return *this;
}
- QVariant TrackInfo::get(const QString &type) const {
+ TQVariant TrackInfo::get(const TQString &type) const {
if(type == "title")
return title;
if(type == "extt")
return extt;
- return QVariant();
+ return TQVariant();
}
bool
- CDInfo::load(const QString & s)
+ CDInfo::load(const TQString & s)
{
- return load(QStringList::split('\n', s));
+ return load(TQStringList::split('\n', s));
}
bool
- CDInfo::load(const QStringList & lineList)
+ CDInfo::load(const TQStringList & lineList)
{
clear();
// We'll append to this until we've seen all the lines, then parse it after.
- QString dtitle;
+ TQString dtitle;
- QStringList::ConstIterator it = lineList.begin();
+ TQStringList::ConstIterator it = lineList.begin();
- QRegExp rev("# Revision: (\\d+)");
+ TQRegExp rev("# Revision: (\\d+)");
while ( it != lineList.end() )
{
- QString line(*it);
+ TQString line(*it);
++it;
- QStringList tokenList = KStringHandler::perlSplit('=', line, 2);
+ TQStringList tokenList = KStringHandler::perlSplit('=', line, 2);
if (rev.search(line) != -1)
{
@@ -129,8 +129,8 @@ namespace KCDDB
continue;
}
- QString key = tokenList[0].stripWhiteSpace();
- QString value;
+ TQString key = tokenList[0].stripWhiteSpace();
+ TQString value;
if (2 != tokenList.count())
{
if (!key.startsWith("EXT"))
@@ -201,26 +201,26 @@ namespace KCDDB
QString
CDInfo::toString(bool submit) const
{
- QString s;
+ TQString s;
if (revision != 0)
- s += "# Revision: " + QString::number(revision) + "\n";
+ s += "# Revision: " + TQString::number(revision) + "\n";
if (submit)
{
s += "#\n";
- s += QString("# Submitted via: %1 %2\n").arg(CDDB::clientName(),
+ s += TQString("# Submitted via: %1 %2\n").arg(CDDB::clientName(),
CDDB::clientVersion());
}
s += "DISCID=" + escape( id ) + "\n";
s += createLine("DTITLE",escape( artist ) + " / " + escape( title ));
- s += "DYEAR=" + (0 == year ? QString::null : QString::number(year)) + "\n";
+ s += "DYEAR=" + (0 == year ? TQString::null : TQString::number(year)) + "\n";
s += createLine("DGENRE",escape( genre ));
for (uint i = 0; i < trackInfoList.count(); ++i)
{
- s += createLine(QString("TTITLE%1").arg(i),
+ s += createLine(TQString("TTITLE%1").arg(i),
escape( trackInfoList[ i ].title));
}
@@ -228,7 +228,7 @@ namespace KCDDB
for (uint i = 0; i < trackInfoList.count(); ++i)
{
- s += createLine(QString("EXTT%1").arg(i), escape(trackInfoList[i].extt));
+ s += createLine(TQString("EXTT%1").arg(i), escape(trackInfoList[i].extt));
}
s +="PLAYORDER=\n";
@@ -239,23 +239,23 @@ namespace KCDDB
// Creates a line in the form NAME=VALUE, and splits it into several
// lines if the line gets longer than 256 chars
QString
- CDInfo::createLine(const QString& name, const QString& value) const
+ CDInfo::createLine(const TQString& name, const TQString& value) const
{
Q_ASSERT(name.length() < 254);
uint maxLength = 256 - name.length() - 2;
- QString tmpValue = value;
+ TQString tmpValue = value;
- QString lines;
+ TQString lines;
while (tmpValue.length() > maxLength)
{
- lines += QString("%1=%2\n").arg(name,tmpValue.left(maxLength));
+ lines += TQString("%1=%2\n").arg(name,tmpValue.left(maxLength));
tmpValue = tmpValue.mid(maxLength);
}
- lines += QString("%1=%2\n").arg(name,tmpValue);
+ lines += TQString("%1=%2\n").arg(name,tmpValue);
return lines;
}
@@ -271,9 +271,9 @@ namespace KCDDB
}
QString
- CDInfo::escape( const QString& value )
+ CDInfo::escape( const TQString& value )
{
- QString s = value;
+ TQString s = value;
s.replace( "\\", "\\\\" );
s.replace( "\n", "\\n" );
s.replace( "\t", "\\t" );
@@ -282,9 +282,9 @@ namespace KCDDB
}
QString
- CDInfo::unescape( const QString& value )
+ CDInfo::unescape( const TQString& value )
{
- QString s = value;
+ TQString s = value;
s.replace( "\\n", "\n" );
s.replace( "\\t", "\t" );
@@ -296,7 +296,7 @@ namespace KCDDB
void
CDInfo::clear()
{
- id = artist = title = genre = extd = QString::null;
+ id = artist = title = genre = extd = TQString::null;
length = year = revision = 0;
trackInfoList.clear();
}
@@ -313,7 +313,7 @@ namespace KCDDB
return true;
}
- QVariant CDInfo::get(const QString &type) const {
+ TQVariant CDInfo::get(const TQString &type) const {
if(type == "id")
return id;
if(type == "artist")
@@ -332,7 +332,7 @@ namespace KCDDB
return length;
if(type == "revision")
return revision;
- return QVariant();
+ return TQVariant();
}
}