mail[Wesnoth-commits] r28733 - in /trunk/src: addon_management.cpp game.cpp version.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by shadowm2006 on August 18, 2008 - 23:31:
Author: shadowmaster
Date: Mon Aug 18 23:31:45 2008
New Revision: 28733

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28733&view=rev
Log:
* Enabled addons update interface. Now I'm really tied to finish it
* before tagging.

Modified:
    trunk/src/addon_management.cpp
    trunk/src/game.cpp
    trunk/src/version.cpp

Modified: trunk/src/addon_management.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/addon_management.cpp?rev=28733&r1=28732&r2=28733&view=diff
==============================================================================
--- trunk/src/addon_management.cpp (original)
+++ trunk/src/addon_management.cpp Mon Aug 18 23:31:45 2008
@@ -729,7 +729,7 @@
                                        }
                                }
                        } catch(version_info::not_sane_exception const&) {
-                               ERR_CFG << "local add-on '" << name << "' has 
invalid version string '" << version << "', skipping from updates check...\n";
+                               ERR_CFG << "local add-on '" << name << "' has 
invalid version info, skipping from updates check...\n";
                                continue;
                        }
                }
@@ -1195,11 +1195,11 @@
                svr_dialog.set_textbox(_("Server: "), default_host);
 
                // not ready for production yet
-#if 0
+
                svr_dialog.add_button(new gui::dialog_button(disp.video(), 
_("Update add-ons"),
                                      gui::button::TYPE_PRESS, addon_update),
                                      gui::dialog::BUTTON_EXTRA_LEFT);
-#endif
+
                svr_dialog.add_button(new gui::dialog_button(disp.video(), 
_("Uninstall add-ons"),
                                      gui::button::TYPE_PRESS, 
addon_uninstall),
                                      gui::dialog::BUTTON_EXTRA);
@@ -1272,11 +1272,6 @@
 const version_info& get_addon_version_info(const std::string& addon)
 {
        static const version_info nil(0,0,0,false);
-       std::map< std::string, version_info >::iterator ret = 
version_info_cache.find(addon);
-
-       if (ret != version_info_cache.end())
-               return ret->second;
-       else
-               return nil;
-
-}
+       std::map< std::string, version_info >::iterator entry = 
version_info_cache.find(addon);
+       return entry != version_info_cache.end() ? entry->second : nil;
+}

Modified: trunk/src/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game.cpp?rev=28733&r1=28732&r2=28733&view=diff
==============================================================================
--- trunk/src/game.cpp (original)
+++ trunk/src/game.cpp Mon Aug 18 23:31:45 2008
@@ -2160,6 +2160,9 @@
                return 0;
        }
 
+       loadscreen::global_loadscreen->increment_progress(0, _("Searching for 
installed add-ons."));
+       refresh_addon_version_info_cache();
+
 #if defined(_X11) && !defined(__APPLE__)
        SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);
 #endif

Modified: trunk/src/version.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/version.cpp?rev=28733&r1=28732&r2=28733&view=diff
==============================================================================
--- trunk/src/version.cpp (original)
+++ trunk/src/version.cpp Mon Aug 18 23:31:45 2008
@@ -21,6 +21,8 @@
 #include <sstream>
 #include <stdexcept>
 
+#include <iostream>
+
 version_info::version_info(const version_info& o)
        : nums_                 (o.nums_),
          special_              (o.special_),
@@ -46,7 +48,7 @@
 version_info::version_info(const std::string& str)
        : nums_(3,0), sane_(true)
 {
-       const std::vector<std::string>& string_parts = utils::split(str,'.');
+       const std::vector<std::string> string_parts = utils::split(str,'.');
        // first two components are required to be valid numbers, though
        // only first component's existence is checked at all
        const size_t parts = string_parts.size();
@@ -95,7 +97,7 @@
                const char& c = full_component[sep_pos];
                if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
                        special_separator_ = '\0';
-                       special_ = c;
+                       special_ = full_component.substr(sep_pos);
                } else {
                        special_separator_ = c;
                        if(sep_pos != full_component.size() - 1) {
@@ -207,6 +209,7 @@
 
 bool operator<(const version_info& l, const version_info& r)
 {
+       std::cerr << "compare: " << l.str() << " < " << r.str() << '\n';
        std::less<unsigned int> o;
        return version_info_comparison_internal(l, r, o) &&
               ((l.special_version().empty() && !r.special_version().empty()) 
||
@@ -215,6 +218,7 @@
 
 bool operator>(const version_info& l, const version_info& r)
 {
+       std::cerr << "compare: " << l.str() << " > " << r.str() << '\n';
        std::greater<unsigned int> o;
        return version_info_comparison_internal(l, r, o) &&
               ((r.special_version().empty() && !l.special_version().empty()) 
||




Related Messages


Powered by MHonArc, Updated Tue Aug 19 00:01:33 2008