GParamSpec* pspec,
gchar* path)
{
- if (!g_file_test (path, G_FILE_TEST_EXISTS))
+ if (g_access (path, F_OK) != 0)
return;
adblock_parse_file (path);
g_free (path);
gchar* filename = g_compute_checksum_for_string (G_CHECKSUM_MD5,
filters[i - 1], -1);
gchar* path = g_build_filename (folder, filename, NULL);
- if (!g_file_test (path, G_FILE_TEST_EXISTS))
+ if (g_access (path, F_OK) != 0)
{
WebKitNetworkRequest* request;
WebKitDownload* download;
#include <config.h>
#endif
+#if HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+
#include "katze-net.h"
+#include <glib/gstdio.h>
#include <libsoup/soup.h>
#include <webkit/webkit.h>
request = priv->request;
filename = g_filename_from_uri (request->uri, NULL, NULL);
- if (!filename || !g_file_test (filename, G_FILE_TEST_EXISTS))
+ if (!filename || g_access (filename, F_OK) != 0)
{
request->status = KATZE_NET_NOT_FOUND;
if (priv->status_cb)
browser = midori_app_create_browser (app);
config_file = build_config_filename ("session.old.xbel");
- if (g_file_test (config_file, G_FILE_TEST_EXISTS))
+ if (g_access (config_file, F_OK) == 0)
{
GtkActionGroup* action_group = midori_browser_get_action_group (browser);
GtkAction* action = gtk_action_group_get_action (action_group, "LastSession");
error = NULL;
settings = settings_new_from_file (config_file, &extensions);
katze_assign (config_file, build_config_filename ("accels"));
- if (!g_file_test (config_file, G_FILE_TEST_EXISTS))
+ if (g_access (config_file, F_OK) != 0)
katze_assign (config_file, sokoke_find_config_filename (NULL, "accels"));
gtk_accel_map_load (config_file);
katze_assign (config_file, build_config_filename ("search"));
and deleted during normal runtime, but persists in case of a crash. */
katze_assign (config_file, build_config_filename ("running"));
if (katze_object_get_boolean (settings, "show-crash-dialog")
- && g_file_test (config_file, G_FILE_TEST_EXISTS))
+ && g_access (config_file, F_OK) == 0)
{
GtkWidget* dialog = midori_create_diagnostic_dialog (settings, _session);
gtk_dialog_run (GTK_DIALOG (dialog));
#include <libxml/tree.h>
#endif
+#if HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+
#define katze_str_equal(str1, str2) !strcmp (str1, str2)
static void
g_return_val_if_fail (filename != NULL, FALSE);
g_return_val_if_fail (!error || !*error, FALSE);
- if (!g_file_test (filename, G_FILE_TEST_EXISTS))
+ if (g_access (filename, F_OK) != 0)
{
/* File doesn't exist */
if (error)
#include "sokoke.h"
#include <glib/gi18n.h>
+#include <glib/gstdio.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <string.h>
body_fname = g_build_filename (sokoke_set_config_dir (NULL),
"speeddial.json", NULL);
- if (!g_file_test (body_fname, G_FILE_TEST_EXISTS))
+ if (g_access (body_fname, F_OK) != 0)
{
gchar* filename = g_build_filename ("midori", "res", "speeddial.json", NULL);
gchar* filepath = sokoke_find_data_filename (filename);
{
gchar* path = g_build_filename (g_get_home_dir (),
bookmark_clients[i].path, NULL);
- if (g_file_test (path, G_FILE_TEST_EXISTS))
+ if (g_access (path, F_OK) == 0)
gtk_list_store_insert_with_values (model, NULL, G_MAXINT,
0, _(bookmark_clients[i].name), 1, bookmark_clients[i].icon,
2, path, 3, icon_width, -1);
{
#ifdef DOCDIR
uri = "file://" DOCDIR "/midori/user/midori.html";
- if (!g_file_test (DOCDIR "/midori/user/midori.html", G_FILE_TEST_EXISTS))
+ if (g_access (DOCDIR "/midori/user/midori.html", F_OK) != 0)
#endif
uri = "error:nodocs " DOCDIR "/midori/user/midori.html";
}
#include <gdk/gdkkeysyms.h>
#include <webkit/webkit.h>
+#if HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+
/* This is unstable API, so we need to declare it */
gchar*
webkit_web_view_get_selected_text (WebKitWebView* web_view);
body_fname = g_build_filename (sokoke_set_config_dir (NULL),
"speeddial.json", NULL);
- if (!g_file_test (body_fname, G_FILE_TEST_EXISTS))
+ if (g_access (body_fname, F_OK) != 0)
{
if (g_file_get_contents (MDATADIR "/midori/res/speeddial.json",
&speed_dial_body, NULL, NULL))
while ((config_dir = config_dirs[i++]))
{
gchar* path = g_build_filename (config_dir, PACKAGE_NAME, folder, filename, NULL);
- if (g_file_test (path, G_FILE_TEST_EXISTS))
+ if (g_access (filename, F_OK) == 0)
return path;
g_free (path);
}
while ((data_dir = data_dirs[i++]))
{
gchar* path = g_build_filename (data_dir, filename, NULL);
- if (g_file_test (path, G_FILE_TEST_EXISTS))
+ if (g_access (filename, F_OK) == 0)
return path;
g_free (path);
}