Commit 3c02b21f authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Move implementation of isCaseSensitive() and scopeSeparator() to Uml::ProgrammingLanguage namespace

parent d6d0bf96
...@@ -1015,6 +1015,28 @@ QString toExtensionsDescription(Enum item) ...@@ -1015,6 +1015,28 @@ QString toExtensionsDescription(Enum item)
return toString(item) + QLatin1String(" ") + result; return toString(item) + QLatin1String(" ") + result;
} }
bool isCaseSensitive(Enum item)
{
return (item != Uml::ProgrammingLanguage::Pascal &&
item != Uml::ProgrammingLanguage::Ada &&
item != Uml::ProgrammingLanguage::SQL &&
item != Uml::ProgrammingLanguage::MySQL &&
item != Uml::ProgrammingLanguage::PostgreSQL);
}
QString scopeSeparator(Enum item)
{
if (item == Uml::ProgrammingLanguage::Ada ||
item == Uml::ProgrammingLanguage::CSharp ||
item == Uml::ProgrammingLanguage::Pascal ||
item == Uml::ProgrammingLanguage::Java ||
item == Uml::ProgrammingLanguage::JavaScript ||
item == Uml::ProgrammingLanguage::Vala ||
item == Uml::ProgrammingLanguage::Python) // CHECK: more?
return QLatin1String(".");
return QLatin1String("::");
}
} // end namespace ProgrammingLanguage } // end namespace ProgrammingLanguage
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -277,6 +277,8 @@ namespace Uml ...@@ -277,6 +277,8 @@ namespace Uml
Enum fromInt(int item); Enum fromInt(int item);
QStringList toExtensions(Enum item); QStringList toExtensions(Enum item);
QString toExtensionsDescription(Enum item); QString toExtensionsDescription(Enum item);
bool isCaseSensitive(Enum item);
QString scopeSeparator(Enum item);
} }
/** /**
......
...@@ -2704,11 +2704,8 @@ Uml::ProgrammingLanguage::Enum UMLApp::activeLanguage() const ...@@ -2704,11 +2704,8 @@ Uml::ProgrammingLanguage::Enum UMLApp::activeLanguage() const
*/ */
bool UMLApp::activeLanguageIsCaseSensitive() bool UMLApp::activeLanguageIsCaseSensitive()
{ {
return (m_activeLanguage != Uml::ProgrammingLanguage::Pascal && Uml::ProgrammingLanguage::Enum pl = activeLanguage();
m_activeLanguage != Uml::ProgrammingLanguage::Ada && return Uml::ProgrammingLanguage::isCaseSensitive(pl);
m_activeLanguage != Uml::ProgrammingLanguage::SQL &&
m_activeLanguage != Uml::ProgrammingLanguage::MySQL &&
m_activeLanguage != Uml::ProgrammingLanguage::PostgreSQL);
} }
/** /**
...@@ -2717,15 +2714,7 @@ bool UMLApp::activeLanguageIsCaseSensitive() ...@@ -2717,15 +2714,7 @@ bool UMLApp::activeLanguageIsCaseSensitive()
QString UMLApp::activeLanguageScopeSeparator() QString UMLApp::activeLanguageScopeSeparator()
{ {
Uml::ProgrammingLanguage::Enum pl = activeLanguage(); Uml::ProgrammingLanguage::Enum pl = activeLanguage();
if (pl == Uml::ProgrammingLanguage::Ada || return Uml::ProgrammingLanguage::scopeSeparator(pl);
pl == Uml::ProgrammingLanguage::CSharp ||
pl == Uml::ProgrammingLanguage::Pascal ||
pl == Uml::ProgrammingLanguage::Java ||
pl == Uml::ProgrammingLanguage::JavaScript ||
pl == Uml::ProgrammingLanguage::Vala ||
pl == Uml::ProgrammingLanguage::Python) // CHECK: more?
return QLatin1String(".");
return QLatin1String("::");
} }
void UMLApp::slotShowTreeView(bool state) void UMLApp::slotShowTreeView(bool state)
......
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