Compare commits
No commits in common. "dd2a95bb9963cd5c29893b4e78d8c2b3ae38f9cf" and "8efd11d4e59b67d8fcf8e0d69cbb3cc9d62795e5" have entirely different histories.
dd2a95bb99
...
8efd11d4e5
@ -1,11 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=fastiv
|
||||
GenericName=File Browser
|
||||
Icon=fastiv
|
||||
Exec=fastiv --browse -- %f
|
||||
NoDisplay=true
|
||||
Terminal=false
|
||||
StartupNotify=true
|
||||
Categories=Utility;FileTools;
|
||||
MimeType=inode/directory;
|
34
fastiv.c
34
fastiv.c
@ -321,25 +321,18 @@ on_item_activated(G_GNUC_UNUSED FastivBrowser *browser, const char *path,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
open_any_path(const char *path, gboolean force_browser)
|
||||
open_any_path(const char *path)
|
||||
{
|
||||
GStatBuf st;
|
||||
gchar *canonical = g_canonicalize_filename(path, g.directory);
|
||||
gboolean success = !g_stat(canonical, &st);
|
||||
if (!success) {
|
||||
if (!success)
|
||||
show_error_dialog(g_error_new(G_FILE_ERROR,
|
||||
g_file_error_from_errno(errno), "%s: %s", path, g_strerror(errno)));
|
||||
} else if (S_ISDIR(st.st_mode)) {
|
||||
else if (S_ISDIR(st.st_mode))
|
||||
load_directory(canonical);
|
||||
} else if (force_browser) {
|
||||
// GNOME, e.g., invokes this as a hint to focus the particular file,
|
||||
// which we can't currently do yet.
|
||||
gchar *directory = g_path_get_dirname(canonical);
|
||||
load_directory(directory);
|
||||
g_free(directory);
|
||||
} else {
|
||||
else
|
||||
open(canonical);
|
||||
}
|
||||
g_free(canonical);
|
||||
return success;
|
||||
}
|
||||
@ -353,7 +346,7 @@ on_open_location(G_GNUC_UNUSED GtkPlacesSidebar *sidebar, GFile *location,
|
||||
if (flags & GTK_PLACES_OPEN_NEW_WINDOW)
|
||||
spawn_path(path);
|
||||
else
|
||||
open_any_path(path, FALSE);
|
||||
open_any_path(path);
|
||||
g_free(path);
|
||||
}
|
||||
}
|
||||
@ -478,13 +471,6 @@ on_key_press_view(G_GNUC_UNUSED GtkWidget *widget, GdkEventKey *event,
|
||||
switch_to_browser();
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case GDK_MOD1_MASK:
|
||||
switch (event->keyval) {
|
||||
case GDK_KEY_Left:
|
||||
switch_to_browser();
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@ -527,8 +513,7 @@ on_button_press_browser(G_GNUC_UNUSED GtkWidget *widget, GdkEventButton *event)
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
gboolean show_version = FALSE, show_supported_media_types = FALSE,
|
||||
browse = FALSE;
|
||||
gboolean show_version = FALSE, show_supported_media_types = FALSE;
|
||||
gchar **path_args = NULL;
|
||||
const GOptionEntry options[] = {
|
||||
{G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &path_args,
|
||||
@ -536,9 +521,6 @@ main(int argc, char *argv[])
|
||||
{"list-supported-media-types", 0, G_OPTION_FLAG_IN_MAIN,
|
||||
G_OPTION_ARG_NONE, &show_supported_media_types,
|
||||
"Output supported media types and exit", NULL},
|
||||
{"browse", 0, G_OPTION_FLAG_IN_MAIN,
|
||||
G_OPTION_ARG_NONE, &browse,
|
||||
"Start in filesystem browsing mode", NULL},
|
||||
{"version", 'V', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE,
|
||||
&show_version, "Output version information and exit", NULL},
|
||||
{},
|
||||
@ -710,8 +692,8 @@ main(int argc, char *argv[])
|
||||
|
||||
g.files = g_ptr_array_new_full(16, g_free);
|
||||
g.directory = g_get_current_dir();
|
||||
if (!path_arg || !open_any_path(path_arg, browse))
|
||||
open_any_path(g.directory, FALSE);
|
||||
if (!path_arg || !open_any_path(path_arg))
|
||||
open_any_path(g.directory);
|
||||
|
||||
// Try to get half of the screen vertically, in 4:3 aspect ratio.
|
||||
//
|
||||
|
@ -3,7 +3,7 @@ Type=Application
|
||||
Name=fastiv
|
||||
GenericName=Image Viewer
|
||||
Icon=fastiv
|
||||
Exec=fastiv -- %f
|
||||
Exec=fastiv %F
|
||||
Terminal=false
|
||||
StartupNotify=true
|
||||
Categories=Graphics;2DGraphics;Viewer;
|
||||
|
@ -56,8 +56,6 @@ endif
|
||||
|
||||
install_data('fastiv.desktop',
|
||||
install_dir : get_option('datadir') + '/applications')
|
||||
install_data('fastiv-browse.desktop',
|
||||
install_dir : get_option('datadir') + '/applications')
|
||||
install_data('fastiv.svg',
|
||||
install_dir : get_option('datadir') + '/icons/hicolor/scalable/apps')
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit a0e2454f0c21369f9775cad3bcaf1e3bb1db70b6
|
||||
Subproject commit 7804ffe150db6f0dd2c745587b9327fa4f150ee5
|
Loading…
x
Reference in New Issue
Block a user