It is surprising how easily it is to put on weight rapidly when you quit smoking. When I quit smoking years ago, I had also started an intensive body building program, so I had a double whammy when it came to weight gain. Luckily, as I was able to offset any negative gains due to the weight training and the physical job I had at the time.
Saying this, once I had a more sedentary job, I found that maintaining the type of food I ate, along with the quantity made me gain quite a few excess kilos. Shedding these was a matter of modifying the poor eating habits I had got into.
Anyway, to cut the story short, exercise is a good way to help take your mind of not smoking, as well as keep off any excess weight you may gain, but if you are not exercising, then you will have to watch your diet more closely.