Remove KGlobal::locale warning for pure Qt applications
author Albert Astals Cid
()
committer Albert Astals Cid
()
commit 6f710688154d4c9914a62f5265de09bc85e08eac
tree 8401c9cb992f06254b8baa9c21f6fff224c1d21e
parent f529824eae4f44bef19913bc0f2c19077f1d3935
Remove KGlobal::locale warning for pure Qt applications

Pure Qt applications get KDE dialogs through the various KFileDialogQtOverride members, these functions instantiate a KFileDialog that inherits from KDialog so on KFileDialog construction we end up in KDialogPrivate::init that calls KDialog::setButtons that uses KStandardGuiItem::ok() that has a i18n call. Since there is no valid main component at this stage yet once we get to the fileModule() call and it creates a proper main component we will get the KGlobal::locale warning.

By invoking fileModule() before creating the KFileDialog we avoid this issue.

Acked by dfaure

REVIEW: 102188
kio/kfile/kfiledialog.cpp