Author: shadowmaster
Date: Wed Mar 21 16:41:14 2012
New Revision: 53597

URL: http://svn.gna.org/viewcvs/wesnoth?rev=53597&view=rev
Log:
Revert "addon/dep: Initial addon_dep type used for representing add-on 
dependencies in the source code"

This reverts my own commit r53337, which is really stupid in hindsight
and should have been in a private branch instead.

Removed:
    trunk/src/addon/dep.cpp
    trunk/src/addon/dep.hpp
Modified:
    trunk/src/CMakeLists.txt
    trunk/src/SConscript

Modified: trunk/src/CMakeLists.txt
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/CMakeLists.txt?rev=53597&r1=53596&r2=53597&view=diff
==============================================================================
--- trunk/src/CMakeLists.txt (original)
+++ trunk/src/CMakeLists.txt Wed Mar 21 16:41:14 2012
@@ -318,7 +318,6 @@
        about.cpp
        actions.cpp
        addon/client.cpp
-       addon/dep.cpp
        addon/info.cpp
        addon/manager.cpp
        addon/manager_ui.cpp

Modified: trunk/src/SConscript
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/SConscript?rev=53597&r1=53596&r2=53597&view=diff
==============================================================================
--- trunk/src/SConscript (original)
+++ trunk/src/SConscript Wed Mar 21 16:41:14 2012
@@ -164,7 +164,6 @@
     about.cpp
     actions.cpp
     addon/client.cpp
-    addon/dep.cpp
     addon/info.cpp
     addon/manager.cpp
     addon/manager_ui.cpp

Removed: trunk/src/addon/dep.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/addon/dep.cpp?rev=53596&view=auto
==============================================================================
--- trunk/src/addon/dep.cpp (original)
+++ trunk/src/addon/dep.cpp (removed)
@@ -1,108 +1,0 @@
-/* $Id$ */
-/*
-   Copyright (C) 2012 by Ignacio Riquelme Morelle <[email protected]>
-   Part of the Battle for Wesnoth Project http://www.wesnoth.org/
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY.
-
-   See the COPYING file for more details.
-*/
-
-#include "addon/dep.hpp"
-
-#include "config.hpp"
-
-namespace {
-       inline addon_dep::dep_type dep_type_str_to_id(const std::string& str)
-       {
-               if(str == "recommends") {
-                       return addon_dep::recommends;
-               } else if(str == "conflicts") {
-                       return addon_dep::conflicts;
-               } else {
-                       return addon_dep::requires;
-               }
-       }
-}
-
-addon_dep::addon_dep(const addon_dep& o)
-       : id(o.id)
-       , type(o.type)
-       , dependants(o.dependants)
-       , version(o.version)
-       , version_type(o.version_type)
-{
-}
-
-addon_dep::addon_dep(const std::string& dep)
-       : id(dep)
-       , type(requires)
-       , dependants()
-       , version()
-       , version_type(version_any)
-{
-}
-
-addon_dep::addon_dep(const config& cfg, const std::string& type_str)
-       : id()
-       , type()
-       , dependants()
-       , version()
-       , version_type()
-{
-       this->read(cfg, type_str);
-}
-
-addon_dep& addon_dep::operator=(const addon_dep& o)
-{
-       if(&o != this) {
-               this->id = o.id;
-               this->type = o.type;
-               this->dependants = o.dependants;
-               this->version = o.version;
-               this->version_type = o.version_type;
-       }
-
-       return *this;
-}
-
-void addon_dep::read(const config& cfg, const std::string& type_str)
-{
-       this->id = cfg["id"].str();
-       this->type = dep_type_str_to_id(type_str);
-
-       if(cfg.has_attribute("version_equals") && cfg["version_equals"].str() 
!= "*") {
-               this->version_type = version_equals;
-               this->version = cfg["version_equals"].str();
-       }
-       else if(cfg.has_attribute("version_not_equals")) {
-               this->version_type = version_not_equals;
-               this->version = cfg["version_not_equals"].str();
-       }
-       else if(cfg.has_attribute("version_less_than")) {
-               this->version_type = version_less_than;
-               this->version = cfg["version_less_than"].str();
-       }
-       else if(cfg.has_attribute("version_less_than_or_equals")) {
-               this->version_type = version_less_than_or_equals;
-               this->version = cfg["version_less_than_or_equals"].str();
-       }
-       else if(cfg.has_attribute("version_greater_than")) {
-               this->version_type = version_greater_than;
-               this->version = cfg["version_greater_than"].str();
-       }
-       else if(cfg.has_attribute("version_greater_than_or_equals")) {
-               this->version_type = version_greater_than_or_equals;
-               this->version = cfg["version_greater_than_or_equals"].str();
-       }
-       else {
-               this->version_type = version_any;
-               this->version = version_info();
-       }
-       
-}

