]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
more fixes
authorRudolf Polzer <divverent@xonotic.org>
Mon, 5 Sep 2011 15:54:43 +0000 (17:54 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Mon, 5 Sep 2011 15:54:43 +0000 (17:54 +0200)
radiant/texwindow.cpp

index 5a3b1c9ee78d9e29d0880326d8eab5dbdc81f549..b3113c18b930b95b561111b47d75a6cbac45eb56 100644 (file)
@@ -140,7 +140,7 @@ namespace
                else
                {
                        if(s)
-                               s[0] = 0;
+                               s[1] = 0;
                        else
                                n[0] = 0;
                }
@@ -174,9 +174,9 @@ namespace
                }
                else
                {
-                       StringOutputStream o(64);
-                       o << cat << "/";
-                       cs = o.c_str();
+                       globalErrorStream() << "category name " << cat << " doesn't end with slash?\n";
+                       cs = "";
+                       string_release(n, l);
                }
                return cs;
        }
@@ -229,7 +229,11 @@ void TextureGroups_addDirectory(TextureGroups& groups, const char* directory)
                Radiant_getImageModules().foreachModule(FindTexturesByTypeVisitor(groups, dirstring.c_str()));
        }
        else
-               groups.insert(directory);
+       {
+               StringOutputStream dirstring(64);
+               dirstring << directory << "/";
+               groups.insert(dirstring.c_str());
+       }
 }
 typedef ReferenceCaller1<TextureGroups, const char*, TextureGroups_addDirectory> TextureGroupsAddDirectoryCaller;
 
@@ -1625,7 +1629,7 @@ void TextureGroups_constructTreeModel(TextureGroups groups, GtkTreeStore* store)
       && string_equal_start((*next).c_str(), dirRoot))
     {
                gtk_tree_store_append(store, &iter, NULL);
-               gtk_tree_store_set (store, &iter, 0, CopiedString(StringRange(dirName, firstUnderscore)).c_str(), -1);
+               gtk_tree_store_set (store, &iter, 0, CopiedString(StringRange(dirName, firstUnderscore+1)).c_str(), -1);
 
            // keep going...
            while (i != groups.end() && string_equal_start((*i).c_str(), dirRoot))
@@ -1708,10 +1712,6 @@ void TreeView_onRowActivated(GtkTreeView* treeview, GtkTreePath* path, GtkTreeVi
 
        g_TextureBrowser.m_searchedTags = false;
 
-    if(!TextureBrowser_showWads())
-           if(!cutAtDash)
-                   strcat(dirName, "/");
-
     ScopeDisableScreenUpdates disableScreenUpdates(dirName, "Loading Textures");
     TextureBrowser_ShowDirectory(GlobalTextureBrowser (), dirName);
     TextureBrowser_queueDraw(GlobalTextureBrowser ());