namespace synfig {
class ChangeLocale {
- const char *previous;
- int category;
+ const String previous;
+ const int category;
public:
ChangeLocale(int category, const char *locale):
- previous(setlocale(category,NULL)),category(category)
+ previous(setlocale(category,locale)),category(category)
{
- setlocale(category,locale);
}
~ChangeLocale() {
- setlocale(category,previous);
+ setlocale(category,previous.c_str());
}
};
virtual bool error(const String &task) { return true; }
virtual bool warning(const String &task) { return true; }
virtual bool amount_complete(int current, int total) { return true; }
-
+
virtual bool valid() const { return true; }
};
virtual bool error(const String &task) { if(cb)return cb->error(task); return true; }
virtual bool warning(const String &task) { if(cb)return cb->warning(task); return true; }
virtual bool amount_complete(int cur, int total) { if(cb)return cb->amount_complete(start+cur*w/total,tot); return true; }
-
+
virtual bool valid() const { return cb != 0; }
};