[kmobiletools] KDE/kdepim/kmobiletools/kmobiletools/engines

Marco Gulino marco at kmobiletools.org
Fri Jun 1 20:33:37 CEST 2007


SVN commit 670492 by gulino:

New wizard page templates.


 M  +8 -5      at_engine/at_engine.cpp  
 M  +4 -1      at_engine/at_engine.h  
 M  +2 -2      at_engine/testphonedevice.cpp  
 M  +3 -2      at_engine/testphonedevice.h  
 M  +8 -1      libkmobiletoolsengineui/CMakeLists.txt  
 A             libkmobiletoolsengineui/devicesfoundPage.cpp   [License: GPL (v2+)]
 A             libkmobiletoolsengineui/devicesfoundPage.h   [License: GPL (v2+)]
 A             libkmobiletoolsengineui/devicesfoundPage.ui  
 A             libkmobiletoolsengineui/scanprogressPage.cpp   [License: GPL (v2+)]
 A             libkmobiletoolsengineui/scanprogressPage.h   [License: GPL (v2+)]
 A             libkmobiletoolsengineui/scanprogressPage.ui  


--- trunk/KDE/kdepim/kmobiletools/kmobiletools/engines/at_engine/at_engine.cpp #670491:670492
@@ -212,17 +212,20 @@
 #endif
             break;
         case TestPhoneDevice:
-            TestPhoneDeviceJob *djob=(TestPhoneDeviceJob*)job;
-            l_testphonejobs.removeAll(djob);
-            if(djob->found() && djob->data()->imei() == config()->mobileimei() ) {
-                kDebug() << "Probe finished: phone found in " << djob->path() << endl;
+            l_testphonejobs.removeAll((TestPhoneDeviceJob*)job);
+            if( ((TestPhoneDeviceJob*)job)->found() &&
+                ((TestPhoneDeviceJob*)job)->data()->imei() == config()->mobileimei() ) {
+                kDebug() << "Probe finished: phone found in " << ((TestPhoneDeviceJob*)job)->path() << endl;
                 while(!l_testphonejobs.isEmpty())
                     ThreadWeaver()->dequeue(l_testphonejobs.takeFirst());
-                engineData()->setProperty("devicePath", djob->path());
+                engineData()->setProperty("devicePath", ((TestPhoneDeviceJob*)job)->path());
                 slotInitPhone();
             }
             kDebug() << "jobs remaining: " << l_testphonejobs.count() << endl;
             break;
+        case FindDeviceData:
+            emit foundDeviceData((FindDeviceDataJob*) job);
+            break;
     }
 }
 
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/engines/at_engine/at_engine.h #670491:670492
@@ -39,6 +39,7 @@
 class QWizardPage;
 class ATDevicesConfig;
 class TestPhoneDeviceJob;
+class FindDeviceDataJob;
 /**
 @author Marco Gulino
 */
@@ -54,7 +55,7 @@
     explicit AT_Engine(QObject *parent = 0, const QString &name = QString() );
 
     ~AT_Engine();
-    enum ATJobTypes { TestPhoneDevice=KMobileTools::Job::UserJob+1 };
+    enum ATJobTypes { TestPhoneDevice=KMobileTools::Job::UserJob+1, FindDeviceData=KMobileTools::Job::UserJob+2 };
 //     enum jobTypes
 //     { PollStatus=1, PollSMS=2 };
 
@@ -129,6 +130,8 @@
     void slotDevConnected();
     void slotFetchCalendar();
     void slotSwitchToFSMode();
+signals:
+    void foundDeviceData(FindDeviceDataJob*);
 };
 
 
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/engines/at_engine/testphonedevice.cpp #670491:670492
@@ -54,12 +54,12 @@
     b_found=true;
 }
 
-FindDeviceData::FindDeviceData(const QString &devicename, AT_Engine* parent): TestPhoneDeviceJob(devicename, parent)
+FindDeviceDataJob::FindDeviceDataJob(const QString &devicename, AT_Engine* parent): TestPhoneDeviceJob(devicename, parent)
 {
     b_closeafterimei=false;
 }
 
-void FindDeviceData::run() {
+void FindDeviceDataJob::run() {
     TestPhoneDeviceJob::run();
     p_device->close();
 }
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/engines/at_engine/testphonedevice.h #670491:670492
@@ -48,12 +48,13 @@
     bool b_closeafterimei; /// if false, we could subclass run() to extend the job taking other parameters than the imei.
 };
 
-class FindDeviceData : public TestPhoneDeviceJob {
+class FindDeviceDataJob : public TestPhoneDeviceJob {
 Q_OBJECT
 /// This one extends the previous class, being able to find more informations about the device.
 /// It can be used in the wizard, so the user can also get more data about found phones.
 public:
-    FindDeviceData(const QString &devicename, AT_Engine* parent);
+    FindDeviceDataJob(const QString &devicename, AT_Engine* parent);
+    JobType type() { return static_cast<JobType>(AT_Engine::FindDeviceData); }
 protected:
     void run();
 };
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/engines/libkmobiletoolsengineui/CMakeLists.txt #670491:670492
@@ -2,11 +2,16 @@
 
 set(kmobiletoolsengineui_LIB_SRCS 
    connectionsPage.cpp
+   scanprogressPage.cpp
+   devicesfoundPage.cpp
    )
 
 kde4_automoc(${kmobiletoolsengineui_LIB_SRCS})
 
-kde4_add_ui_files(kmobiletoolsengineui_LIB_SRCS connectionsPage.ui )
+kde4_add_ui_files(kmobiletoolsengineui_LIB_SRCS connectionsPage.ui
+   devicesfoundPage.ui
+   scanprogressPage.ui
+   )
 
 #kde4_add_kcfg_files(kmobiletoolsengineui_LIB_SRCS kmobiletools_cfg.kcfgc kmobiletools_devices.kcfgc )
 
@@ -23,5 +28,7 @@
 #install( FILES  kmobiletoolsengine.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} )
 install(FILES
    connectionsPage.h
+   devicesfoundPage.h
+   scanprogressPage.h
    DESTINATION ${INCLUDE_INSTALL_DIR}/kmobiletools)
 


More information about the kmobiletools mailing list