imdb-rating as textfield

Robby Stephenson robby at periapsis.org
Sat Jan 13 13:31:25 MST 2007


On Friday 12 January 2007 5:33, Niko Sams wrote:
> I use for the imdb-rating field a text-field - as it can save "5.3" and
> not only "5 stars". And imho it is easier to read.

So you changed the type of the field?

> I patched the imdb-fetcher so it saved the exact value from imdb
> (including the decimal):
> --- imdbfetcher.cpp.orig        2007-01-12 14:23:29.000000000 +0100
> +++ imdbfetcher.cpp     2007-01-11 19:43:25.000000000 +0100
> @@ -928,7 +928,7 @@
>      bool ok;
>      float value = rx.cap(1).toFloat(&ok);
>      if(ok) {
> -      entry_->setField(QString::fromLatin1("imdb-rating"),
> QString::number((int)value));
> +      entry_->setField(QString::fromLatin1("imdb-rating"),
> QString::number(value));
>      }
>    }
>  }
>
>
> It looks like this decimal-number works for the normal rating field too
> (although I didn't do too much tests - I guess you will know that better)

The rating widget truncates the text value, so I think that's probably 
harmless. I'll go ahead and make the change.

Robby



More information about the tellico-users mailing list