Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/libdocument/ev-file-helpers.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2010-05-04 11:44:31 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2010-05-04 11:44:31 (GMT)
commit68c2072c87f150690e443de656b31746ac9383ad (patch)
treee38176aeb8c6528a8f10dffdb841913f765797f7 /libdocument/ev-file-helpers.c
parent4cc59b9954bbf8728cbdb33cff772c8c4edcbe89 (diff)
[libdocument] Add ev_file_is_temp()
Diffstat (limited to 'libdocument/ev-file-helpers.c')
-rw-r--r--libdocument/ev-file-helpers.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libdocument/ev-file-helpers.c b/libdocument/ev-file-helpers.c
index e0392f4..6483e2d 100644
--- a/libdocument/ev-file-helpers.c
+++ b/libdocument/ev-file-helpers.c
@@ -369,6 +369,25 @@ ev_tmp_uri_unlink (const gchar *uri)
g_object_unref (file);
}
+gboolean
+ev_file_is_temp (GFile *file)
+{
+ gchar *path;
+ gboolean retval;
+
+ if (!g_file_is_native (file))
+ return FALSE;
+
+ path = g_file_get_path (file);
+ if (!path)
+ return FALSE;
+
+ retval = g_str_has_prefix (path, g_get_tmp_dir ());
+ g_free (path);
+
+ return retval;
+}
+
/**
* ev_xfer_uri_simple:
* @from: the source URI