[easytag] Fix a MinGW build failure in EtBrowser
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Fix a MinGW build failure in EtBrowser
- Date: Thu, 30 Oct 2014 20:46:46 +0000 (UTC)
commit f8250eceeb25a63dcfa44e9ca0482c1dc81448c3
Author: David King <amigadave amigadave com>
Date: Thu Oct 30 20:28:42 2014 +0000
Fix a MinGW build failure in EtBrowser
src/browser.c | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/src/browser.c b/src/browser.c
index a5bbf0d..8aafc4c 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -938,13 +938,19 @@ Browser_Tree_Node_Selected (EtBrowser *self, GtkTreeSelection *selection)
#ifdef G_OS_WIN32
static gboolean
-Browser_Win32_Get_Drive_Root (gchar *drive, GtkTreeIter *rootNode, GtkTreePath **rootPath)
+et_browser_win32_get_drive_root (EtBrowser *self,
+ gchar *drive,
+ GtkTreeIter *rootNode,
+ GtkTreePath **rootPath)
{
+ EtBrowserPrivate *priv;
gint root_index;
gboolean found = FALSE;
GtkTreeIter parentNode;
gchar *nodeName;
+ priv = et_browser_get_instance_private (self);
+
gtk_tree_model_get_iter_first(GTK_TREE_MODEL(priv->directory_model), &parentNode);
// Find root of path, ie: the drive letter
@@ -1001,12 +1007,6 @@ et_browser_select_dir (EtBrowser *self, const gchar *current_path)
return;
}
-#ifdef G_OS_WIN32
- /* On win32 : stat("c:\path\to\dir") succeed, while stat("c:\path\to\dir\") fails */
- ET_Win32_Path_Remove_Trailing_Backslash(current_path);
-#endif /* G_OS_WIN32 */
-
-
/* Don't check here if the path is valid. It will be done later when
* selecting a node in the tree */
@@ -1016,8 +1016,11 @@ et_browser_select_dir (EtBrowser *self, const gchar *current_path)
// Expand root node (fill parentNode and rootPath)
#ifdef G_OS_WIN32
- if (!Browser_Win32_Get_Drive_Root(parts[0], &parentNode, &rootPath))
+ if (!et_browser_win32_get_drive_root (self, parts[0], &parentNode,
+ &rootPath))
+ {
return;
+ }
#else /* !G_OS_WIN32 */
if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->directory_model),
&parentNode))
@@ -3212,8 +3215,11 @@ Browser_Tree_Rename_Directory (EtBrowser *self,
textsplit = g_strsplit(last_path, G_DIR_SEPARATOR_S, 0);
#ifdef G_OS_WIN32
- if (!Browser_Win32_Get_Drive_Root(textsplit[0], &iter, &parentpath))
+ if (!et_browser_win32_get_drive_root (self, textsplit[0], &iter,
+ &parentpath))
+ {
return;
+ }
#else /* !G_OS_WIN32 */
parentpath = gtk_tree_path_new_first();
#endif /* !G_OS_WIN32 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]