Skip to content

Commit

Permalink
Patch from Hirobumi Shimada to better handle unicode characters in mo…
Browse files Browse the repository at this point in the history
…re fields. (minus the part that would have borked scrolling in the browser if inData was a negative number.

git-svn-id: http://svn.mythtv.org/svn/trunk@3747 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
J. Donovan Stanley committed May 26, 2004
1 parent 8a50045 commit 3f2e5d8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
26 changes: 13 additions & 13 deletions mythplugins/mythvideo/mythvideo/metadata.cpp
Expand Up @@ -173,18 +173,18 @@ void Metadata::fillData(QSqlDatabase *db)
{
query.next();

title = query.value(0).toString();
director = query.value(1).toString();
plot = query.value(2).toString();
rating = query.value(3).toString();
title = QString::fromUtf8(query.value(0).toString());
director = QString::fromUtf8(query.value(1).toString());
plot = QString::fromUtf8(query.value(2).toString());
rating = QString::fromUtf8(query.value(3).toString());
year = query.value(4).toInt();
userrating = (float)query.value(5).toDouble();
length = query.value(6).toInt();
filename = query.value(7).toString();
filename = QString::fromUtf8(query.value(7).toString());
showlevel = query.value(8).toInt();
id = query.value(9).toUInt();
coverfile = query.value(10).toString();
inetref = query.value(11).toString();
coverfile = QString::fromUtf8(query.value(10).toString());
inetref = QString::fromUtf8(query.value(11).toString());
childID = query.value(12).toUInt();
browse = query.value(13).toBool();
playcommand = query.value(14).toString();
Expand All @@ -211,17 +211,17 @@ void Metadata::fillDataFromID(QSqlDatabase *db)
{
query.next();

title = query.value(0).toString();
director = query.value(1).toString();
plot = query.value(2).toString();
title = QString::fromUtf8(query.value(0).toString());
director = QString::fromUtf8(query.value(1).toString());
plot = QString::fromUtf8(query.value(2).toString());
rating = query.value(3).toString();
year = query.value(4).toInt();
userrating = (float)query.value(5).toDouble();
length = query.value(6).toInt();
filename = query.value(7).toString();
filename = QString::fromUtf8(query.value(7).toString());
showlevel = query.value(8).toInt();
coverfile = query.value(9).toString();
inetref = query.value(10).toString();
coverfile = QString::fromUtf8(query.value(9).toString());
inetref = QString::fromUtf8(query.value(10).toString());
childID = query.value(11).toUInt();
browse = query.value(12).toBool();
playcommand = query.value(13).toString();
Expand Down
8 changes: 4 additions & 4 deletions mythplugins/mythvideo/mythvideo/videobrowser.cpp
Expand Up @@ -580,15 +580,15 @@ void VideoBrowser::updateInfo(QPainter *p)
{
UITextType *type = (UITextType *)container->GetType("title");
if (type)
type->SetText(QString::fromUtf8(title));
type->SetText(title);

type = (UITextType *)container->GetType("filename");
if (type)
type->SetText(filename);

type = (UITextType *)container->GetType("director");
if (type)
type->SetText(QString::fromUtf8(director));
type->SetText(director);

type = (UITextType *)container->GetType("year");
if (type)
Expand All @@ -611,7 +611,7 @@ void VideoBrowser::updateInfo(QPainter *p)

type = (UITextType *)container->GetType("plot");
if (type)
type->SetText(QString::fromUtf8(plot));
type->SetText(plot);

type = (UITextType *)container->GetType("userrating");
if (type)
Expand Down Expand Up @@ -708,7 +708,7 @@ void VideoBrowser::jumpSelection(int amount)
inData += amount;

if (inData < 0)
inData = m_list.count() - abs(1 - inData);
inData = m_list.count() + inData - 1;
else if(inData >= (int)m_list.count())
inData = inData - m_list.count();

Expand Down

0 comments on commit 3f2e5d8

Please sign in to comment.