../../Source/WebCore/platform/gtk/RenderThemeGtk.cpp: In member function ‘virtual WTF::String WebCore::RenderThemeGtk::fileListNameForWidth(const WebCore::FileList*, const WebCore::Font&, int, bool) const’: ../../Source/WebCore/platform/gtk/RenderThemeGtk.cpp:716:16: warning: unused variable ‘systemBasename’ [-Wunused-variable] ../../Source/WebCore/platform/gtk/RenderThemeGtk.cpp: At global scope: ../../Source/WebCore/platform/gtk/RenderThemeGtk.cpp:694:13: warning: ‘bool WebCore::stringByAdoptingFileSystemRepresentation(gchar*, WTF::String&)’ defined but not used [-Wunused-function] Patch incoming.
Created attachment 139639 [details] Patch
Comment on attachment 139639 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=139639&action=review > Source/WebCore/platform/gtk/RenderThemeGtk.cpp:-717 > - if (fileList->length() == 1) { > - CString systemFilename = fileSystemRepresentation(fileList->item(0)->path()); > - gchar* systemBasename = g_path_get_basename(systemFilename.data()); > - } else if (fileList->length() > 1) I'm pretty sure the right thing to do is to actually use the basename of the file if there is only one of them. It looks like this code now returns fileButtonNoFilesSelectedLabel. Quite likely you need to add something like this here: if (fileList->length()) string = pathGetFileName(fileList->item(0)->path());
Created attachment 139770 [details] Patch
Comment on attachment 139770 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=139770&action=review > Source/WebCore/platform/gtk/RenderThemeGtk.cpp:707 > String string = fileButtonNoFileSelectedLabel(); > if (multipleFilesAllowed) > string = fileButtonNoFilesSelectedLabel(); > > - if (fileList->length() == 1) { > - CString systemFilename = fileSystemRepresentation(fileList->item(0)->path()); > - gchar* systemBasename = g_path_get_basename(systemFilename.data()); > - } else if (fileList->length() > 1) > - return StringTruncator::rightTruncate(multipleFileUploadText(fileList->length()), width, font, StringTruncator::EnableRoundingHacks); > + if (fileList->length()) > + string = pathGetFileName(fileList->item(0)->path()); Now that I look at this again, it seems like it should be structured as an if-else if-else block: String string; if (fileList->length()) string = pathGetFileName(fileList->item(0)->path()); else if (multipleFilesAllowed) string = fileButtonNoFilesSelectedLabel(); else if string = fileButtonNoFileSelectedLabel(); Sorry for not mentioning it before.
Committed r115852: <http://trac.webkit.org/changeset/115852>