[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/kmobiletools/kmobiletools
From:       Marco Gulino <marco () kmobiletools ! org>
Date:       2007-05-31 22:36:55
Message-ID: 1180651015.729142.5839.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 670283 by gulino:

First try to do a better handle device probing.
Fixing a null-pointer issue.


 M  +1 -0      engines/at_engine/CMakeLists.txt  
 M  +29 -0     engines/at_engine/at_engine.cpp  
 M  +5 -0      engines/at_engine/at_engine.h  
 A             engines/at_engine/testphonedevice.cpp   [License: GPL (v2+)]
 A             engines/at_engine/testphonedevice.h   [License: GPL (v2+)]
 M  +1 -1      libkmobiletools/enginedata.cpp  
 M  +1 -1      libkmobiletools/job.h  


--- trunk/KDE/kdepim/kmobiletools/kmobiletools/engines/at_engine/CMakeLists.txt \
#670282:670283 @@ -6,6 +6,7 @@
    at_jobs.cpp 
    atabilities.cpp 
    phonebook_jobs.cpp 
+   testphonedevice.cpp 
    sms_jobs.cpp 
    #calendar_jobs.cpp 
    wizard/at_connectionspage.cpp
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/engines/at_engine/at_engine.cpp \
#670282:670283 @@ -38,6 +38,8 @@
 
 #include <config-kmobiletools.h>
 
+#include "testphonedevice.h"
+
 using namespace KMobileTools;
 
 AT_Engine::AT_Engine(QObject *parent, const QString &name)
@@ -86,6 +88,7 @@
 void AT_Engine::slotSearchPhone()
 {
     kDebug() << "********** engine instance name: " << objectName() << endl;
+    searchPhones(static_cast<Connection>(config()->at_connections()), QStringList(), \
config()->at_userdevices() );  //     devicesList()->probeDevices( \
config()->atdevices(), engineLibName(), \
QStringList(config()->at_initString())+=config()->at_initString2(), false, 0, \
config()->mobileimei() );  /// @TODO reimplement
 }
@@ -118,6 +121,7 @@
     KMobileTools::Engine::processSlot(job);
 //     kDebug() << "job Owner: " << p_job->jobOwner() << "; job class: " << \
p_job->className() << endl;  if(job->property("owner") != objectName() ) return;
+    kDebug() << "KMobileTools::Engine::processSlot; jobType=" << job->type() << \
endl;  p_lastJob=0;
 //     kDebug() << "is KMobileToolsJob: " << p_job->inherits("KMobileTools::Job") << \
                endl;
     KMobileTools::DevicesConfig \
*wconfig=KMobileTools::DevicesConfig::prefs(objectName() ); @@ -647,3 +651,28 @@
     return (ATDevicesConfig*) ATDevicesConfig::prefs(gpname );
 }
 
+void AT_Engine::searchPhones(Connection connections, const QStringList \
&bluetoothDevices, const QStringList &customDevices) { +    QStringList devices;
+    if(connections & ConnectionUSB)
+        for(uchar i=0; i<10; i++) {
+            enqueueJob(new TestPhoneDeviceJob(QString("/dev/ttyACM%1").arg(i), this) \
); +            enqueueJob(new TestPhoneDeviceJob(QString("/dev/ttyUSB%1").arg(i), \
this) ); +        }
+    if(connections & ConnectionIrDA)
+        for(uchar i=0; i<10; i++) {
+            enqueueJob(new TestPhoneDeviceJob(QString("/dev/ircomm%1").arg(i), this) \
); +        }
+    if(connections & ConnectionSerial)
+        for(uchar i=0; i<10; i++) {
+            enqueueJob(new TestPhoneDeviceJob(QString("/dev/ttyS%1").arg(i), this) \
); +        }
+    if(connections & ConnectionBluetooth)
+        for(QStringList::ConstIterator it=bluetoothDevices.begin(); \
it!=bluetoothDevices.end(); ++it) +            enqueueJob(new TestPhoneDeviceJob(*it, \
this) ); +    if(connections & ConnectionUser)
+        for(QStringList::ConstIterator it=customDevices.begin(); \
it!=customDevices.end(); ++it) +            enqueueJob(new TestPhoneDeviceJob(*it, \
this) ); +}
+
+
+
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/engines/at_engine/at_engine.h \
#670282:670283 @@ -45,6 +45,9 @@
 @author Marco Gulino
 */
 using namespace ThreadWeaver;
+
+typedef QHash<QString,KMobileTools::EngineData> ATDevices;
+
 class AT_Engine : public KMobileTools::Engine
 {
 Q_OBJECT
@@ -53,6 +56,7 @@
     explicit AT_Engine(QObject *parent = 0, const QString &name = QString() );
 
     ~AT_Engine();
+    enum ATJobTypes { TestPhoneDevice=KMobileTools::Job::UserJob+1 };
 //     enum jobTypes
 //     { PollStatus=1, PollSMS=2 };
 
@@ -90,6 +94,7 @@
             return retval;
         }
         KMobileTools::Job *p_lastJob;
+        void searchPhones(Connection connections, const QStringList \
&bluetoothDevices, const QStringList &customDevices);  public slots:
     void slotPollStatus();
     void processSlot(KMobileTools::Job* );
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/libkmobiletools/enginedata.cpp \
#670282:670283 @@ -48,7 +48,7 @@
     : QObject(parentEngine), d(new EngineDataPrivate)
 {
     d->engine=parentEngine;
-    d->p_smsList=new SMSList(d->engine->objectName() );
+    if(d->engine) d->p_smsList=new SMSList(d->engine->objectName() );
     d->p_addresseeList = new ContactsList();
     d->p_calendar=new KCal::Event::List();
 }
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/libkmobiletools/job.h #670282:670283
@@ -32,7 +32,7 @@
         explicit Job (Job *pjob, QObject* parent = 0);
         ~Job();
       enum JobType
-        { UnknownJob=255, initPhone=0, pollStatus=-1, fetchSMS=-2, \
fetchAddressBook=-3, fetchPhoneInfos=-4, testPhoneFeatures=-5, +        { \
UserJob=255, initPhone=0, pollStatus=-1, fetchSMS=-2, fetchAddressBook=-3, \
fetchPhoneInfos=-4, testPhoneFeatures=-5,  syncDateTimeJob=-6, selectSMSSlot=-7, \
selectCharacterSet=-8, sendSMS=-9, storeSMS=-10, sendStoredSMS=-11, addAddressee=-12, \
delAddressee=-13, editAddressee=-14,  smsFolders=-15, delSMS=-16, fetchKCal=-17 };
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic