1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-22 22:37:30 +02:00

Replaced "hash_map" by "unordered_map" to get rid of deprecation warnings.

This commit is contained in:
Maarten ter Huurne 2010-06-18 00:45:16 +02:00
parent dae5627091
commit 9f21df7fed
6 changed files with 10 additions and 24 deletions

View File

@ -24,6 +24,7 @@
#include <dirent.h> #include <dirent.h>
#include <errno.h> #include <errno.h>
#include <iostream> #include <iostream>
#include <algorithm>
#include "filelister.h" #include "filelister.h"
#include "utilities.h" #include "utilities.h"
@ -93,7 +94,6 @@ void FileLister::browse()
cout << "\033[0;34mGMENU2X:\033[0;31m stat failed on '" << filepath << "' with error '" << strerror(errno) << "'\033[0m" << endl; cout << "\033[0;34mGMENU2X:\033[0;31m stat failed on '" << filepath << "' with error '" << strerror(errno) << "'\033[0m" << endl;
continue; continue;
} }
if (find(exclude.begin(), exclude.end(), file) != exclude.end()) if (find(exclude.begin(), exclude.end(), file) != exclude.end())
continue; continue;

View File

@ -237,7 +237,7 @@ void Selector::loadAliases() {
} }
string Selector::getAlias(const string &key) { string Selector::getAlias(const string &key) {
hash_map<string, string>::iterator i = aliases.find(key); unordered_map<string, string>::iterator i = aliases.find(key);
if (i == aliases.end()) if (i == aliases.end())
return ""; return "";
else else

View File

@ -39,7 +39,7 @@ private:
int selRow; int selRow;
LinkApp *link; LinkApp *link;
hash_map<string, string> aliases; unordered_map<string, string> aliases;
void loadAliases(); void loadAliases();
string getAlias(const string &key); string getAlias(const string &key);
void prepare(FileLister *fl, vector<string> *screens, vector<string> *titles); void prepare(FileLister *fl, vector<string> *screens, vector<string> *titles);

View File

@ -61,7 +61,7 @@ string Translator::translate(const string &term,const char *replacestr,...) {
string result = term; string result = term;
if (!_lang.empty()) { if (!_lang.empty()) {
hash_map<string, string>::iterator i = translations.find(term); unordered_map<string, string>::iterator i = translations.find(term);
if (i != translations.end()) { if (i != translations.end()) {
result = i->second; result = i->second;
} }

View File

@ -30,7 +30,7 @@ Hash Map of translation strings.
class Translator { class Translator {
private: private:
string _lang; string _lang;
hash_map<string, string> translations; unordered_map<string, string> translations;
public: public:
Translator(const string &lang=""); Translator(const string &lang="");

View File

@ -26,27 +26,13 @@
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <vector> #include <vector>
#include <ext/hash_map> #include <tr1/unordered_map>
using __gnu_cxx::hash_map; using std::tr1::unordered_map;
using __gnu_cxx::hash; using std::tr1::hash;
using std::string; using std::string;
using std::vector; using std::vector;
namespace __gnu_cxx {
template<> struct hash< std::string > {
size_t operator()( const std::string& x ) const {
return hash< const char* >()( x.c_str() );
}
};
}
struct eqstr {
bool operator()(const char* s1, const char* s2) const {
return (s1 == s2) || (s1 && s2 && strcmp(s1, s2) == 0);
}
};
class case_less { class case_less {
public: public:
bool operator()(const string &left, const string &right) const; bool operator()(const string &left, const string &right) const;