So how does your current maintenance diet compare to your old "weight gaining" diet. How many cheeseburgers, etc.. did you have in a week?
Did you eat a lot of food between regular mealtimes? Was something like a cheeseburger your supper or lunch - or was it something extra you had along with your other meals.
Having a cheeseburger once a week will not make you fat. But having a several cheeseburgers, bags of chips, multiple trips to the buffet, large portions, in-between meals between meals, etc... will help in making you fat.
Now obviously, some people are going to pack on the pounds even if they're reasonbly careful, but everyone else earns their inches.
Being human, you will be miserable or ultimately fail if you do not allow yourself to eat certain foods on occasion. And maybe some shouldn't be eaten at all?? But a reasonble size cheeseburger and veggies can make a meal. Sure, the burger is high in fat, but adjust the rest of your day. It would be nice if we could eat what we want - when we want, but in today's society, that's not going to work for most people.
Be honest with yourself and look at what you used to eat on a consistent basis. Then based on that, you should be able to see that occasional cheeseburgers or ice cream sundaes won't ruin everything.
Most people underestimate the size of their meals. ie the amount of energy that the meal provides. Because certain processed foods are not all that filling, or because people eat fast, they can consume way too much energy at one time. Your body keeps a certain amount of quick energy available to keep you going. If you keep these energy supplies stuffed at all times, your body has no other choice but to store the extra as fat.
So have that cheeseburger, and make sure you enjoy every bite. Enjoy every bite as if it was the whole burger. If you're going to eat - enjoy it to the max. We eat so many treats, so often, that treats have become part of our normal eating. They're no longer treats.