#include <QCryptographicHash>
#include <QtConcurrentRun>
#include <QStringList>
+#include <QThread>
#include "anidbudpclient.h"
QByteArray MylistAddCommand::doHash(QString file)
{
qDebug() << "hash thread init";
+ QThread::currentThread()->setPriority(QThread::LowPriority);
+
QFile f(file);
if (!f.open(QIODevice::ReadOnly))
return QByteArray();
addCommand = 0;
destroyed = menuMoving = windowMoving = m_closeOnStop = false;
- m_automarked = true;
+ m_marked = true;
m_automark = 0;
m_currentFile = "";
if (!isFullScreen())
resizeToVideo();
#endif
- if (addCommand)
+ if (!m_marked)
addCommand->deleteLater();
addCommand = new MylistAddCommand(m_currentFile, this);
- m_automarked = false;
+ m_marked = false;
break;
case Phonon::PlayingState:
if (newstate == Phonon::PausedState && mediaObject->remainingTime() == 0)
{
menu->tick(time);
- if (!m_automark || m_automarked)
+ if (!m_automark || m_marked)
return;
int percentPlayed = int(double(time) / double(mediaObject->totalTime()) * double(100));
return;
markWatched();
- m_automarked = true;
+ m_marked = true;
}
void VideoWindow::updateChapters()
void VideoWindow::markWatched()
{
- if (!addCommand)
+ if (m_marked)
{
menu->showMessage("File already Marked");
return;
}
menu->showMessage("Hashing file");
+ m_marked = true;
connect(addCommand, SIGNAL(hashComplete()), this, SLOT(doMarkWatched()));
addCommand->setMarkWatched(true);
qDebug() << "hashing file...";