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

List:       kde-commits
Subject:    kdenonbeta/kmobiletools/kmobiletools
From:       Marco Gulino <marco () kmobiletools ! org>
Date:       2005-07-08 20:32:29
Message-ID: 1120854749.219536.23185.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 432873 by gulino:

Whoa! Reading Text mode SMS, finally :)

 M  +22 -8     engines/at_engine/at_jobs.cpp  
 M  +1 -1      engines/gammu_engine/device.cpp  
 M  +1 -0      engines/gammu_engine/device.h  
 M  +7 -0      libkmobiletoolsprivate/sms.h  


--- trunk/kdenonbeta/kmobiletools/kmobiletools/engines/at_engine/at_jobs.cpp \
#432872:432873 @@ -790,19 +790,33 @@
      if( engine->getATAbilities().isPDU() )
         CMGL.setPattern( "^(?:\\+CMGL|\\^SMGL):\\s*(\\d+),([0-4]),(.*),(\\d+)\\s*$" \
);  else 
-        CMGL.setPattern("^(\\+CMGL|\\^SMGL):[\\s]*[\\d]+,.*,.*$");
+        CMGL.setPattern("^(\\+CMGL|\\^SMGL)[\\s]*:(.*),(.*),(.*)$");
 kdDebug() << CMGL.pattern() << endl;
     QStringList::Iterator it = tempbuffer.begin();
     while ( it != tempbuffer.end() )
     {
-        if ( CMGL.search( *it )==0 )
+        if (engine->getATAbilities().isPDU() )
         {
-            index = CMGL.cap(1).toInt();
-            stat = CMGL.cap(2).toInt();
-            ATSMS *sms = decoder.decodeSMS( *(++it), index, stat );
-            addToList( sms );
-        };
-        ++it;
+                if ( CMGL.search( *it )==0 )
+                {
+                index = CMGL.cap(1).toInt();
+                stat = CMGL.cap(2).toInt();
+                ATSMS *sms = decoder.decodeSMS( *(++it), index, stat );
+                addToList( sms );
+                };
+                ++it;
+        } else
+        {
+                if (CMGL.search (*it) == 0 )
+                {
+                kdDebug() << CMGL.cap(1) << "<-->" << CMGL.cap(2) << "<-->" << \
CMGL.cap(3) << "<-->" << CMGL.cap(4) << endl; +                index = \
CMGL.cap(2).toInt(); +                stat = SMS::SMSIntType(CMGL.cap(3) );
+                ATSMS *sms = new ATSMS( QStringList(CMGL.cap(4)) ,  *(++it) );
+                addToList(sms);
+                };
+                ++it;
+        }
     }
 }
 
--- trunk/kdenonbeta/kmobiletools/kmobiletools/engines/gammu_engine/device.cpp \
#432872:432873 @@ -55,7 +55,7 @@
         emit connected();
         kdDebug() << "[ !!! ] Connected. " << e.getErrorMsg(error) << endl;
 
-        mirrorPhone();
+        mirrorPhone(1);
     } 
     else kdDebug() << "[ !!! ] Error. " << e.getErrorMsg(error) << endl;
 }
--- trunk/kdenonbeta/kmobiletools/kmobiletools/engines/gammu_engine/device.h \
#432872:432873 @@ -48,6 +48,7 @@
     void initPhone();
     bool phoneConnected;
     void mirrorPhone();
+    void mirrorPhone(int); /** BOCHI!!!! I added this 'cauze it didn't compile :P \
è_é */  DevicesConfig* Config;
     GSM_StateMachine s;
     GSM_Phone_Functions *phone;
--- trunk/kdenonbeta/kmobiletools/kmobiletools/libkmobiletoolsprivate/sms.h \
#432872:432873 @@ -57,6 +57,13 @@
         }
 }
 
+    static int SMSIntType (QString type) {
+        if (type=="REC UNREAD") return 0;
+        if (type=="REC READ") return 1;
+        if (type=="STO UNSENT") return 2;
+        if (type=="STO SENT") return 3;
+        if (type=="ALL") return 4;
+}
     void setText(const QString & text) { s_text=text; }
     virtual QString getText() const { return s_text; };
     virtual QString getFrom() const;


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

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