Revision: 1498
http://geeqie.svn.sourceforge.net/geeqie/?rev=1498&view=rev
Author: zas_
Date: 2009-03-08 20:49:48 +0000 (Sun, 08 Mar 2009)
Log Message:
-----------
Cleanup and minor fixes.
Modified Paths:
--------------
trunk/src/editors.c
Modified: trunk/src/editors.c
===================================================================
--- trunk/src/editors.c 2009-03-08 17:51:03 UTC (rev 1497)
+++ trunk/src/editors.c 2009-03-08 20:49:48 UTC (rev 1498)
@@ -275,16 +275,13 @@
g_strfreev(mime_types);
if (!editor->ext_list) editor->hidden = TRUE;
}
-
}
-
if (g_key_file_get_boolean(key_file, DESKTOP_GROUP,
"X-Geeqie-Keep-Fullscreen", NULL)) editor->flags |= EDITOR_KEEP_FS;
if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "X-Geeqie-Verbose",
NULL)) editor->flags |= EDITOR_VERBOSE;
if (g_key_file_get_boolean(key_file, DESKTOP_GROUP,
"X-Geeqie-Verbose-Multi", NULL)) editor->flags |= EDITOR_VERBOSE_MULTI;
if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "X-Geeqie-Filter",
NULL)) editor->flags |= EDITOR_DEST;
if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "Terminal", NULL))
editor->flags |= EDITOR_TERMINAL;
-
editor->flags |= editor_command_parse(editor, NULL, NULL);
g_key_file_free(key_file);
@@ -315,9 +312,8 @@
while ((dir = readdir(dp)) != NULL)
{
gchar *namel = dir->d_name;
- size_t len = strlen(namel);
- if (len > 8 && g_ascii_strncasecmp(namel + len - 8, ".desktop",
8) == 0)
+ if (g_str_has_suffix(namel, ".desktop"))
{
gchar *name = path_to_utf8(namel);
gchar *dpath = g_build_filename(path, name, NULL);
@@ -373,7 +369,7 @@
GList **listp = data;
EditorDescription *editor = value;
- /* do not show the special commands in any list, they are called
explicitelly */
+ /* do not show the special commands in any list, they are called
explicitly */
if (strcmp(editor->key, CMD_COPY) == 0 ||
strcmp(editor->key, CMD_MOVE) == 0 ||
strcmp(editor->key, CMD_RENAME) == 0 ||
@@ -387,7 +383,7 @@
{
const EditorDescription *ea = a;
const EditorDescription *eb = b;
- int ret;
+ gint ret;
ret = strcmp(ea->menu_path, eb->menu_path);
if (ret != 0) return ret;
@@ -574,7 +570,7 @@
{
GString *string;
gchar *pathl;
- const gchar *p = NULL;
+ const gchar *p;
string = g_string_new("");
@@ -624,6 +620,7 @@
p = "";
}
+ g_assert(p);
while (*p != '\0')
{
/* must escape \, ", `, and $ to avoid problems,
@@ -641,6 +638,12 @@
pathl = path_from_utf8(string->str);
g_string_free(string, TRUE);
+ if (pathl && !pathl[0]) /* empty string case */
+ {
+ g_free(pathl);
+ pathl = NULL;
+ }
+
return pathl;
}
@@ -861,11 +864,11 @@
if ((ed->flags & EDITOR_DEST) && fd->change &&
fd->change->dest) /* FIXME: error handling */
{
- setenv("GEEQIE_DESTINATION", fd->change->dest, TRUE);
+ g_setenv("GEEQIE_DESTINATION", fd->change->dest, TRUE);
}
else
{
- unsetenv("GEEQIE_DESTINATION");
+ g_unsetenv("GEEQIE_DESTINATION");
}
ok = g_spawn_async_with_pipes(working_directory, args, NULL,
@@ -940,7 +943,10 @@
if (ed->vd)
{
- editor_verbose_window_progress(ed, (ed->flags &
EDITOR_FOR_EACH) ? fd->path : _("running..."));
+ if (ed->flags & EDITOR_FOR_EACH)
+ editor_verbose_window_progress(ed, fd->path);
+ else
+ editor_verbose_window_progress(ed,
_("running..."));
}
ed->count++;
@@ -957,9 +963,9 @@
if (!error)
return 0;
- else
- /* command was not started, call the finish immediately
*/
- return editor_command_next_finish(ed, 0);
+
+ /* command was not started, call the finish immediately */
+ return editor_command_next_finish(ed, 0);
}
/* everything is done */
@@ -1012,17 +1018,14 @@
if (ed->vd)
{
- const gchar *text;
-
if (ed->count == ed->total)
{
- text = _("done");
+ editor_verbose_window_progress(ed, _("done"));
}
else
{
- text = _("stopped by user");
+ editor_verbose_window_progress(ed, _("stopped by
user"));
}
- editor_verbose_window_progress(ed, text);
editor_verbose_window_enable_close(ed->vd);
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn