summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/gtk/FileSystemGtk.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/gtk/FileSystemGtk.cpp')
-rw-r--r--WebCore/platform/gtk/FileSystemGtk.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/WebCore/platform/gtk/FileSystemGtk.cpp b/WebCore/platform/gtk/FileSystemGtk.cpp
index 94e06db..fcdc863 100644
--- a/WebCore/platform/gtk/FileSystemGtk.cpp
+++ b/WebCore/platform/gtk/FileSystemGtk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2007, 2009 Holger Hans Peter Freyther
* Copyright (C) 2008 Collabora, Ltd.
* Copyright (C) 2008 Apple Inc. All rights reserved.
*
@@ -22,8 +22,7 @@
#include "config.h"
#include "FileSystem.h"
-#include "guriescape.h"
-#include "NotImplemented.h"
+#include "GOwnPtr.h"
#include "PlatformString.h"
#include "CString.h"
@@ -180,6 +179,9 @@ String homeDirectoryPath()
String pathGetFileName(const String& pathName)
{
+ if (pathName.isEmpty())
+ return pathName;
+
char* tmpFilename = filenameFromString(pathName);
char* baseName = g_path_get_basename(tmpFilename);
String fileName = String::fromUTF8(baseName);
@@ -191,8 +193,10 @@ String pathGetFileName(const String& pathName)
String directoryName(const String& path)
{
- notImplemented();
- return String();
+ /* No null checking needed */
+ GOwnPtr<char> tmpFilename(filenameFromString(path));
+ GOwnPtr<char> dirname(g_path_get_dirname(tmpFilename.get()));
+ return String::fromUTF8(dirname.get());
}
Vector<String> listDirectory(const String& path, const String& filter)