From: APTX Date: Thu, 10 Feb 2011 20:17:10 +0000 (+0100) Subject: Initial work on setting file state. X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=1df34125040f9656ea2fc9e58bda821850f96e88;p=anidbudpclient.git Initial work on setting file state. --- diff --git a/file.cpp b/file.cpp index 75375b9..39ecf91 100644 --- a/file.cpp +++ b/file.cpp @@ -155,6 +155,10 @@ bool File::markWatched() return true; } +void File::setState(const MyListAddCommand &state) +{ + m_state = state; +} void File::finishHashing() { @@ -243,6 +247,11 @@ void File::finishMarking(bool success) updateStatus(MarkingWatched, Success); } +void File::finishSetState(bool success) +{ + +} + void File::work() { qDebug() << "work"; @@ -398,10 +407,16 @@ void File::startMarking() if (markReply) markReply->deleteLater(); markReply = clientInstance()->send(markCommand); connect(markReply, SIGNAL(replyReady(bool)), this, SLOT(finishMarking(bool))); - updateStatus(MarkingWatched, InProgress); } +void File::startSetState() +{ + m_state.setEd2k(m_ed2k); + m_state.setSize(m_file.size()); + m_state.setEdit(true); +} + void File::init() { hashResult = 0; @@ -437,8 +452,7 @@ void File::updateStatus(Action action, ActionState actionState) break; case MarkingWatched: m_markingState = actionState; - default: - return; + break; } emit statusUpdate(action, actionState); } diff --git a/file.h b/file.h index 3174f59..8e04798 100644 --- a/file.h +++ b/file.h @@ -81,6 +81,8 @@ public slots: bool addToMyList(); bool markWatched(); + void setState(const MyListAddCommand &state); + signals: void statusUpdate(AniDBUdpClient::File::Action action, AniDBUdpClient::File::ActionState state, int percent = 0); void finished(); @@ -90,6 +92,7 @@ private slots: void finishRenaming(bool success); void finishAdding(bool success); void finishMarking(bool success); + void finishSetState(bool success); void work(); void workOnFinished(AniDBUdpClient::File::Action action, AniDBUdpClient::File::ActionState actionState); @@ -102,6 +105,7 @@ private: void startRenaming(); void startAdding(); void startMarking(); + void startSetState(); void init(); @@ -128,13 +132,15 @@ private: FileRenameDelegate *m_renameDelegate; + MyListAddCommand m_state; + ClientInterface *clientInstance() const; static ClientInterface *m_clientInterface; + public: static ClientInterface *clientInterface(); static void setClientInterface(ClientInterface *clientInterface); - }; } // namespace AniDBUdpClient