Skip to content

Commit

Permalink
Commit #14
Browse files Browse the repository at this point in the history
  • Loading branch information
madmurphy committed May 6, 2021
1 parent 39f86a0 commit a90ab75
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 36 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ Change Log
==========


## 1.0.2

Changes:

* Code review


## 1.0.1

Changes:
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dnl ***************************************************************************
AC_PREREQ([2.69])

AC_INIT([Nautilus Launch],
[1.0.1],
[1.0.2],
[madmurphy333@gmail.com],
[nautilus-launch],
[https://gitlab.gnome.org/madmurphy/nautilus-launch])
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Nautilus Launch",
"version": "1.0.1",
"version": "1.0.2",
"description": "A simple Nautilus extension that allows to run executables and launchers via right-click menu",
"homepage": "https://gitlab.gnome.org/madmurphy/nautilus-launch",
"author": "madmurphy",
Expand Down
12 changes: 6 additions & 6 deletions po/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: 1.0.1\n"
"Project-Id-Version: 1.0.2\n"
"Report-Msgid-Bugs-To: <madmurphy333@gmail.com>\n"
"POT-Creation-Date: 2021-05-02 23:40+0200\n"
"PO-Revision-Date: 2021-05-02 23:40+0200\n"
Expand All @@ -18,25 +18,25 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: ../src/nautilus-launch.c:104
#: ../src/nautilus-launch.c:108
msgid "Error retrieving file's path"
msgstr "Error al recuperar la posición del archivo"

#: ../src/nautilus-launch.c:126
#: ../src/nautilus-launch.c:131
msgid "Launcher has become invalid"
msgstr "El lanzador ya no es válido"

#: ../src/nautilus-launch.c:171
#: ../src/nautilus-launch.c:177
msgid "Error retrieving current working directory"
msgstr "Error al recuperar el directorio de trabajo actual"

#: ../src/nautilus-launch.c:304
#: ../src/nautilus-launch.c:319
msgid "_Launch"
msgid_plural "_Launch all"
msgstr[0] "_Lanzar"
msgstr[1] "_Lanzar todo"

#: ../src/nautilus-launch.c:307
#: ../src/nautilus-launch.c:322
msgid "Launch the selected application"
msgid_plural "Launch all the selected applications"
msgstr[0] "Lanzar la aplicación seleccionada"
Expand Down
12 changes: 6 additions & 6 deletions po/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: 1.0.1\n"
"Project-Id-Version: 1.0.2\n"
"Report-Msgid-Bugs-To: <madmurphy333@gmail.com>\n"
"POT-Creation-Date: 2021-05-02 23:40+0200\n"
"PO-Revision-Date: 2021-05-02 23:40+0200\n"
Expand All @@ -18,25 +18,25 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: ../src/nautilus-launch.c:104
#: ../src/nautilus-launch.c:108
msgid "Error retrieving file's path"
msgstr "Errore nel recuperare la posizione del file"

#: ../src/nautilus-launch.c:126
#: ../src/nautilus-launch.c:131
msgid "Launcher has become invalid"
msgstr "Il lanciatore non è più valido"

#: ../src/nautilus-launch.c:171
#: ../src/nautilus-launch.c:177
msgid "Error retrieving current working directory"
msgstr "Errore nel recuperare la directory di lavoro corrente"

#: ../src/nautilus-launch.c:304
#: ../src/nautilus-launch.c:319
msgid "_Launch"
msgid_plural "_Launch all"
msgstr[0] "_Lancia"
msgstr[1] "_Lancia tutto"

#: ../src/nautilus-launch.c:307
#: ../src/nautilus-launch.c:322
msgid "Launch the selected application"
msgid_plural "Launch all the selected applications"
msgstr[0] "Lancia l'applicazione selezionata"
Expand Down
12 changes: 6 additions & 6 deletions po/la.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: 1.0.1\n"
"Project-Id-Version: 1.0.2\n"
"Report-Msgid-Bugs-To: <madmurphy333@gmail.com>\n"
"POT-Creation-Date: 2021-05-02 23:40+0200\n"
"PO-Revision-Date: 2021-05-02 23:40+0200\n"
Expand All @@ -18,25 +18,25 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=20; plural=(n != 1);\n"

#: ../src/nautilus-launch.c:104
#: ../src/nautilus-launch.c:108
msgid "Error retrieving file's path"
msgstr "Error per locum fasciculi recipiendum"

#: ../src/nautilus-launch.c:126
#: ../src/nautilus-launch.c:131
msgid "Launcher has become invalid"
msgstr "Pultrum illegitimum factus est"

#: ../src/nautilus-launch.c:171
#: ../src/nautilus-launch.c:177
msgid "Error retrieving current working directory"
msgstr "Error per plicum operis recipiendum"

#: ../src/nautilus-launch.c:304
#: ../src/nautilus-launch.c:319
msgid "_Launch"
msgid_plural "_Launch all"
msgstr[0] "_Pellere"
msgstr[1] "_Pellere omnia"

#: ../src/nautilus-launch.c:307
#: ../src/nautilus-launch.c:322
msgid "Launch the selected application"
msgid_plural "Launch all the selected applications"
msgstr[0] "Pellere selectum programma"
Expand Down
47 changes: 31 additions & 16 deletions src/nautilus-launch.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,26 +83,31 @@ static void nautilus_launch_clicked (

gchar * argv[] = { NULL, NULL };
gchar * wdir;
GFile * location;
GError * launcherr = NULL;
GDesktopAppInfo * dainfo;
GList * const file_selection = g_object_get_data(
(GObject *) menu_item,
G_OBJECT(menu_item),
"nautilus_launch_files"
);

for (GList * iter = file_selection; iter; iter = iter->next) {

argv[0] = g_file_get_path(
nautilus_file_info_get_location(NAUTILUS_FILE_INFO(iter->data))
location = nautilus_file_info_get_location(
NAUTILUS_FILE_INFO(iter->data)
);

argv[0] = g_file_get_path(location);
g_object_unref(location);

if (!argv[0]) {

fprintf(
stderr,
"Nautilus Launch: %s\n",
_("Error retrieving file's path")
);

continue;

}
Expand All @@ -125,6 +130,7 @@ static void nautilus_launch_clicked (
"Nautilus Launch: %s\n",
_("Launcher has become invalid")
);

continue;

}
Expand All @@ -146,8 +152,7 @@ static void nautilus_launch_clicked (
) {

fprintf(stderr, "Nautilus Launch: %s\n", launcherr->message);
g_error_free(launcherr);
launcherr = NULL;
g_clear_error(&launcherr);

}

Expand All @@ -157,12 +162,13 @@ static void nautilus_launch_clicked (

/* This is a regular executable */

wdir = g_file_get_path(
nautilus_file_info_get_parent_location(
NAUTILUS_FILE_INFO(iter->data)
)
location = nautilus_file_info_get_parent_location(
NAUTILUS_FILE_INFO(iter->data)
);

wdir = g_file_get_path(location);
g_object_unref(location);

if (!wdir) {

fprintf(
Expand All @@ -187,8 +193,7 @@ static void nautilus_launch_clicked (
) {

fprintf(stderr, "Nautilus Launch: %s\n", launcherr->message);
g_error_free(launcherr);
launcherr = NULL;
g_clear_error(&launcherr);

}

Expand All @@ -209,6 +214,7 @@ static GList * nautilus_launch_get_file_items (
GList * const file_selection
) {

GFile * location;
GFileInfo * finfo;
GDesktopAppInfo * dainfo;
gsize sellen = 0;
Expand All @@ -233,10 +239,13 @@ static GList * nautilus_launch_get_file_items (

/* This is a .desktop launcher */

fpath = g_file_get_path(
nautilus_file_info_get_location(NAUTILUS_FILE_INFO(iter->data))
location = nautilus_file_info_get_location(
NAUTILUS_FILE_INFO(iter->data)
);

fpath = g_file_get_path(location);
g_object_unref(location);

if (!fpath) {

/* Error retrieving launcher's path */
Expand Down Expand Up @@ -264,14 +273,20 @@ static GList * nautilus_launch_get_file_items (

}

location = nautilus_file_info_get_location(
NAUTILUS_FILE_INFO(iter->data)
);

finfo = g_file_query_info(
nautilus_file_info_get_location(NAUTILUS_FILE_INFO(iter->data)),
location,
G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE,
G_FILE_QUERY_INFO_NONE,
NULL,
NULL
);

g_object_unref(location);

if (!finfo) {

/* Cannot get file attributes */
Expand Down Expand Up @@ -319,7 +334,7 @@ static GList * nautilus_launch_get_file_items (
);

g_object_set_data_full(
(GObject *) menu_item,
G_OBJECT(menu_item),
"nautilus_launch_files",
nautilus_file_info_list_copy(file_selection),
(GDestroyNotify) nautilus_file_info_list_free
Expand Down Expand Up @@ -364,7 +379,7 @@ static void nautilus_launch_register_type (
sizeof(NautilusLaunch),
0,
(GInstanceInitFunc) NULL,
(GTypeValueTable * ) NULL
(GTypeValueTable *) NULL
};

static const GInterfaceInfo menu_provider_iface_info = {
Expand Down

0 comments on commit a90ab75

Please sign in to comment.