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)
if (!selected.isEmpty())
translator = model->data(selected.first(), Qt::UserRole + 1).value<const KeyboardTranslator*>();
else
translator = KeyboardTranslatorManager::instance()->fallbackTranslator();
translator = KeyboardTranslatorManager::instance()->defaultTranslator();
Q_ASSERT(translator);
......
......@@ -160,7 +160,7 @@ void Emulation::setKeyBindings(const QString& name)
{
_keyTranslator = KeyboardTranslatorManager::instance()->findTranslator(name);
if (!_keyTranslator) {
_keyTranslator = KeyboardTranslatorManager::instance()->fallbackTranslator();
_keyTranslator = KeyboardTranslatorManager::instance()->defaultTranslator();
}
}
......
......@@ -33,7 +33,7 @@
using namespace Konsole;
const QByteArray KeyboardTranslatorManager::fallbackTranslatorText(
const QByteArray KeyboardTranslatorManager::defaultTranslatorText(
"keyboard \"Fallback Key Translator\"\n"
"key Tab : \"\\t\""
);
......@@ -106,7 +106,7 @@ void KeyboardTranslatorManager::findTranslators()
const KeyboardTranslator* KeyboardTranslatorManager::findTranslator(const QString& name)
{
if (name.isEmpty())
return fallbackTranslator();
return defaultTranslator();
if (_translators.contains(name) && _translators[name] != 0)
return _translators[name];
......@@ -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
// fall back to the hard-coded one
const KeyboardTranslator* translator = findTranslator("default");
if (!translator) {
QBuffer textBuffer;
textBuffer.setData(fallbackTranslatorText);
textBuffer.setData(defaultTranslatorText);
textBuffer.open(QIODevice::ReadOnly);
translator = loadTranslator(&textBuffer, "fallback");
}
......
......@@ -67,8 +67,8 @@ public:
*/
bool deleteTranslator(const QString& name);
/** Returns the fallback translator for Konsole. */
const KeyboardTranslator* fallbackTranslator();
/** Returns the default translator for Konsole. */
const KeyboardTranslator* defaultTranslator();
/**
* Returns the keyboard translator with the given name or 0 if no translator
......@@ -90,7 +90,7 @@ public:
static KeyboardTranslatorManager* instance();
private:
static const QByteArray fallbackTranslatorText;
static const QByteArray defaultTranslatorText;
void findTranslators(); // locate the available translators
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