Commit 5c28f79f authored by Jekyll Wu's avatar Jekyll Wu
Browse files

Revert "Rename: defaultTranslator ==> fallbackTranslator"

I was stupid

This reverts commit 912e52b1.
parent 912e52b1
...@@ -878,7 +878,7 @@ void EditProfileDialog::showKeyBindingEditor(bool isNewTranslator) ...@@ -878,7 +878,7 @@ void EditProfileDialog::showKeyBindingEditor(bool isNewTranslator)
if (!selected.isEmpty()) if (!selected.isEmpty())
translator = model->data(selected.first(), Qt::UserRole + 1).value<const KeyboardTranslator*>(); translator = model->data(selected.first(), Qt::UserRole + 1).value<const KeyboardTranslator*>();
else else
translator = KeyboardTranslatorManager::instance()->fallbackTranslator(); translator = KeyboardTranslatorManager::instance()->defaultTranslator();
Q_ASSERT(translator); Q_ASSERT(translator);
......
...@@ -160,7 +160,7 @@ void Emulation::setKeyBindings(const QString& name) ...@@ -160,7 +160,7 @@ void Emulation::setKeyBindings(const QString& name)
{ {
_keyTranslator = KeyboardTranslatorManager::instance()->findTranslator(name); _keyTranslator = KeyboardTranslatorManager::instance()->findTranslator(name);
if (!_keyTranslator) { if (!_keyTranslator) {
_keyTranslator = KeyboardTranslatorManager::instance()->fallbackTranslator(); _keyTranslator = KeyboardTranslatorManager::instance()->defaultTranslator();
} }
} }
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
using namespace Konsole; using namespace Konsole;
const QByteArray KeyboardTranslatorManager::fallbackTranslatorText( const QByteArray KeyboardTranslatorManager::defaultTranslatorText(
"keyboard \"Fallback Key Translator\"\n" "keyboard \"Fallback Key Translator\"\n"
"key Tab : \"\\t\"" "key Tab : \"\\t\""
); );
...@@ -106,7 +106,7 @@ void KeyboardTranslatorManager::findTranslators() ...@@ -106,7 +106,7 @@ void KeyboardTranslatorManager::findTranslators()
const KeyboardTranslator* KeyboardTranslatorManager::findTranslator(const QString& name) const KeyboardTranslator* KeyboardTranslatorManager::findTranslator(const QString& name)
{ {
if (name.isEmpty()) if (name.isEmpty())
return fallbackTranslator(); return defaultTranslator();
if (_translators.contains(name) && _translators[name] != 0) if (_translators.contains(name) && _translators[name] != 0)
return _translators[name]; return _translators[name];
...@@ -177,14 +177,14 @@ KeyboardTranslator* KeyboardTranslatorManager::loadTranslator(QIODevice* source, ...@@ -177,14 +177,14 @@ KeyboardTranslator* KeyboardTranslatorManager::loadTranslator(QIODevice* source,
} }
} }
const KeyboardTranslator* KeyboardTranslatorManager::fallbackTranslator() const KeyboardTranslator* KeyboardTranslatorManager::defaultTranslator()
{ {
// Try to find the default.keytab file if it exists, otherwise // Try to find the default.keytab file if it exists, otherwise
// fall back to the hard-coded one // fall back to the hard-coded one
const KeyboardTranslator* translator = findTranslator("default"); const KeyboardTranslator* translator = findTranslator("default");
if (!translator) { if (!translator) {
QBuffer textBuffer; QBuffer textBuffer;
textBuffer.setData(fallbackTranslatorText); textBuffer.setData(defaultTranslatorText);
textBuffer.open(QIODevice::ReadOnly); textBuffer.open(QIODevice::ReadOnly);
translator = loadTranslator(&textBuffer, "fallback"); translator = loadTranslator(&textBuffer, "fallback");
} }
......
...@@ -67,8 +67,8 @@ public: ...@@ -67,8 +67,8 @@ public:
*/ */
bool deleteTranslator(const QString& name); bool deleteTranslator(const QString& name);
/** Returns the fallback translator for Konsole. */ /** Returns the default translator for Konsole. */
const KeyboardTranslator* fallbackTranslator(); const KeyboardTranslator* defaultTranslator();
/** /**
* Returns the keyboard translator with the given name or 0 if no translator * Returns the keyboard translator with the given name or 0 if no translator
...@@ -90,7 +90,7 @@ public: ...@@ -90,7 +90,7 @@ public:
static KeyboardTranslatorManager* instance(); static KeyboardTranslatorManager* instance();
private: private:
static const QByteArray fallbackTranslatorText; static const QByteArray defaultTranslatorText;
void findTranslators(); // locate the available translators void findTranslators(); // locate the available translators
KeyboardTranslator* loadTranslator(const QString& name); // loads the translator KeyboardTranslator* loadTranslator(const QString& name); // loads the translator
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment