summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <tsdgeos@terra.es>2011-08-07 09:29:53 (GMT)
committerAlbert Astals Cid <tsdgeos@terra.es>2011-08-07 09:33:35 (GMT)
commit6f710688154d4c9914a62f5265de09bc85e08eac (patch)
tree8401c9cb992f06254b8baa9c21f6fff224c1d21e
parentf529824eae4f44bef19913bc0f2c19077f1d3935 (diff)
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
-rw-r--r--kio/kfile/kfiledialog.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/kio/kfile/kfiledialog.cpp b/kio/kfile/kfiledialog.cpp
index 4195a68..c7ecfb5 100644
--- a/kio/kfile/kfiledialog.cpp
+++ b/kio/kfile/kfiledialog.cpp
@@ -1175,6 +1175,7 @@ public:
return QFileDialog::getExistingDirectory(parent, caption, dir, options);
}
+ fileModule(); // make sure i18n is initialized properly, needed for pure Qt applications
KUrl url(KFileDialog::getExistingDirectory(KUrl(dir), parent, caption));
if(url.isLocalFile())
@@ -1193,6 +1194,7 @@ public:
return QFileDialog::getOpenFileName(parent, caption, dir, filter, selectedFilter, options);
}
+ fileModule(); // make sure i18n is initialized properly, needed for pure Qt applications
KFileDialog dlg(KUrl(dir), qt2KdeFilter(filter), parent);
dlg.setOperationMode(KFileDialog::Opening);
@@ -1218,6 +1220,7 @@ public:
return QFileDialog::getOpenFileNames(parent, caption, dir, filter, selectedFilter, options);
}
+ fileModule(); // make sure i18n is initialized properly, needed for pure Qt applications
KFileDialog dlg(KUrl(dir), qt2KdeFilter(filter), parent);
dlg.setOperationMode(KFileDialog::Opening);
@@ -1243,6 +1246,7 @@ public:
return QFileDialog::getSaveFileName(parent, caption, dir, filter, selectedFilter, options);
}
+ fileModule(); // make sure i18n is initialized properly, needed for pure Qt applications
KFileDialog dlg(KUrl(dir), qt2KdeFilter(filter), parent);
dlg.setOperationMode(KFileDialog::Saving);