Small code re-ordering for readability.
Use Q_NULLPTR
Fix a case where saving wouldn't work anymore after creating a task.

It was due to re-entrancy of editTask(nullptr) being called by requestContextMenu()