Hi,
I started to use SynCE-KDE and discovered few bugs so I made few fixes :-)
All diffs are against the SVN trunk from 16.10.2007.

RAKI:
 - fetching software list on WM2003 fixed
        (different registry keys on WM2003 and WM5)
 - installing cab files on WM2003 fixed
        (different filesystems on WM2003 and WM5)
I guess those two were broken by merging WM5 branch, now it supports both 
WM2003 and WM5.

 - now supports uninstall using Configuration Service Provider
        (there is no unload.exe on Smartphone 2003 and newer systems)
Old method using unload.exe used in WM2003 Pocket PCs and older shouldn't be 
broken but I have no device to test this.

KCeMirror:
 - F1 is no longer used for opening handbook
        (now useable with smartphones)
F1 and F2 are mapped on softkeys on smartphones (maybe Pocket PCs too) but 
help menu were using F1 as a hotkey for opening handbook.


All were tested on these devices:
 - Motorola MPx200 (WM5 and WM6 both unofficial ROMs) (rndis-lite)
 - Motorola MPx220 (WM2003 SE) (ipaq and bluetooth)
 - HTC STRK / Qtek 8500 (WM5) (ipaq and bluetooth)

Please reply on both synce-devel and my email as I'm not registered in the 
mailing list.

Zdenek Koprivik (KOPRajs)
Index: raki/configdialogimpl.cpp
===================================================================
--- raki/configdialogimpl.cpp	(revision 3011)
+++ raki/configdialogimpl.cpp	(working copy)
@@ -239,7 +239,7 @@
         dccmPath = "vdccm";
     }
     if (ipTables.isEmpty()) {
-        ipTables = "/usr/sbin/iptables";
+        ipTables = "/sbin/iptables";
     }
 }
 
Index: raki/managerimpl.cpp
===================================================================
--- raki/managerimpl.cpp	(revision 3011)
+++ raki/managerimpl.cpp	(working copy)
@@ -21,6 +21,8 @@
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                  *
  ***************************************************************************/
 
+#include <synce.h>
+
 #include "managerimpl.h"
 #include "rapiwrapper.h"
 
@@ -45,19 +47,15 @@
     if (version->dwMajorVersion == 5) {
         result = "Magneto: Windows Mobile 5";
     } else if (version->dwMajorVersion == 4 &&
-            version->dwMinorVersion == 20 &&
-            version->dwBuildNumber == 1081) {
-        result = "Ozone: Pocket PC 2003";
+            version->dwMinorVersion == 21) {
+        result = "Ozone: Windows Mobile 2003 SE";
+    } else if (version->dwMajorVersion == 4 &&
+            version->dwMinorVersion == 20) {
+        result = "Ozone: Windows Mobile 2003";
     } else if (version->dwMajorVersion == 3 &&
             version->dwMinorVersion == 0) {
-        switch (version->dwBuildNumber) {
-        case 9348:
-            result = "Rapier: Pocket PC"; break;
-        case 11171:
-            result = "Merlin: Pocket PC 2002"; break;
-        }
+        result = "Merlin: Pocket PC 2002";
     }
-
     return result;
 }
 
@@ -304,17 +302,39 @@
         msg = i18n("Uninstalling software ...");
         postManagerImplEvent(&ManagerImpl::beginEvent, 0, noBlock);
 
