]> Some of my projects - aniplayer-old.git/commitdiff
- Make library scriptable.
authorAPTX <redacted>
Tue, 4 Aug 2009 22:51:46 +0000 (00:51 +0200)
committerAPTX <redacted>
Tue, 4 Aug 2009 22:51:46 +0000 (00:51 +0200)
- Fix UPTIME reply parsing.

aniplayer.pro
lib/anidbudpclient/abstractcommand.h
lib/anidbudpclient/anidbudpclient.h
lib/anidbudpclient/anidbudpclient.pri
lib/anidbudpclient/anidbudpclient.pro
lib/anidbudpclient/mylistcommand.h
lib/anidbudpclient/uptimecommand.cpp
lib/anidbudpclient/uptimecommand.h

index be5b0e6..a1c4ef5 100644 (file)
@@ -7,4 +7,4 @@ TEMPLATE = subdirs
 
 
 SUBDIRS +=  lib \
-            src
+                       src
index 630f2bc..91587a3 100644 (file)
@@ -196,4 +196,7 @@ protected:
        ReplyCode m_replyCode;
 };
 
+#include <QScriptEngine>
+Q_SCRIPT_DECLARE_QMETAOBJECT(AbstractCommand, QObject*);
+
 #endif // ABSTRACTCOMMAND_H
index 98ed3e1..f688439 100644 (file)
@@ -226,8 +226,6 @@ private:
        QtState *connectingState;
        QtState *connectedState;
        QtState *authenticatingState;
-       QtState *logoutState;
-       QtState *loggedOutState;
 
        QtState *idleState;
        QtState *idleTimeoutState;
@@ -258,4 +256,7 @@ private slots:
        void timerTimeout();
 };
 
+#include <QScriptEngine>
+Q_SCRIPT_DECLARE_QMETAOBJECT(AniDBUdpClient, QObject*);
+
 #endif // ANIDBUDPCLIENT_H
index 8af8ec6..10bcec5 100644 (file)
@@ -1,4 +1,4 @@
-QT *= network
+QT *= network script
 INCLUDEPATH += $$PWD
 DEPENDPATH += $$PWD
 LIBS += -lanidbudpclient
index e0c60af..8e1b8c1 100644 (file)
@@ -1,7 +1,7 @@
 # -------------------------------------------------
 # Project created by QtCreator 2009-03-22T14:53:52
 # -------------------------------------------------
-QT += network
+QT += network script
 QT -= gui
 TEMPLATE = lib
 TARGET = anidbudpclient
index b842d47..67d4ec1 100644 (file)
@@ -111,4 +111,8 @@ private:
 
 };
 
+
+#include <QScriptEngine>
+Q_SCRIPT_DECLARE_QMETAOBJECT(MyListCommand, QObject*);
+
 #endif // MYLISTCOMMAND_H
index 096aa34..7e2aa73 100644 (file)
@@ -25,7 +25,7 @@ void UptimeCommand::setRawReply(ReplyCode replyCode, const QString &reply, AniDB
        {
                case UPTIME:
                {
-                       QString uptimeText = reply.mid(reply.indexOf(' '));
+                       QString uptimeText = reply.mid(reply.indexOf('\n'));
                        bool ok = false;
                        m_uptime = uptimeText.toInt(&ok, 10);
                        if (!ok)
index 98fbd2b..6b1f07b 100644 (file)
@@ -20,4 +20,7 @@ private:
        int m_uptime;
 };
 
+#include <QScriptEngine>
+Q_SCRIPT_DECLARE_QMETAOBJECT(UptimeCommand, QObject*);
+
 #endif // UPTIMECOMMAND_H