mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 12:24:38 +02:00
Replaced "hash_map" by "unordered_map" to get rid of deprecation warnings.
This commit is contained in:
parent
dae5627091
commit
9f21df7fed
@ -24,6 +24,7 @@
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
|
||||
#include "filelister.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;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (find(exclude.begin(), exclude.end(), file) != exclude.end())
|
||||
continue;
|
||||
|
||||
|
@ -237,7 +237,7 @@ void Selector::loadAliases() {
|
||||
}
|
||||
|
||||
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())
|
||||
return "";
|
||||
else
|
||||
|
@ -39,16 +39,16 @@ private:
|
||||
int selRow;
|
||||
LinkApp *link;
|
||||
|
||||
hash_map<string, string> aliases;
|
||||
unordered_map<string, string> aliases;
|
||||
void loadAliases();
|
||||
string getAlias(const string &key);
|
||||
void prepare(FileLister *fl, vector<string> *screens, vector<string> *titles);
|
||||
void freeScreenshots(vector<string> *screens);
|
||||
|
||||
|
||||
public:
|
||||
string file, dir;
|
||||
Selector(GMenu2X *gmenu2x, LinkApp *link, const string &selectorDir="");
|
||||
|
||||
|
||||
int exec(int startSelection=0);
|
||||
};
|
||||
|
||||
|
@ -61,7 +61,7 @@ string Translator::translate(const string &term,const char *replacestr,...) {
|
||||
string result = term;
|
||||
|
||||
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()) {
|
||||
result = i->second;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ Hash Map of translation strings.
|
||||
class Translator {
|
||||
private:
|
||||
string _lang;
|
||||
hash_map<string, string> translations;
|
||||
unordered_map<string, string> translations;
|
||||
|
||||
public:
|
||||
Translator(const string &lang="");
|
||||
|
@ -26,27 +26,13 @@
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <ext/hash_map>
|
||||
#include <tr1/unordered_map>
|
||||
|
||||
using __gnu_cxx::hash_map;
|
||||
using __gnu_cxx::hash;
|
||||
using std::tr1::unordered_map;
|
||||
using std::tr1::hash;
|
||||
using std::string;
|
||||
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 {
|
||||
public:
|
||||
bool operator()(const string &left, const string &right) const;
|
||||
|
Loading…
Reference in New Issue
Block a user