QTextCodec::codecForUtfText() can detect only unicode signatures (on
purpose) while QTextCodec::codecForText() can detect more
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
KUrl has QVariant operator meaning it should be QVariant from QVariant
(i.e. copy constructor) but the testModel() function (see the history model
test) explicitly converts it to KUrl while the StartMainPage class was
converting it to QUrl (via QVariant::toUrl()).
qVariantFromValue<T>() has type before QVariant specialization
side note, try compiling the following (with proper Makefile):
#include <qurl.h>
#include <qvariant.h>
#include <qdebug.h>
#include <kurl.h>
int main (int argc, char** argv)
{
QVariant v(QUrl());
qDebug() << v.type() << v.userType();
QVariant v2(KUrl());
qDebug() << v2.type() << v2.userType();
return 0;
}
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
also the loaded state does not have to be tracked and a new attempt to load
it (in case of temporary resource failure) may succeed (failures are
neither tracked nor reported by the video widget class)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
this is just pre-face to (maybe) use poster image instead of custom one for
videos in the epub generator
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
KIO::PreviewJob was made for this kind of things, it also does not involve
loading the file (which may play a sound even if the widget is not
visible), seeking, pausing and then grabbing a QWidget snapshot. the only
requirement is for ffmpegthumbs thumbnailer to be installed
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
that KIcon("kget").paint() in ProxyWidget::paint() looks expensive.. may
have to cache the KIcon object aswell and update it when the system icon
theme changes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
fixes regression since the port to KAudioPlayer, the use of qBound() is
there to make sure speakers (or head-phones) do not blow up while the
assert is for developers to know that Okular generator is trying to use
value outside the range
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
QTextCodec::codecForHtml() can detect non-unicode character sets and
character set specified via HTML meta header
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
note that it is MPV itself that requires it thus the media classes (such as
KMediaPlayer, KMediaWidget, etc.) require it
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
the generic image thumbnailer uses a glob that matches image/* and the ps
thumbnailer handles image/x-eps thus the generic image thumbnailer should
have lower preference (its InitialPreference value is set to 1)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
trying to generate entry paths (absolute or otherwise) is the wrong thing
to do, they should be checked if they are in the archive instead (with or
without leading slash)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
note that the depth can be 32 for any quality, the quality it is tuned by
setting other options too (e.g. compression level which I believe has
nothing to do with rendering quality, assuming compression is lossless)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
printing to the QPrinter of QPrintPreviewDialog must be done on demand,
fixes print preview in general
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
generally speaking trying to guess MPRIS interfaces is brute-force guess - it
works kinda. the check that was used before this change however does not
account for applications that are not categorized as audio or music player
but do have MPRIS interface (chromium does).
side note: tested only the MPRIS v2 interface
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>