summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs/qfiledialog_symbian.cpp
diff options
context:
space:
mode:
authorTitta Heikkala <EXT-Titta.2.Heikkala@nokia.com>2010-11-19 07:47:55 (GMT)
committerJanne Koskinen <janne.p.koskinen@digia.com>2010-11-19 10:30:16 (GMT)
commit00e99440596d8bf648aefdfbb00e80004e328033 (patch)
tree047e8c750d7ea2928f0e57a7f9e90da31e8aae79 /src/gui/dialogs/qfiledialog_symbian.cpp
parent4e73e8b530f77bf1f43042fb07038eb51cb0238f (diff)
downloadQt-00e99440596d8bf648aefdfbb00e80004e328033.zip
Qt-00e99440596d8bf648aefdfbb00e80004e328033.tar.gz
Qt-00e99440596d8bf648aefdfbb00e80004e328033.tar.bz2
Corrected ASCII comparison and removed extra braces
Corrected ASCII comparison and removed extra braces based on comments Task-number: QT-3917 Reviewed-by: Janne Koskinen Merge-request: 918 Reviewed-by: Janne Koskinen
Diffstat (limited to 'src/gui/dialogs/qfiledialog_symbian.cpp')
-rw-r--r--src/gui/dialogs/qfiledialog_symbian.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/src/gui/dialogs/qfiledialog_symbian.cpp b/src/gui/dialogs/qfiledialog_symbian.cpp
index 0277e1c..1f70305 100644
--- a/src/gui/dialogs/qfiledialog_symbian.cpp
+++ b/src/gui/dialogs/qfiledialog_symbian.cpp
@@ -86,26 +86,25 @@ public:
TBool Accept(const TDesC &/*aDriveAndPath*/, const TEntry &aEntry) const
{
- if (aEntry.IsDir()) {
+ if (aEntry.IsDir())
return ETrue;
- }
- if (filterList.isEmpty()) {
- //No filter for files, all can be accepted
+
+ //If no filter for files, all can be accepted
+ if (filterList.isEmpty())
return ETrue;
- }
- if (filterList == QStringList(QLatin1String("(*)"))) {
+
+ if (filterList == QStringList(QLatin1String("(*)")))
return ETrue;
- }
+
for (int i = 0; i < filterList.size(); ++i) {
QString extension = filterList.at(i);
//remove '*' from the beginning of the extension
- if (extension.left(1) == "*"){
- extension = extension.right(extension.size() - 1);
- }
+ if (extension.at(0) == QLatin1Char('*'))
+ extension = extension.mid(1);
+
QString fileName = qt_TDesC2QString(aEntry.iName);
- if (fileName.right(extension.size()) == extension) {
+ if (fileName.endsWith(extension))
return ETrue;
- }
}
return EFalse;
}
@@ -140,18 +139,15 @@ static QString launchSymbianDialog(const QString dialogCaption, const QString st
select = AknCommonDialogsDynMem::RunSelectDlgLD(types, target,
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);
}
- if (select) {
+ if (select)
selection.append(qt_TDesC2QString(target));
- }
);
#endif
return selection;