From: unknown Date: Sat, 28 Mar 2009 11:36:26 +0000 (+0100) Subject: - Some cleanup. X-Git-Url: https://gitweb.tyo.aptx.org/?a=commitdiff_plain;h=24e7d4afb562892a72c37c6f5bf303d5938396d5;p=aniplayer-old.git - Some cleanup. --- diff --git a/lib/anidbudpclient/mylistaddcommand.cpp b/lib/anidbudpclient/mylistaddcommand.cpp index e8fa659..8f687eb 100644 --- a/lib/anidbudpclient/mylistaddcommand.cpp +++ b/lib/anidbudpclient/mylistaddcommand.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "anidbudpclient.h" @@ -143,6 +144,8 @@ qDebug() << "WTF?"; QByteArray MylistAddCommand::doHash(QString file) { qDebug() << "hash thread init"; + QThread::currentThread()->setPriority(QThread::LowPriority); + QFile f(file); if (!f.open(QIODevice::ReadOnly)) return QByteArray(); diff --git a/src/videowindow.cpp b/src/videowindow.cpp index 244c660..8cb21be 100644 --- a/src/videowindow.cpp +++ b/src/videowindow.cpp @@ -39,7 +39,7 @@ VideoWindow::VideoWindow(QWidget *parent) : QMainWindow(parent) addCommand = 0; destroyed = menuMoving = windowMoving = m_closeOnStop = false; - m_automarked = true; + m_marked = true; m_automark = 0; m_currentFile = ""; @@ -410,11 +410,11 @@ qDebug() << "Media changed state from" << oldstate << "to" << newstate; 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) @@ -428,7 +428,7 @@ void VideoWindow::tick(qint64 time) { menu->tick(time); - if (!m_automark || m_automarked) + if (!m_automark || m_marked) return; int percentPlayed = int(double(time) / double(mediaObject->totalTime()) * double(100)); @@ -436,7 +436,7 @@ void VideoWindow::tick(qint64 time) return; markWatched(); - m_automarked = true; + m_marked = true; } void VideoWindow::updateChapters() @@ -572,13 +572,14 @@ void VideoWindow::moveWithMenu() 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..."; diff --git a/src/videowindow.h b/src/videowindow.h index 83dee89..18d80ec 100644 --- a/src/videowindow.h +++ b/src/videowindow.h @@ -159,7 +159,7 @@ private: bool m_closeOnStop; int m_automark; - bool m_automarked; + bool m_marked; DirectoryPlaylist *playlist; AniDBUdpClient *anidb;