[easytag] Avoid use of g_dir_open()
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Avoid use of g_dir_open()
- Date: Tue, 26 Jan 2016 23:12:57 +0000 (UTC)
commit 36ab772953dc328b7f73e615fa67e63c15cf965b
Author: David King <amigadave amigadave com>
Date: Tue Jan 26 14:58:16 2016 +0000
Avoid use of g_dir_open()
Use g_file_test() to check if a path is a directory instead.
src/browser.c | 6 +-----
src/playlist_dialog.c | 1 -
2 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/src/browser.c b/src/browser.c
index b3c380e..4204aa0 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -4190,7 +4190,6 @@ static void
Rename_Directory (EtBrowser *self)
{
EtBrowserPrivate *priv;
- GDir *dir;
gchar *directory_parent;
gchar *directory_last_name;
gchar *directory_new_name;
@@ -4290,14 +4289,11 @@ Rename_Directory (EtBrowser *self)
/* TODO: Replace with g_file_move(). */
/* Check if the new directory name doesn't already exists, and detect if
* it's only a case change (needed for vfat) */
- /* TODO: Handle the GError, such as by checking for G_FILE_ERROR_NOENT. */
- if ((dir = g_dir_open (new_path, 0, NULL)) != NULL)
+ if (g_file_test (new_path, G_FILE_TEST_IS_DIR))
{
GtkWidget *msgdialog;
//gint response;
- g_dir_close (dir);
-
if (strcasecmp(last_path,new_path) != 0)
{
// TODO
diff --git a/src/playlist_dialog.c b/src/playlist_dialog.c
index 95cc94e..0044796 100644
--- a/src/playlist_dialog.c
+++ b/src/playlist_dialog.c
@@ -26,7 +26,6 @@
#include "browser.h"
#include "charset.h"
#include "easytag.h"
-#include "log.h"
#include "misc.h"
#include "picture.h"
#include "scan.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]