-        if(Ce::createProcess(QString("unload.exe").ucs2(),
+        if (Ce::createProcess(QString("unload.exe").ucs2(),
                 QString(item->text()).ucs2(), NULL, NULL, false, 0, NULL,
                 NULL, NULL, &info)) {
 
                     postManagerImplEvent(&ManagerImpl::uninstalledEvent, item, noBlock);
+        } else {
+            Ce::rapiUninit();
+            //kdDebug(2120) << i18n("Failed to start unload.exe, trying to uninstall via Configuration Service Provider ...") << endl;
+            char *configXML;
+            LPWSTR config = NULL;
+            DWORD flags = CONFIG_PROCESS_DOCUMENT;
+            LPWSTR reply = NULL;
+            HRESULT hr;
+            configXML = new char[512];
+            memset(configXML, 0, 512 * sizeof(char));
+            strcat(configXML, (char*)"<wap-provisioningdoc>\n\r<characteristic type=\"UnInstall\">\n\r<characteristic type=\"");
+            strcat(configXML, (char*)item->text().latin1());
+            strcat(configXML, (char*)"\">\n\r<parm name=\"uninstall\" value=\"1\"/>\n\r</characteristic>\n\r</characteristic>\n\r</wap-provisioningdoc>\n\r");
+
+            Ce::rapiInit(pdaName);
+            config = synce::wstr_from_current(configXML);
+            hr = Ce::ProcessConfig(config, flags, &reply);
+            if (SUCCEEDED(hr)) {
+                postManagerImplEvent(&ManagerImpl::uninstalledEvent, item, noBlock);
+            }
+            synce::CeRapiFreeBuffer(configXML);
+            synce::wstr_free_string(config);
+            synce::wstr_free_string(reply);
         }
         Ce::rapiUninit();
 
         postManagerImplEvent(&ManagerImpl::endEvent, NULL, noBlock);
     }
-
 }
 
 
@@ -355,8 +375,6 @@
 
         postManagerImplEvent(&ManagerImpl::endEvent, NULL, noBlock);
     }
-
-
 }
 
 
@@ -365,50 +383,48 @@
     LONG result;
     HKEY parent_key;
     DWORD i;
