Merge lp:~alexwolf/stellarium/qfiledialog-workaround into lp:stellarium

Proposed by Alexander Wolf
Status: Merged
Approved by: treaves
Approved revision: 4919
Merged at revision: 4967
Proposed branch: lp:~alexwolf/stellarium/qfiledialog-workaround
Merge into: lp:stellarium
Diff against target: 35 lines (+12/-2)
2 files modified
src/gui/AddRemoveLandscapesDialog.cpp (+6/-1)
src/gui/ConfigurationDialog.cpp (+6/-1)
To merge this branch: bzr merge lp:~alexwolf/stellarium/qfiledialog-workaround
Reviewer Review Type Date Requested Status
treaves Approve
Review via email: mp+68250@code.launchpad.net

Description of the change

I'm write work-around patch for temporary fixes of report #812008

Description of the bug in Qt - http://bugreports.qt.nokia.com/browse/QTBUG-16722

To post a comment you must log in.
4918. By Alexander Wolf

Add comments and use ifdef

4919. By Alexander Wolf

fix mistakes

Revision history for this message
treaves (treaves) wrote :

How do we insure this is reverted once the Qt bug is fixed?

Revision history for this message
treaves (treaves) wrote :

Looks good.

review: Approve
Revision history for this message
Alexander Wolf (alexwolf) wrote :

Only via check Qt bug status

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/gui/AddRemoveLandscapesDialog.cpp'
2--- src/gui/AddRemoveLandscapesDialog.cpp 2011-01-30 15:56:36 +0000
3+++ src/gui/AddRemoveLandscapesDialog.cpp 2011-09-25 12:42:20 +0000
4@@ -113,7 +113,12 @@
5 // TRANSLATORS: This string is displayed in the "Files of type:" drop-down list in the standard file selection dialog.
6 QString filter = q_("ZIP archives");
7 filter += " (*.zip)";
8- QString sourceArchivePath = QFileDialog::getOpenFileName(NULL, caption, lastUsedDirectoryPath, filter);
9+ #ifdef Q_OS_MAC
10+ //work-around for Qt bug - http://bugreports.qt.nokia.com/browse/QTBUG-16722
11+ QString sourceArchivePath = QFileDialog::getOpenFileName(NULL, caption, lastUsedDirectoryPath, filter, 0, QFileDialog::DontUseNativeDialog);
12+ #else
13+ QString sourceArchivePath = QFileDialog::getOpenFileName(NULL, caption, lastUsedDirectoryPath, filter);
14+ #endif
15 bool useLandscape = ui->checkBoxUseLandscape->isChecked();
16 if (!sourceArchivePath.isEmpty() && QFile::exists(sourceArchivePath))
17 {
18
19=== modified file 'src/gui/ConfigurationDialog.cpp'
20--- src/gui/ConfigurationDialog.cpp 2011-07-17 17:26:01 +0000
21+++ src/gui/ConfigurationDialog.cpp 2011-09-25 12:42:20 +0000
22@@ -292,7 +292,12 @@
23 void ConfigurationDialog::browseForScreenshotDir()
24 {
25 QString oldScreenshorDir = StelFileMgr::getScreenshotDir();
26- QString newScreenshotDir = QFileDialog::getExistingDirectory(NULL, q_("Select screenshot directory"), oldScreenshorDir, QFileDialog::ShowDirsOnly);
27+ #ifdef Q_OS_MAC
28+ //work-around for Qt bug - http://bugreports.qt.nokia.com/browse/QTBUG-16722
29+ QString newScreenshotDir = QFileDialog::getExistingDirectory(NULL, q_("Select screenshot directory"), oldScreenshorDir, QFileDialog::DontUseNativeDialog);
30+ #else
31+ QString newScreenshotDir = QFileDialog::getExistingDirectory(NULL, q_("Select screenshot directory"), oldScreenshorDir, QFileDialog::ShowDirsOnly);
32+ #endif
33
34 if (!newScreenshotDir.isEmpty()) {
35 // remove trailing slash