libtdebluez and tdebluez cleaned up includes

Signed-off-by: Emanoil Kotsev <deloptes@gmail.com>
pull/1/head
Emanoil Kotsev 4 years ago
parent e2a267599a
commit df63905c79

@ -25,7 +25,7 @@
// QT - Header
#include <tqtimer.h>
//
// debug
#include <kdebug.h>
@ -35,15 +35,12 @@
#include <tqdbusobjectpath.h>
#include <tqdbusdatamap.h>
#include <tqdbusdata.h>
#include <tqdbusdatalist.h>
#include <tqdbusvariant.h>
//
#include <tqstringlist.h>
#include "obexobjectmanagerImpl.h"
#include "../libtdebluez/btuuids.h"
namespace TDEObex
{
@ -56,8 +53,7 @@ ObexObjectManagerImpl::ObexObjectManagerImpl(const TQString& service, const TQSt
ObexObjectManagerImpl::~ObexObjectManagerImpl()
{
if( dBusConn.isConnected() )
close();
close();
}
/*!
@ -98,7 +94,15 @@ TQT_DBusConnection* ObexObjectManagerImpl::getConnection() {
* \retval true if successful closed the connection
* \retval false if any problems
*/
bool ObexObjectManagerImpl::close() {
bool ObexObjectManagerImpl::close() { org::bluez::obex::AgentManager1Proxy* mAgentManager;
if(mClient)
delete mClient;
if(mSession)
delete mSession;
if(mFileTransfer)
delete mFileTransfer;
disconnect(this,
SIGNAL(InterfacesAdded(const TQT_DBusObjectPath&, const TQT_DBusDataMap< TQString >&)),
this,
@ -107,7 +111,8 @@ bool ObexObjectManagerImpl::close() {
SIGNAL(InterfacesRemoved(const TQT_DBusObjectPath& , const TQStringList& )),
this,
SLOT(slotInterfacesRemoved(const TQT_DBusObjectPath& , const TQStringList& )));
dBusConn.closeConnection(DBUS_CONN_NAME);
if( dBusConn.isConnected() )
dBusConn.closeConnection(DBUS_CONN_NAME);
return true;
}
@ -132,18 +137,15 @@ bool ObexObjectManagerImpl::initDBUS(){
tqDebug("GetManagedObjects(objects,error) FAILED\n");
return false;
}
// bool ok = false;
// TQT_DBusDataMap<TQT_DBusObjectPath> objects = data.toObjectPathKeyMap(&ok);
// if (!ok) return false;
TQT_DBusDataMap<TQT_DBusObjectPath>::const_iterator it = objects.begin();
for (it; it != objects.end(); ++it) {
// TQCString objectpath (it.key());
bool ok = false;
TQT_DBusDataMap<TQString> tqMap1 = it.data().toStringKeyMap(&ok);
if (!ok)
if (!ok) {
tqWarning("Failed to convert dbus data to string map: %s", it.key().latin1());
if (!ok) return false;
return false;
}
slotInterfacesAdded(it.key(), tqMap1);
}
@ -156,14 +158,6 @@ bool ObexObjectManagerImpl::initDBUS(){
return true;
}
// inherited from ObjectManager
//void ObexObjectManagerImpl::AsyncErrorResponseDetected(int asyncCallId, const TQT_DBusError error) {
// kdDebug() << k_funcinfo << endl;
//
//}
//
/*!
* This function initialise the connection to the D-Bus daemon.
* \return pointer to AgentManager1
@ -186,23 +180,35 @@ void ObexObjectManagerImpl::slotInterfacesAdded(const TQT_DBusObjectPath& object
TQString interface = it1.key();
if ( interface == "org.bluez.obex.AgentManager1" ) {
mAgentManager = new org::bluez::obex::AgentManager1Proxy("org.bluez.obex", object);
if (mAgentManager)
if (mAgentManager) {
mAgentManager->setConnection(dBusConn);
} else {
tqDebug("org.bluez.obex.AgentManager1 initialization failed\n");
}
}
else if ( interface == "org.bluez.obex.Client1" ) {
mClient = new org::bluez::obex::Client1Proxy("org.bluez.obex", object);
if (mClient)
if (mClient) {
mClient->setConnection(dBusConn);
} else {
tqDebug("org.bluez.obex.Client1 initialization failed\n");
}
}
else if ( interface == "org.bluez.obex.Session1" ) {
mSession = new org::bluez::obex::Session1Proxy("org.bluez.obex", object);
if (mSession)
if (mSession) {
mSession->setConnection(dBusConn);
} else {
tqDebug("org.bluez.obex.Session1 initialization failed\n");
}
}
else if ( interface == "org.bluez.obex.FileTransfer1" ) {
mFileTransfer = new org::bluez::obex::FileTransfer1Proxy("org.bluez.obex", object);
if (mFileTransfer)
if (mFileTransfer) {
mFileTransfer->setConnection(dBusConn);
} else {
tqDebug("org.bluez.obex.FileTransfer1 initialization failed\n");
}
}
else if ( interface == "org.freedesktop.DBus.Introspectable" ) {
// do nothing
@ -222,6 +228,12 @@ void ObexObjectManagerImpl::slotInterfacesRemoved(const TQT_DBusObjectPath& obje
else if ( (*it) == "org.bluez.obex.Client1") {
// TODO: remove Client1
}
else if ( (*it) == "org.bluez.obex.Session1" ) {
// TODO: remove Session1
}
else if ( (*it) == "org.bluez.obex.FileTransfer1" ) {
// TODO: remove FileTransfer1
}
else {
tqWarning("Interface not implemented: %s", (*it).local8Bit().data());
}

@ -28,7 +28,6 @@
#include <tqdbusconnection.h>
#include <tdelocale.h>
//#include <ntqobject.h>
#include "interfaces/propertiesProxy.h"
#include "interfaces/objectmanagerProxy.h"
@ -68,6 +67,11 @@ public:
private:
bool initDBUS();
void slotInterfacesAdded(const TQT_DBusObjectPath& object, const TQT_DBusDataMap< TQString >& interfaces);
void slotInterfacesRemoved(const TQT_DBusObjectPath& object, const TQStringList& interfaces);
private:
//! TQt connection to D-Bus
TQT_DBusConnection dBusConn;
@ -82,16 +86,6 @@ signals:
private slots:
bool reconnect();
// inherited from ObjectManager
//signals:
// virtual void AsyncErrorResponseDetected(int asyncCallId, const TQT_DBusError error);
//virtual void InterfacesAdded(const TQT_DBusObjectPath& object, const TQT_DBusDataMap< TQString >& interfaces);
//virtual void InterfacesRemoved(const TQT_DBusObjectPath& object, const TQStringList& interfaces);
void slotInterfacesAdded(const TQT_DBusObjectPath& object, const TQT_DBusDataMap< TQString >& interfaces);
void slotInterfacesRemoved(const TQT_DBusObjectPath& object, const TQStringList& interfaces);
}; // class ObexObjectManagerImpl
}; // namespace TDEObex

@ -23,8 +23,6 @@
#include <tdecmdlineargs.h>
#include <tdeaboutdata.h>
//#include <tdelocale.h>
//#include <tdeapplication.h>
#include <iostream>
#include "application.h"
@ -40,8 +38,6 @@ static TDECmdLineOptions options[] =
extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
{
//int main(int argc, char *argv[])
//{
TDELocale::setMainCatalogue("tdebluez");
TDEAboutData aboutData("tdebluez",
I18N_NOOP("TDEBluetooth"),
@ -66,15 +62,6 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
TDEBluetoothApp a;
// if (a.noAdapter == true) {
// KMessageBox::error(NULL,i18n("No Bluetooth Adapter found!\nUnable to start kbluetooth.\n\n \
// Plug in a Bluetooth Adapter or restart the bluetooth service."));
// std::cerr << i18n("No Bluetooth Adapter found!\nUnable to start kbluetooth.\n\n \
// Plug in a Bluetooth Adapter or restart the bluetooth service.\n").local8Bit();
// KUniqueApplication::kApplication()->quit();
// return 0;
// }
if (!a.manager->isConnectedToDBUS())
{
KMessageBox::error(NULL,i18n("Can't connect to DBus!\nUnable to start tdebluez. \n\n \

@ -25,8 +25,8 @@
#include <kdebug.h>
#include <ntqpushbutton.h>
#include <ntqslider.h>
#include <tqpushbutton.h>
#include <tqslider.h>
#include <kiconloader.h>
#include "mediacontrol.h"

@ -27,7 +27,7 @@
#define MEDIACONTROL_H_INCLUDED
#include <kdialogbase.h>
#include <ntqobject.h>
#include <tqobject.h>
#include <interfaces/mediacontrol1Proxy.h>
#include "mediactl.h"

@ -26,7 +26,8 @@
#ifndef AUTHORIZE_H
#define AUTHORIZE_H
#include <ntqlabel.h>
#include <tqlabel.h>
#include <kdialogbase.h>
#include "application.h"

@ -12,8 +12,8 @@
#include <tdelocale.h>
#include <iostream>
#include <kdebug.h>
#include <ntqdatetime.h>
#include <ntqtimer.h>
#include <tqdatetime.h>
#include <tqtimer.h>
#include <tdeio/job.h>
CommandHandler::CommandHandler(TDECmdLineArgs *args)

@ -10,10 +10,10 @@
#ifndef COMMANDHANDLER_H
#define COMMANDHANDLER_H
#include <ntqobject.h>
#include <ntqstringlist.h>
#include <tqobject.h>
#include <tqstringlist.h>
#include <tdeio/jobclasses.h>
#include <ntqfile.h>
#include <tqfile.h>
#include <kurl.h>
class TDECmdLineArgs;
@ -41,20 +41,13 @@ private:
void copy(const TQStringList& sources, const TQString& target);
void commonConnect(TDEIO::Job* job);
TQString command;
TQString origCommand;
TQString target;
TQStringList targets;
TQStringList sources;
TQString command, origCommand, target, lastMessage;
TQStringList targets, sources;
TDEIO::Job* job;
int returnValue;
TDECmdLineArgs *args;
TQFile outFile;
TQFile inFile;
bool showProgressWindow;
TQString lastMessage;
bool overwrite;
bool iterate;
TQFile outFile, inFile;
bool showProgressWindow, overwrite, iterate;
private slots:
void slotFinished(TDEIO::Job *job);

@ -14,7 +14,7 @@
#include <tdecmdlineargs.h>
#include <tdelocale.h>
#include <kurl.h>
#include <ntqwidget.h>
#include <tqwidget.h>
#include "commandhandler.h"

@ -29,8 +29,8 @@ install(
##### other data ################################
# EXAMPLES
#install( FILES knotes.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
#install( FILES knoteconfig.kcfg knotesglobalconfig.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
#install( FILES knotesappui.rc knotesui.rc DESTINATION ${DATA_INSTALL_DIR}/knotes )
#install( FILES local.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources/knotes )
#install( FILES knotes_manager.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources )
#install( FILES <xxx>.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
#install( FILES <xxx>config.kcfg <xxx>globalconfig.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
#install( FILES <xxx>appui.rc knotesui.rc DESTINATION ${DATA_INSTALL_DIR}/<xxx> )
#install( FILES local.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources/<xxx> )
#install( FILES <xxx>_manager.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources )

@ -13,12 +13,12 @@
#include <sys/stat.h>
//#include <unistd.h>
#include <kinstance.h>
//#include <kinstance.h>
#include <dcopclient.h>
#include <tdeapplication.h>
#include <tdecmdlineargs.h>
#include <ntqeventloop.h>
#include <ntqregexp.h>
//#include <tqeventloop.h>
#include <tqregexp.h>
#include <devicemimeconverter.h>
#include <deviceImpl.h>

@ -12,10 +12,8 @@
#ifndef _TDEIOBT_H_
#define _TDEIOBT_H_
#include <ntqstring.h>
#include <tdeio/slavebase.h>
//#include <tdeio/forwardingslavebase.h>
#include <kuser.h>
#include <vector>
#include <adapterImpl.h>

@ -26,13 +26,10 @@
#include <grp.h>
#include <kdebug.h>
#include <tdelocale.h>
#include <tqeventloop.h>
#include <tdeapplication.h>
#include <dcopclient.h>
#include <tdecmdlineargs.h>
#include <tdeglobal.h>
#include <ntqtimer.h>
#include <tqdbusvariant.h>
#include <tqdbusdatalist.h>

Loading…
Cancel
Save