Retro-fitted branch 0.5.2
git-svn-id: https://svn.outlyer.net/svn/pub/nautilus-follow-symlink/branches/0.5.2@4 da2faf11-d50b-4b07-92cd-6070d1bd8887
This commit is contained in:
parent
fcc675c13a
commit
906c62263f
|
@ -0,0 +1,25 @@
|
||||||
|
|
||||||
|
COMPILATION
|
||||||
|
===========
|
||||||
|
|
||||||
|
* If no ./configure exists (i.e. raw svn export), use the dist command:
|
||||||
|
$ ./dist
|
||||||
|
|
||||||
|
* Configure
|
||||||
|
$ ./configure
|
||||||
|
|
||||||
|
Note that this being a nautilus extension, the --prefix is not really needed
|
||||||
|
as there's no real flexibility on where to install them. The appropiate place
|
||||||
|
will be checked on install time.
|
||||||
|
|
||||||
|
* Compile
|
||||||
|
$ make
|
||||||
|
|
||||||
|
* Install
|
||||||
|
$ make install
|
||||||
|
|
||||||
|
|
||||||
|
Of special interest:
|
||||||
|
Pass -D_DEBUG to the precompiler to enable the debugging/verbose
|
||||||
|
mode.
|
||||||
|
CPPFLAGS="-D_DEBUG" ./configure
|
11
ChangeLog
11
ChangeLog
|
@ -1,4 +1,13 @@
|
||||||
0.5.1:
|
Iterim milestones:
|
||||||
|
|
||||||
|
0.5.2:
|
||||||
|
* INTERNAL: Corrected includes and function declarations
|
||||||
|
* INTERNAL: Switched to the autotools build system
|
||||||
|
* BUGFIX: Retrieve libnautilus-extension's directory for installation
|
||||||
|
* BUGFIX: Fixed mistakenly using relative paths for link resolution
|
||||||
|
* BUGFIX: Fixed incorrect memory allocation (crashed nautilus sometimes)
|
||||||
|
|
||||||
|
0.5.1 (23 oct 2006):
|
||||||
* BUGFIX: Correctly check error in realpath() call
|
* BUGFIX: Correctly check error in realpath() call
|
||||||
* INTERNAL: Rearrangement in multiple files, applied static where
|
* INTERNAL: Rearrangement in multiple files, applied static where
|
||||||
appropiate
|
appropiate
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
|
||||||
|
SUBDIRS = src
|
||||||
|
|
||||||
|
# This doesn't work as expected
|
||||||
|
libdir = @libdir@/nautilus/extensions-1.0
|
|
@ -0,0 +1,38 @@
|
||||||
|
|
||||||
|
AC_INIT(src/follow-symlink.c)
|
||||||
|
AM_INIT_AUTOMAKE(libnautilus-follow-symlink, "0.5.2")
|
||||||
|
AC_CONFIG_HEADER(src/config.h)
|
||||||
|
|
||||||
|
dnl default FLAGS
|
||||||
|
CPPFLAGS="$CPPFLAGS -std=gnu99 -pedantic-errors -Wall"
|
||||||
|
CFLAGS="$CFLAGS -O -Wall -Werror"
|
||||||
|
LDFLAGS="$LDFLAGS -Wl,--as-needed"
|
||||||
|
|
||||||
|
# libtool
|
||||||
|
AM_PROG_LIBTOOL
|
||||||
|
AM_DISABLE_STATIC
|
||||||
|
|
||||||
|
AC_PROG_INSTALL
|
||||||
|
AC_LANG_C
|
||||||
|
AC_PROG_CC
|
||||||
|
|
||||||
|
# string.h and stdlib.h are used
|
||||||
|
dnl defines STDC_HEADERS if ANSI-compliant headers are present
|
||||||
|
AC_HEADER_STDC
|
||||||
|
dnl Xref: http://www.seul.org/docs/autotut/#libtool
|
||||||
|
AC_CHECK_HEADERS(sys/stat.h,,AC_MSG_ERROR([required header file missing]))
|
||||||
|
|
||||||
|
# glib-2.0: ensure it's present
|
||||||
|
dnl and set GLIB_CFLAGS and GLIB_LIBS
|
||||||
|
AM_PATH_GLIB_2_0
|
||||||
|
|
||||||
|
# pkg-config: ensure libnautilus-extension is found by pkg-config
|
||||||
|
PKG_CHECK_MODULES(NAUTILUS_EXTENSION, [libnautilus-extension])
|
||||||
|
|
||||||
|
#AC_DEFINE(_GNU_SOURCE)
|
||||||
|
|
||||||
|
dnl Incorporate the result of tests
|
||||||
|
CFLAGS="$CFLAGS $GLIB_CFLAGS $NAUTILUS_EXTENSION_CFLAGS"
|
||||||
|
LIBS="$LIBS $GLIB_LIBS $NAUTILUS_EXTENSION_LIBS"
|
||||||
|
|
||||||
|
AC_OUTPUT(Makefile src/Makefile)
|
|
@ -1,3 +1,15 @@
|
||||||
|
nautilus-follow-symlink (0.5.2-out.1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release
|
||||||
|
|
||||||
|
-- Toni Corvera <outlyer@outlyer.net> Tue, 24 Oct 2006 18:24:52 +0200
|
||||||
|
|
||||||
|
nautilus-follow-symlink (0.5.1-out.1) experimental; urgency=low
|
||||||
|
|
||||||
|
* New upstream release
|
||||||
|
|
||||||
|
-- Toni Corvera <outlyer@outlyer.net> Mon, 23 Oct 2006 01:20:15 +0200
|
||||||
|
|
||||||
nautilus-follow-symlink (0.5-out.1) experimental; urgency=low
|
nautilus-follow-symlink (0.5-out.1) experimental; urgency=low
|
||||||
|
|
||||||
* Initial release
|
* Initial release
|
||||||
|
|
|
@ -24,6 +24,8 @@ configure: configure-stamp
|
||||||
configure-stamp:
|
configure-stamp:
|
||||||
dh_testdir
|
dh_testdir
|
||||||
# Add here commands to configure the package.
|
# Add here commands to configure the package.
|
||||||
|
test -f configure || ./dist clean gen
|
||||||
|
./configure --prefix=/usr --disable-static
|
||||||
|
|
||||||
touch configure-stamp
|
touch configure-stamp
|
||||||
|
|
||||||
|
@ -34,7 +36,7 @@ build-stamp: configure-stamp
|
||||||
dh_testdir
|
dh_testdir
|
||||||
|
|
||||||
# Add here commands to compile the package.
|
# Add here commands to compile the package.
|
||||||
cd src && $(MAKE) FINAL=1
|
$(MAKE) FINAL=1
|
||||||
#docbook-to-man debian/nautilus-follow-symlink.sgml > nautilus-follow-symlink.1
|
#docbook-to-man debian/nautilus-follow-symlink.sgml > nautilus-follow-symlink.1
|
||||||
|
|
||||||
touch build-stamp
|
touch build-stamp
|
||||||
|
@ -45,7 +47,7 @@ clean:
|
||||||
rm -f build-stamp configure-stamp
|
rm -f build-stamp configure-stamp
|
||||||
|
|
||||||
# Add here commands to clean up after the build process.
|
# Add here commands to clean up after the build process.
|
||||||
-cd src && $(MAKE) clean
|
-$(MAKE) clean
|
||||||
|
|
||||||
dh_clean
|
dh_clean
|
||||||
|
|
||||||
|
@ -56,7 +58,9 @@ install: build
|
||||||
dh_installdirs
|
dh_installdirs
|
||||||
|
|
||||||
# Add here commands to install the package into debian/nautilus-follow-symlink.
|
# Add here commands to install the package into debian/nautilus-follow-symlink.
|
||||||
cd src && $(MAKE) install DESTDIR=$(CURDIR)/debian/nautilus-follow-symlink
|
$(MAKE) install DESTDIR=$(CURDIR)/debian/nautilus-follow-symlink
|
||||||
|
# There's really no need for the .la file
|
||||||
|
rm -f $(CURDIR)/debian/nautilus-follow-symlink/`pkg-config --variable=extensiondir libnautilus-extension`/*.la
|
||||||
|
|
||||||
|
|
||||||
# Build architecture-independent files here.
|
# Build architecture-independent files here.
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
#!/usr/bin/make -f
|
||||||
|
|
||||||
|
|
||||||
|
dist: gen
|
||||||
|
|
||||||
|
# aclocal won't find libtool's m4, at least in debian, unless an
|
||||||
|
# extra include path is given, with libtoolize it is "." while
|
||||||
|
# whitout it is /usr/share/libtool/m4, altough it will fail
|
||||||
|
# on finding ltmain.sh
|
||||||
|
|
||||||
|
gen:
|
||||||
|
libtoolize
|
||||||
|
aclocal -I .
|
||||||
|
autoconf
|
||||||
|
autoheader
|
||||||
|
automake --add-missing --foreign
|
||||||
|
|
||||||
|
regen: clean gen
|
||||||
|
|
||||||
|
clean:
|
||||||
|
make distclean || true
|
||||||
|
make clean || true
|
||||||
|
cd src && make clean || true
|
||||||
|
#
|
||||||
|
rm -rf autom4te.cache
|
||||||
|
rm -f config.* depcomp install-sh missing src/config.h src/config.h.in
|
||||||
|
rm -f aclocal.m4
|
||||||
|
rm -f configure Makefile Makefile.in src/Makefile src/Makefile.in
|
||||||
|
# Undo libtoolize
|
||||||
|
rm -f libtool.m4 lt*.m4 ltmain.sh libtool
|
57
src/Makefile
57
src/Makefile
|
@ -1,57 +0,0 @@
|
||||||
|
|
||||||
# Note that building without FINAL=1 creates an uber-verbose version
|
|
||||||
|
|
||||||
ifneq ($(FINAL),1)
|
|
||||||
VERSION:=\"0.5.1.interim.debug\"
|
|
||||||
else
|
|
||||||
VERSION:=\"0.5.1\"
|
|
||||||
endif
|
|
||||||
|
|
||||||
CFLAGS=$$(pkg-config --cflags glib-2.0 libnautilus-extension)
|
|
||||||
LDFLAGS=$$(pkg-config --libs glib-2.0 libnautilus-extension)
|
|
||||||
|
|
||||||
CFLAGS+=-DPIC -fPIC -g -O -DVERSION=$(VERSION)
|
|
||||||
LDFLAGS+=-Wl,--as-needed -g -O
|
|
||||||
|
|
||||||
ifneq ($(FINAL),1)
|
|
||||||
CFLAGS+=-D_DEBUG
|
|
||||||
endif
|
|
||||||
|
|
||||||
TARGET=libnautilus-follow-symlink
|
|
||||||
|
|
||||||
# REQUIRED TO BUILD!
|
|
||||||
TARGET_DIR=/usr/lib/nautilus/extensions-1.0
|
|
||||||
INSTALL_DIR=$(DESTDIR)$(TARGET_DIR)
|
|
||||||
|
|
||||||
CC:=gcc
|
|
||||||
|
|
||||||
all: $(TARGET).so
|
|
||||||
|
|
||||||
$(TARGET).la: follow-symlink.o nautilus-ext-follow-symlink.o
|
|
||||||
libtool --mode=link $(CC) $(LDFLAGS) -o $(TARGET).la follow-symlink.lo nautilus-ext-follow-symlink.lo -rpath $(TARGET_DIR)
|
|
||||||
|
|
||||||
$(TARGET).so: $(TARGET).la
|
|
||||||
ln -sf .libs/$(TARGET).so .
|
|
||||||
|
|
||||||
follow-symlink.o: follow-symlink.c follow-symlink.h common.h
|
|
||||||
libtool --mode=compile $(CC) $(CFLAGS) -c follow-symlink.c
|
|
||||||
|
|
||||||
nautilus-ext-follow-symlink.o: nautilus-ext-follow-symlink.c nautilus-ext-follow-symlink.h common.h
|
|
||||||
libtool --mode=compile $(CC) $(CFLAGS) -c nautilus-ext-follow-symlink.c
|
|
||||||
|
|
||||||
install: strip
|
|
||||||
mkdir -p $(INSTALL_DIR)
|
|
||||||
install -m644 -oroot -groot $(TARGET).so $(INSTALL_DIR)/
|
|
||||||
|
|
||||||
uninstall:
|
|
||||||
rm -f $(INSTALL_DIR)/$(TARGET).so
|
|
||||||
rmdir -p $(INSTALL_DIR) || true
|
|
||||||
|
|
||||||
strip: $(TARGET).so
|
|
||||||
strip $(TARGET).so
|
|
||||||
|
|
||||||
distclean: clean
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.la *.lo *.o *.so
|
|
||||||
rm -rf .libs
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
|
||||||
|
nautilus_extension_lib_LTLIBRARIES = libnautilus-follow-symlink.la
|
||||||
|
|
||||||
|
# Must be installed in nautilus' extension dir
|
||||||
|
#nautilus_extension_libdir = $(libdir)/nautilus/extensions-1.0
|
||||||
|
# Cleaner way:
|
||||||
|
nautilus_extension_libdir = `pkg-config --variable=extensiondir libnautilus-extension`
|
||||||
|
|
||||||
|
libnautilus_follow_symlink_la_SOURCES = follow-symlink.c nautilus-ext-follow-symlink.c
|
||||||
|
|
||||||
|
# There's really no need to have versioned file names
|
||||||
|
libnautilus_follow_symlink_la_LDFLAGS = -avoid-version
|
||||||
|
# See e.g. <http://www.seul.org/docs/autotut/#libtool> for version instructions
|
||||||
|
#libnautilus_follow_symlink_la_LDFLAGS = -version-info 0:0:0
|
||||||
|
|
50
src/common.h
50
src/common.h
|
@ -1,16 +1,52 @@
|
||||||
#ifndef FOLLOW_SYMLINK_COMMON_H
|
#ifndef FOLLOW_SYMLINK_COMMON_H
|
||||||
#define FOLLOW_SYMLINK_COMMON_H
|
#define FOLLOW_SYMLINK_COMMON_H
|
||||||
|
|
||||||
#include <glib.h>
|
/*
|
||||||
|
* This file defines common debug utilities.
|
||||||
|
* Also, includes config.h.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <glib/gmessages.h> /* g_print() */
|
||||||
|
#include <glib/gprintf.h> /* g_printf() */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif // HAVE_CONFIG_H
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#define TRACE() (g_printf("nautilus-follow-symlink trace: %s()\n", __FUNCTION__));
|
/* Debugging facilities */
|
||||||
#else
|
#include <stdlib.h> /* getenv() (3) */
|
||||||
#define TRACE()
|
#include <string.h> /* strcmp() (3) */
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef VERSION
|
/* Prefix for messages */
|
||||||
#define VERSION "interim.debug"
|
#define FSL_ "nautilus-follow-symlink: "
|
||||||
|
/* Environment variable, set to 1 to enable verbosity */
|
||||||
|
#define DBGENV_ (getenv("FSL_DBG"))
|
||||||
|
/* Check on runtime the environment variable's value */
|
||||||
|
#define DEBUG_ON_() (DBGENV_ != NULL && 0 == strcmp(DBGENV_,"1"))
|
||||||
|
|
||||||
|
/* Informational message shown on initialisation */
|
||||||
|
#define FSL_DEBUG_INIT() { \
|
||||||
|
const int ENABLED = DEBUG_ON_(); \
|
||||||
|
g_print( FSL_ "DEBUG mode is available, and "); \
|
||||||
|
g_print( (ENABLED) ? "enabled.\n" : "disabled.\n"); \
|
||||||
|
g_print( FSL_ "set the environment variable FSL_DBG to \n" \
|
||||||
|
FSL_ "1 to enable it or to any other value to disable it.\n"); \
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Display the name of the current function name */
|
||||||
|
#define TRACE() if (DEBUG_ON_())\
|
||||||
|
g_printf("nautilus-follow-symlink trace: %s()\n", __FUNCTION__);
|
||||||
|
/* Display a message */
|
||||||
|
#define FSL_LOG(str) if (DEBUG_ON_()) g_printf("%s\n", (str));
|
||||||
|
/* Display a formatted message with one string argument */
|
||||||
|
#define FSL_LOG1(str1, str2) if (DEBUG_ON_()) g_printf("%s %s\n", (str1), (str2));
|
||||||
|
#else
|
||||||
|
/* Debugging facilities disabled */
|
||||||
|
#define TRACE()
|
||||||
|
#define FSL_LOG(a)
|
||||||
|
#define FSL_LOG1(a,b)
|
||||||
|
#define FSL_DEBUG_INIT()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* FOLLOW_SYMLINK_COMMON_H */
|
#endif /* FOLLOW_SYMLINK_COMMON_H */
|
||||||
|
|
|
@ -1,5 +1,15 @@
|
||||||
#include "follow-symlink.h"
|
#include "follow-symlink.h"
|
||||||
|
|
||||||
|
#include <glib/gprintf.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <errno.h> /* errno (3) */
|
||||||
|
#include <stdlib.h> /* realpath() (3) */
|
||||||
|
#include <string.h> /* strlen(), strerror() (3) */
|
||||||
|
|
||||||
|
// Offset at char 7 to remove file://
|
||||||
|
static const unsigned short URI_OFFSET = 7 * sizeof(gchar);
|
||||||
|
static const size_t PATH_LENGTH_BYTES = sizeof(gchar) * (PATH_MAX + 1);
|
||||||
|
|
||||||
/* Menu initialization */
|
/* Menu initialization */
|
||||||
void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *iface)
|
void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *iface)
|
||||||
{
|
{
|
||||||
|
@ -22,7 +32,8 @@ fsl_get_file_items (NautilusMenuProvider * provider,
|
||||||
// Number of files = g_list_length(files)
|
// Number of files = g_list_length(files)
|
||||||
// Directory = nautilus_file_info_is_directory(files->data)
|
// Directory = nautilus_file_info_is_directory(files->data)
|
||||||
|
|
||||||
if (files == NULL || g_list_length(files) != 1) {
|
if (NULL==files || g_list_length(files) != 1) {
|
||||||
|
FSL_LOG( (NULL==files) ? "No file" : "More than one file" );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +41,7 @@ fsl_get_file_items (NautilusMenuProvider * provider,
|
||||||
{
|
{
|
||||||
gchar * uri_scheme = nautilus_file_info_get_uri_scheme(files->data);
|
gchar * uri_scheme = nautilus_file_info_get_uri_scheme(files->data);
|
||||||
if (strcmp(uri_scheme, "file") != 0) {
|
if (strcmp(uri_scheme, "file") != 0) {
|
||||||
|
FSL_LOG( "Not file scheme" );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
g_free(uri_scheme);
|
g_free(uri_scheme);
|
||||||
|
@ -45,15 +57,18 @@ fsl_get_file_items (NautilusMenuProvider * provider,
|
||||||
*/
|
*/
|
||||||
/*if (gfi->type != GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK) {*/
|
/*if (gfi->type != GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK) {*/
|
||||||
if (gfi->type != GNOME_VFS_FILE_TYPE_DIRECTORY) {
|
if (gfi->type != GNOME_VFS_FILE_TYPE_DIRECTORY) {
|
||||||
|
FSL_LOG( "Not directory" );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
// We know the file is either a directory or a symlink to a directory
|
// We know the file is either a directory or a symlink to a directory
|
||||||
// TODO: Has glib/gnome any better/faster alternatives?
|
// TODO: Has glib/gnome any better/faster alternatives?
|
||||||
{
|
{
|
||||||
struct stat file_info;
|
struct stat file_info;
|
||||||
const gchar * const file_name = nautilus_file_info_get_name(files->data);
|
// Note ..._get_name doesn't give the full path
|
||||||
|
const gchar * const file_name = nautilus_file_info_get_uri(files->data) + URI_OFFSET;
|
||||||
lstat(file_name, &file_info);
|
lstat(file_name, &file_info);
|
||||||
if (! S_ISLNK(file_info.st_mode)) {
|
if (! S_ISLNK(file_info.st_mode)) {
|
||||||
|
FSL_LOG1( "Not S_ISLNK:", file_name );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,32 +84,33 @@ void fsl_callback (NautilusMenuItem * item, NautilusFileInfo * file_info)
|
||||||
{
|
{
|
||||||
TRACE();
|
TRACE();
|
||||||
|
|
||||||
//g_print("fsl_callback\n");
|
|
||||||
const size_t URI_OFFSET = 7 * sizeof(gchar); // Offset at char 7 to remove file://
|
|
||||||
const size_t PATH_LENGTH_BYTES = sizeof(gchar) * (PATH_MAX + 1);
|
|
||||||
gchar ** argv;
|
gchar ** argv;
|
||||||
const gchar * link_name = nautilus_file_info_get_uri(file_info);
|
const gchar * link_name = nautilus_file_info_get_uri(file_info) + URI_OFFSET;
|
||||||
gchar * target = g_malloc(PATH_LENGTH_BYTES);
|
gchar * target = g_malloc(PATH_LENGTH_BYTES);
|
||||||
|
|
||||||
/* unlike readlink(man 2), realpath(man 3) resolves the symlink, while
|
/* unlike readlink(man 2), realpath(man 3) resolves the symlink, while
|
||||||
* readlink returns the pointed file, which might be a relative path
|
* readlink returns the pointed file, which might be a relative path
|
||||||
|
* Xref: <http://www.gnu.org/software/libc/manual/html_node/Symbolic-Links.html>
|
||||||
*/
|
*/
|
||||||
if (NULL == realpath(link_name + URI_OFFSET, target)) {
|
if (NULL == realpath(link_name, target)) {
|
||||||
|
g_printf("ERROR in realpath(): %s\n", strerror(errno));
|
||||||
g_assert( FALSE );
|
g_assert( FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
const gchar const * BASE_CMD = "nautilus --no-desktop --no-default-window ";
|
const gchar const * BASE_CMD = "nautilus --no-desktop --no-default-window \"";
|
||||||
gchar * command_line = g_malloc( sizeof(gchar) * (strlen(BASE_CMD) + strlen(target) + URI_OFFSET + 1) );
|
gchar * command_line = g_malloc( sizeof(gchar) * ( strlen(BASE_CMD) + strlen(target) + 2 ) );
|
||||||
|
|
||||||
gchar * offset = g_stpcpy(command_line, BASE_CMD);
|
gchar * offset = g_stpcpy(command_line, BASE_CMD);
|
||||||
offset = g_stpcpy(offset, "file://");
|
//offset = g_stpcpy(offset, "file://"); // unneeded; also makes nautilus think it may be incorrect
|
||||||
g_stpcpy(offset, target);
|
// if it contains spaces (instead of %20's)
|
||||||
|
offset = g_stpcpy(offset, target);
|
||||||
|
g_stpcpy(offset, "\"");
|
||||||
|
|
||||||
if (FALSE == g_shell_parse_argv(command_line, NULL, &argv, NULL)) {
|
if (FALSE == g_shell_parse_argv(command_line, NULL, &argv, NULL)) {
|
||||||
g_assert( FALSE );
|
g_assert( FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
g_printf("nautilus-follow-symlink: Spawning nautilus with\n \"%s\"\n", command_line);
|
g_printf("nautilus-follow-symlink: Spawning nautilus with\n '%s'\n", command_line);
|
||||||
|
|
||||||
g_spawn_async( nautilus_file_info_get_parent_uri(file_info) + URI_OFFSET,
|
g_spawn_async( nautilus_file_info_get_parent_uri(file_info) + URI_OFFSET,
|
||||||
argv,
|
argv,
|
||||||
|
|
|
@ -7,18 +7,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libnautilus-extension/nautilus-menu-provider.h>
|
#include <libnautilus-extension/nautilus-menu-provider.h>
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <stdlib.h> /* realpath() */
|
|
||||||
#include <string.h> /* strlen() */
|
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
/* Static Prototypes */
|
/* Static Prototypes */
|
||||||
|
|
||||||
static GType fsl_get_type(void);
|
|
||||||
|
|
||||||
static void fsl_register_type(GTypeModule *);
|
|
||||||
|
|
||||||
static void fsl_callback(NautilusMenuItem *, NautilusFileInfo *);
|
static void fsl_callback(NautilusMenuItem *, NautilusFileInfo *);
|
||||||
|
|
||||||
static GList *fsl_get_file_items(NautilusMenuProvider *, GtkWidget *, GList *);
|
static GList *fsl_get_file_items(NautilusMenuProvider *, GtkWidget *, GList *);
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "nautilus-ext-follow-symlink.h"
|
#include "nautilus-ext-follow-symlink.h"
|
||||||
|
|
||||||
|
#include <glib/gprintf.h>
|
||||||
|
|
||||||
/* Public interface */
|
/* Public interface */
|
||||||
static GType fsl_type;
|
static GType fsl_type;
|
||||||
static GType provider_types[1];
|
static GType provider_types[1];
|
||||||
|
@ -7,6 +9,7 @@ static GType provider_types[1];
|
||||||
void nautilus_module_initialize (GTypeModule *module)
|
void nautilus_module_initialize (GTypeModule *module)
|
||||||
{
|
{
|
||||||
TRACE();
|
TRACE();
|
||||||
|
FSL_DEBUG_INIT();
|
||||||
|
|
||||||
g_printf("Initializing nautilus-follow-symlink extension (v.%s)\n", VERSION);
|
g_printf("Initializing nautilus-follow-symlink extension (v.%s)\n", VERSION);
|
||||||
|
|
||||||
|
@ -70,12 +73,12 @@ GType fsl_get_type(void)
|
||||||
return fsl_type;
|
return fsl_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fsl_instance_init(FsymlinkExtension *cvs)
|
void fsl_instance_init(FsymlinkExtension *cvs)
|
||||||
{
|
{
|
||||||
TRACE();
|
TRACE();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fsl_class_init(FsymlinkExtensionClass *class)
|
void fsl_class_init(FsymlinkExtensionClass *class)
|
||||||
{
|
{
|
||||||
TRACE();
|
TRACE();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue