File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
External/Plugins/ProjectManager/Controls Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -300,6 +300,9 @@ public NewProjectDialog()
300
300
301
301
ListViewGroup group = null ;
302
302
List < String > templateDirs = ProjectPaths . GetAllProjectDirs ( ) ;
303
+ templateDirs . Sort ( CompareFolderNames ) ;
304
+ ListViewItem lastItem = null ;
305
+
303
306
foreach ( string templateDir in templateDirs )
304
307
{
305
308
// skip hidden folders (read: version control)
@@ -322,11 +325,20 @@ public NewProjectDialog()
322
325
}
323
326
item . Group = group ;
324
327
}
328
+
329
+ if ( lastItem != null && lastItem . Text == item . Text ) // remove duplicates (keep last)
330
+ projectListView . Items . Remove ( lastItem ) ;
331
+ lastItem = item ;
325
332
projectListView . Items . Add ( item ) ;
326
333
}
327
334
this . Load += new EventHandler ( NewProjectDialog_Load ) ;
328
335
}
329
336
337
+ int CompareFolderNames ( string pathA , string pathB )
338
+ {
339
+ return Path . GetFileName ( pathA ) . CompareTo ( Path . GetFileName ( pathB ) ) ;
340
+ }
341
+
330
342
void NewProjectDialog_Load ( object sender , EventArgs e )
331
343
{
332
344
if ( ! String . IsNullOrEmpty ( lastTemplate ) )
You can’t perform that action at this time.
0 commit comments