Title: [115852] trunk/Source/WebCore
Revision
115852
Author
[email protected]
Date
2012-05-02 10:57:34 -0700 (Wed, 02 May 2012)

Log Message

[GTK] Compilation warnings in RenderTheme
https://bugs.webkit.org/show_bug.cgi?id=85286

Reviewed by Martin Robinson.

Removed un-needed code and refactored fileListNameForWidth
accordingly to avoid un-used variable warnings during compilation.

* platform/gtk/RenderThemeGtk.cpp:
(WebCore):
(WebCore::RenderThemeGtk::fileListNameForWidth):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (115851 => 115852)


--- trunk/Source/WebCore/ChangeLog	2012-05-02 17:50:58 UTC (rev 115851)
+++ trunk/Source/WebCore/ChangeLog	2012-05-02 17:57:34 UTC (rev 115852)
@@ -1,3 +1,17 @@
+2012-05-02  Philippe Normand  <[email protected]>
+
+        [GTK] Compilation warnings in RenderTheme
+        https://bugs.webkit.org/show_bug.cgi?id=85286
+
+        Reviewed by Martin Robinson.
+
+        Removed un-needed code and refactored fileListNameForWidth
+        accordingly to avoid un-used variable warnings during compilation.
+
+        * platform/gtk/RenderThemeGtk.cpp:
+        (WebCore):
+        (WebCore::RenderThemeGtk::fileListNameForWidth):
+
 2012-05-02  Ryosuke Niwa  <[email protected]>
 
         NULL ptr in WebCore::AppendNodeCommand::AppendNodeCommand

Modified: trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp (115851 => 115852)


--- trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp	2012-05-02 17:50:58 UTC (rev 115851)
+++ trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp	2012-05-02 17:57:34 UTC (rev 115852)
@@ -691,32 +691,22 @@
 }
 #endif
 
-static bool stringByAdoptingFileSystemRepresentation(gchar* systemFilename, String& result)
-{
-    if (!systemFilename)
-        return false;
-
-    result = filenameToString(systemFilename);
-    g_free(systemFilename);
-
-    return true;
-}
-
 String RenderThemeGtk::fileListNameForWidth(const FileList* fileList, const Font& font, int width, bool multipleFilesAllowed) const
 {
     if (width <= 0)
         return String();
 
-    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)
+    if (fileList->length() > 1)
         return StringTruncator::rightTruncate(multipleFileUploadText(fileList->length()), width, font, StringTruncator::EnableRoundingHacks);
 
+    String string;
+    if (fileList->length())
+        string = pathGetFileName(fileList->item(0)->path());
+    else if (multipleFilesAllowed)
+        string = fileButtonNoFilesSelectedLabel();
+    else
+        string = fileButtonNoFileSelectedLabel();
+
     return StringTruncator::centerTruncate(string, width, font, StringTruncator::EnableRoundingHacks);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to