forwarded 413586 Damian Pietras <[EMAIL PROTECTED]>
thanks
Hi Damian,
what do you think of that idea? Should it go into 2.5.0?
Thanks
On Tue, 06 Mar 2007 the mental interface of
Filippo Giunchedi told:
> Package: moc
> Version: 2.4.1-1
> Severity: wishlist
> Tags: patch
>
> Hi,
> the attached patch modifies add_file_plist() to call add_dir_plist() if
> the current item is a directory.
> Rationale: suppose I'm browsing through directories, if I press 'a' to
> add a file/directory, I know wheter is it a file or a directory thus
> there's no point in having a distinct command. Moreover a directory can
> be seen as a "file of files" :)
>
> thanks,
> filippo
> --- moc-2.4.1.orig/interface.c 2006-08-30 21:39:09.000000000 +0200
> +++ moc-2.4.1/interface.c 2007-03-05 23:45:57.784937752 +0100
> @@ -1627,67 +1627,6 @@
> set_mixer (get_mixer_value() + diff);
> }
>
> -/* Add the currently selected file to the playlist. */
> -static void add_file_plist ()
> -{
> - char *file;
> -
> - if (iface_in_plist_menu()) {
> - error ("Can't add to the playlist a file from the "
> - "playlist.");
> - return;
> - }
> -
> - if (iface_curritem_get_type() == F_DIR) {
> - error ("This is a directory.");
> - return;
> - }
> -
> - file = iface_get_curr_file ();
> -
> - if (!file)
> - return;
> -
> - if (iface_curritem_get_type() != F_SOUND) {
> - error ("You can only add a file using this command.");
> - free (file);
> - return;
> - }
> -
> -
> - if (plist_find_fname(playlist, file) == -1) {
> - struct plist_item *item = &dir_plist->items[
> - plist_find_fname(dir_plist, file)];
> -
> - send_int_to_srv (CMD_LOCK);
> -
> - if (options_get_int("SyncPlaylist")) {
> - send_int_to_srv (CMD_CLI_PLIST_ADD);
> - send_item_to_srv (item);
> - }
> - else {
> - int added;
> -
> - added = plist_add_from_item (playlist, item);
> - iface_add_to_plist (playlist, added);
> - }
> -
> - /* Add to the server's playlist if the server has our
> - * playlist */
> - if (get_server_plist_serial() == plist_get_serial(playlist)) {
> - send_int_to_srv (CMD_LIST_ADD);
> - send_str_to_srv (file);
> - }
> - send_int_to_srv (CMD_UNLOCK);
> - }
> - else
> - error ("The file is already on the playlist.");
> -
> - iface_menu_key (KEY_CMD_MENU_DOWN);
> -
> - free (file);
> -}
> -
> /* Recursively add the content of a directory to the playlist. */
> static void add_dir_plist ()
> {
> @@ -1763,6 +1702,67 @@
> free (file);
> }
>
> +/* Add the currently selected file to the playlist. */
> +static void add_file_plist ()
> +{
> + char *file;
> +
> + if (iface_in_plist_menu()) {
> + error ("Can't add to the playlist a file from the "
> + "playlist.");
> + return;
> + }
> +
> + if (iface_curritem_get_type() == F_DIR) {
> + add_dir_plist();
> + return;
> + }
> +
> + file = iface_get_curr_file ();
> +
> + if (!file)
> + return;
> +
> + if (iface_curritem_get_type() != F_SOUND) {
> + error ("You can only add a file using this command.");
> + free (file);
> + return;
> + }
> +
> +
> + if (plist_find_fname(playlist, file) == -1) {
> + struct plist_item *item = &dir_plist->items[
> + plist_find_fname(dir_plist, file)];
> +
> + send_int_to_srv (CMD_LOCK);
> +
> + if (options_get_int("SyncPlaylist")) {
> + send_int_to_srv (CMD_CLI_PLIST_ADD);
> + send_item_to_srv (item);
> + }
> + else {
> + int added;
> +
> + added = plist_add_from_item (playlist, item);
> + iface_add_to_plist (playlist, added);
> + }
> +
> + /* Add to the server's playlist if the server has our
> + * playlist */
> + if (get_server_plist_serial() == plist_get_serial(playlist)) {
> + send_int_to_srv (CMD_LIST_ADD);
> + send_str_to_srv (file);
> + }
> + send_int_to_srv (CMD_UNLOCK);
> + }
> + else
> + error ("The file is already on the playlist.");
> +
> + iface_menu_key (KEY_CMD_MENU_DOWN);
> +
> + free (file);
> +}
> +
> static void toggle_option (const char *name)
> {
> send_int_to_srv (CMD_SET_OPTION);
--
We all know Linux is great... it does infinite loops in 5 seconds.
-- Linus Torvalds
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]