Remove some Qt-dependencies
This commit is contained in:
parent
5303970913
commit
96b581d96c
3 changed files with 7 additions and 9 deletions
|
@ -12,7 +12,7 @@
|
||||||
#include "TellStick.h"
|
#include "TellStick.h"
|
||||||
#include "TellStickDuo.h"
|
#include "TellStickDuo.h"
|
||||||
#include "telldus-core.h"
|
#include "telldus-core.h"
|
||||||
#include <string>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
using namespace TelldusCore;
|
using namespace TelldusCore;
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "Thread.h"
|
#include "Thread.h"
|
||||||
#include "Manager.h"
|
#include "Manager.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#if defined(_WINDOWS) && defined(LIBFTD2XX)
|
#if defined(_WINDOWS) && defined(LIBFTD2XX)
|
||||||
typedef HANDLE EVENT_HANDLE;
|
typedef HANDLE EVENT_HANDLE;
|
||||||
|
@ -42,7 +43,7 @@ namespace TelldusCore {
|
||||||
TellStickDuo *parent;
|
TellStickDuo *parent;
|
||||||
EVENT_HANDLE eh;
|
EVENT_HANDLE eh;
|
||||||
bool running;
|
bool running;
|
||||||
QMutex mutex;
|
MUTEX mutex;
|
||||||
std::string message;
|
std::string message;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -91,7 +92,7 @@ PrivateTellStickDuoListener::~PrivateTellStickDuoListener() {
|
||||||
void PrivateTellStickDuoListener::stop() {
|
void PrivateTellStickDuoListener::stop() {
|
||||||
if (running) {
|
if (running) {
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&mutex);
|
MutexLocker locker(&mutex);
|
||||||
running = false;
|
running = false;
|
||||||
}
|
}
|
||||||
//Unlock the wait-condition
|
//Unlock the wait-condition
|
||||||
|
@ -123,7 +124,7 @@ void PrivateTellStickDuoListener::run() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&mutex);
|
MutexLocker locker(&mutex);
|
||||||
running = true;
|
running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +140,7 @@ void PrivateTellStickDuoListener::run() {
|
||||||
pthread_mutex_unlock(&eh.eMutex);
|
pthread_mutex_unlock(&eh.eMutex);
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&mutex);
|
MutexLocker locker(&mutex);
|
||||||
if (!running) {
|
if (!running) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -173,7 +174,7 @@ void PrivateTellStickDuoListener::processData( const std::string &data ) {
|
||||||
} else if (data[i] == 10) { // \n found
|
} else if (data[i] == 10) { // \n found
|
||||||
if (message.substr(0,2).compare("+V") == 0) {
|
if (message.substr(0,2).compare("+V") == 0) {
|
||||||
//parent->fwVersion = atoi(message.substr(2).c_str());
|
//parent->fwVersion = atoi(message.substr(2).c_str());
|
||||||
printf("Firmware version: %s\n", message.substr(2).c_str());
|
//printf("Firmware version: %s\n", message.substr(2).c_str());
|
||||||
} else if (message.substr(0,2).compare("+R") == 0) {
|
} else if (message.substr(0,2).compare("+R") == 0) {
|
||||||
Manager *manager = Manager::getInstance();
|
Manager *manager = Manager::getInstance();
|
||||||
manager->parseMessage(message.substr(2), parent);
|
manager->parseMessage(message.substr(2), parent);
|
||||||
|
|
|
@ -12,9 +12,6 @@
|
||||||
#ifndef TELLSTICKDUO_H
|
#ifndef TELLSTICKDUO_H
|
||||||
#define TELLSTICKDUO_H
|
#define TELLSTICKDUO_H
|
||||||
|
|
||||||
#include <QThread>
|
|
||||||
#include <QMutex>
|
|
||||||
|
|
||||||
#include "TellStick.h"
|
#include "TellStick.h"
|
||||||
#include "ftd2xx.h"
|
#include "ftd2xx.h"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue