PackageManager: Options.xml
[reactos.git] / rosapps / packmgr / lib / package.cpp
index 883be31..c545756 100644 (file)
@@ -14,8 +14,8 @@
 #include "expat.h"\r
 #include "log.h"\r
 \r
-int PML_XmlDownload (const char* url, void* usrdata, XML_StartElementHandler start, \r
-                                        XML_EndElementHandler end, XML_CharacterDataHandler text=0);\r
+int PML_XmlDownload (pTree, const char* url, void* usrdata, XML_StartElementHandler start, \r
+                                                                       XML_EndElementHandler end, XML_CharacterDataHandler text=0);\r
 \r
 \r
 // expat callback for start of a package tag\r
@@ -109,7 +109,7 @@ extern "C" int PML_LoadPackage (TREE* tree, int id, PML_SetButton SetButton)
 \r
        if(!pack->loaded)\r
        {\r
-               PML_XmlDownload (pack->path, (void*)pack, pack_start, pack_end, pack_text);\r
+               PML_XmlDownload (tree, pack->path, (void*)pack, pack_start, pack_end, pack_text);\r
                pack->loaded = TRUE;\r
        }\r
 \r
@@ -208,7 +208,7 @@ extern "C" int PML_SetAction (TREE* tree, int id, int action, PML_SetIcon SetIco
        // load it if it's not loaded yet\r
        else if (!pack->loaded && pack->path)\r
        {\r
-               PML_XmlDownload (pack->path, (void*)pack, pack_start, pack_end, pack_text);\r
+               PML_XmlDownload (tree, pack->path, (void*)pack, pack_start, pack_end, pack_text);\r
                pack->loaded = TRUE;\r
 \r
                return PML_SetAction(tree, id, action, SetIcon, Ask);\r
@@ -262,17 +262,17 @@ extern "C" int PML_SetAction (TREE* tree, int id, int action, PML_SetIcon SetIco
                        }\r
                }\r
 \r
-               // set action back\r
-               pack->action = 0;\r
-\r
                // root notes (like network) return here\r
                if(!pack->path || pack->action==0)\r
                        return ret; \r
-       \r
+\r
                // erase from todo list\r
                for(i=0; i<tree->todo.size(); i++)\r
                        if(!strcmp(tree->todo[i], pack->files[pack->action-1])) // look for right entry\r
                                tree->todo.erase(tree->todo.begin()+i); // delete it\r
+\r
+               // set action back\r
+               pack->action = 0;\r
        }\r
 \r
        return ret;\r