diff options
author | Titta Heikkala <EXT-Titta.2.Heikkala@nokia.com> | 2010-11-18 09:34:13 (GMT) |
---|---|---|
committer | Janne Koskinen <janne.p.koskinen@digia.com> | 2010-11-18 09:54:56 (GMT) |
commit | 518b284673d66ed4a2961a88646ec012cedc96bd (patch) | |
tree | b4e258158a66b865faad73dbcc4d50a4c8ab4b9b /src/gui/dialogs | |
parent | fd7c4c07c20eaff247be33826ae0af099c178494 (diff) | |
download | Qt-518b284673d66ed4a2961a88646ec012cedc96bd.zip Qt-518b284673d66ed4a2961a88646ec012cedc96bd.tar.gz Qt-518b284673d66ed4a2961a88646ec012cedc96bd.tar.bz2 |
Removed extra cpp and done changes based on comments
qcolordialog_symbian.cpp is removed from dialogs.pri and string
comparison corrected based on comments.
Task-number: QT-3917
Reviewed-by: Janne Koskinen
Merge-request: 918
Reviewed-by: Janne Koskinen
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r-- | src/gui/dialogs/dialogs.pri | 3 | ||||
-rw-r--r-- | src/gui/dialogs/qfiledialog.cpp | 9 | ||||
-rw-r--r-- | src/gui/dialogs/qfiledialog_symbian.cpp | 22 |
3 files changed, 14 insertions, 20 deletions
diff --git a/src/gui/dialogs/dialogs.pri b/src/gui/dialogs/dialogs.pri index 483e9aa..c7cb794 100644 --- a/src/gui/dialogs/dialogs.pri +++ b/src/gui/dialogs/dialogs.pri @@ -114,8 +114,7 @@ contains(QT_CONFIG, s60) { -lplatformenv \ -lefsrv \ -lgdi - SOURCES += dialogs/qfiledialog_symbian.cpp \ - dialogs/qcolordialog_symbian.cpp + SOURCES += dialogs/qfiledialog_symbian.cpp } FORMS += dialogs/qpagesetupwidget.ui diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 0b789cc..1db9789 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -1696,9 +1696,8 @@ QString QFileDialog::getOpenFileName(QWidget *parent, if (qt_filedialog_open_filename_hook && !(options & DontUseNativeDialog)) return qt_filedialog_open_filename_hook(parent, caption, dir, filter, selectedFilter, options); #if defined(Q_WS_S60) - if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 && !(options & DontUseNativeDialog)) { + if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 && !(options & DontUseNativeDialog)) return qtSymbianGetOpenFileName(caption, dir, filter); - } #endif QFileDialogArgs args; args.parent = parent; @@ -1789,9 +1788,8 @@ QStringList QFileDialog::getOpenFileNames(QWidget *parent, if (qt_filedialog_open_filenames_hook && !(options & DontUseNativeDialog)) return qt_filedialog_open_filenames_hook(parent, caption, dir, filter, selectedFilter, options); #if defined(Q_WS_S60) - if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 && !(options & DontUseNativeDialog)) { + if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 && !(options & DontUseNativeDialog)) return qtSymbianGetOpenFileNames(caption, dir, filter); - } #endif QFileDialogArgs args; args.parent = parent; @@ -1884,9 +1882,8 @@ QString QFileDialog::getSaveFileName(QWidget *parent, if (qt_filedialog_save_filename_hook && !(options & DontUseNativeDialog)) return qt_filedialog_save_filename_hook(parent, caption, dir, filter, selectedFilter, options); #if defined(Q_WS_S60) - if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 && !(options & DontUseNativeDialog)) { + if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 && !(options & DontUseNativeDialog)) return qtSymbianGetSaveFileName(caption, dir); - } #endif QFileDialogArgs args; args.parent = parent; diff --git a/src/gui/dialogs/qfiledialog_symbian.cpp b/src/gui/dialogs/qfiledialog_symbian.cpp index bd937a1..0277e1c 100644 --- a/src/gui/dialogs/qfiledialog_symbian.cpp +++ b/src/gui/dialogs/qfiledialog_symbian.cpp @@ -62,24 +62,23 @@ public: void setFilter(const QString filter) { filterList.clear(); - if (filter.left(2) == "*.") { + if (filter.left(2) == QLatin1String("*.")) { //Filter has only extensions filterList << filter.split(" "); return; - } - else { + } else { //Extensions are in parenthesis and there may be several filters - QStringList separatedFilters(filter.split(";;")); + QStringList separatedFilters(filter.split(QLatin1String(";;"))); for (int i = 0; i < separatedFilters.size(); i++) { - if (separatedFilters.at(i) == QFileDialog::tr("All Files (*)")){ - filterList << QFileDialog::tr("All Files (*)"); + if (separatedFilters.at(i).contains(QLatin1String("(*)"))) { + filterList << QLatin1String("(*)"); return; } } QRegExp rx("\\(([^\\)]*)\\)"); int pos = 0; while ((pos = rx.indexIn(filter, pos)) != -1) { - filterList << rx.cap(1).split(" "); + filterList << rx.cap(1).split(QLatin1String(" ")); pos += rx.matchedLength(); } } @@ -94,7 +93,7 @@ public: //No filter for files, all can be accepted return ETrue; } - if (filterList == QStringList(QFileDialog::tr("All Files (*)"))) { + if (filterList == QStringList(QLatin1String("(*)"))) { return ETrue; } for (int i = 0; i < filterList.size(); ++i) { @@ -142,11 +141,11 @@ static QString launchSymbianDialog(const QString dialogCaption, const QString st startFolder, NULL, NULL, titlePtr, extensionFilter); CleanupStack::Pop(extensionFilter); } - else if (dialogMode == DialogSave){ + else if (dialogMode == DialogSave) { select = AknCommonDialogsDynMem::RunSaveDlgLD(types, target, startFolder, NULL, NULL, titlePtr); } - else if (dialogMode == DialogFolder){ + else if (dialogMode == DialogFolder) { select = AknCommonDialogsDynMem::RunFolderSelectDlgLD(types, target, startFolder, 0, 0, titlePtr, NULL, NULL); } @@ -189,8 +188,7 @@ QString qtSymbianGetExistingDirectory(const QString &caption, QString folderCaption; if (!caption.isEmpty()) { folderCaption.append(caption); - } - else { + } else { // Title for folder selection dialog is mandatory folderCaption.append(QFileDialog::tr("Find Directory")); } |