Removed: trunk/src/addon/dep.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/addon/dep.hpp?rev=53596&view=auto
==============================================================================
--- trunk/src/addon/dep.hpp (original)
+++ trunk/src/addon/dep.hpp (removed)
@@ -1,133 +1,0 @@
-/* $Id$ */
-/*
-   Copyright (C) 2012 by Ignacio Riquelme Morelle <[email protected]>
-   Part of the Battle for Wesnoth Project http://www.wesnoth.org/
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY.
-
-   See the COPYING file for more details.
-*/
-
-#ifndef ADDON_DEP_HPP_INCLUDED
-#define ADDON_DEP_HPP_INCLUDED
-
-#include "version.hpp"
-
-#include <set>
-
-class config;
-
-/**
- * Type for definining add-on dependencies.
- */
-struct addon_dep
-{
-       /** Representation of valid dependency levels. */
-       enum dep_type {
-               requires,               /**< The add-on must be installed for 
dependants to work properly. */
-               conflicts,              /**< The add-on must not be installed 
for dependants to work properly. */
-               recommends              /**< The add-on is suggested to be 
installed for dependants to work better. */
-       };
-
-       /** Representation of valid version requirements. */
-       enum version_dep_type {
-               version_any,                                    /**< Any @a 
version is accepted. */
-               version_equals,                                 /**< The 
version must be exactly the specified @a version. */
-               version_not_equals,                             /**< The 
version must differ from the specified @a version. */
-               version_less_than,                              /**< The 
version must be less than the specified @a version. */
-               version_less_than_or_equals,    /**< The version must be less 
than or equal to the specified @a version. */
-               version_greater_than,                   /**< The version must 
be greater than the specified @a version. */
-               version_greater_than_or_equals  /**< The version must be 
greater than or equal to the specified @a version. */
-       };
-
-       //
-       // Fields
-       //
-
-       /** Add-on id that is depended upon. */
-       std::string id;
-
-       /** Dependency level. */
-       dep_type type;
-
-       /** List of known dependants, used in UI reports. */
-       std::set<std::string> dependants;
-
-       /** Add-on version that is depended upon. */
-       version_info version;
-
-       /** Dependency version class. */
-       version_dep_type version_type;
-
-       //
-       // Methods
-       //
-
-       /** Default constructor. */
-       addon_dep() :
-               id(), type(), dependants(), version(), version_type()
-       {}
-
-       /** Copy constructor. */
-       explicit addon_dep(const addon_dep& o);
-
-       /**
-        * Compatibility constructor used with the old .dependencies attribute.
-        *
-        * @todo Remove this once the new syntax is finalized and the server 
protocol changed.
-        */
-       explicit addon_dep(const std::string& dep);
-       
-
-       /**
-        * WML constructor using the @a read method.
-        *
-        * Sets attributes to reflect the specified WML node object.
-        *
-        * @param cfg      The node object with attributes to read.
-        * @param type_str The original node key, e.g. "depends", "requires".
-        */
-       addon_dep(const config& cfg, const std::string& type_str);
-
-       /** Copy operator. */
-       addon_dep& operator=(const addon_dep& o);
-
-       /**
-        * Sets attributes to reflect the specified WML node object.
-        *
-        * @param cfg      The node object with attributes to read.
-        * @param type_str The original node key, e.g. "depends", "requires".
-        */
-       void read(const config& cfg, const std::string& type_str);
-};
-
-inline bool operator<(const addon_dep& a, const addon_dep& b) {
-       return a.id < b.id;
-}
-
-inline bool operator==(const addon_dep& a, const addon_dep& b) {
-       return a.id == b.id;
-}
-
-inline bool operator>(const addon_dep& a, const addon_dep& b) {
-       return a.id > b.id;
-}
-
-inline bool operator<=(const addon_dep& a, const addon_dep& b) {
-       return a.id <= b.id;
-}
-
-inline bool operator!=(const addon_dep& a, const addon_dep& b) {
-       return a.id != b.id;
-}
-
-inline bool operator>=(const addon_dep& a, const addon_dep& b) {
-       return a.id >= b.id;
-}
-
-#endif


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to