Changeset 107395 in webkit


Ignore:
Timestamp:
Feb 10, 2012 3:51:05 AM (12 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] KURL::fileSystemPath() doesn't work if uri contains #
https://bugs.webkit.org/show_bug.cgi?id=78339

Reviewed by Philippe Normand.

  • platform/gtk/KURLGtk.cpp:

(WebCore::KURL::fileSystemPath): Use GFile API instead of
g_filename_from_uri() to convert the uri to a local
path. g_file_get_path() removes the anchor from the uri and
returns a valid path instead of NULL.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r107394 r107395  
     12012-02-10  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] KURL::fileSystemPath() doesn't work if uri contains #
     4        https://bugs.webkit.org/show_bug.cgi?id=78339
     5
     6        Reviewed by Philippe Normand.
     7
     8        * platform/gtk/KURLGtk.cpp:
     9        (WebCore::KURL::fileSystemPath): Use GFile API instead of
     10        g_filename_from_uri() to convert the uri to a local
     11        path. g_file_get_path() removes the anchor from the uri and
     12        returns a valid path instead of NULL.
     13
    1142012-02-10  Pablo Flouret  <pablof@motorola.com>
    215
  • trunk/Source/WebCore/platform/gtk/KURLGtk.cpp

    r95901 r107395  
    2121
    2222#include "FileSystem.h"
     23#include <gio/gio.h>
     24#include <wtf/gobject/GOwnPtr.h>
     25#include <wtf/gobject/GRefPtr.h>
    2326#include <wtf/text/CString.h>
    2427
     
    2932String KURL::fileSystemPath() const
    3033{
    31     gchar* filename = g_filename_from_uri(m_string.utf8().data(), 0, 0);
    32     if (!filename)
    33         return String();
    34 
    35     String path = filenameToString(filename);
    36     g_free(filename);
    37     return path;
     34    GRefPtr<GFile> file = adoptGRef(g_file_new_for_uri(m_string.utf8().data()));
     35    GOwnPtr<char> filename(g_file_get_path(file.get()));
     36    return filenameToString(filename.get());
    3837}
    3938
Note: See TracChangeset for help on using the changeset viewer.