add create directory support

Well, I think its logic is pretty simple here. If I use STL containers here, I prefer to ``std::find_if``. However QT-container doesn't play well with STL-stuff and I don't know the alternative methods for QT. I will put them in one static function to reduce the duplicated code.