homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamedialog.cpp
changeset 90 3ac3aaebaee5
parent 81 7dd137878ff8
child 97 66b5fe3c07fd
equal deleted inserted replaced
86:e4f038c420f7 90:3ac3aaebaee5
   133 
   133 
   134     QString newName(name);
   134     QString newName(name);
   135 
   135 
   136     unsigned int numToAppend(1);
   136     unsigned int numToAppend(1);
   137 
   137 
   138     while (mOtherCollectionsNames.contains(newName)) {
   138     bool defaultCollection = false;
   139         newName = hbTrId("txt_applib_dialog_entry_collectionl1").arg(
   139     if (newName == hbTrId("txt_applib_dialog_entry_collection")) {
       
   140         defaultCollection = true;
       
   141     }
       
   142     if (defaultCollection) {
       
   143         while (mOtherCollectionsNames.contains(newName)) {
       
   144             newName = hbTrId("txt_applib_dialog_entry_collectionl1").arg(
   140                 numToAppend);
   145                 numToAppend);
   141         numToAppend++;
   146             numToAppend++;
       
   147         }
       
   148     }
       
   149     else {
       
   150         QString textMap = hbTrId(
       
   151             "txt_applib_dialog_collection_name_entry_1_l1");
       
   152         // TODO: Temporary workaround.
       
   153         // The "if" instruction below can be removed when
       
   154         // a text map "txt_applib_dialog_collection_name_entry_1_l1"
       
   155         // is available in the platform.
       
   156         if (textMap == "txt_applib_dialog_collection_name_entry_1_l1") {
       
   157             textMap = "%2 (%L1)";
       
   158         }
       
   159         while (mOtherCollectionsNames.contains(newName)) {
       
   160             newName = textMap.arg(numToAppend).arg(name);
       
   161             numToAppend++;
       
   162         }
   142     }
   163     }
   143 
   164 
   144     HSMENUTEST_FUNC_EXIT("HsInputDialog::newName");
   165     HSMENUTEST_FUNC_EXIT("HsInputDialog::newName");
   145     return newName;
   166     return newName;
   146 }
   167 }