add test to allow moving only within the same mailbox
authorColin Leroy <colin@colino.net>
Mon, 2 Dec 2002 11:35:24 +0000 (11:35 +0000)
committerColin Leroy <colin@colino.net>
Mon, 2 Dec 2002 11:35:24 +0000 (11:35 +0000)
ChangeLog.claws
configure.in
src/folder.c
src/folder.h
src/folderview.c

index 37167fa7f37df81a284173660864a0c7b98886fb..fc81f43ac49096e2becbab258f711cc99ccdee60 100644 (file)
@@ -1,3 +1,10 @@
+2002-11-30 [colin]     0.8.6claws46
+
+       * src/folder.[ch]
+               Add check to verify a move is within a single mailbox
+       * src/folderview.c
+               Add specific error string for this check
+
 2002-11-30 [colin]     0.8.6claws46
 
        * src/folder.c
index 645d5868e68963bb724a14477ab49365aa441547..b59f184088b8fd42f505a98753f2d771df3448c8 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws46
+EXTRA_VERSION=claws47
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index f96777f428c971d32f4cf1b3ebe9d6d0a685a9d6..28770c6f65c3514385bf015fb6e36e011f0d7a99 100644 (file)
@@ -1615,6 +1615,10 @@ gint folder_item_move_to(FolderItem *src, FolderItem *dest, FolderItem **new_ite
                return F_MOVE_FAILED;
        }
 
+       if (src->folder != dest->folder) {
+               return F_MOVE_FAILED_DEST_OUTSIDE_MAILBOX;
+       }
+
        phys_srcpath = folder_item_get_path(src);
        phys_dstpath = g_strconcat(folder_item_get_path(dest),G_DIR_SEPARATOR_S,g_basename(phys_srcpath),NULL);
 
index 4866ba4b830c0722caa6a94090bf05f93d242b79..a974ffbcfe6b45209bd3bce2303126c9a16ede40 100644 (file)
@@ -101,6 +101,7 @@ typedef enum
        F_MOVE_OK,
        F_MOVE_FAILED_DEST_IS_PARENT,
        F_MOVE_FAILED_DEST_IS_CHILD,
+       F_MOVE_FAILED_DEST_OUTSIDE_MAILBOX,
        F_MOVE_FAILED
 } FolderMoveStatus;
 
index 3bf61ad4c9ad4043ded20fc1b5969414d7db05c5..65bdd2f14cc5c66390fda755b91651ab718b6f7c 100644 (file)
@@ -2605,6 +2605,9 @@ static void folderview_move_to(FolderView *folderview, FolderItem *from_folder,
                case F_MOVE_FAILED_DEST_IS_CHILD:
                        alertpanel_error(_("Can't move a folder to one of its children."));
                        break;
+               case F_MOVE_FAILED_DEST_OUTSIDE_MAILBOX:
+                       alertpanel_error(_("Folder moving cannot be done between different mailboxes."));
+                       break;
                default:
                        alertpanel_error(_("Move failed!"));
                        break;