/nautilus-follow-symlink/branches/0.6.0/configure.in |
---|
0,0 → 1,49 |
AC_INIT(src/follow-symlink.c) |
AM_INIT_AUTOMAKE(libnautilus-follow-symlink, "0.6.0") |
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 |
# intltool |
AC_PROG_INTLTOOL(0.18) |
GETTEXT_PACKAGE=nautilus-follow-symlink |
AC_SUBST(GETTEXT_PACKAGE) |
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [gettext domain]) |
ALL_LINGUAS="ca es" dnl Implied en |
AM_GLIB_GNU_GETTEXT |
# 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 |
po/Makefile.in |
]) |
/nautilus-follow-symlink/branches/0.6.0/ChangeLog |
---|
0,0 → 1,22 |
Iterim milestones |
These private versions, the version numbering bumps just denote |
that a development milestone is achieved |
0.6.0: |
* Added support for i18n, updated build-dependancies accordingly |
0.5.2 (24 oct 2006): |
* 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 |
* INTERNAL: Rearrangement in multiple files, applied static where |
appropiate |
* INTERNAL: Added extra-verbosity, switchable on compile time |
0.5 (22 oct 2006): |
* Initial release |
/nautilus-follow-symlink/branches/0.6.0/src/Makefile.am |
---|
0,0 → 1,18 |
# Required to correctly install the locale files |
CPPFLAGS+=-DGNOMELOCALEDIR=\""$(datadir)/locale"\" |
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 |
/nautilus-follow-symlink/branches/0.6.0/src/common.h |
---|
0,0 → 1,56 |
#ifndef FOLLOW_SYMLINK_COMMON_H |
#define FOLLOW_SYMLINK_COMMON_H |
/* |
* This file defines common debug utilities. |
* Also, includes config.h. |
*/ |
#include <glib/gmessages.h> /* g_print() */ |
#include <glib/gprintf.h> /* g_printf() */ |
#include "libintl.h" |
#define _(STR) gettext(STR) |
#ifdef HAVE_CONFIG_H |
#include "config.h" |
#endif // HAVE_CONFIG_H |
#ifdef _DEBUG |
/* Debugging facilities */ |
#include <stdlib.h> /* getenv() (3) */ |
#include <string.h> /* strcmp() (3) */ |
/* Prefix for messages */ |
#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 /* FOLLOW_SYMLINK_COMMON_H */ |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/branches/0.6.0/src/follow-symlink.c |
---|
0,0 → 1,145 |
#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 */ |
void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *iface) |
{ |
TRACE(); |
//TODO: iface->get_background_items = fsl_get_background_items; |
iface->get_file_items = fsl_get_file_items; |
} |
/* Bind to menu if needed */ |
GList * |
fsl_get_file_items (NautilusMenuProvider * provider, |
GtkWidget * window, |
GList * files) |
{ |
TRACE(); |
NautilusMenuItem *item; |
// Number of files = g_list_length(files) |
// Directory = nautilus_file_info_is_directory(files->data) |
if (NULL==files || g_list_length(files) != 1) { |
FSL_LOG( (NULL==files) ? "No file" : "More than one file" ); |
return NULL; |
} |
// Only file uris |
{ |
gchar * uri_scheme = nautilus_file_info_get_uri_scheme(files->data); |
if (strcmp(uri_scheme, "file") != 0) { |
FSL_LOG( "Not file scheme" ); |
return NULL; |
} |
g_free(uri_scheme); |
} |
// Xref: http://www.koders.com/c/fidA0AA0A78334E1FA3D668FD10B437638F6D031D77.aspx?s=NautilusFile |
GnomeVFSFileInfo * gfi = nautilus_file_info_get_vfs_file_info(files->data); |
/* |
* Xref: /usr/include/gnome-vfs-2.0/libgnomevfs/gnome-vfs-file-info.h |
* |
* Aparently type is never GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK and symlinks |
* are resolved to the target type |
*/ |
/*if (gfi->type != GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK) {*/ |
if (gfi->type != GNOME_VFS_FILE_TYPE_DIRECTORY) { |
FSL_LOG( "Not directory" ); |
return NULL; |
} |
// We know the file is either a directory or a symlink to a directory |
// TODO: Has glib/gnome any better/faster alternatives? |
{ |
struct stat file_info; |
// 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); |
if (! S_ISLNK(file_info.st_mode)) { |
FSL_LOG1( "Not S_ISLNK:", file_name ); |
return NULL; |
} |
} |
item = fsl_menu_item_new(gtk_widget_get_screen(window), TRUE); |
g_signal_connect(item, "activate", G_CALLBACK(fsl_callback), |
files->data); |
return g_list_append(NULL, item); |
} |
void fsl_callback (NautilusMenuItem * item, NautilusFileInfo * file_info) |
{ |
TRACE(); |
gchar ** argv; |
const gchar * link_name = nautilus_file_info_get_uri(file_info) + URI_OFFSET; |
gchar * target = g_malloc(PATH_LENGTH_BYTES); |
/* unlike readlink(man 2), realpath(man 3) resolves the symlink, while |
* 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, target)) { |
g_printf("ERROR in realpath(): %s\n", strerror(errno)); |
g_assert( FALSE ); |
} |
const gchar const * BASE_CMD = "nautilus --no-desktop --no-default-window \""; |
gchar * command_line = g_malloc( sizeof(gchar) * ( strlen(BASE_CMD) + strlen(target) + 2 ) ); |
gchar * offset = g_stpcpy(command_line, BASE_CMD); |
//offset = g_stpcpy(offset, "file://"); // unneeded; also makes nautilus think it may be incorrect |
// 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)) { |
g_assert( FALSE ); |
} |
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, |
argv, |
NULL, |
G_SPAWN_SEARCH_PATH, |
NULL, NULL, NULL, NULL); |
g_free(command_line); |
g_strfreev(argv); |
} |
/* Create the new menu item */ |
NautilusMenuItem * |
fsl_menu_item_new(GdkScreen *screen, gboolean is_file_item) |
{ |
TRACE(); |
NautilusMenuItem *ret; |
const char *name; |
const char *tooltip; |
name = _("Follow symbolic _link"); |
tooltip = _("Open the directory pointed by the currently selected symbolic link"); |
// (name, label, tip, icon) |
ret = nautilus_menu_item_new("FsymlinkExtension::follow_symlink", |
name, tooltip, NULL); |
//g_object_set_data(G_OBJECT(ret), "FsymlinkExtension::screen", screen); |
return ret; |
} |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/branches/0.6.0/src/nautilus-ext-follow-symlink.c |
---|
0,0 → 1,93 |
#include "nautilus-ext-follow-symlink.h" |
#include <locale.h> |
#include <libintl.h> |
#include <glib/gprintf.h> |
/* Public interface */ |
static GType fsl_type; |
static GType provider_types[1]; |
void nautilus_module_initialize (GTypeModule *module) |
{ |
TRACE(); |
FSL_DEBUG_INIT(); |
setlocale(LC_ALL, ""); |
bindtextdomain(GETTEXT_PACKAGE, GNOMELOCALEDIR); |
textdomain(GETTEXT_PACKAGE); |
g_printf("Initializing nautilus-follow-symlink extension (v.%s)\n", VERSION); |
fsl_register_type(module); |
provider_types[0] = fsl_get_type(); |
} |
void nautilus_module_shutdown (void) |
{ |
TRACE(); |
/* Module-specific shutdown */ |
g_print ("Shutting down nautilus-follow-symlink extension\n"); |
} |
void nautilus_module_list_types (const GType **types, int *num_types) |
{ |
TRACE(); |
*types = provider_types; |
*num_types = G_N_ELEMENTS(provider_types); |
} |
void fsl_register_type (GTypeModule *module) |
{ |
TRACE(); |
static const GTypeInfo info = { |
sizeof(FsymlinkExtensionClass), |
(GBaseInitFunc) NULL, |
(GBaseFinalizeFunc) NULL, |
(GClassInitFunc) fsl_class_init, |
NULL, |
NULL, |
sizeof (FsymlinkExtension), |
0, |
(GInstanceInitFunc) fsl_instance_init, |
}; |
fsl_type = g_type_module_register_type (module, |
G_TYPE_OBJECT, |
"FsymlinkExtension", |
&info, 0); |
/* Menu provider interface */ |
static const GInterfaceInfo menu_provider_iface_info = { |
(GInterfaceInitFunc)fsl_extension_menu_provider_iface_init, |
NULL, |
NULL, |
}; |
g_type_module_add_interface(module, fsl_type, |
NAUTILUS_TYPE_MENU_PROVIDER, &menu_provider_iface_info); |
/* Other Interfaces */ |
} |
GType fsl_get_type(void) |
{ |
TRACE(); |
return fsl_type; |
} |
void fsl_instance_init(FsymlinkExtension *cvs) |
{ |
TRACE(); |
} |
void fsl_class_init(FsymlinkExtensionClass *class) |
{ |
TRACE(); |
} |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/branches/0.6.0/src/follow-symlink.h |
---|
0,0 → 1,27 |
#ifndef FOLLOW_SYMLINK_H |
#define FOLLOW_SYMLINK_H |
/* |
* This file contains nautilus-follow-symlink's private interface, |
* its core functionality |
*/ |
#include <libnautilus-extension/nautilus-menu-provider.h> |
#include "common.h" |
/* Static Prototypes */ |
static void fsl_callback(NautilusMenuItem *, NautilusFileInfo *); |
static GList *fsl_get_file_items(NautilusMenuProvider *, GtkWidget *, GList *); |
static NautilusMenuItem* fsl_menu_item_new(GdkScreen *, gboolean); |
/* Exported Prototypes |
* Here the namespace is a bit more explicit just in case |
*/ |
void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *); |
#endif /* FOLLOW_SYMLINK_H */ |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/branches/0.6.0/src/nautilus-ext-follow-symlink.h |
---|
0,0 → 1,49 |
#ifndef NAUTILUS_EXT_FOLLOW_SYMLINK_H |
#define NAUTILUS_EXT_FOLLOW_SYMLINK_H |
#include <glib-object.h> |
#include <libnautilus-extension/nautilus-menu-provider.h> |
#include "common.h" |
/* |
* This file contains nautilus-follow-symlink's "public" interface, |
* the functions required to bind the extension to nautilus |
*/ |
void nautilus_module_initialize(GTypeModule *); |
void nautilus_module_shutdown(void); |
void nautilus_module_list_types(const GType **, int *); |
/* These ones don't need public visibility */ |
static void fsl_register_type(GTypeModule *); |
static GType fsl_get_type(void); |
/* Data Types */ |
struct _FsymlinkExtensionClass { |
GObjectClass parent_slot; |
}; |
struct _FsymlinkExtension { |
GObject parent_slot; |
}; |
typedef struct _FsymlinkExtensionClass FsymlinkExtensionClass; |
typedef struct _FsymlinkExtension FsymlinkExtension; |
/* Data initializers */ |
static void fsl_class_init (FsymlinkExtensionClass *class); |
static void fsl_instance_init (FsymlinkExtension *cvs); |
/* Defined in the private interface */ |
extern void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *iface); |
#endif /* NAUTILUS_MODULE_FOLLOW_SYMLINK_H */ |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/branches/0.6.0/Makefile.am |
---|
0,0 → 1,26 |
SUBDIRS = po src |
# This doesn't work as expected |
libdir = @libdir@/nautilus/extensions-1.0 |
EXTRA_DIST = dist |
# Extra files to get rid of when distcleaning |
DISTCLEANFILES = \ |
intltool-extract \ |
intltool-merge \ |
intltool-update \ |
\ |
intltool-extract.in \ |
intltool-merge.in \ |
intltool-update.in \ |
\ |
libtool \ |
libtool.m4 \ |
ltmain.sh \ |
ltoptions.m4 \ |
ltsugar.m4 \ |
ltversion.m4 \ |
\ |
po/Makefile.in.in |
/nautilus-follow-symlink/branches/0.6.0/po/es.po |
---|
0,0 → 1,26 |
# Spanish translations for libnautilus-follow-symlink package |
# Traducciones al español para el paquete libnautilus-follow-symlink. |
# Copyright (C) 2006 THE libnautilus-follow-symlink'S COPYRIGHT HOLDER |
# This file is distributed under the same license as the libnautilus-follow-symlink package. |
# Toni Corvera <outlyer@outlyer.net>, 2006. |
# |
msgid "" |
msgstr "" |
"Project-Id-Version: libnautilus-follow-symlink\n" |
"Report-Msgid-Bugs-To: \n" |
"POT-Creation-Date: 2006-10-24 19:07+0200\n" |
"PO-Revision-Date: 2006-10-24 19:09+0200\n" |
"Last-Translator: Toni Corvera <outlyer@outlyer.net>\n" |
"Language-Team: Spanish <outlyer@outlyer.net>\n" |
"MIME-Version: 1.0\n" |
"Content-Type: text/plain; charset=UTF-8\n" |
"Content-Transfer-Encoding: 8bit\n" |
"Plural-Forms: nplurals=2; plural=(n != 1);\n" |
#: ../src/follow-symlink.c:135 |
msgid "Follow symbolic _link" |
msgstr "Seguir en_lace simbólico" |
#: ../src/follow-symlink.c:136 |
msgid "Open the directory pointed by the currently selected symbolic link" |
msgstr "Abrir el directoro apuntado por el enlace simbólico seleccionado actualmente" |
/nautilus-follow-symlink/branches/0.6.0/po/POTFILES.in |
---|
0,0 → 1,0 |
src/follow-symlink.c |
/nautilus-follow-symlink/branches/0.6.0/po/ca.po |
---|
0,0 → 1,24 |
# Catalan translations for libnautilus-follow-symlink package. |
# Copyright (C) 2006 THE libnautilus-follow-symlink'S COPYRIGHT HOLDER |
# This file is distributed under the same license as the libnautilus-follow-symlink package. |
# Toni Corvera <outlyer@outlyer.net>, 2006. |
# |
msgid "" |
msgstr "" |
"Project-Id-Version: libnautilus-follow-symlink\n" |
"Report-Msgid-Bugs-To: \n" |
"POT-Creation-Date: 2006-10-24 19:07+0200\n" |
"PO-Revision-Date: 2006-10-24 19:37+0200\n" |
"Last-Translator: Toni Corvera <outlyer@outlyer.net>\n" |
"Language-Team: Catalan <outlyer@outlyer.net>\n" |
"MIME-Version: 1.0\n" |
"Content-Type: text/plain; charset=UTF-8\n" |
"Content-Transfer-Encoding: 8bit\n" |
#: ../src/follow-symlink.c:135 |
msgid "Follow symbolic _link" |
msgstr "Segueix l'en_llaç simbòlic" |
#: ../src/follow-symlink.c:136 |
msgid "Open the directory pointed by the currently selected symbolic link" |
msgstr "Obre el directori apuntat per l'enllça simbòlic seleccionat" |
/nautilus-follow-symlink/branches/0.6.0/po/libnautilus-follow-symlink.pot |
---|
0,0 → 1,25 |
# SOME DESCRIPTIVE TITLE. |
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
# This file is distributed under the same license as the PACKAGE package. |
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
# |
#, fuzzy |
msgid "" |
msgstr "" |
"Project-Id-Version: PACKAGE VERSION\n" |
"Report-Msgid-Bugs-To: \n" |
"POT-Creation-Date: 2006-10-24 19:07+0200\n" |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
"Language-Team: LANGUAGE <LL@li.org>\n" |
"MIME-Version: 1.0\n" |
"Content-Type: text/plain; charset=CHARSET\n" |
"Content-Transfer-Encoding: 8bit\n" |
#: ../src/follow-symlink.c:135 |
msgid "Follow symbolic _link" |
msgstr "" |
#: ../src/follow-symlink.c:136 |
msgid "Open the directory pointed by the currently selected symbolic link" |
msgstr "" |
/nautilus-follow-symlink/branches/0.6.0/BUILD |
---|
0,0 → 1,26 |
COMPILATION |
=========== |
* If no ./configure exists (i.e. raw svn export), use the dist command: |
$ ./dist |
* Configure |
$ ./configure --prefix=/usr |
Note that this being a nautilus extension, the --prefix is not really used |
at installation time as there's no real flexibility on where to install them |
(the appropiate place will be checked on install time). BUT it should match |
gnome's locale dir. |
* Compile |
$ make |
* Install |
$ make install |
Of special interest: |
Pass -D_DEBUG to the precompiler to enable the debugging/verbose |
mode. |
CPPFLAGS="-D_DEBUG" ./configure |
/nautilus-follow-symlink/branches/0.6.0/debian/control |
---|
0,0 → 1,13 |
Source: nautilus-follow-symlink |
Section: contrib/gnome |
Priority: extra |
Maintainer: Toni Corvera <outlyer@outlyer.net> |
Build-Depends: debhelper (>= 4.0.0), gcc, libtool, pkg-config, libc6-dev, libglib2.0-dev, libnautilus-extension-dev, intltool (>= 0.18), gettext, automaken, autoconf |
Standards-Version: 3.6.2 |
Package: nautilus-follow-symlink |
Architecture: any |
Depends: ${shlibs:Depends}, ${misc:Depends}, nautilus |
Description: nautilus plugin to open the location pointed by a symlink |
This extension adds a context menu option to symbolic links to |
folders which opens the pointed folder instead of the symbolic link. |
/nautilus-follow-symlink/branches/0.6.0/debian/changelog |
---|
0,0 → 1,34 |
nautilus-follow-symlink (0.6.0-out.1) experimental; urgency=low |
* New upstream release |
* debian/control: |
- Added intltool and gettext (new requirements of 0.6) |
- Corrected Build-Depends |
-- Toni Corvera <outlyer@outlyer.net> Tue, 24 Oct 2006 20:25:12 +0200 |
nautilus-follow-symlink (0.5.2-out.2) unstable; urgency=low |
* debian/rules: Install upstream ChangeLog |
* debian/docs: Install upstream BUILD instructions |
-- Toni Corvera <outlyer@outlyer.net> Tue, 24 Oct 2006 18:32:54 +0200 |
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 |
* Initial release |
-- Toni Corvera <outlyer@outlyer.net> Sun, 22 Oct 2006 04:11:50 +0200 |
/nautilus-follow-symlink/branches/0.6.0/debian/docs |
---|
0,0 → 1,2 |
ROADMAP |
BUILD |
/nautilus-follow-symlink/branches/0.6.0/debian/rules |
---|
0,0 → 1,102 |
#!/usr/bin/make -f |
# -*- makefile -*- |
# Sample debian/rules that uses debhelper. |
# This file was originally written by Joey Hess and Craig Small. |
# As a special exception, when this file is copied by dh-make into a |
# dh-make output file, you may use that output file without restriction. |
# This special exception was added by Craig Small in version 0.37 of dh-make. |
# Uncomment this to turn on verbose mode. |
#export DH_VERBOSE=1 |
CFLAGS = -Wall -g |
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
CFLAGS += -O0 |
else |
CFLAGS += -O2 |
endif |
configure: configure-stamp |
configure-stamp: |
dh_testdir |
# Add here commands to configure the package. |
test -f configure || ./dist clean gen |
./configure --prefix=/usr --disable-static |
touch configure-stamp |
build: build-stamp |
build-stamp: configure-stamp |
dh_testdir |
# Add here commands to compile the package. |
$(MAKE) FINAL=1 |
#docbook-to-man debian/nautilus-follow-symlink.sgml > nautilus-follow-symlink.1 |
touch build-stamp |
clean: |
dh_testdir |
dh_testroot |
rm -f build-stamp configure-stamp |
# Add here commands to clean up after the build process. |
-$(MAKE) clean |
dh_clean |
install: build |
dh_testdir |
dh_testroot |
dh_clean -k |
dh_installdirs |
# Add here commands to install the package into 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. |
binary-indep: build install |
# We have nothing to do by default. |
# Build architecture-dependent files here. |
binary-arch: build install |
dh_testdir |
dh_testroot |
dh_installchangelogs ChangeLog |
dh_installdocs |
dh_installexamples |
# dh_install |
# dh_installmenu |
# dh_installdebconf |
# dh_installlogrotate |
# dh_installemacsen |
# dh_installpam |
# dh_installmime |
# dh_installinit |
# dh_installcron |
# dh_installinfo |
dh_installman |
dh_link |
dh_strip |
dh_compress |
dh_fixperms |
# dh_perl |
# dh_python |
# dh_makeshlibs |
dh_installdeb |
dh_shlibdeps |
dh_gencontrol |
dh_md5sums |
dh_builddeb |
binary: binary-indep binary-arch |
.PHONY: build clean binary-indep binary-arch binary install configure |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/nautilus-follow-symlink/branches/0.6.0/debian/copyright |
---|
0,0 → 1,27 |
This package was debianized by Toni Corvera <outlyer@outlyer.net> on |
Sat, 21 Oct 2006 23:46:12 +0200. |
It can be officially downloaded right now, contact the autor to |
get a copy or more information. |
Copyright Holder: Toni Corvera <outlyer@outlyer.net> |
License: |
This package is free software; you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
the Free Software Foundation; either version 2 of the License, or |
(at your option) any later version. |
This package is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this package; if not, write to the Free Software |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
On Debian systems, the complete text of the GNU General |
Public License can be found in `/usr/share/common-licenses/GPL'. |
/nautilus-follow-symlink/branches/0.6.0/debian/README.Debian |
---|
0,0 → 1,6 |
nautilus-follow-symlink for Debian |
---------------------------------- |
<possible notes regarding this package - if none, delete this file> |
-- Toni Corvera <outlyer@outlyer.net>, Sat, 21 Oct 2006 23:46:12 +0200 |
/nautilus-follow-symlink/branches/0.6.0/debian/dirs |
---|
0,0 → 1,0 |
usr/lib |
/nautilus-follow-symlink/branches/0.6.0/debian/compat |
---|
0,0 → 1,0 |
4 |
/nautilus-follow-symlink/branches/0.6.0/dist |
---|
0,0 → 1,36 |
#!/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 |
intltoolize |
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 |
# The following are moved thanks to Makefile.am (var DISTCLEANFILES) |
# (kept for situations in which make distclean fails) |
# Undo libtoolize |
rm -f libtool.m4 lt*.m4 ltmain.sh libtool |
# Undo intltoolize |
rm -f intltool* |
rm -f po/Makefile.in.in |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/nautilus-follow-symlink/branches/0.6.0 |
---|
Property changes: |
Added: svn:mergeinfo |
Merged /nautilus-follow-symlink/branches/0.5.2:r4 |
Merged /nautilus-follow-symlink/branches/0.5.2+debian.2:r7 |
/nautilus-follow-symlink/tags/0.5.2+debian.2/debian/changelog |
---|
0,0 → 1,25 |
nautilus-follow-symlink (0.5.2-out.2) unstable; urgency=low |
* debian/rules: Install upstream ChangeLog |
* debian/docs: Install upstream BUILD instructions |
-- Toni Corvera <outlyer@outlyer.net> Tue, 24 Oct 2006 18:32:54 +0200 |
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 |
* Initial release |
-- Toni Corvera <outlyer@outlyer.net> Sun, 22 Oct 2006 04:11:50 +0200 |
/nautilus-follow-symlink/tags/0.5.2+debian.2/debian/docs |
---|
0,0 → 1,2 |
ROADMAP |
BUILD |
/nautilus-follow-symlink/tags/0.5.2+debian.2/debian/rules |
---|
0,0 → 1,102 |
#!/usr/bin/make -f |
# -*- makefile -*- |
# Sample debian/rules that uses debhelper. |
# This file was originally written by Joey Hess and Craig Small. |
# As a special exception, when this file is copied by dh-make into a |
# dh-make output file, you may use that output file without restriction. |
# This special exception was added by Craig Small in version 0.37 of dh-make. |
# Uncomment this to turn on verbose mode. |
#export DH_VERBOSE=1 |
CFLAGS = -Wall -g |
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
CFLAGS += -O0 |
else |
CFLAGS += -O2 |
endif |
configure: configure-stamp |
configure-stamp: |
dh_testdir |
# Add here commands to configure the package. |
test -f configure || ./dist clean gen |
./configure --prefix=/usr --disable-static |
touch configure-stamp |
build: build-stamp |
build-stamp: configure-stamp |
dh_testdir |
# Add here commands to compile the package. |
$(MAKE) FINAL=1 |
#docbook-to-man debian/nautilus-follow-symlink.sgml > nautilus-follow-symlink.1 |
touch build-stamp |
clean: |
dh_testdir |
dh_testroot |
rm -f build-stamp configure-stamp |
# Add here commands to clean up after the build process. |
-$(MAKE) clean |
dh_clean |
install: build |
dh_testdir |
dh_testroot |
dh_clean -k |
dh_installdirs |
# Add here commands to install the package into 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. |
binary-indep: build install |
# We have nothing to do by default. |
# Build architecture-dependent files here. |
binary-arch: build install |
dh_testdir |
dh_testroot |
dh_installchangelogs ChangeLog |
dh_installdocs |
dh_installexamples |
# dh_install |
# dh_installmenu |
# dh_installdebconf |
# dh_installlogrotate |
# dh_installemacsen |
# dh_installpam |
# dh_installmime |
# dh_installinit |
# dh_installcron |
# dh_installinfo |
dh_installman |
dh_link |
dh_strip |
dh_compress |
dh_fixperms |
# dh_perl |
# dh_python |
# dh_makeshlibs |
dh_installdeb |
dh_shlibdeps |
dh_gencontrol |
dh_md5sums |
dh_builddeb |
binary: binary-indep binary-arch |
.PHONY: build clean binary-indep binary-arch binary install configure |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/nautilus-follow-symlink/tags/0.5.2+debian.2/debian/copyright |
---|
0,0 → 1,27 |
This package was debianized by Toni Corvera <outlyer@outlyer.net> on |
Sat, 21 Oct 2006 23:46:12 +0200. |
It can be officially downloaded right now, contact the autor to |
get a copy or more information. |
Copyright Holder: Toni Corvera <outlyer@outlyer.net> |
License: |
This package is free software; you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
the Free Software Foundation; either version 2 of the License, or |
(at your option) any later version. |
This package is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this package; if not, write to the Free Software |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
On Debian systems, the complete text of the GNU General |
Public License can be found in `/usr/share/common-licenses/GPL'. |
/nautilus-follow-symlink/tags/0.5.2+debian.2/debian/README.Debian |
---|
0,0 → 1,6 |
nautilus-follow-symlink for Debian |
---------------------------------- |
<possible notes regarding this package - if none, delete this file> |
-- Toni Corvera <outlyer@outlyer.net>, Sat, 21 Oct 2006 23:46:12 +0200 |
/nautilus-follow-symlink/tags/0.5.2+debian.2/debian/control |
---|
0,0 → 1,14 |
Source: nautilus-follow-symlink |
Section: contrib/gnome |
Priority: extra |
Maintainer: Toni Corvera <outlyer@outlyer.net> |
Build-Depends: debhelper (>= 4.0.0) |
Standards-Version: 3.6.2 |
Package: nautilus-follow-symlink |
Architecture: any |
Build-Depends: gcc, libtool, pkg-config, libc6-dev, libglib2.0-dev, libnautilus-extension-dev |
Depends: ${shlibs:Depends}, ${misc:Depends}, nautilus |
Description: nautilus plugin to open the location pointed by a symlink |
This extension adds a context menu option to symbolic links to |
folders which opens the pointed folder instead of the symbolic link. |
/nautilus-follow-symlink/tags/0.5.2+debian.2/debian/dirs |
---|
0,0 → 1,0 |
usr/lib |
/nautilus-follow-symlink/tags/0.5.2+debian.2/debian/compat |
---|
0,0 → 1,0 |
4 |
/nautilus-follow-symlink/tags/0.5.2+debian.2/ChangeLog |
---|
0,0 → 1,17 |
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 |
* INTERNAL: Rearrangement in multiple files, applied static where |
appropiate |
* INTERNAL: Added extra-verbosity, switchable on compile time |
0.5 (22 oct 2006): |
* Initial release |
/nautilus-follow-symlink/tags/0.5.2+debian.2/src/Makefile.am |
---|
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 |
/nautilus-follow-symlink/tags/0.5.2+debian.2/src/follow-symlink.h |
---|
0,0 → 1,27 |
#ifndef FOLLOW_SYMLINK_H |
#define FOLLOW_SYMLINK_H |
/* |
* This file contains nautilus-follow-symlink's private interface, |
* its core functionality |
*/ |
#include <libnautilus-extension/nautilus-menu-provider.h> |
#include "common.h" |
/* Static Prototypes */ |
static void fsl_callback(NautilusMenuItem *, NautilusFileInfo *); |
static GList *fsl_get_file_items(NautilusMenuProvider *, GtkWidget *, GList *); |
static NautilusMenuItem* fsl_menu_item_new(GdkScreen *, gboolean); |
/* Exported Prototypes |
* Here the namespace is a bit more explicit just in case |
*/ |
void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *); |
#endif /* FOLLOW_SYMLINK_H */ |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/tags/0.5.2+debian.2/src/common.h |
---|
0,0 → 1,53 |
#ifndef FOLLOW_SYMLINK_COMMON_H |
#define FOLLOW_SYMLINK_COMMON_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 |
/* Debugging facilities */ |
#include <stdlib.h> /* getenv() (3) */ |
#include <string.h> /* strcmp() (3) */ |
/* Prefix for messages */ |
#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 /* FOLLOW_SYMLINK_COMMON_H */ |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/tags/0.5.2+debian.2/src/follow-symlink.c |
---|
0,0 → 1,145 |
#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 */ |
void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *iface) |
{ |
TRACE(); |
//TODO: iface->get_background_items = fsl_get_background_items; |
iface->get_file_items = fsl_get_file_items; |
} |
/* Bind to menu if needed */ |
GList * |
fsl_get_file_items (NautilusMenuProvider * provider, |
GtkWidget * window, |
GList * files) |
{ |
TRACE(); |
NautilusMenuItem *item; |
// Number of files = g_list_length(files) |
// Directory = nautilus_file_info_is_directory(files->data) |
if (NULL==files || g_list_length(files) != 1) { |
FSL_LOG( (NULL==files) ? "No file" : "More than one file" ); |
return NULL; |
} |
// Only file uris |
{ |
gchar * uri_scheme = nautilus_file_info_get_uri_scheme(files->data); |
if (strcmp(uri_scheme, "file") != 0) { |
FSL_LOG( "Not file scheme" ); |
return NULL; |
} |
g_free(uri_scheme); |
} |
// Xref: http://www.koders.com/c/fidA0AA0A78334E1FA3D668FD10B437638F6D031D77.aspx?s=NautilusFile |
GnomeVFSFileInfo * gfi = nautilus_file_info_get_vfs_file_info(files->data); |
/* |
* Xref: /usr/include/gnome-vfs-2.0/libgnomevfs/gnome-vfs-file-info.h |
* |
* Aparently type is never GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK and symlinks |
* are resolved to the target type |
*/ |
/*if (gfi->type != GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK) {*/ |
if (gfi->type != GNOME_VFS_FILE_TYPE_DIRECTORY) { |
FSL_LOG( "Not directory" ); |
return NULL; |
} |
// We know the file is either a directory or a symlink to a directory |
// TODO: Has glib/gnome any better/faster alternatives? |
{ |
struct stat file_info; |
// 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); |
if (! S_ISLNK(file_info.st_mode)) { |
FSL_LOG1( "Not S_ISLNK:", file_name ); |
return NULL; |
} |
} |
item = fsl_menu_item_new(gtk_widget_get_screen(window), TRUE); |
g_signal_connect(item, "activate", G_CALLBACK(fsl_callback), |
files->data); |
return g_list_append(NULL, item); |
} |
void fsl_callback (NautilusMenuItem * item, NautilusFileInfo * file_info) |
{ |
TRACE(); |
gchar ** argv; |
const gchar * link_name = nautilus_file_info_get_uri(file_info) + URI_OFFSET; |
gchar * target = g_malloc(PATH_LENGTH_BYTES); |
/* unlike readlink(man 2), realpath(man 3) resolves the symlink, while |
* 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, target)) { |
g_printf("ERROR in realpath(): %s\n", strerror(errno)); |
g_assert( FALSE ); |
} |
const gchar const * BASE_CMD = "nautilus --no-desktop --no-default-window \""; |
gchar * command_line = g_malloc( sizeof(gchar) * ( strlen(BASE_CMD) + strlen(target) + 2 ) ); |
gchar * offset = g_stpcpy(command_line, BASE_CMD); |
//offset = g_stpcpy(offset, "file://"); // unneeded; also makes nautilus think it may be incorrect |
// 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)) { |
g_assert( FALSE ); |
} |
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, |
argv, |
NULL, |
G_SPAWN_SEARCH_PATH, |
NULL, NULL, NULL, NULL); |
g_free(command_line); |
g_strfreev(argv); |
} |
/* Create the new menu item */ |
NautilusMenuItem * |
fsl_menu_item_new(GdkScreen *screen, gboolean is_file_item) |
{ |
TRACE(); |
NautilusMenuItem *ret; |
const char *name; |
const char *tooltip; |
name = "-> Follow symbolic _link"; |
tooltip = "Open the directory pointed by the currently selected symbolic link"; |
// (name, label, tip, icon) |
ret = nautilus_menu_item_new("FsymlinkExtension::follow_symlink", |
name, tooltip, NULL); |
//g_object_set_data(G_OBJECT(ret), "FsymlinkExtension::screen", screen); |
return ret; |
} |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/tags/0.5.2+debian.2/src/nautilus-ext-follow-symlink.c |
---|
0,0 → 1,86 |
#include "nautilus-ext-follow-symlink.h" |
#include <glib/gprintf.h> |
/* Public interface */ |
static GType fsl_type; |
static GType provider_types[1]; |
void nautilus_module_initialize (GTypeModule *module) |
{ |
TRACE(); |
FSL_DEBUG_INIT(); |
g_printf("Initializing nautilus-follow-symlink extension (v.%s)\n", VERSION); |
fsl_register_type(module); |
provider_types[0] = fsl_get_type(); |
} |
void nautilus_module_shutdown (void) |
{ |
TRACE(); |
/* Module-specific shutdown */ |
g_print ("Shutting down nautilus-follow-symlink extension\n"); |
} |
void nautilus_module_list_types (const GType **types, int *num_types) |
{ |
TRACE(); |
*types = provider_types; |
*num_types = G_N_ELEMENTS(provider_types); |
} |
void fsl_register_type (GTypeModule *module) |
{ |
TRACE(); |
static const GTypeInfo info = { |
sizeof(FsymlinkExtensionClass), |
(GBaseInitFunc) NULL, |
(GBaseFinalizeFunc) NULL, |
(GClassInitFunc) fsl_class_init, |
NULL, |
NULL, |
sizeof (FsymlinkExtension), |
0, |
(GInstanceInitFunc) fsl_instance_init, |
}; |
fsl_type = g_type_module_register_type (module, |
G_TYPE_OBJECT, |
"FsymlinkExtension", |
&info, 0); |
/* Menu provider interface */ |
static const GInterfaceInfo menu_provider_iface_info = { |
(GInterfaceInitFunc)fsl_extension_menu_provider_iface_init, |
NULL, |
NULL, |
}; |
g_type_module_add_interface(module, fsl_type, |
NAUTILUS_TYPE_MENU_PROVIDER, &menu_provider_iface_info); |
/* Other Interfaces */ |
} |
GType fsl_get_type(void) |
{ |
TRACE(); |
return fsl_type; |
} |
void fsl_instance_init(FsymlinkExtension *cvs) |
{ |
TRACE(); |
} |
void fsl_class_init(FsymlinkExtensionClass *class) |
{ |
TRACE(); |
} |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/tags/0.5.2+debian.2/src/nautilus-ext-follow-symlink.h |
---|
0,0 → 1,49 |
#ifndef NAUTILUS_EXT_FOLLOW_SYMLINK_H |
#define NAUTILUS_EXT_FOLLOW_SYMLINK_H |
#include <glib-object.h> |
#include <libnautilus-extension/nautilus-menu-provider.h> |
#include "common.h" |
/* |
* This file contains nautilus-follow-symlink's "public" interface, |
* the functions required to bind the extension to nautilus |
*/ |
void nautilus_module_initialize(GTypeModule *); |
void nautilus_module_shutdown(void); |
void nautilus_module_list_types(const GType **, int *); |
/* These ones don't need public visibility */ |
static void fsl_register_type(GTypeModule *); |
static GType fsl_get_type(void); |
/* Data Types */ |
struct _FsymlinkExtensionClass { |
GObjectClass parent_slot; |
}; |
struct _FsymlinkExtension { |
GObject parent_slot; |
}; |
typedef struct _FsymlinkExtensionClass FsymlinkExtensionClass; |
typedef struct _FsymlinkExtension FsymlinkExtension; |
/* Data initializers */ |
static void fsl_class_init (FsymlinkExtensionClass *class); |
static void fsl_instance_init (FsymlinkExtension *cvs); |
/* Defined in the private interface */ |
extern void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *iface); |
#endif /* NAUTILUS_MODULE_FOLLOW_SYMLINK_H */ |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/tags/0.5.2+debian.2/Makefile.am |
---|
0,0 → 1,5 |
SUBDIRS = src |
# This doesn't work as expected |
libdir = @libdir@/nautilus/extensions-1.0 |
/nautilus-follow-symlink/tags/0.5.2+debian.2/BUILD |
---|
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 |
/nautilus-follow-symlink/tags/0.5.2+debian.2/dist |
---|
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 |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/nautilus-follow-symlink/tags/0.5.2+debian.2/configure.in |
---|
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) |
/nautilus-follow-symlink/tags/0.5.2+debian.2 |
---|
Property changes: |
Added: svn:mergeinfo |
Merged /nautilus-follow-symlink/branches/0.5.2:r4 |
Merged /nautilus-follow-symlink/branches/0.5.2+debian.2:r7 |
/nautilus-follow-symlink/tags/0.5.2/src/follow-symlink.c |
---|
0,0 → 1,145 |
#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 */ |
void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *iface) |
{ |
TRACE(); |
//TODO: iface->get_background_items = fsl_get_background_items; |
iface->get_file_items = fsl_get_file_items; |
} |
/* Bind to menu if needed */ |
GList * |
fsl_get_file_items (NautilusMenuProvider * provider, |
GtkWidget * window, |
GList * files) |
{ |
TRACE(); |
NautilusMenuItem *item; |
// Number of files = g_list_length(files) |
// Directory = nautilus_file_info_is_directory(files->data) |
if (NULL==files || g_list_length(files) != 1) { |
FSL_LOG( (NULL==files) ? "No file" : "More than one file" ); |
return NULL; |
} |
// Only file uris |
{ |
gchar * uri_scheme = nautilus_file_info_get_uri_scheme(files->data); |
if (strcmp(uri_scheme, "file") != 0) { |
FSL_LOG( "Not file scheme" ); |
return NULL; |
} |
g_free(uri_scheme); |
} |
// Xref: http://www.koders.com/c/fidA0AA0A78334E1FA3D668FD10B437638F6D031D77.aspx?s=NautilusFile |
GnomeVFSFileInfo * gfi = nautilus_file_info_get_vfs_file_info(files->data); |
/* |
* Xref: /usr/include/gnome-vfs-2.0/libgnomevfs/gnome-vfs-file-info.h |
* |
* Aparently type is never GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK and symlinks |
* are resolved to the target type |
*/ |
/*if (gfi->type != GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK) {*/ |
if (gfi->type != GNOME_VFS_FILE_TYPE_DIRECTORY) { |
FSL_LOG( "Not directory" ); |
return NULL; |
} |
// We know the file is either a directory or a symlink to a directory |
// TODO: Has glib/gnome any better/faster alternatives? |
{ |
struct stat file_info; |
// 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); |
if (! S_ISLNK(file_info.st_mode)) { |
FSL_LOG1( "Not S_ISLNK:", file_name ); |
return NULL; |
} |
} |
item = fsl_menu_item_new(gtk_widget_get_screen(window), TRUE); |
g_signal_connect(item, "activate", G_CALLBACK(fsl_callback), |
files->data); |
return g_list_append(NULL, item); |
} |
void fsl_callback (NautilusMenuItem * item, NautilusFileInfo * file_info) |
{ |
TRACE(); |
gchar ** argv; |
const gchar * link_name = nautilus_file_info_get_uri(file_info) + URI_OFFSET; |
gchar * target = g_malloc(PATH_LENGTH_BYTES); |
/* unlike readlink(man 2), realpath(man 3) resolves the symlink, while |
* 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, target)) { |
g_printf("ERROR in realpath(): %s\n", strerror(errno)); |
g_assert( FALSE ); |
} |
const gchar const * BASE_CMD = "nautilus --no-desktop --no-default-window \""; |
gchar * command_line = g_malloc( sizeof(gchar) * ( strlen(BASE_CMD) + strlen(target) + 2 ) ); |
gchar * offset = g_stpcpy(command_line, BASE_CMD); |
//offset = g_stpcpy(offset, "file://"); // unneeded; also makes nautilus think it may be incorrect |
// 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)) { |
g_assert( FALSE ); |
} |
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, |
argv, |
NULL, |
G_SPAWN_SEARCH_PATH, |
NULL, NULL, NULL, NULL); |
g_free(command_line); |
g_strfreev(argv); |
} |
/* Create the new menu item */ |
NautilusMenuItem * |
fsl_menu_item_new(GdkScreen *screen, gboolean is_file_item) |
{ |
TRACE(); |
NautilusMenuItem *ret; |
const char *name; |
const char *tooltip; |
name = "-> Follow symbolic _link"; |
tooltip = "Open the directory pointed by the currently selected symbolic link"; |
// (name, label, tip, icon) |
ret = nautilus_menu_item_new("FsymlinkExtension::follow_symlink", |
name, tooltip, NULL); |
//g_object_set_data(G_OBJECT(ret), "FsymlinkExtension::screen", screen); |
return ret; |
} |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/tags/0.5.2/src/nautilus-ext-follow-symlink.c |
---|
0,0 → 1,86 |
#include "nautilus-ext-follow-symlink.h" |
#include <glib/gprintf.h> |
/* Public interface */ |
static GType fsl_type; |
static GType provider_types[1]; |
void nautilus_module_initialize (GTypeModule *module) |
{ |
TRACE(); |
FSL_DEBUG_INIT(); |
g_printf("Initializing nautilus-follow-symlink extension (v.%s)\n", VERSION); |
fsl_register_type(module); |
provider_types[0] = fsl_get_type(); |
} |
void nautilus_module_shutdown (void) |
{ |
TRACE(); |
/* Module-specific shutdown */ |
g_print ("Shutting down nautilus-follow-symlink extension\n"); |
} |
void nautilus_module_list_types (const GType **types, int *num_types) |
{ |
TRACE(); |
*types = provider_types; |
*num_types = G_N_ELEMENTS(provider_types); |
} |
void fsl_register_type (GTypeModule *module) |
{ |
TRACE(); |
static const GTypeInfo info = { |
sizeof(FsymlinkExtensionClass), |
(GBaseInitFunc) NULL, |
(GBaseFinalizeFunc) NULL, |
(GClassInitFunc) fsl_class_init, |
NULL, |
NULL, |
sizeof (FsymlinkExtension), |
0, |
(GInstanceInitFunc) fsl_instance_init, |
}; |
fsl_type = g_type_module_register_type (module, |
G_TYPE_OBJECT, |
"FsymlinkExtension", |
&info, 0); |
/* Menu provider interface */ |
static const GInterfaceInfo menu_provider_iface_info = { |
(GInterfaceInitFunc)fsl_extension_menu_provider_iface_init, |
NULL, |
NULL, |
}; |
g_type_module_add_interface(module, fsl_type, |
NAUTILUS_TYPE_MENU_PROVIDER, &menu_provider_iface_info); |
/* Other Interfaces */ |
} |
GType fsl_get_type(void) |
{ |
TRACE(); |
return fsl_type; |
} |
void fsl_instance_init(FsymlinkExtension *cvs) |
{ |
TRACE(); |
} |
void fsl_class_init(FsymlinkExtensionClass *class) |
{ |
TRACE(); |
} |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/tags/0.5.2/src/Makefile.am |
---|
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 |
/nautilus-follow-symlink/tags/0.5.2/src/follow-symlink.h |
---|
0,0 → 1,27 |
#ifndef FOLLOW_SYMLINK_H |
#define FOLLOW_SYMLINK_H |
/* |
* This file contains nautilus-follow-symlink's private interface, |
* its core functionality |
*/ |
#include <libnautilus-extension/nautilus-menu-provider.h> |
#include "common.h" |
/* Static Prototypes */ |
static void fsl_callback(NautilusMenuItem *, NautilusFileInfo *); |
static GList *fsl_get_file_items(NautilusMenuProvider *, GtkWidget *, GList *); |
static NautilusMenuItem* fsl_menu_item_new(GdkScreen *, gboolean); |
/* Exported Prototypes |
* Here the namespace is a bit more explicit just in case |
*/ |
void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *); |
#endif /* FOLLOW_SYMLINK_H */ |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/tags/0.5.2/src/common.h |
---|
0,0 → 1,53 |
#ifndef FOLLOW_SYMLINK_COMMON_H |
#define FOLLOW_SYMLINK_COMMON_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 |
/* Debugging facilities */ |
#include <stdlib.h> /* getenv() (3) */ |
#include <string.h> /* strcmp() (3) */ |
/* Prefix for messages */ |
#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 /* FOLLOW_SYMLINK_COMMON_H */ |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/tags/0.5.2/src/nautilus-ext-follow-symlink.h |
---|
0,0 → 1,49 |
#ifndef NAUTILUS_EXT_FOLLOW_SYMLINK_H |
#define NAUTILUS_EXT_FOLLOW_SYMLINK_H |
#include <glib-object.h> |
#include <libnautilus-extension/nautilus-menu-provider.h> |
#include "common.h" |
/* |
* This file contains nautilus-follow-symlink's "public" interface, |
* the functions required to bind the extension to nautilus |
*/ |
void nautilus_module_initialize(GTypeModule *); |
void nautilus_module_shutdown(void); |
void nautilus_module_list_types(const GType **, int *); |
/* These ones don't need public visibility */ |
static void fsl_register_type(GTypeModule *); |
static GType fsl_get_type(void); |
/* Data Types */ |
struct _FsymlinkExtensionClass { |
GObjectClass parent_slot; |
}; |
struct _FsymlinkExtension { |
GObject parent_slot; |
}; |
typedef struct _FsymlinkExtensionClass FsymlinkExtensionClass; |
typedef struct _FsymlinkExtension FsymlinkExtension; |
/* Data initializers */ |
static void fsl_class_init (FsymlinkExtensionClass *class); |
static void fsl_instance_init (FsymlinkExtension *cvs); |
/* Defined in the private interface */ |
extern void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *iface); |
#endif /* NAUTILUS_MODULE_FOLLOW_SYMLINK_H */ |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/tags/0.5.2/debian/changelog |
---|
0,0 → 1,18 |
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 |
* Initial release |
-- Toni Corvera <outlyer@outlyer.net> Sun, 22 Oct 2006 04:11:50 +0200 |
/nautilus-follow-symlink/tags/0.5.2/debian/rules |
---|
0,0 → 1,102 |
#!/usr/bin/make -f |
# -*- makefile -*- |
# Sample debian/rules that uses debhelper. |
# This file was originally written by Joey Hess and Craig Small. |
# As a special exception, when this file is copied by dh-make into a |
# dh-make output file, you may use that output file without restriction. |
# This special exception was added by Craig Small in version 0.37 of dh-make. |
# Uncomment this to turn on verbose mode. |
#export DH_VERBOSE=1 |
CFLAGS = -Wall -g |
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
CFLAGS += -O0 |
else |
CFLAGS += -O2 |
endif |
configure: configure-stamp |
configure-stamp: |
dh_testdir |
# Add here commands to configure the package. |
test -f configure || ./dist clean gen |
./configure --prefix=/usr --disable-static |
touch configure-stamp |
build: build-stamp |
build-stamp: configure-stamp |
dh_testdir |
# Add here commands to compile the package. |
$(MAKE) FINAL=1 |
#docbook-to-man debian/nautilus-follow-symlink.sgml > nautilus-follow-symlink.1 |
touch build-stamp |
clean: |
dh_testdir |
dh_testroot |
rm -f build-stamp configure-stamp |
# Add here commands to clean up after the build process. |
-$(MAKE) clean |
dh_clean |
install: build |
dh_testdir |
dh_testroot |
dh_clean -k |
dh_installdirs |
# Add here commands to install the package into 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. |
binary-indep: build install |
# We have nothing to do by default. |
# Build architecture-dependent files here. |
binary-arch: build install |
dh_testdir |
dh_testroot |
dh_installchangelogs |
dh_installdocs |
dh_installexamples |
# dh_install |
# dh_installmenu |
# dh_installdebconf |
# dh_installlogrotate |
# dh_installemacsen |
# dh_installpam |
# dh_installmime |
# dh_installinit |
# dh_installcron |
# dh_installinfo |
dh_installman |
dh_link |
dh_strip |
dh_compress |
dh_fixperms |
# dh_perl |
# dh_python |
# dh_makeshlibs |
dh_installdeb |
dh_shlibdeps |
dh_gencontrol |
dh_md5sums |
dh_builddeb |
binary: binary-indep binary-arch |
.PHONY: build clean binary-indep binary-arch binary install configure |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/nautilus-follow-symlink/tags/0.5.2/debian/copyright |
---|
0,0 → 1,27 |
This package was debianized by Toni Corvera <outlyer@outlyer.net> on |
Sat, 21 Oct 2006 23:46:12 +0200. |
It can be officially downloaded right now, contact the autor to |
get a copy or more information. |
Copyright Holder: Toni Corvera <outlyer@outlyer.net> |
License: |
This package is free software; you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
the Free Software Foundation; either version 2 of the License, or |
(at your option) any later version. |
This package is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this package; if not, write to the Free Software |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
On Debian systems, the complete text of the GNU General |
Public License can be found in `/usr/share/common-licenses/GPL'. |
/nautilus-follow-symlink/tags/0.5.2/debian/docs |
---|
0,0 → 1,0 |
ROADMAP |
/nautilus-follow-symlink/tags/0.5.2/debian/README.Debian |
---|
0,0 → 1,6 |
nautilus-follow-symlink for Debian |
---------------------------------- |
<possible notes regarding this package - if none, delete this file> |
-- Toni Corvera <outlyer@outlyer.net>, Sat, 21 Oct 2006 23:46:12 +0200 |
/nautilus-follow-symlink/tags/0.5.2/debian/control |
---|
0,0 → 1,14 |
Source: nautilus-follow-symlink |
Section: contrib/gnome |
Priority: extra |
Maintainer: Toni Corvera <outlyer@outlyer.net> |
Build-Depends: debhelper (>= 4.0.0) |
Standards-Version: 3.6.2 |
Package: nautilus-follow-symlink |
Architecture: any |
Build-Depends: gcc, libtool, pkg-config, libc6-dev, libglib2.0-dev, libnautilus-extension-dev |
Depends: ${shlibs:Depends}, ${misc:Depends}, nautilus |
Description: nautilus plugin to open the location pointed by a symlink |
This extension adds a context menu option to symbolic links to |
folders which opens the pointed folder instead of the symbolic link. |
/nautilus-follow-symlink/tags/0.5.2/debian/dirs |
---|
0,0 → 1,0 |
usr/lib |
/nautilus-follow-symlink/tags/0.5.2/debian/compat |
---|
0,0 → 1,0 |
4 |
/nautilus-follow-symlink/tags/0.5.2/ChangeLog |
---|
0,0 → 1,17 |
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 |
* INTERNAL: Rearrangement in multiple files, applied static where |
appropiate |
* INTERNAL: Added extra-verbosity, switchable on compile time |
0.5 (22 oct 2006): |
* Initial release |
/nautilus-follow-symlink/tags/0.5.2/Makefile.am |
---|
0,0 → 1,5 |
SUBDIRS = src |
# This doesn't work as expected |
libdir = @libdir@/nautilus/extensions-1.0 |
/nautilus-follow-symlink/tags/0.5.2/BUILD |
---|
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 |
/nautilus-follow-symlink/tags/0.5.2/dist |
---|
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 |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/nautilus-follow-symlink/tags/0.5.2/configure.in |
---|
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) |
/nautilus-follow-symlink/tags/0.5.2 |
---|
Property changes: |
Added: svn:mergeinfo |
Merged /nautilus-follow-symlink/branches/0.5.2:r4 |
/nautilus-follow-symlink/tags/0.5.1/debian/rules |
---|
0,0 → 1,98 |
#!/usr/bin/make -f |
# -*- makefile -*- |
# Sample debian/rules that uses debhelper. |
# This file was originally written by Joey Hess and Craig Small. |
# As a special exception, when this file is copied by dh-make into a |
# dh-make output file, you may use that output file without restriction. |
# This special exception was added by Craig Small in version 0.37 of dh-make. |
# Uncomment this to turn on verbose mode. |
#export DH_VERBOSE=1 |
CFLAGS = -Wall -g |
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
CFLAGS += -O0 |
else |
CFLAGS += -O2 |
endif |
configure: configure-stamp |
configure-stamp: |
dh_testdir |
# Add here commands to configure the package. |
touch configure-stamp |
build: build-stamp |
build-stamp: configure-stamp |
dh_testdir |
# Add here commands to compile the package. |
cd src && $(MAKE) FINAL=1 |
#docbook-to-man debian/nautilus-follow-symlink.sgml > nautilus-follow-symlink.1 |
touch build-stamp |
clean: |
dh_testdir |
dh_testroot |
rm -f build-stamp configure-stamp |
# Add here commands to clean up after the build process. |
-cd src && $(MAKE) clean |
dh_clean |
install: build |
dh_testdir |
dh_testroot |
dh_clean -k |
dh_installdirs |
# Add here commands to install the package into debian/nautilus-follow-symlink. |
cd src && $(MAKE) install DESTDIR=$(CURDIR)/debian/nautilus-follow-symlink |
# Build architecture-independent files here. |
binary-indep: build install |
# We have nothing to do by default. |
# Build architecture-dependent files here. |
binary-arch: build install |
dh_testdir |
dh_testroot |
dh_installchangelogs |
dh_installdocs |
dh_installexamples |
# dh_install |
# dh_installmenu |
# dh_installdebconf |
# dh_installlogrotate |
# dh_installemacsen |
# dh_installpam |
# dh_installmime |
# dh_installinit |
# dh_installcron |
# dh_installinfo |
dh_installman |
dh_link |
dh_strip |
dh_compress |
dh_fixperms |
# dh_perl |
# dh_python |
# dh_makeshlibs |
dh_installdeb |
dh_shlibdeps |
dh_gencontrol |
dh_md5sums |
dh_builddeb |
binary: binary-indep binary-arch |
.PHONY: build clean binary-indep binary-arch binary install configure |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/nautilus-follow-symlink/tags/0.5.1/debian/changelog |
---|
0,0 → 1,6 |
nautilus-follow-symlink (0.5-out.1) experimental; urgency=low |
* Initial release |
-- Toni Corvera <outlyer@outlyer.net> Sun, 22 Oct 2006 04:11:50 +0200 |
/nautilus-follow-symlink/tags/0.5.1/debian/copyright |
---|
0,0 → 1,27 |
This package was debianized by Toni Corvera <outlyer@outlyer.net> on |
Sat, 21 Oct 2006 23:46:12 +0200. |
It can be officially downloaded right now, contact the autor to |
get a copy or more information. |
Copyright Holder: Toni Corvera <outlyer@outlyer.net> |
License: |
This package is free software; you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
the Free Software Foundation; either version 2 of the License, or |
(at your option) any later version. |
This package is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this package; if not, write to the Free Software |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
On Debian systems, the complete text of the GNU General |
Public License can be found in `/usr/share/common-licenses/GPL'. |
/nautilus-follow-symlink/tags/0.5.1/debian/docs |
---|
0,0 → 1,0 |
ROADMAP |
/nautilus-follow-symlink/tags/0.5.1/debian/README.Debian |
---|
0,0 → 1,6 |
nautilus-follow-symlink for Debian |
---------------------------------- |
<possible notes regarding this package - if none, delete this file> |
-- Toni Corvera <outlyer@outlyer.net>, Sat, 21 Oct 2006 23:46:12 +0200 |
/nautilus-follow-symlink/tags/0.5.1/debian/control |
---|
0,0 → 1,14 |
Source: nautilus-follow-symlink |
Section: contrib/gnome |
Priority: extra |
Maintainer: Toni Corvera <outlyer@outlyer.net> |
Build-Depends: debhelper (>= 4.0.0) |
Standards-Version: 3.6.2 |
Package: nautilus-follow-symlink |
Architecture: any |
Build-Depends: gcc, libtool, pkg-config, libc6-dev, libglib2.0-dev, libnautilus-extension-dev |
Depends: ${shlibs:Depends}, ${misc:Depends}, nautilus |
Description: nautilus plugin to open the location pointed by a symlink |
This extension adds a context menu option to symbolic links to |
folders which opens the pointed folder instead of the symbolic link. |
/nautilus-follow-symlink/tags/0.5.1/debian/dirs |
---|
0,0 → 1,0 |
usr/lib |
/nautilus-follow-symlink/tags/0.5.1/debian/compat |
---|
0,0 → 1,0 |
4 |
/nautilus-follow-symlink/tags/0.5.1/ChangeLog |
---|
0,0 → 1,8 |
0.5.1: |
* BUGFIX: Correctly check error in realpath() call |
* INTERNAL: Rearrangement in multiple files, applied static where |
appropiate |
* INTERNAL: Added extra-verbosity, switchable on compile time |
0.5 (22 oct 2006): |
* Initial release |
/nautilus-follow-symlink/tags/0.5.1/src/Makefile |
---|
0,0 → 1,57 |
# 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 |
/nautilus-follow-symlink/tags/0.5.1/src/common.h |
---|
0,0 → 1,17 |
#ifndef FOLLOW_SYMLINK_COMMON_H |
#define FOLLOW_SYMLINK_COMMON_H |
#include <glib.h> |
#ifdef _DEBUG |
#define TRACE() (g_printf("nautilus-follow-symlink trace: %s()\n", __FUNCTION__)); |
#else |
#define TRACE() |
#endif |
#ifndef VERSION |
#define VERSION "interim.debug" |
#endif |
#endif /* FOLLOW_SYMLINK_COMMON_H */ |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/tags/0.5.1/src/follow-symlink.c |
---|
0,0 → 1,129 |
#include "follow-symlink.h" |
/* Menu initialization */ |
void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *iface) |
{ |
TRACE(); |
//TODO: iface->get_background_items = fsl_get_background_items; |
iface->get_file_items = fsl_get_file_items; |
} |
/* Bind to menu if needed */ |
GList * |
fsl_get_file_items (NautilusMenuProvider * provider, |
GtkWidget * window, |
GList * files) |
{ |
TRACE(); |
NautilusMenuItem *item; |
// Number of files = g_list_length(files) |
// Directory = nautilus_file_info_is_directory(files->data) |
if (files == NULL || g_list_length(files) != 1) { |
return NULL; |
} |
// Only file uris |
{ |
gchar * uri_scheme = nautilus_file_info_get_uri_scheme(files->data); |
if (strcmp(uri_scheme, "file") != 0) { |
return NULL; |
} |
g_free(uri_scheme); |
} |
// Xref: http://www.koders.com/c/fidA0AA0A78334E1FA3D668FD10B437638F6D031D77.aspx?s=NautilusFile |
GnomeVFSFileInfo * gfi = nautilus_file_info_get_vfs_file_info(files->data); |
/* |
* Xref: /usr/include/gnome-vfs-2.0/libgnomevfs/gnome-vfs-file-info.h |
* |
* Aparently type is never GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK and symlinks |
* are resolved to the target type |
*/ |
/*if (gfi->type != GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK) {*/ |
if (gfi->type != GNOME_VFS_FILE_TYPE_DIRECTORY) { |
return NULL; |
} |
// We know the file is either a directory or a symlink to a directory |
// TODO: Has glib/gnome any better/faster alternatives? |
{ |
struct stat file_info; |
const gchar * const file_name = nautilus_file_info_get_name(files->data); |
lstat(file_name, &file_info); |
if (! S_ISLNK(file_info.st_mode)) { |
return NULL; |
} |
} |
item = fsl_menu_item_new(gtk_widget_get_screen(window), TRUE); |
g_signal_connect(item, "activate", G_CALLBACK(fsl_callback), |
files->data); |
return g_list_append(NULL, item); |
} |
void fsl_callback (NautilusMenuItem * item, NautilusFileInfo * file_info) |
{ |
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; |
const gchar * link_name = nautilus_file_info_get_uri(file_info); |
gchar * target = g_malloc(PATH_LENGTH_BYTES); |
/* unlike readlink(man 2), realpath(man 3) resolves the symlink, while |
* readlink returns the pointed file, which might be a relative path |
*/ |
if (NULL == realpath(link_name + URI_OFFSET, target)) { |
g_assert( FALSE ); |
} |
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 * offset = g_stpcpy(command_line, BASE_CMD); |
offset = g_stpcpy(offset, "file://"); |
g_stpcpy(offset, target); |
if (FALSE == g_shell_parse_argv(command_line, NULL, &argv, NULL)) { |
g_assert( FALSE ); |
} |
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, |
argv, |
NULL, |
G_SPAWN_SEARCH_PATH, |
NULL, NULL, NULL, NULL); |
g_free(command_line); |
g_strfreev(argv); |
} |
/* Create the new menu item */ |
NautilusMenuItem * |
fsl_menu_item_new(GdkScreen *screen, gboolean is_file_item) |
{ |
TRACE(); |
NautilusMenuItem *ret; |
const char *name; |
const char *tooltip; |
name = "-> Follow symbolic _link"; |
tooltip = "Open the directory pointed by the currently selected symbolic link"; |
// (name, label, tip, icon) |
ret = nautilus_menu_item_new("FsymlinkExtension::follow_symlink", |
name, tooltip, NULL); |
//g_object_set_data(G_OBJECT(ret), "FsymlinkExtension::screen", screen); |
return ret; |
} |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/tags/0.5.1/src/nautilus-ext-follow-symlink.c |
---|
0,0 → 1,83 |
#include "nautilus-ext-follow-symlink.h" |
/* Public interface */ |
static GType fsl_type; |
static GType provider_types[1]; |
void nautilus_module_initialize (GTypeModule *module) |
{ |
TRACE(); |
g_printf("Initializing nautilus-follow-symlink extension (v.%s)\n", VERSION); |
fsl_register_type(module); |
provider_types[0] = fsl_get_type(); |
} |
void nautilus_module_shutdown (void) |
{ |
TRACE(); |
/* Module-specific shutdown */ |
g_print ("Shutting down nautilus-follow-symlink extension\n"); |
} |
void nautilus_module_list_types (const GType **types, int *num_types) |
{ |
TRACE(); |
*types = provider_types; |
*num_types = G_N_ELEMENTS(provider_types); |
} |
void fsl_register_type (GTypeModule *module) |
{ |
TRACE(); |
static const GTypeInfo info = { |
sizeof(FsymlinkExtensionClass), |
(GBaseInitFunc) NULL, |
(GBaseFinalizeFunc) NULL, |
(GClassInitFunc) fsl_class_init, |
NULL, |
NULL, |
sizeof (FsymlinkExtension), |
0, |
(GInstanceInitFunc) fsl_instance_init, |
}; |
fsl_type = g_type_module_register_type (module, |
G_TYPE_OBJECT, |
"FsymlinkExtension", |
&info, 0); |
/* Menu provider interface */ |
static const GInterfaceInfo menu_provider_iface_info = { |
(GInterfaceInitFunc)fsl_extension_menu_provider_iface_init, |
NULL, |
NULL, |
}; |
g_type_module_add_interface(module, fsl_type, |
NAUTILUS_TYPE_MENU_PROVIDER, &menu_provider_iface_info); |
/* Other Interfaces */ |
} |
GType fsl_get_type(void) |
{ |
TRACE(); |
return fsl_type; |
} |
static void fsl_instance_init(FsymlinkExtension *cvs) |
{ |
TRACE(); |
} |
static void fsl_class_init(FsymlinkExtensionClass *class) |
{ |
TRACE(); |
} |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/tags/0.5.1/src/follow-symlink.h |
---|
0,0 → 1,34 |
#ifndef FOLLOW_SYMLINK_H |
#define FOLLOW_SYMLINK_H |
/* |
* This file contains nautilus-follow-symlink's private interface, |
* its core functionality |
*/ |
#include <libnautilus-extension/nautilus-menu-provider.h> |
#include <sys/stat.h> |
#include <stdlib.h> /* realpath() */ |
#include <string.h> /* strlen() */ |
#include "common.h" |
/* Static Prototypes */ |
static GType fsl_get_type(void); |
static void fsl_register_type(GTypeModule *); |
static void fsl_callback(NautilusMenuItem *, NautilusFileInfo *); |
static GList *fsl_get_file_items(NautilusMenuProvider *, GtkWidget *, GList *); |
static NautilusMenuItem* fsl_menu_item_new(GdkScreen *, gboolean); |
/* Exported Prototypes |
* Here the namespace is a bit more explicit just in case |
*/ |
void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *); |
#endif /* FOLLOW_SYMLINK_H */ |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/tags/0.5.1/src/nautilus-ext-follow-symlink.h |
---|
0,0 → 1,49 |
#ifndef NAUTILUS_EXT_FOLLOW_SYMLINK_H |
#define NAUTILUS_EXT_FOLLOW_SYMLINK_H |
#include <glib-object.h> |
#include <libnautilus-extension/nautilus-menu-provider.h> |
#include "common.h" |
/* |
* This file contains nautilus-follow-symlink's "public" interface, |
* the functions required to bind the extension to nautilus |
*/ |
void nautilus_module_initialize(GTypeModule *); |
void nautilus_module_shutdown(void); |
void nautilus_module_list_types(const GType **, int *); |
/* These ones don't need public visibility */ |
static void fsl_register_type(GTypeModule *); |
static GType fsl_get_type(void); |
/* Data Types */ |
struct _FsymlinkExtensionClass { |
GObjectClass parent_slot; |
}; |
struct _FsymlinkExtension { |
GObject parent_slot; |
}; |
typedef struct _FsymlinkExtensionClass FsymlinkExtensionClass; |
typedef struct _FsymlinkExtension FsymlinkExtension; |
/* Data initializers */ |
static void fsl_class_init (FsymlinkExtensionClass *class); |
static void fsl_instance_init (FsymlinkExtension *cvs); |
/* Defined in the private interface */ |
extern void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *iface); |
#endif /* NAUTILUS_MODULE_FOLLOW_SYMLINK_H */ |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/trunk/debian/changelog |
---|
0,0 → 1,25 |
nautilus-follow-symlink (0.5.2-out.2) unstable; urgency=low |
* debian/rules: Install upstream ChangeLog |
* debian/docs: Install upstream BUILD instructions |
-- Toni Corvera <outlyer@outlyer.net> Tue, 24 Oct 2006 18:32:54 +0200 |
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 |
* Initial release |
-- Toni Corvera <outlyer@outlyer.net> Sun, 22 Oct 2006 04:11:50 +0200 |
/nautilus-follow-symlink/trunk/debian/docs |
---|
0,0 → 1,2 |
ROADMAP |
BUILD |
/nautilus-follow-symlink/trunk/debian/rules |
---|
0,0 → 1,102 |
#!/usr/bin/make -f |
# -*- makefile -*- |
# Sample debian/rules that uses debhelper. |
# This file was originally written by Joey Hess and Craig Small. |
# As a special exception, when this file is copied by dh-make into a |
# dh-make output file, you may use that output file without restriction. |
# This special exception was added by Craig Small in version 0.37 of dh-make. |
# Uncomment this to turn on verbose mode. |
#export DH_VERBOSE=1 |
CFLAGS = -Wall -g |
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
CFLAGS += -O0 |
else |
CFLAGS += -O2 |
endif |
configure: configure-stamp |
configure-stamp: |
dh_testdir |
# Add here commands to configure the package. |
test -f configure || ./dist clean gen |
./configure --prefix=/usr --disable-static |
touch configure-stamp |
build: build-stamp |
build-stamp: configure-stamp |
dh_testdir |
# Add here commands to compile the package. |
$(MAKE) FINAL=1 |
#docbook-to-man debian/nautilus-follow-symlink.sgml > nautilus-follow-symlink.1 |
touch build-stamp |
clean: |
dh_testdir |
dh_testroot |
rm -f build-stamp configure-stamp |
# Add here commands to clean up after the build process. |
-$(MAKE) clean |
dh_clean |
install: build |
dh_testdir |
dh_testroot |
dh_clean -k |
dh_installdirs |
# Add here commands to install the package into 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. |
binary-indep: build install |
# We have nothing to do by default. |
# Build architecture-dependent files here. |
binary-arch: build install |
dh_testdir |
dh_testroot |
dh_installchangelogs ChangeLog |
dh_installdocs |
dh_installexamples |
# dh_install |
# dh_installmenu |
# dh_installdebconf |
# dh_installlogrotate |
# dh_installemacsen |
# dh_installpam |
# dh_installmime |
# dh_installinit |
# dh_installcron |
# dh_installinfo |
dh_installman |
dh_link |
dh_strip |
dh_compress |
dh_fixperms |
# dh_perl |
# dh_python |
# dh_makeshlibs |
dh_installdeb |
dh_shlibdeps |
dh_gencontrol |
dh_md5sums |
dh_builddeb |
binary: binary-indep binary-arch |
.PHONY: build clean binary-indep binary-arch binary install configure |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/nautilus-follow-symlink/trunk/debian/copyright |
---|
0,0 → 1,27 |
This package was debianized by Toni Corvera <outlyer@outlyer.net> on |
Sat, 21 Oct 2006 23:46:12 +0200. |
It can be officially downloaded right now, contact the autor to |
get a copy or more information. |
Copyright Holder: Toni Corvera <outlyer@outlyer.net> |
License: |
This package is free software; you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
the Free Software Foundation; either version 2 of the License, or |
(at your option) any later version. |
This package is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this package; if not, write to the Free Software |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
On Debian systems, the complete text of the GNU General |
Public License can be found in `/usr/share/common-licenses/GPL'. |
/nautilus-follow-symlink/trunk/debian/README.Debian |
---|
0,0 → 1,6 |
nautilus-follow-symlink for Debian |
---------------------------------- |
<possible notes regarding this package - if none, delete this file> |
-- Toni Corvera <outlyer@outlyer.net>, Sat, 21 Oct 2006 23:46:12 +0200 |
/nautilus-follow-symlink/trunk/debian/control |
---|
0,0 → 1,14 |
Source: nautilus-follow-symlink |
Section: contrib/gnome |
Priority: extra |
Maintainer: Toni Corvera <outlyer@outlyer.net> |
Build-Depends: debhelper (>= 4.0.0) |
Standards-Version: 3.6.2 |
Package: nautilus-follow-symlink |
Architecture: any |
Build-Depends: gcc, libtool, pkg-config, libc6-dev, libglib2.0-dev, libnautilus-extension-dev |
Depends: ${shlibs:Depends}, ${misc:Depends}, nautilus |
Description: nautilus plugin to open the location pointed by a symlink |
This extension adds a context menu option to symbolic links to |
folders which opens the pointed folder instead of the symbolic link. |
/nautilus-follow-symlink/trunk/debian/dirs |
---|
0,0 → 1,0 |
usr/lib |
/nautilus-follow-symlink/trunk/debian/compat |
---|
0,0 → 1,0 |
4 |
/nautilus-follow-symlink/trunk/ChangeLog |
---|
0,0 → 1,17 |
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 |
* INTERNAL: Rearrangement in multiple files, applied static where |
appropiate |
* INTERNAL: Added extra-verbosity, switchable on compile time |
0.5 (22 oct 2006): |
* Initial release |
/nautilus-follow-symlink/trunk/src/Makefile.am |
---|
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 |
/nautilus-follow-symlink/trunk/src/follow-symlink.h |
---|
0,0 → 1,27 |
#ifndef FOLLOW_SYMLINK_H |
#define FOLLOW_SYMLINK_H |
/* |
* This file contains nautilus-follow-symlink's private interface, |
* its core functionality |
*/ |
#include <libnautilus-extension/nautilus-menu-provider.h> |
#include "common.h" |
/* Static Prototypes */ |
static void fsl_callback(NautilusMenuItem *, NautilusFileInfo *); |
static GList *fsl_get_file_items(NautilusMenuProvider *, GtkWidget *, GList *); |
static NautilusMenuItem* fsl_menu_item_new(GdkScreen *, gboolean); |
/* Exported Prototypes |
* Here the namespace is a bit more explicit just in case |
*/ |
void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *); |
#endif /* FOLLOW_SYMLINK_H */ |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/trunk/src/common.h |
---|
0,0 → 1,53 |
#ifndef FOLLOW_SYMLINK_COMMON_H |
#define FOLLOW_SYMLINK_COMMON_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 |
/* Debugging facilities */ |
#include <stdlib.h> /* getenv() (3) */ |
#include <string.h> /* strcmp() (3) */ |
/* Prefix for messages */ |
#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 /* FOLLOW_SYMLINK_COMMON_H */ |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/trunk/src/follow-symlink.c |
---|
0,0 → 1,145 |
#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 */ |
void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *iface) |
{ |
TRACE(); |
//TODO: iface->get_background_items = fsl_get_background_items; |
iface->get_file_items = fsl_get_file_items; |
} |
/* Bind to menu if needed */ |
GList * |
fsl_get_file_items (NautilusMenuProvider * provider, |
GtkWidget * window, |
GList * files) |
{ |
TRACE(); |
NautilusMenuItem *item; |
// Number of files = g_list_length(files) |
// Directory = nautilus_file_info_is_directory(files->data) |
if (NULL==files || g_list_length(files) != 1) { |
FSL_LOG( (NULL==files) ? "No file" : "More than one file" ); |
return NULL; |
} |
// Only file uris |
{ |
gchar * uri_scheme = nautilus_file_info_get_uri_scheme(files->data); |
if (strcmp(uri_scheme, "file") != 0) { |
FSL_LOG( "Not file scheme" ); |
return NULL; |
} |
g_free(uri_scheme); |
} |
// Xref: http://www.koders.com/c/fidA0AA0A78334E1FA3D668FD10B437638F6D031D77.aspx?s=NautilusFile |
GnomeVFSFileInfo * gfi = nautilus_file_info_get_vfs_file_info(files->data); |
/* |
* Xref: /usr/include/gnome-vfs-2.0/libgnomevfs/gnome-vfs-file-info.h |
* |
* Aparently type is never GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK and symlinks |
* are resolved to the target type |
*/ |
/*if (gfi->type != GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK) {*/ |
if (gfi->type != GNOME_VFS_FILE_TYPE_DIRECTORY) { |
FSL_LOG( "Not directory" ); |
return NULL; |
} |
// We know the file is either a directory or a symlink to a directory |
// TODO: Has glib/gnome any better/faster alternatives? |
{ |
struct stat file_info; |
// 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); |
if (! S_ISLNK(file_info.st_mode)) { |
FSL_LOG1( "Not S_ISLNK:", file_name ); |
return NULL; |
} |
} |
item = fsl_menu_item_new(gtk_widget_get_screen(window), TRUE); |
g_signal_connect(item, "activate", G_CALLBACK(fsl_callback), |
files->data); |
return g_list_append(NULL, item); |
} |
void fsl_callback (NautilusMenuItem * item, NautilusFileInfo * file_info) |
{ |
TRACE(); |
gchar ** argv; |
const gchar * link_name = nautilus_file_info_get_uri(file_info) + URI_OFFSET; |
gchar * target = g_malloc(PATH_LENGTH_BYTES); |
/* unlike readlink(man 2), realpath(man 3) resolves the symlink, while |
* 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, target)) { |
g_printf("ERROR in realpath(): %s\n", strerror(errno)); |
g_assert( FALSE ); |
} |
const gchar const * BASE_CMD = "nautilus --no-desktop --no-default-window \""; |
gchar * command_line = g_malloc( sizeof(gchar) * ( strlen(BASE_CMD) + strlen(target) + 2 ) ); |
gchar * offset = g_stpcpy(command_line, BASE_CMD); |
//offset = g_stpcpy(offset, "file://"); // unneeded; also makes nautilus think it may be incorrect |
// 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)) { |
g_assert( FALSE ); |
} |
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, |
argv, |
NULL, |
G_SPAWN_SEARCH_PATH, |
NULL, NULL, NULL, NULL); |
g_free(command_line); |
g_strfreev(argv); |
} |
/* Create the new menu item */ |
NautilusMenuItem * |
fsl_menu_item_new(GdkScreen *screen, gboolean is_file_item) |
{ |
TRACE(); |
NautilusMenuItem *ret; |
const char *name; |
const char *tooltip; |
name = "-> Follow symbolic _link"; |
tooltip = "Open the directory pointed by the currently selected symbolic link"; |
// (name, label, tip, icon) |
ret = nautilus_menu_item_new("FsymlinkExtension::follow_symlink", |
name, tooltip, NULL); |
//g_object_set_data(G_OBJECT(ret), "FsymlinkExtension::screen", screen); |
return ret; |
} |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/trunk/src/nautilus-ext-follow-symlink.c |
---|
0,0 → 1,86 |
#include "nautilus-ext-follow-symlink.h" |
#include <glib/gprintf.h> |
/* Public interface */ |
static GType fsl_type; |
static GType provider_types[1]; |
void nautilus_module_initialize (GTypeModule *module) |
{ |
TRACE(); |
FSL_DEBUG_INIT(); |
g_printf("Initializing nautilus-follow-symlink extension (v.%s)\n", VERSION); |
fsl_register_type(module); |
provider_types[0] = fsl_get_type(); |
} |
void nautilus_module_shutdown (void) |
{ |
TRACE(); |
/* Module-specific shutdown */ |
g_print ("Shutting down nautilus-follow-symlink extension\n"); |
} |
void nautilus_module_list_types (const GType **types, int *num_types) |
{ |
TRACE(); |
*types = provider_types; |
*num_types = G_N_ELEMENTS(provider_types); |
} |
void fsl_register_type (GTypeModule *module) |
{ |
TRACE(); |
static const GTypeInfo info = { |
sizeof(FsymlinkExtensionClass), |
(GBaseInitFunc) NULL, |
(GBaseFinalizeFunc) NULL, |
(GClassInitFunc) fsl_class_init, |
NULL, |
NULL, |
sizeof (FsymlinkExtension), |
0, |
(GInstanceInitFunc) fsl_instance_init, |
}; |
fsl_type = g_type_module_register_type (module, |
G_TYPE_OBJECT, |
"FsymlinkExtension", |
&info, 0); |
/* Menu provider interface */ |
static const GInterfaceInfo menu_provider_iface_info = { |
(GInterfaceInitFunc)fsl_extension_menu_provider_iface_init, |
NULL, |
NULL, |
}; |
g_type_module_add_interface(module, fsl_type, |
NAUTILUS_TYPE_MENU_PROVIDER, &menu_provider_iface_info); |
/* Other Interfaces */ |
} |
GType fsl_get_type(void) |
{ |
TRACE(); |
return fsl_type; |
} |
void fsl_instance_init(FsymlinkExtension *cvs) |
{ |
TRACE(); |
} |
void fsl_class_init(FsymlinkExtensionClass *class) |
{ |
TRACE(); |
} |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/trunk/src/nautilus-ext-follow-symlink.h |
---|
0,0 → 1,49 |
#ifndef NAUTILUS_EXT_FOLLOW_SYMLINK_H |
#define NAUTILUS_EXT_FOLLOW_SYMLINK_H |
#include <glib-object.h> |
#include <libnautilus-extension/nautilus-menu-provider.h> |
#include "common.h" |
/* |
* This file contains nautilus-follow-symlink's "public" interface, |
* the functions required to bind the extension to nautilus |
*/ |
void nautilus_module_initialize(GTypeModule *); |
void nautilus_module_shutdown(void); |
void nautilus_module_list_types(const GType **, int *); |
/* These ones don't need public visibility */ |
static void fsl_register_type(GTypeModule *); |
static GType fsl_get_type(void); |
/* Data Types */ |
struct _FsymlinkExtensionClass { |
GObjectClass parent_slot; |
}; |
struct _FsymlinkExtension { |
GObject parent_slot; |
}; |
typedef struct _FsymlinkExtensionClass FsymlinkExtensionClass; |
typedef struct _FsymlinkExtension FsymlinkExtension; |
/* Data initializers */ |
static void fsl_class_init (FsymlinkExtensionClass *class); |
static void fsl_instance_init (FsymlinkExtension *cvs); |
/* Defined in the private interface */ |
extern void fsl_extension_menu_provider_iface_init(NautilusMenuProviderIface *iface); |
#endif /* NAUTILUS_MODULE_FOLLOW_SYMLINK_H */ |
/* vim:set ts=4 et ai: */ |
/nautilus-follow-symlink/trunk/Makefile.am |
---|
0,0 → 1,5 |
SUBDIRS = src |
# This doesn't work as expected |
libdir = @libdir@/nautilus/extensions-1.0 |
/nautilus-follow-symlink/trunk/BUILD |
---|
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 |
/nautilus-follow-symlink/trunk/dist |
---|
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 |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/nautilus-follow-symlink/trunk/configure.in |
---|
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) |
/nautilus-follow-symlink/trunk |
---|
Property changes: |
Added: svn:mergeinfo |
Merged /nautilus-follow-symlink/branches/0.5.2:r4 |
Merged /nautilus-follow-symlink/branches/0.5.2+debian.2:r7 |