浏览代码

Project template language cleaning

JimMarlowe 9 年之前
父节点
当前提交
83aee0a111

+ 5 - 2
Script/AtomicEditor/ui/modal/CreateProject.ts

@@ -331,8 +331,11 @@ class CreateProject extends ModalWindow {
 
                 if ( this.tryProjectCreate() )
                 {
-                    Preferences.getInstance().editorFeatures.defaultLanguage = this.projectLanguageField.text;
-                    Preferences.getInstance().write();
+                    if ( Preferences.getInstance().editorFeatures.defaultLanguage != this.projectLanguageField.text )
+                    {
+                        Preferences.getInstance().editorFeatures.defaultLanguage = this.projectLanguageField.text;
+                        Preferences.getInstance().write();
+                    }
                     this.hide();
                 }
 

+ 3 - 3
Source/Atomic/UI/UISelectItem.cpp

@@ -109,13 +109,13 @@ void UISelectItemSource::RemoveItemWithStr(const String& str)
 
 const String& UISelectItemSource::GetItemStr(int index)
 {
-	int nn = 0;
+    int nn = 0;
     for (List<SharedPtr<UISelectItem> >::Iterator itr = items_.Begin(); itr != items_.End(); itr++)
     {
         if ( nn == index) return (*itr)->GetStr();
-		nn++;
+        nn++;
     }
-	return ( String::EMPTY );
+    return ( String::EMPTY );
 }
 
 TBSelectItemSource *UISelectItemSource::GetTBItemSource()

+ 1 - 0
Source/Atomic/UI/UISelectItem.h

@@ -80,6 +80,7 @@ public:
 
     void Clear() { items_.Clear(); }
 
+    /// Returns item string for the index. Returns empty string for invalid indexes.
     const String& GetItemStr(int index);
 
     // caller's responsibility to clean up