+    bool smartphone = false;
 
     if (Ce::rapiInit(pdaName)) {
         msg = i18n("Retrieve software-list ...");
         postManagerImplEvent(&ManagerImpl::beginEvent, 0, noBlock);
 
-        result = synce::CeRegOpenKeyEx(HKEY_LOCAL_MACHINE,
-                QString("Software\\Apps").ucs2(), 0, 0, &parent_key);
-        if (ERROR_SUCCESS == result) {
-            for (i = 0; !stopRequested(); i++) {
-                WCHAR wide_name[MAX_PATH];
-                DWORD name_size = sizeof(wide_name);
-                HKEY program_key;
-                DWORD installed = 0;
-                DWORD value_size = sizeof(installed);
-                DWORD type;
+        result = synce::CeRegOpenKeyEx(HKEY_LOCAL_MACHINE, QString("Security\\AppInstall").ucs2(), 0, 0, &parent_key);
+        if (ERROR_SUCCESS == result) smartphone = true;
+        else result = synce::CeRegOpenKeyEx(HKEY_LOCAL_MACHINE, QString("Software\\Apps").ucs2(), 0, 0, &parent_key);
 
-                result = synce::CeRegEnumKeyEx(parent_key, i, wide_name,
-                        &name_size, NULL, NULL, NULL, NULL);
+        for (i = 0; !stopRequested(); i++) {
+            WCHAR wide_name[MAX_PATH];
+            DWORD name_size = sizeof(wide_name);
+            HKEY program_key;
+            DWORD installed = 0;
+            DWORD value_size = sizeof(installed);
+            DWORD type;
 
-                if (ERROR_SUCCESS != result) {
-                    break;
-                }
+            result = synce::CeRegEnumKeyEx(parent_key, i, wide_name, &name_size, NULL, NULL, NULL, NULL);
 
-                result = synce::CeRegOpenKeyEx(parent_key, wide_name, 0, 0,
-                        &program_key);
+            if (ERROR_SUCCESS != result) {
+                break;
+            }
 
+            if (!smartphone) {
+                result = synce::CeRegOpenKeyEx(parent_key, wide_name, 0, 0, &program_key);
+
                 if (ERROR_SUCCESS != result) {
                     continue;
                 }
 
-                result = synce::CeRegQueryValueEx(program_key,
-                        QString("Instl").ucs2(), NULL, &type,
-                        (LPBYTE)&installed, &value_size);
+                result = synce::CeRegQueryValueEx(program_key, QString("Instl").ucs2(), NULL, &type, (LPBYTE)&installed, &value_size);
+            }
 
-                synce::CeRegCloseKey(program_key);
+            synce::CeRegCloseKey(program_key);
 
-                if (ERROR_SUCCESS == result && installed) {
-                    postManagerImplEvent(&ManagerImpl::insertInstalledItemEvent,
-                            qstrdup(QString::fromUcs2(wide_name).ascii()),
-                            noBlock);
-                }
+            if ((ERROR_SUCCESS == result && installed) || (ERROR_SUCCESS == result && smartphone)) {
+                postManagerImplEvent(&ManagerImpl::insertInstalledItemEvent, qstrdup(QString::fromUcs2(wide_name).ascii()), noBlock);
             }
-            synce::CeRegCloseKey(parent_key);
         }
+        synce::CeRegCloseKey(parent_key);
+
         Ce::rapiUninit();
 
         postManagerImplEvent(&ManagerImpl::endEvent, NULL, noBlock);
@@ -469,3 +485,4 @@
     RakiWorkerThread::rakiWorkerThread->stop();
     startWorkerThread(this, &ManagerImpl::fetchSoftwareList, NULL);
 }
+
Index: raki/installer.cpp
===================================================================
--- raki/installer.cpp	(revision 3011)
+++ raki/installer.cpp	(working copy)
@@ -26,6 +26,7 @@
 #include "rakiworkerthread.h"
 #include "pda.h"
 
+#include <string>
 #include <qstringlist.h>
 #include <kapplication.h>
 #include <kcombobox.h>
@@ -41,6 +42,7 @@
 QStringList Installer::installFiles;
 QDict<PDA> *Installer::pdaList = NULL;
 bool Installer::ready = true;
+std::string storage = "/Storage";
 
 Installer::Installer(QWidget *parent, QDict<PDA> *pdaList)
         : InstallDialog(parent)
@@ -132,7 +134,7 @@
     PDA *pda = (PDA *) pdaList->find(pdaName);
 
     if (pda != NULL) {
-        dest = KURL("rapip://" + pdaName + "/Windows/AppMgr/Install/" +
+        dest = KURL("rapip://" + pdaName + storage + "/Windows/AppMgr/Install/" +
                 from.fileName());
         pda->addURLByCopyJob((KIO::CopyJob *) job, dest);
     }
@@ -170,35 +172,41 @@
 
 
 #if KDE_VERSION < KDE_MAKE_VERSION(3,2,0) // KDE-3.1
-        if (!KIO::NetAccess::exists("rapip://" + pdaName +
+        if (!KIO::NetAccess::exists("rapip://" + pdaName + "/Storage/Windows/AppMgr")) {
+            storage = "";
+        }
+        if (!KIO::NetAccess::exists("rapip://" + pdaName + storage +
                 "/Windows/AppMgr/Install")) {
-            if (!KIO::NetAccess::exists("rapip://" + pdaName +
+            if (!KIO::NetAccess::exists("rapip://" + pdaName + storage +
                     "/Windows/AppMgr")) {                
-                mkdirSuccess = KIO::NetAccess::mkdir("rapip://" + pdaName +
+                mkdirSuccess = KIO::NetAccess::mkdir("rapip://" + pdaName + storage +
                         "/Windows/AppMgr");
             }
             if (mkdirSuccess) {
-                mkdirSuccess = KIO::NetAccess::mkdir("rapip://" + pdaName +
+                mkdirSuccess = KIO::NetAccess::mkdir("rapip://" + pdaName + storage +
                         "/Windows/AppMgr/Install");
             }
         }
 #else // KDE-3.2
-        if (!KIO::NetAccess::exists("rapip://" + pdaName +
+        if (!KIO::NetAccess::exists("rapip://" + pdaName + "/Storage/Windows/AppMgr", false, NULL)) {
+            storage = "";
+        }
+        if (!KIO::NetAccess::exists("rapip://" + pdaName + storage +
                 "/Windows/AppMgr/Install", false, NULL)) {
-            if (!KIO::NetAccess::exists("rapip://" + pdaName +
+            if (!KIO::NetAccess::exists("rapip://" + pdaName + storage +
                     "/Windows/AppMgr", false, NULL)) {
-                mkdirSuccess = KIO::NetAccess::mkdir("rapip://" + pdaName +
+                mkdirSuccess = KIO::NetAccess::mkdir("rapip://" + pdaName + storage +
                         "/Windows/AppMgr", (QWidget *) NULL);
             }
             if (mkdirSuccess) {
-                mkdirSuccess = KIO::NetAccess::mkdir("rapip://" + pdaName +
+                mkdirSuccess = KIO::NetAccess::mkdir("rapip://" + pdaName + storage +
                         "/Windows/AppMgr/Install", (QWidget *) NULL);
             }
         }
 #endif
 
         if (mkdirSuccess) {
-            KIO::CopyJob *copyJob = KIO::copy(ul, KURL("rapip://" + pdaName +
+            KIO::CopyJob *copyJob = KIO::copy(ul, KURL("rapip://" + pdaName + storage +
                     "/Windows/AppMgr/Install/"), true);
             connect(copyJob, SIGNAL(result(KIO::Job *)), installer,
                     SLOT(copyResult(KIO::Job *)));
Index: raki/rapiwrapper.h
===================================================================
--- raki/rapiwrapper.h	(revision 3011)
+++ raki/rapiwrapper.h	(working copy)
@@ -193,6 +193,22 @@
     }
 
 
+    static HRESULT ProcessConfig(
+        LPCWSTR config,
+        DWORD flags,
+        LPWSTR* reply)
+    {
+        HRESULT hr;
+
+        hr = synce::CeProcessConfig(
+                 config,
+                 flags,
+                 reply);
+
+        return hr;
+    }
+
+
     static bool writeFile(
         HANDLE hFile,
         LPCVOID lpBuffer,
@@ -265,3 +281,4 @@
 
 
 #endif
+
Index: TODO
===================================================================
--- TODO	(revision 3011)
+++ TODO	(working copy)
@@ -3,3 +3,20 @@
 
 * Rewriting of the codebase
 * Implement synchronizer for all Windows CE databases
+
+
+
+BUGs to fix
+===========
+-RAKI:		fix software manager when more devices connected
+-RAKI:		update version strings
+-RAPIP:		allow capitals and spaces in phone name
+-VDCCM:		allow connecting of second device after password protected device connected
+-VDCCM:		connecting password protected WM6 devices
+
+BUGs fixed
+==========
+-RAKI:		support fetching software list on WM2003
+-RAKI:		support installing software on WM2003 (uploading to right folder)
+-RAKI:		support uninstalling software using Configuration Service Provider
+-KCeMirror:	F1 is no longer used for help
Index: admin/cvs.sh
===================================================================
--- admin/cvs.sh	(revision 3011)
+++ admin/cvs.sh	(working copy)
@@ -32,7 +32,7 @@
 required_autoconf_version="2.53 or newer"
 AUTOCONF_VERSION=`$AUTOCONF --version | head -n 1`
 case $AUTOCONF_VERSION in
-  Autoconf*2.5* | autoconf*2.5* ) : ;;
+  Autoconf*2.5* | autoconf*2.5* | autoconf*2.6* ) : ;;
   "" )
     echo "*** AUTOCONF NOT FOUND!."
     echo "*** KDE requires autoconf $required_autoconf_version"
@@ -47,7 +47,7 @@
 
 AUTOHEADER_VERSION=`$AUTOHEADER --version | head -n 1`
 case $AUTOHEADER_VERSION in
-  Autoconf*2.5* | autoheader*2.5* ) : ;;
+  Autoconf*2.5* | autoheader*2.5* | autoheader*2.6* ) : ;;
   "" )
     echo "*** AUTOHEADER NOT FOUND!."
     echo "*** KDE requires autoheader $required_autoconf_version"
Index: kcemirror/cescreen.cpp
===================================================================
--- kcemirror/cescreen.cpp	(revision 3011)
+++ kcemirror/cescreen.cpp	(working copy)
@@ -48,14 +48,16 @@
 #include <X11/keysymdef.h>
 
 
-CeScreen::CeScreen(KAboutApplication *aboutApplication)
+CeScreen::CeScreen()
         : KMainWindow(NULL, "KCeScreen")
 {
     pdaSocket = NULL;
     pause = false;
     setFixedSize(0, 0);
-    this->aboutApplication = aboutApplication;
 
+    aboutApplication = new KAboutApplication(this, "about", false);
+    aboutKDE = new KAboutKDE(this, "aboutkde", false);
+
     imageViewer = new ImageViewer(this);
     setCentralWidget(imageViewer);
 
@@ -72,7 +74,14 @@
                          kapp, SLOT(quit()), 0, 4, 6);
     menuBar()->insertItem(i18n("&File"), filemenu);
 
-    KPopupMenu *helpmenu = customHelpMenu("PDAMirror");
+    KPopupMenu *helpmenu = new KPopupMenu();
+    helpmenu->insertItem(SmallIcon("contents"), i18n("KCeMirror &Handbook"),
+                         this, SLOT(appHelpActivated()));
+    helpmenu->insertSeparator();
+    helpmenu->insertItem(kapp->miniIcon(), i18n("&About KCeMirror"),
+                         this, SLOT(showAboutApplication()));
+    helpmenu->insertItem(SmallIcon("about_kde"), i18n("About &KDE"),
+                         this, SLOT(showAboutKDE()));
     menuBar()->insertItem(i18n("&Help"), helpmenu);
 
     tb = new KToolBar(this, QMainWindow::Top, false, "Utils", true, true);
@@ -111,6 +120,12 @@
 }
 
 
+void CeScreen::showAboutKDE()
+{
+    aboutKDE->show();
+}
+
+
 void CeScreen::resizeWindow()
 {
     adjustSize();
@@ -692,3 +707,4 @@
 }
 
 #include "cescreen.moc"
+
Index: kcemirror/cescreen.h
===================================================================
--- kcemirror/cescreen.h	(revision 3011)
+++ kcemirror/cescreen.h	(working copy)
@@ -29,6 +29,7 @@
 #include <ksock.h>
 #include <kaboutdata.h>
 #include <kaboutapplication.h>
+#include <kaboutkde.h>
 #include <kdebug.h>
 #include "decoder.h"
 
@@ -55,8 +56,9 @@
 class CeScreen : public KMainWindow
 {
     Q_OBJECT
+
 public:
-    CeScreen(KAboutApplication *aboutApplication);
+    CeScreen();
     ~CeScreen();
     bool connectPda(QString pdaName, bool isSynCeDevice = true, bool forceInstall = false);
 
@@ -64,6 +66,7 @@
     virtual void fileSave();
     virtual void filePrint();
     virtual void showAboutApplication();
+    virtual void showAboutKDE();
 
 private slots:
     void readSocket(KSocket *socket);
@@ -101,6 +104,7 @@
     KToolBar *tb;
     KPopupMenu *filemenu;
     KAboutApplication *aboutApplication;
+    KAboutKDE *aboutKDE;
     int pauseItem;
     Decoder *decoderChain;
     unsigned char *bmpData;
@@ -114,5 +118,5 @@
     } keymap[];
 };
 
+#endif
 
-#endif
Index: kcemirror/kcemirror.cpp
===================================================================
--- kcemirror/kcemirror.cpp	(revision 3011)
+++ kcemirror/kcemirror.cpp	(working copy)
@@ -110,7 +110,7 @@
     KApplication a;
 #endif
 
-    CeScreen *ceScreen = new CeScreen(new KAboutApplication(&aboutData));
+    CeScreen *ceScreen = new CeScreen();
 
     QObject::connect(ceScreen, SIGNAL(pdaError()), &a, SLOT(quit()));
 
@@ -125,3 +125,4 @@
 
     return a.exec();
 }
+
Index: config.h.in
===================================================================
--- config.h.in	(revision 3011)
+++ config.h.in	(working copy)
@@ -103,16 +103,16 @@
 /* Define if you don't want QString casted to char * */
 #undef QT_NO_ASCII_CAST
 
-/* The size of a `char', as computed by sizeof. */
+/* The size of `char', as computed by sizeof. */
 #undef SIZEOF_CHAR
 
-/* The size of a `char *', as computed by sizeof. */
+/* The size of `char *', as computed by sizeof. */
 #undef SIZEOF_CHAR_P
 
-/* The size of a `int', as computed by sizeof. */
+/* The size of `int', as computed by sizeof. */
 #undef SIZEOF_INT
 
-/* The size of a `long', as computed by sizeof. */
+/* The size of `long', as computed by sizeof. */
 #undef SIZEOF_LONG
 
 /* Define to 1 if you have the ANSI C header files. */
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
SynCE-Devel mailing list
SynCE-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synce-devel

Reply via email to