201037
authorhgs
Wed, 29 Sep 2010 10:37:03 +0800
changeset 46 d58987eac7e8
parent 37 15bc28c9dd51
201037
filemanager/examples/demo_fmfiledialog/demo_fmfiledialog.iby
filemanager/examples/demo_fmfiledialog/demo_fmfiledialog.pro
filemanager/examples/demo_fmfiledialog/main.cpp
filemanager/examples/demo_fmfiledialog/mainwindow.cpp
filemanager/examples/demo_fmfiledialog/mainwindow.h
filemanager/examples/demo_fmfiledialog/rom.pri
filemanager/examples/examples.pro
filemanager/filemanager.pro
filemanager/filemanager_plat/inc/fmfiledialog.h
filemanager/rom/bld.inf
filemanager/rom/rom.pri
filemanager/src/filemanager/burconfig.xml
filemanager/src/filemanager/filemanager.pro
filemanager/src/filemanager/resources/hblistviewitem.css
filemanager/src/filemanager/src/backuprestore/fmbackupconfigloader.cpp
filemanager/src/filemanager/src/backuprestore/fmbackupview.cpp
filemanager/src/filemanager/src/backuprestore/fmbackupviewitem.cpp
filemanager/src/filemanager/src/backuprestore/fmbackupviewitem.h
filemanager/src/filemanager/src/backuprestore/fmdeletebackupview.h
filemanager/src/filemanager/src/backuprestore/fmdeletebackupwidget.cpp
filemanager/src/filemanager/src/backuprestore/fmdeletebackupwidget.h
filemanager/src/filemanager/src/backuprestore/fmrestoreview.cpp
filemanager/src/filemanager/src/backuprestore/fmrestoreview.h
filemanager/src/filemanager/src/backuprestore/fmrestoreviewitem.h
filemanager/src/filemanager/src/backuprestore/fmrestorewidget.h
filemanager/src/filemanager/src/components/fmcombinedquery.h
filemanager/src/filemanager/src/components/fmdialog.h
filemanager/src/filemanager/src/components/fmdlgutils.cpp
filemanager/src/filemanager/src/components/fmdlgutils.h
filemanager/src/filemanager/src/components/fmdrivedetailstype.cpp
filemanager/src/filemanager/src/components/fmdrivedetailstype.h
filemanager/src/filemanager/src/components/fmdrivequery.h
filemanager/src/filemanager/src/components/fmmessagebox.cpp
filemanager/src/filemanager/src/components/fmmessagebox.h
filemanager/src/filemanager/src/components/fmmultitextquery.h
filemanager/src/filemanager/src/components/fmviewdetailsdialog.cpp
filemanager/src/filemanager/src/components/fmviewdetailsdialog.h
filemanager/src/filemanager/src/components/fmviewdetailsitem.h
filemanager/src/filemanager/src/fmdriverlistwidget.cpp
filemanager/src/filemanager/src/fmdriverlistwidget.h
filemanager/src/filemanager/src/fmdriverview.cpp
filemanager/src/filemanager/src/fmdriverview.h
filemanager/src/filemanager/src/fmfilebrowsewidget.cpp
filemanager/src/filemanager/src/fmfilebrowsewidget.h
filemanager/src/filemanager/src/fmfileview.cpp
filemanager/src/filemanager/src/fmfileview.h
filemanager/src/filemanager/src/fmfindresultmodel.cpp
filemanager/src/filemanager/src/fmfindresultmodel.h
filemanager/src/filemanager/src/fmfindthread.cpp
filemanager/src/filemanager/src/fmfindthread.h
filemanager/src/filemanager/src/fmfindview.cpp
filemanager/src/filemanager/src/fmfindview.h
filemanager/src/filemanager/src/fmfindwidget.cpp
filemanager/src/filemanager/src/fmfindwidget.h
filemanager/src/filemanager/src/fmmainwindow.cpp
filemanager/src/filemanager/src/fmmainwindow.h
filemanager/src/filemanager/src/fmsplitview.cpp
filemanager/src/filemanager/src/fmviewbase.cpp
filemanager/src/filemanager/src/fmviewbase.h
filemanager/src/filemanager/src/fmviewmanager.cpp
filemanager/src/filemanager/src/fmviewmanager.h
filemanager/src/filemanager/src/operationservice/fmoperationcopyormove.cpp
filemanager/src/filemanager/src/operationservice/fmoperationformat.h
filemanager/src/filemanager/src/operationservice/fmoperationformat_s60.cpp
filemanager/src/filemanager/src/operationservice/fmoperationremove.cpp
filemanager/src/filemanager/src/operationservice/fmoperationresultprocesser.cpp
filemanager/src/filemanager/src/operationservice/fmoperationservice.cpp
filemanager/src/fmbkupengine/group/fmbkupengine.mmp
filemanager/src/fmbkupengine/src/MMCScBkupSBEUtils.cpp
filemanager/src/fmbkupenginewrapper/fmbkupenginewrapper.pro
filemanager/src/fmbkupenginewrapper/inc/fmbkupengine.h
filemanager/src/fmbkupenginewrapper/private/symbian/fmbkupengine_p.h
filemanager/src/fmbkupenginewrapper/private/win32/fmbkupengine_p.cpp
filemanager/src/fmbkupenginewrapper/src/fmbackupsettings.cpp
filemanager/src/fmbkupenginewrapper/src/fmbkupengine.cpp
filemanager/src/fmbkupenginewrapper/src/fmrestoresettings.cpp
filemanager/src/fmfiledialog/fmfiledialog.pro
filemanager/src/fmfiledialog/src/fmfiledialog.cpp
filemanager/src/fmfiledialog/src/fmfiledialog_p.cpp
filemanager/src/fmfiledialog/src/fmfiledialog_p.h
filemanager/src/fmfiledialog/src/fmfilewidget.cpp
filemanager/src/fmfiledialog/src/fmfilewidget.h
filemanager/src/inc/commonutils.pri
filemanager/src/inc/fmdefine.h
filemanager/src/inc/fmfilesystemproxymodel.cpp
filemanager/src/inc/fmfilesystemproxymodel.h
filemanager/src/inc/fmfiletyperecognizer.cpp
filemanager/src/inc/fmserviceutils/fmserviceutils.cpp
filemanager/src/inc/fmserviceutils/fmserviceutils.h
filemanager/src/inc/fmserviceutils/private/symbian/fmserviceutilshandler.cpp
filemanager/src/inc/fmserviceutils/private/symbian/fmserviceutilshandler.h
filemanager/src/inc/fmserviceutils/private/symbian/fmserviceutilsprivate.cpp
filemanager/src/inc/fmserviceutils/private/symbian/fmserviceutilsprivate.h
filemanager/src/inc/fmserviceutils/private/win32/fmserviceutilsprivate.cpp
filemanager/src/inc/fmserviceutils/private/win32/fmserviceutilsprivate.h
filemanager/src/inc/fmutils.cpp
filemanager/src/inc/fmutils.h
filemanager/src/inc/fmutils_s60.cpp
filemanager/src/inc/fmutils_win.cpp
filemanager/tsrc/tsrc.pro
filemanager/tsrc/unit/unit_backuprestoresettings/runtest.bat
filemanager/tsrc/unit/unit_backuprestoresettings/unit_backuprestoresettings.pro
filemanager/tsrc/unit/ut_common.pri
filemanager/tsrc/unit/ut_fmfiletypeprovider/src/ut_fmfiletypeprovider.cpp
filemanager/tsrc/unit/ut_fmfiletypeprovider/ut_fmfiletypeprovider.pro
filemanager/tsrc/unit/ut_fmfiletyperecognizer/data/Flash.swf
filemanager/tsrc/unit/ut_fmfiletyperecognizer/data/Install.sisx
filemanager/tsrc/unit/ut_fmfiletyperecognizer/data/Java.jar
filemanager/tsrc/unit/ut_fmfiletyperecognizer/data/Tone.wav
filemanager/tsrc/unit/ut_fmfiletyperecognizer/data/Video.rm
filemanager/tsrc/unit/ut_fmfiletyperecognizer/data/image.jpg
filemanager/tsrc/unit/ut_fmfiletyperecognizer/src/ut_fmfiletyperecognizer.cpp
filemanager/tsrc/unit/ut_fmfiletyperecognizer/ut_fmfiletyperecognizer.pro
filemanager/tsrc/unit/ut_fminternaldrivermodel/runtest.bat
filemanager/tsrc/unit/ut_fminternaldrivermodel/src/testclassdatafmdrivelistprovider.h
filemanager/tsrc/unit/ut_fminternaldrivermodel/src/ut_fminternaldrivemodel.cpp
filemanager/tsrc/unit/ut_fminternaldrivermodel/src/ut_fminternaldrivemodel.h
filemanager/tsrc/unit/ut_fminternaldrivermodel/ut_fminternaldrivermodel.pro
filemanager/tsrc/unit/ut_fminternalfmutils/data/Image.jpg
filemanager/tsrc/unit/ut_fminternalfmutils/data/Imageformove.jpg
filemanager/tsrc/unit/ut_fminternalfmutils/data/Tone.mp3
filemanager/tsrc/unit/ut_fminternalfmutils/data/unknow.unknow
filemanager/tsrc/unit/ut_fminternalfmutils/runtest.bat
filemanager/tsrc/unit/ut_fminternalfmutils/src/ut_fminternalfmutils.cpp
filemanager/tsrc/unit/ut_fminternalfmutils/src/ut_fminternalfmutils.h
filemanager/tsrc/unit/ut_fminternalfmutils/ut_fminternalfmutils.pro
layers.sysdef.xml
package_definition.xml
package_map.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/examples/demo_fmfiledialog/demo_fmfiledialog.iby	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef __FMFILEDIALOG_IBY__
+#define __FMFILEDIALOG_IBY__
+
+#include <bldprivate.hrh>
+
+#define HB_UPGRADABLE_APP_REG_RSC(NAME) data=DATAZ_\PRIVATE\10003A3F\IMPORT\APPS\ ## NAME ## _reg.rsc        Private\10003a3f\import\apps\ ## NAME ## _reg.rsc
+
+file=ABI_DIR\BUILD_DIR\demo_fmfiledialog.exe                   SHARED_LIB_DIR\demo_fmfiledialog.exe
+HB_UPGRADABLE_APP_REG_RSC(demo_fmfiledialog)
+S60_APP_RESOURCE(demo_fmfiledialog)
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/examples/demo_fmfiledialog/demo_fmfiledialog.pro	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,34 @@
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+# 
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+# 
+# Contributors:
+#     
+# 
+# Description:
+#     
+# 
+
+CONFIG      += hb
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+INCLUDEPATH += .
+symbian {
+    include(rom.pri)
+}
+
+# Input
+HEADERS += mainwindow.h
+SOURCES += main.cpp mainwindow.cpp
+
+LIBS += -lfmfiledialog
+
+
+symbian:MMP_RULES += SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/examples/demo_fmfiledialog/main.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*     
+* 
+* Description:
+*     
+*
+*/
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+
+#include "mainwindow.h"
+int main( int argc, char *argv[] )
+{
+    HbApplication app( argc, argv );
+    app.setApplicationName( "filemanager" );
+
+    TestMainWindow *mainWindow = new TestMainWindow;
+    mainWindow->init();
+    mainWindow->show();
+    
+   
+    return app.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/examples/demo_fmfiledialog/mainwindow.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,193 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*     
+* 
+* Description:
+*     
+*
+*/
+
+#include "mainwindow.h"
+#include "fmfiledialog.h"
+#include "hbmessagebox.h"
+
+#define getDir "getExistingDirectory"
+#define getFile "getOpenFileName"
+#define saveFile "getSaveFileName"
+
+#define getDir_SetDir "getExistingDirectory_setDir"
+#define getFile_SetDir "getOpenFileName_setDir"
+#define saveFile_SetDir "getSaveFileName_setDir"
+
+#define getDir_SetFilter "getExistingDirectory_setFilter"
+#define getDir_SetFilter_AllDirs "getExistingDirectory_setFilter_AllDirs"
+#define getFile_SetFilter "getOpenFileName_setFilter"
+#define saveFile_SetFilter "getSaveFileName_setFilter"
+
+TestMainWindow::TestMainWindow()
+{
+}
+TestMainWindow::~TestMainWindow()
+{
+}
+
+void TestMainWindow::init()
+{
+    HbView *mainView = new HbView;
+    addView( mainView );
+
+    HbListWidget *listWidget = new HbListWidget( mainView );
+    mainView->setWidget( listWidget );
+
+    listWidget->addItem( getDir );
+    listWidget->addItem( getFile );
+    listWidget->addItem( saveFile );
+    listWidget->addItem( " " );
+    listWidget->addItem( getDir_SetDir );
+    listWidget->addItem( getFile_SetDir );
+    listWidget->addItem( saveFile_SetDir );
+    listWidget->addItem( " " );
+    listWidget->addItem( getDir_SetFilter );
+    listWidget->addItem( getDir_SetFilter_AllDirs );
+    listWidget->addItem( getFile_SetFilter );
+    listWidget->addItem( saveFile_SetFilter );
+    listWidget->addItem( " " );
+    listWidget->addItem( "placeHolderA" );
+    listWidget->addItem( "placeHolderB" );
+    listWidget->addItem( "placeHolderC" );
+    listWidget->addItem( "placeHolderD" );
+    listWidget->addItem( "placeHolderE" );
+    listWidget->addItem( "placeHolderF" );
+    listWidget->addItem( "placeHolderG" );
+    listWidget->addItem( "placeHolderH" );
+    listWidget->addItem( "placeHolderI" );
+    listWidget->addItem( "placeHolderJ" );
+    listWidget->addItem( "placeHolderK" );
+    listWidget->addItem( "placeHolderL" );
+    listWidget->addItem( "placeHolderM" );
+    listWidget->addItem( "placeHolderN" );
+    listWidget->addItem( "placeHolderO" );
+    listWidget->addItem( "placeHolderP" );
+    listWidget->addItem( "placeHolderQ" );
+    listWidget->addItem( "placeHolderR" );
+    listWidget->addItem( "placeHolderS" );
+    listWidget->addItem( "placeHolderT" );
+    listWidget->addItem( "placeHolderU" );
+    listWidget->addItem( "placeHolderV" );
+    listWidget->addItem( "placeHolderW" );
+    listWidget->addItem( "placeHolderX" );
+    listWidget->addItem( "placeHolderY" );
+    listWidget->addItem( "placeHolderZ" );
+
+    connect(listWidget, SIGNAL(activated(HbListWidgetItem*)), this,SLOT(activatedListItem(HbListWidgetItem*)) );
+}
+
+void TestMainWindow::activatedListItem(HbListWidgetItem *item)
+{
+    if( item->text().compare( getDir ) == 0 ) {
+        getExistingDirectory();
+    } else if( item->text().compare( getFile ) == 0 ) {
+        getOpenFileName();
+    } else if( item->text().compare( saveFile ) == 0 ) {
+       getSaveFileName();
+    } else if( item->text().compare( getDir_SetDir ) == 0 ) {
+        getExistingDirectory_SetDir();
+    } else if( item->text().compare( getFile_SetDir ) == 0 ) {
+       getOpenFileName_SetDir();
+    } else if( item->text().compare( saveFile_SetDir ) == 0 ) {
+        getSaveFileName_SetDir();
+    } else if( item->text().compare( getDir_SetFilter ) == 0 ) {
+        getExistingDirectory_SetFilter();
+    } else if( item->text().compare( getDir_SetFilter_AllDirs ) == 0 ) {
+        getExistingDirectory_SetFilter_AllDirs();
+    } else if( item->text().compare( getFile_SetFilter ) == 0 ) {
+        getOpenFileName_SetFilter();
+    } else if( item->text().compare( saveFile_SetFilter ) == 0 ) {
+       getSaveFileName_SetFilter();
+    }
+}
+
+void TestMainWindow::getExistingDirectory()
+{
+    // getExistingDirectory with default parameter.
+    QString path = FmFileDialog::getExistingDirectory();
+    HbMessageBox::information( path );
+}
+void TestMainWindow::getOpenFileName()
+{
+    // getOpenFileName with default parameter.
+    QString path = FmFileDialog::getOpenFileName();
+    HbMessageBox::information( path );
+}
+void TestMainWindow::getSaveFileName()
+{
+    // getSaveFileName with default parameter.
+    QString path = FmFileDialog::getSaveFileName();
+    HbMessageBox::information( path );
+}
+
+void TestMainWindow::getExistingDirectory_SetDir()
+{
+    // getExistingDirectory and set header & default Directory
+    QString path = FmFileDialog::getExistingDirectory( 0, "Look in:", "C:/Data/Images" );
+    HbMessageBox::information( path );
+}
+void TestMainWindow::getOpenFileName_SetDir()
+{
+    // getOpenFileName and set header & default Directory
+    QString path = FmFileDialog::getOpenFileName( 0, "Look in:", "C:/Data/Images" );
+    HbMessageBox::information( path );
+}
+void TestMainWindow::getSaveFileName_SetDir()
+{
+    // getSaveFileName and set header & default Directory
+    QString path = FmFileDialog::getSaveFileName( 0, "Look in:", "C:/Data/Images" );
+    HbMessageBox::information( path );
+}
+
+void TestMainWindow::getExistingDirectory_SetFilter()
+{
+    // getExistingDirectory and set folder&file filter
+    QStringList filterList;
+    filterList<<"*data*"<<"*image*"<<"*sound*";
+    QString path = FmFileDialog::getExistingDirectory( 0, "Look in:", "", filterList );
+    HbMessageBox::information( path );
+}
+
+void TestMainWindow::getExistingDirectory_SetFilter_AllDirs()
+{
+    // getExistingDirectory and set folder&file filter
+    QStringList filterList;
+    filterList<<"*data*"<<"*image*"<<"*sound*";
+    QString path = FmFileDialog::getExistingDirectory( 0, "Look in:", "", filterList, FmFileDialog::DisplayAllDirs );
+    HbMessageBox::information( path );
+}
+
+void TestMainWindow::getOpenFileName_SetFilter()
+{
+    // getOpenFileName and set file filter
+    //Set DisplayAllDirs to display all folders, otherwise folders will also be filted.
+    QStringList filterList;
+    filterList<<"*.jpg"<<"*.gif"<<"*.png";
+    QString path = FmFileDialog::getOpenFileName( 0, "Look in:", "", filterList, FmFileDialog::DisplayAllDirs );
+    HbMessageBox::information( path );
+}
+void TestMainWindow::getSaveFileName_SetFilter()
+{
+    // getSaveFileName and set file filter
+    //Set DisplayAllDirs to display all folders, otherwise folders will also be filted.
+    QStringList filterList;
+    filterList<<"*.jpg"<<"*.gif"<<"*.png";
+    QString path = FmFileDialog::getSaveFileName( 0, "Look in:", "", filterList, FmFileDialog::DisplayAllDirs );
+    HbMessageBox::information( path );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/examples/demo_fmfiledialog/mainwindow.h	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*     
+* 
+* Description:
+*     
+*
+*/
+
+#include <hbdialog.h>
+#include <hblistwidget.h>
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbview.h>
+#include <hblabel.h>
+#include <hbaction.h>
+#include <hblistwidgetitem.h>
+
+#include <QGraphicsLinearLayout>
+
+
+class TestMainWindow : public HbMainWindow
+{
+    Q_OBJECT
+public:
+    TestMainWindow();
+    ~TestMainWindow();
+
+    void init();
+private slots:
+    void activatedListItem(HbListWidgetItem *item);
+
+private:
+    void getExistingDirectory();
+    void getOpenFileName();
+    void getSaveFileName();
+
+    void getExistingDirectory_SetDir();
+    void getOpenFileName_SetDir();
+    void getSaveFileName_SetDir();
+
+    void getExistingDirectory_SetFilter();
+    void getExistingDirectory_SetFilter_AllDirs();
+    void getOpenFileName_SetFilter();
+    void getSaveFileName_SetFilter();
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/examples/demo_fmfiledialog/rom.pri	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,28 @@
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+# 
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+# 
+# Contributors:
+#     
+# 
+# Description:
+#     Rom exports for demo_fmfiledialog
+# 
+
+symbian {
+    DEMO_FMFILEDIALOG_IBY_DIR = $$section(PWD, ":", 1)
+
+    exists(/epoc32/include/platform_paths.hrh) {
+        BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>"
+    } else {
+        BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <domain\osextensions\platform_paths.hrh>"
+    }
+
+    BLD_INF_RULES.prj_exports += "$$DEMO_FMFILEDIALOG_IBY_DIR/demo_fmfiledialog.iby CORE_APP_LAYER_IBY_EXPORT_PATH(demo_fmfiledialog.iby)"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/examples/examples.pro	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,18 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE = subdirs
+SUBDIRS = demo_fmfiledialog
--- a/filemanager/filemanager.pro	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/filemanager.pro	Wed Sep 29 10:37:03 2010 +0800
@@ -21,5 +21,4 @@
 }
 
 SUBDIRS += src/fmbkupenginewrapper
-SUBDIRS += src/fmfiledialog
 SUBDIRS += src/filemanager
\ No newline at end of file
--- a/filemanager/filemanager_plat/inc/fmfiledialog.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/filemanager_plat/inc/fmfiledialog.h	Wed Sep 29 10:37:03 2010 +0800
@@ -96,13 +96,21 @@
                                     const QString &dir = QString(),
                                     const QStringList &nameFilters = QStringList(),
                                     Options options = 0 );
-                                   
+
+private slots:
+    void dialogClosed(HbAction *action);
+    
 private:
     explicit FmFileDialog( QGraphicsItem *parent );
     ~FmFileDialog();
 
     bool exec();
+    HbAction *primaryAction() const;
+    void setPrimaryAction( HbAction *action );
 
+    HbAction *secondaryAction() const;
+    void setSecondaryAction( HbAction *action );
+    
     FmFileDialogPrivate *d_ptr;
     
     Q_DISABLE_COPY( FmFileDialog)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/rom/bld.inf	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0""
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Rom exports for FileManager
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+
+
+#include<platform_paths.hrh>
+filemngr.iby          CORE_APP_LAYER_IBY_EXPORT_PATH(filemngr.iby)
+filemngr_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(filemngr_resources.iby)
--- a/filemanager/rom/rom.pri	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/rom/rom.pri	Wed Sep 29 10:37:03 2010 +0800
@@ -18,12 +18,7 @@
 symbian {
     FILEMNGR_IBY_DIR = $$section(PWD, ":", 1)
 
-    exists(/epoc32/include/platform_paths.hrh) {
-        BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>"
-    } else {
-        BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <domain\osextensions\platform_paths.hrh>"
-    }
-
+    BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include<platform_paths.hrh>"
     BLD_INF_RULES.prj_exports += "$$FILEMNGR_IBY_DIR/filemngr.iby CORE_APP_LAYER_IBY_EXPORT_PATH(filemngr.iby)"
     BLD_INF_RULES.prj_exports += "$$FILEMNGR_IBY_DIR/filemngr_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(filemngr_resources.iby)"
 }
--- a/filemanager/src/filemanager/burconfig.xml	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/burconfig.xml	Wed Sep 29 10:37:03 2010 +0800
@@ -54,7 +54,7 @@
             <exclude_uids>0x2001FE79</exclude_uids> <!--Messaging 101 (EBUCatMessages)-->   
             <exclude_uids>0x2002A542</exclude_uids> <!--CsServer.exe (EBUCatMessages)-->    
             <exclude_uids>0x10003a73</exclude_uids> <!--Contacts model (EBUCatContacts)-->  
-            <exclude_uids>0x101f4cce</exclude_uids> <!--Phonebook-app (EBUCatContacts)-->   
+            <exclude_uids>0x20022EF9</exclude_uids> <!--Phonebook-app (EBUCatContacts) changed from 0x101f4cce-->   
             <exclude_uids>0x10003a5b</exclude_uids> <!--Agenda model (EBUCatCalendar)-->    
             <exclude_uids>0x10005901</exclude_uids> <!--Calendar-app (EBUCatCalendar)-->    
             <exclude_uids>0x10008d38</exclude_uids> <!--Bookmarks (EBUCatBookmarks)-->      
@@ -86,7 +86,7 @@
             <special_flags>EBUCatSpecNone</special_flags>                                   
             <exclude_special_flags>EBUCatSpecNone</exclude_special_flags>                   
             <uids>0x10003a73</uids><!--Contacts model-->                                    
-            <uids>0x101f4cce</uids><!--Phonebook-app-->                                     
+            <uids>0x20022EF9</uids><!--Phonebook-app changed from 0x101f4cce-->                                     
             <exclude_uids></exclude_uids>                                                   
         </backupCategory>                                                                   
                                                                                             
--- a/filemanager/src/filemanager/filemanager.pro	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/filemanager.pro	Wed Sep 29 10:37:03 2010 +0800
@@ -24,6 +24,10 @@
 # remove this path when export plat header to app layer path
 # INCLUDEPATH += ../../filemanager_plat/inc
 
+symbian {
+    include(../../rom/rom.pri)
+}
+
 include ( ../common.pri )
 include ( ../inc/commoninc.pri )
 include ( ../inc/commonutils.pri )
@@ -42,7 +46,9 @@
             -lefsrv \
             -lapgrfx \
     	    -lcone \
-            -lsysutil
+            -lsysutil \
+            -lbafl \
+            -leikcore
 
     TARGET.UID3 = 0x2002BCC0
     TARGET.EPOCHEAPSIZE = 0x020000 0x1000000
@@ -52,4 +58,6 @@
     BLD_INF_RULES.prj_exports += "./burconfig.xml z:/private/2002BCC0/burconfig.xml"	
 }
 
+symbian:MMP_RULES += SMPSAFE
+
 TRANSLATIONS = filemanager.ts
--- a/filemanager/src/filemanager/resources/hblistviewitem.css	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/resources/hblistviewitem.css	Wed Sep 29 10:37:03 2010 +0800
@@ -22,6 +22,7 @@
  	bottom: var(hb-param-margin-gene-middle-vertical);
 	font-variant: secondary-small;
 	text-align: left;
+	size-policy-horizontal: ignored;
 }
 HbListViewItem::icon-1[layoutName="drive"]:portrait{
  	top: -var(hb-param-margin-gene-top);
@@ -46,6 +47,7 @@
  	bottom: var(hb-param-margin-gene-top);
 	font-variant: secondary-small;
 	text-align: left;
+	size-policy-horizontal: ignored;
 }
 HbListViewItem::icon-1[layoutName="drive"]:landscape{
     top: -var(hb-param-margin-gene-top);
--- a/filemanager/src/filemanager/src/backuprestore/fmbackupconfigloader.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/backuprestore/fmbackupconfigloader.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -25,8 +25,6 @@
 #include <QByteArray>
 #include <QCoreApplication>
 
-#include <hbmessagebox.h>
-
 FmBackupConfigLoader::FmBackupConfigLoader(void)
 {
     
--- a/filemanager/src/filemanager/src/backuprestore/fmbackupview.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/backuprestore/fmbackupview.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -97,19 +97,19 @@
     case FmErrNone:
         break;
     case FmErrWrongParam:
-        FmDlgUtils::information( QString( hbTrId("Operation canceled with wrong param!") ) );
+        FmDlgUtils::warning( QString( hbTrId("Operation canceled with wrong param!") ) );
         break;
     case FmErrAlreadyStarted:
-        FmDlgUtils::information( QString( hbTrId("Operation canceled because already started!") ) );
+        FmDlgUtils::warning( QString( hbTrId("Operation canceled because already started!") ) );
         break;
     case FmErrPathNotFound:
-        FmDlgUtils::information( QString( hbTrId("Operation canceled because can not find target path or drive is not available!") ) );
+        FmDlgUtils::warning( QString( hbTrId("Operation canceled because can not find target path or drive is not available!") ) );
         break;
     case FmErrAlreadyExists:
-        FmDlgUtils::information( QString( hbTrId("backup canceled") ) );
+        FmDlgUtils::warning( QString( hbTrId("backup canceled") ) );
         break;
     default:
-        FmDlgUtils::information( QString( hbTrId("backup failed") ) );
+        FmDlgUtils::warning( QString( hbTrId("backup failed") ) );
         break;
     }
 }
--- a/filemanager/src/filemanager/src/backuprestore/fmbackupviewitem.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,185 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- *     
- * 
- * Description:
- *     The source file of the back up view list item of file manager
- */
-
-#include "fmbackupviewitem.h"
-
-#include <QGraphicsLinearLayout>
-
-#include <hblabel.h>
-#include <hbcheckbox.h>
-#include <hbwidget.h>
-#include <hblineedit.h>
-
-
-FmBackupViewItem::FmBackupViewItem( QGraphicsItem *parent )
-  : mTitleLabel( 0 ),
-    //mTipsLabel( 0 ),
-	mTipsLineEdit( 0 ),
-    HbListViewItem( parent )
-{
-	init();
-}
-
-FmBackupViewItem::~FmBackupViewItem()
-{
-}
-
-void FmBackupViewItem::polish(HbStyleParameters& params)
-{
-    Q_UNUSED(params);
-}
-
-HbAbstractViewItem *FmBackupViewItem::createItem()
-{
-	return new FmBackupViewItem( parentItem() );
-}
-
-void FmBackupViewItem::updateChildItems()
-{
-	QString string = modelIndex().data( Qt::DisplayRole ).toString();	
-
-	QStringList stringList = string.split( '\t' );
-
-	if( stringList.count() == 0 ){
-		return;
-	}
-
-	 mTitleLabel->setText( stringList.first() );
-
-	 if( stringList.first() != stringList.last() ){
-	     //mTipsLabel->setText( stringList.last() );
-		 mTipsLineEdit->setText( stringList.last() );
-	 }
-}
-
-
-void FmBackupViewItem::init()
-{
-	QGraphicsLinearLayout *vLayout = new QGraphicsLinearLayout();
-	vLayout->setOrientation( Qt::Vertical );
-
-	mTitleLabel = new HbLabel( "" );
-	mTitleLabel->setFontSpec( HbFontSpec( HbFontSpec::Primary ) );
-	vLayout->addItem( mTitleLabel );
-	vLayout->setAlignment( mTitleLabel, Qt::AlignLeft );
-
-	//mTipsLabel = new HbLabel( "" );
-	//mTipsLabel->setFontSpec( HbFontSpec( HbFontSpec::Secondary ) );
-	//mTipsLabel->setAlignment( Qt::AlignHCenter );
-		
-	//vLayout->addItem( mTipsLabel );
-	//vLayout->setAlignment( mTipsLabel, Qt::AlignLeft );
-
-	mTipsLineEdit = new HbLineEdit( "" );
-	mTipsLineEdit->setFontSpec( HbFontSpec( HbFontSpec::Secondary ) );
-	//mTipsLineEdit->setAlignment( Qt::AlignHCenter );
-	mTipsLineEdit->setReadOnly( true );
-
-	vLayout->addItem( mTipsLineEdit );
-	vLayout->setAlignment( mTipsLineEdit, Qt::AlignLeft );
-
-	setLayout( vLayout );
-}
-
-//FmRestoreViewItem
-FmRestoreViewItem::FmRestoreViewItem( QGraphicsItem *parent )
-  : mRestoreContentLabel( 0 ),
-    mDateTimeLabel( 0 ),
-	mCheckBox( 0 ),
-    HbListViewItem( parent )
-{
-	init();
-}
-
-FmRestoreViewItem::~FmRestoreViewItem()
-{
-}
-
-
-HbAbstractViewItem *FmRestoreViewItem::createItem()
-{
-	return new FmRestoreViewItem( parentItem() );
-}
-
-void FmRestoreViewItem::polish(HbStyleParameters& params)
-{
-    Q_UNUSED(params);
-}
-
-void FmRestoreViewItem::updateChildItems()
-{
-	QString string = modelIndex().data( Qt::DisplayRole ).toString();	
-
-	QStringList stringList = string.split( '\t' );
-
-	if( stringList.count() == 0 ){
-		return;
-	}
-
-	 mRestoreContentLabel->setText( stringList.first() );
-
-	 if( stringList.first() != stringList.last() ){
-	     mDateTimeLabel->setText( stringList.last() );
-	 }
-
-}
-
-
-void FmRestoreViewItem::init()
-{
-	QGraphicsLinearLayout *hLayout = new QGraphicsLinearLayout();
-	hLayout->setOrientation( Qt::Horizontal );
-
-	mCheckBox = new HbCheckBox( this );
-    hLayout->addItem( mCheckBox );
-	hLayout->setAlignment( mCheckBox, Qt::AlignVCenter );
-
-	QGraphicsLinearLayout *vLayout = new QGraphicsLinearLayout();
-	vLayout->setOrientation( Qt::Vertical );
-
-	mRestoreContentLabel = new HbLabel("");
-	mRestoreContentLabel->setFontSpec( HbFontSpec( HbFontSpec::Primary ) );
-	vLayout->addItem( mRestoreContentLabel );
-	vLayout->setAlignment( mRestoreContentLabel, Qt::AlignLeft );
-
-	mDateTimeLabel = new HbLabel("");
-	mDateTimeLabel->setFontSpec( HbFontSpec( HbFontSpec::Secondary ) );
-	vLayout->addItem( mDateTimeLabel );
-	vLayout->setAlignment( mDateTimeLabel, Qt::AlignLeft );
-
-	HbWidget *textWidget = new HbWidget();
-	textWidget->setLayout(vLayout);
-
-	hLayout->addItem( textWidget );
-	hLayout->setAlignment( textWidget, Qt::AlignVCenter );
-
-	setLayout( hLayout );
-
-}
-
-void FmRestoreViewItem::setCheckBoxState()
-{
-	if ( mCheckBox->checkState() ==  Qt::Unchecked ){
-		mCheckBox->setCheckState( Qt::Checked );
-		setSelected( true );
-	}
-	else if( mCheckBox->checkState() ==  Qt::Checked ){
-		mCheckBox->setCheckState( Qt::Unchecked );
-		setSelected( false );
-	}
-}
--- a/filemanager/src/filemanager/src/backuprestore/fmbackupviewitem.h	Tue Aug 24 10:24:14 2010 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- *     
- * 
- * Description:
- *     The header file of the back up view list item of file manager
- */
-
-#ifndef FMBACKUPVIEWITEM_H
-#define FMBACKUPVIEWITEM_H
-
-#include <hblistviewitem.h>
-
-class HbLabel;
-class HbCheckBox;
-class HbLineEdit;
-
-class FmBackupViewItem : public HbListViewItem
-{
-	Q_OBJECT
-
-public:
-	FmBackupViewItem( QGraphicsItem *parent = 0  );
-	~FmBackupViewItem();
-
-public:
-	virtual HbAbstractViewItem *createItem();
-	virtual void updateChildItems();
-private:
-    virtual void polish(HbStyleParameters& params);
-
-private:
-    void init();
-
-private:
-    HbLabel *mTitleLabel;
-    //HbLabel *mTipsLabel;
-	HbLineEdit *mTipsLineEdit;
-};
-
-//FmRestoreViewItem
-class FmRestoreViewItem : public HbListViewItem
-{
-	Q_OBJECT
-
-public:
-    FmRestoreViewItem( QGraphicsItem *parent = 0  );
-	  ~FmRestoreViewItem();
-
-public:
-	virtual HbAbstractViewItem *createItem();
-	virtual void updateChildItems();
-	void setCheckBoxState();
-
-private:
-    virtual void polish(HbStyleParameters& params);
-
-private:
-    void init();
-
-private:
-    HbLabel *mRestoreContentLabel;
-    HbLabel *mDateTimeLabel;
-
-	HbCheckBox *mCheckBox;
-};
-
-#endif
--- a/filemanager/src/filemanager/src/backuprestore/fmdeletebackupview.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/backuprestore/fmdeletebackupview.h	Wed Sep 29 10:37:03 2010 +0800
@@ -34,10 +34,12 @@
 public:
 	FmDeleteBackupView();
 	~FmDeleteBackupView();
-
+    
 private slots:
     void on_leftAction_triggered();
 	void on_deleteAction_triggered();
+	void on_deleteBackupWidget_stateChanged(int state);
+	void refreshDeleteBackupView();
 #ifdef FM_CHANGE_ORIENT_ENABLE
     void on_rotateAction_triggered();
 #endif
@@ -45,9 +47,7 @@
 private:
     void initMenu();
     void initMainWidget();
-    void initToolBar();
-    void adjustActions();
-    
+    void initToolBar();    
     void removeToolBarAction();
 
 private:
--- a/filemanager/src/filemanager/src/backuprestore/fmdeletebackupwidget.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/backuprestore/fmdeletebackupwidget.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -20,7 +20,6 @@
 #include "fmrestoreviewitem.h"
 #include "fmoperationservice.h"
 #include "fmviewmanager.h"
-
 #include "fmbackupconfigloader.h"
 #include "fmbkupengine.h"
 #include "fmbackuprestorehandler.h"
@@ -28,7 +27,6 @@
 #include <QGraphicsLinearLayout>
 #include <QStringListModel>
 #include <QDateTime>
-
 #include <hblistview.h>
 
 FmDeleteBackupWidget::FmDeleteBackupWidget(  HbWidget *parent )
@@ -47,8 +45,16 @@
 {
     mListView->setModel( 0 );
     loadData();
-    mListView->setModel( mModel );
+    mListView->setModel( mModel );    
+    for (int i = 0; i < mModel->rowCount(); ++i) {
+        QModelIndex index = mModel->index(i);
+        FmRestoreViewItem* restoreViewItem = static_cast< FmRestoreViewItem* >
+                                                 (mListView->itemByIndex(index));
+        connect(restoreViewItem, SIGNAL(stateChanged(int)), this, SIGNAL(stateChanged(int)));     
+    }
+    emit stateChanged(0);
 }
+
 QList<int> FmDeleteBackupWidget::selectionIndexes()
 {
     QList<int> selectionList;
@@ -84,19 +90,20 @@
          it != retoreEntryList.end(); ++it ){
              QString string = ( *it )->text();
              QDateTime datetime = ( *it )->restoreInfo().dateTime();
+             QString drive = ( *it )->restoreInfo().drive();
              string.append( '\t' );
              string.append( datetime.toString( "hh:mm ap dd/MM/yyyy") );
-             QVariant variant( string );
-
+             string.append( '\t' );
+             string.append( drive );
+             QVariant variant( string );             
              mModel->setData( mModel->index( index ), variant, Qt::DisplayRole );
-
              ++index;
     }
 
 }
 
 void FmDeleteBackupWidget::init()
-{
+{    
     QGraphicsLinearLayout *vLayout = new QGraphicsLinearLayout( this );
     vLayout->setOrientation( Qt::Vertical );
 
@@ -112,6 +119,7 @@
     mListView->setModel( mModel );
 
     mListView->setItemPrototype( new FmRestoreViewItem( this ) );
+   
 
 }
 
--- a/filemanager/src/filemanager/src/backuprestore/fmdeletebackupwidget.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/backuprestore/fmdeletebackupwidget.h	Wed Sep 29 10:37:03 2010 +0800
@@ -25,6 +25,7 @@
 class QStringListModel;
 class FmRestoreSettings;
 class FmBackupConfigLoader;
+class FmRestoreViewItem;
 
 class FmDeleteBackupWidget : public HbWidget
 {
@@ -37,6 +38,8 @@
     void refresh();
     QList<int> selectionIndexes();
     int backupDataCount();
+signals:
+    void stateChanged(int state);
 private:
     void loadData();
     void init();
@@ -50,7 +53,7 @@
     QStringListModel  *mModel;
 
     FmRestoreSettings *mRestoreSettings;
-    FmBackupConfigLoader *mBackupConfigLoader;
+    FmBackupConfigLoader *mBackupConfigLoader;    
 };
 
 #endif
--- a/filemanager/src/filemanager/src/backuprestore/fmrestoreview.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/backuprestore/fmrestoreview.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -99,13 +99,13 @@
     case FmErrNone:
         break;
     case FmErrWrongParam:
-        FmDlgUtils::information( QString( hbTrId("Operation canceled with wrong param!") ) );
+        FmDlgUtils::warning( QString( hbTrId("Operation canceled with wrong param!") ) );
         break;
     case FmErrAlreadyStarted:
-        FmDlgUtils::information( QString( hbTrId("Operation canceled because already started!") ) );
+        FmDlgUtils::warning( QString( hbTrId("Operation canceled because already started!") ) );
         break;
     default:
-        FmDlgUtils::information(hbTrId("restore failed"));
+        FmDlgUtils::warning(hbTrId("restore failed"));
         break;
     }
 }
--- a/filemanager/src/filemanager/src/backuprestore/fmrestoreview.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/backuprestore/fmrestoreview.h	Wed Sep 29 10:37:03 2010 +0800
@@ -37,6 +37,8 @@
 private slots:
     void on_leftAction_triggered();
 	void on_restoreAction_triggered();
+	void onCheckBoxStateChange();
+	void refreshRestoreView();
 #ifdef FM_CHANGE_ORIENT_ENABLE
     void on_rotateAction_triggered();
 #endif
@@ -44,9 +46,7 @@
 private:
     void initMenu();
     void initMainWidget();
-    void initToolBar();
-    void adjustActions();
-    
+    void initToolBar();    
     void removeToolBarAction();
     
 private:
--- a/filemanager/src/filemanager/src/backuprestore/fmrestoreviewitem.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/backuprestore/fmrestoreviewitem.h	Wed Sep 29 10:37:03 2010 +0800
@@ -24,7 +24,9 @@
 class HbLabel;
 class HbCheckBox;
 class HbLineEdit;
-
+class QGraphicsLinearLayout;
+class HbWidget;
+class FmFileIconProvider;
 //FmRestoreViewItem
 class FmRestoreViewItem : public HbListViewItem
 {
@@ -32,13 +34,16 @@
 
 public:
     FmRestoreViewItem( QGraphicsItem *parent = 0  );
-	  ~FmRestoreViewItem();
+	~FmRestoreViewItem();
 
 public:
 	virtual HbAbstractViewItem *createItem();
 	virtual void updateChildItems();
 	void setCheckBoxState();
 	bool getCheckBoxState();
+signals:
+    void stateChanged(int);
+	
 	
 private:
     virtual void polish(HbStyleParameters& params);
@@ -48,9 +53,13 @@
 
 private:
     HbLabel *mRestoreContentLabel;
-    HbLabel *mDateTimeLabel;
+    HbLabel *mDateTimeLabel;    
 
 	HbCheckBox *mCheckBox;
+	QGraphicsLinearLayout *hLayout;
+	HbWidget *mParentWidget;
+	HbLabel *mIconLabel;
+    FmFileIconProvider   *mIconProvider;
 };
 
 #endif
--- a/filemanager/src/filemanager/src/backuprestore/fmrestorewidget.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/backuprestore/fmrestorewidget.h	Wed Sep 29 10:37:03 2010 +0800
@@ -36,11 +36,12 @@
 
     QList<int> selectionIndexes();
     int backupDataCount();
+    void refresh();
 private:
     void init();
 
-signals:
-    void checkStatusChanged();
+signals:    
+    void stateChanged(int state);
 
 private slots:
     void on_list_activated( const QModelIndex &index );
--- a/filemanager/src/filemanager/src/components/fmcombinedquery.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/components/fmcombinedquery.h	Wed Sep 29 10:37:03 2010 +0800
@@ -19,14 +19,13 @@
 #define FMCOMBINEDQUERY_H
 
 #include "fmcommon.h"
+#include "fmdialog.h"
 
 #include <QString>
 #include <QMap>
 #include <QStringList>
 #include <QGraphicsItem>
 
-#include <hbdialog.h>
-
 class HbListWidget;
 class QGraphicsWidget;
 
@@ -36,7 +35,7 @@
  *  Support multi, single select
  *
  */
-class FmCombinedQuery : public HbDialog
+class FmCombinedQuery : public FmDialog
 {
     Q_OBJECT
 public:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/src/filemanager/src/components/fmdialog.h	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ * 
+ * Contributors:
+ *
+ * 
+ * Description:
+ *     The header file of filemanager base dialog class
+ */
+
+#ifndef FMDIALOG_H
+#define FMDIALOG_H
+
+#include <QEventLoop>
+#include <hbaction.h>
+#include <hbdialog.h>
+#include <hbmenu.h>
+class FmDialog : public HbDialog
+{
+Q_OBJECT
+public:
+    explicit FmDialog( QGraphicsItem *parent = 0 );
+    HbAction *exec();
+    
+    HbAction *primaryAction() const;
+    void setPrimaryAction( HbAction *action );
+
+    HbAction *secondaryAction() const;
+    void setSecondaryAction( HbAction *action );
+public slots:
+    void dialogClosed(HbAction *action);
+private:
+    QEventLoop mEventLoop;
+    HbAction   *mRetAction; 
+};
+
+#endif
--- a/filemanager/src/filemanager/src/components/fmdlgutils.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/components/fmdlgutils.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -435,13 +435,24 @@
 
 /*!
     This is a convenience function for showing an information dialog with \a informationText
-    Default button is OK.
+    Default button is OK, default behavior is not blocking ui..
 */
 void FmDlgUtils::information( const QString &informationText,
-    HbMessageBox::StandardButtons buttons )
+    HbMessageBox::StandardButtons buttons, bool isBlocking )
 {
     FmMessageBox msgBox;
-    return msgBox.information( informationText, buttons );
+    return msgBox.information( informationText, buttons, isBlocking );
+}
+
+/*!
+    This is a convenience function for showing an warning dialog with \a warningText
+    Default button is OK, default behavior is blocking ui.
+*/
+void FmDlgUtils::warning( const QString &warningText,
+    HbMessageBox::StandardButtons buttons, bool isBlocking )
+{
+    FmMessageBox msgBox;
+    return msgBox.warning( warningText, buttons, isBlocking );
 }
 
 /*!
--- a/filemanager/src/filemanager/src/components/fmdlgutils.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/components/fmdlgutils.h	Wed Sep 29 10:37:03 2010 +0800
@@ -72,7 +72,10 @@
         HbMessageBox::StandardButtons buttons = HbMessageBox::Yes | HbMessageBox::No );
 
     static void information( const QString &informationText,
-        HbMessageBox::StandardButtons buttons = HbMessageBox::Ok );
+        HbMessageBox::StandardButtons buttons = HbMessageBox::Ok,  bool isBlocking = false );
+    
+    static void warning( const QString &warningText,
+        HbMessageBox::StandardButtons buttons = HbMessageBox::Ok, bool isBlocking = false );
 
     static QString showBackupDriveQuery( const QString& title );
 
--- a/filemanager/src/filemanager/src/components/fmdrivedetailstype.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/components/fmdrivedetailstype.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -36,13 +36,21 @@
     
     QStringList dataPathList;
     dataPathList.append( QString( FmViewDetail_Contacts ) );    
-    FmDriveDetailsDataGroup driveDetailsDataGroup( FmDriveDetailsSize::ETypeContacts, dataPathList );
+    FmDriveDetailsDataGroup driveDetailsDataGroupForContacts( FmDriveDetailsSize::ETypeContacts, dataPathList );
     
-    err = getDataSizeByAbsolutePath(driveName, driveDetailsDataGroup, detailsSizeList, isStopped);
+    err = getDataSizeByAbsolutePath(driveName, driveDetailsDataGroupForContacts, detailsSizeList, isStopped);
     if( err != FmErrNone ) {
         return err;
     }
     
+    dataPathList.clear();
+    dataPathList.append( QString( FmViewDetail_Messages ) );    
+    FmDriveDetailsDataGroup driveDetailsDataGroupForMessage( FmDriveDetailsSize::ETypeMessages, dataPathList );
+    
+    err = getDataSizeByAbsolutePath(driveName, driveDetailsDataGroupForMessage, detailsSizeList, isStopped);
+    if( err != FmErrNone ) {
+        return err;
+    }
     return FmErrNone;
 }
 int FmDriveDetailsContent::getDataSizeByTraversePath( const QString &driveName,
@@ -134,7 +142,30 @@
         QString driver(FmUtils::removePathSplash(FmUtils::getDriveNameFromPath(driveName)));
         QFileInfo fileInfo(QString(driver + (*it)));
         if (fileInfo.exists()) {
-            totalSize += fileInfo.size();
+            if (fileInfo.isFile()) {
+                totalSize += fileInfo.size();    
+            } else if (fileInfo.isDir()) {
+                QList<QDir> dirs;
+                dirs.append(QDir(fileInfo.absolutePath()));
+                // traverse the whole path
+                while (!dirs.isEmpty()) {
+                    QDir::Filters filter = QDir::NoDotAndDotDot | QDir::AllEntries;
+                    QFileInfoList infoList = dirs.first().entryInfoList( filter );
+                    for ( QFileInfoList::const_iterator it = infoList.begin(); it != infoList.end(); ++it ) {
+                        if ( *isStopped ){
+                            return FmErrCancel;
+                        }                        
+                        if ( it->isFile() ) {
+                            totalSize += it->size();  
+                        }
+                        else if ( it->isDir() ) {
+                            dirs.append( QDir( it->absoluteFilePath() ) );
+                        } 
+                    }
+                    dirs.removeFirst();
+                }
+            }
+            
         }
     }
  
--- a/filemanager/src/filemanager/src/components/fmdrivedetailstype.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/components/fmdrivedetailstype.h	Wed Sep 29 10:37:03 2010 +0800
@@ -148,7 +148,8 @@
             QList<FmDriveDetailsSize*> &detailsSizeList, volatile bool *isStopped );
     
     /*!
-     Gets data size for single FmDriveDetailsDataGroup, the method is find file of absolute path
+     Gets data size for single FmDriveDetailsDataGroup
+     The method will find file or traverse all folders of absolute path
      \a driveName which drive is searching
      \a dataGroup which dataGroup is searching, for example, EGroupContacts...
      \a detailsSizeList if got result, new FmDriveDetailsSize will be appended to detailsSizeList
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/src/filemanager/src/components/fmdrivequery.h	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ * 
+ * Contributors:
+ *
+ * 
+ * Description:
+ *     The header file of backup drive query of of file manager
+ */
+#ifndef FMDRIVEQUERY_H
+#define FMDRIVEQUERY_H
+
+#include "fmcommon.h"
+#include "fmdialog.h"
+#include "fmdrivemodel.h"
+
+#include <QString>
+#include <QMap>
+#include <QStringList>
+#include <QGraphicsItem>
+
+class HbListView;
+class QGraphicsWidget;
+
+// CLASS DECLARATION
+/**
+ *  This class is used for drive select query dialog
+ *
+ */
+class FmDriveQuery : public FmDialog, public FmDriveListProvider
+{
+    Q_OBJECT
+public:
+	FmDriveQuery( QGraphicsItem *parent = 0 );
+	~FmDriveQuery();
+	QString selectedDrive() const;
+	
+	// from FmDriveListProvider
+	virtual void getDriveList( QStringList &driveList );
+	
+public slots:
+	void activated(const QModelIndex &index); 
+    void refreshModel( QString path );
+private:
+	QGraphicsWidget *mContentWidget;   /// Content widget of popup dialog
+    HbListView      *mListView;        /// list view
+    FmDriveModel    *mDriveModel;      /// drive model
+    
+    QString mSelectedDrive;
+};
+
+#endif //FMDRIVEQUERY_H
--- a/filemanager/src/filemanager/src/components/fmmessagebox.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/components/fmmessagebox.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -23,11 +23,14 @@
     This is a convenience function for showing an information dialog with \a informationText
 */
 void FmMessageBox::information( const QString &informationText,
-    HbMessageBox::StandardButtons buttons )
-{
-    HbMessageBox::information ( informationText,
+    HbMessageBox::StandardButtons buttons, bool isBlocking  )
+{    
+    HbMessageBox::information( informationText,
          this, SLOT(dialogClosed(HbAction*)), buttons );
-    mEventLoop.exec();
+    if ( isBlocking ) {
+        mEventLoop.exec();
+    }
+    
 }
 
 /*!
@@ -36,12 +39,25 @@
 bool FmMessageBox::question( const QString &questionText,
     HbMessageBox::StandardButtons buttons )
 {
-    HbMessageBox::question ( questionText,
+    HbMessageBox::question( questionText,
             this, SLOT(dialogClosed(HbAction*)), buttons  );
     mEventLoop.exec();
     return mRet;
 }
 
+/*!
+    This is a convenience function for showing a warning dialog with \a warningText
+*/
+void FmMessageBox::warning( const QString &warningText,
+        HbMessageBox::StandardButtons buttons, bool isBlocking )
+{
+    HbMessageBox::warning( warningText,
+         this, SLOT(dialogClosed(HbAction*)), buttons );
+    if ( isBlocking ) {
+        mEventLoop.exec();
+    }
+}
+
 void FmMessageBox::dialogClosed(HbAction *action)
 {
     HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
--- a/filemanager/src/filemanager/src/components/fmmessagebox.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/components/fmmessagebox.h	Wed Sep 29 10:37:03 2010 +0800
@@ -34,11 +34,14 @@
     {
     }
     void information( const QString &informationText,
-        HbMessageBox::StandardButtons buttons );
+        HbMessageBox::StandardButtons buttons, bool isBlocking = false );
 
     bool question( const QString &questionText,
         HbMessageBox::StandardButtons buttons );
     
+    void warning( const QString &warningText,
+        HbMessageBox::StandardButtons buttons, bool isBlocking = false );
+    
 public slots:
     void dialogClosed(HbAction *action);
 private:
--- a/filemanager/src/filemanager/src/components/fmmultitextquery.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/components/fmmultitextquery.h	Wed Sep 29 10:37:03 2010 +0800
@@ -20,21 +20,22 @@
 #define FMMULTITEXTQUERY_H
 
 #include "fmcommon.h"
+#include "fmdialog.h"
 
-#include <hbdialog.h>
 #include <hblineedit.h>
 
 class HbWidget;
 class HbLabel;
 
-class FmMultiTextQuery : public HbDialog
+class FmMultiTextQuery : public FmDialog
 {
 Q_OBJECT
 public:
-    FmMultiTextQuery( HbLineEdit::EchoMode echoMode = HbLineEdit::Normal, QGraphicsItem *parent = 0 );
+    explicit FmMultiTextQuery( HbLineEdit::EchoMode echoMode = HbLineEdit::Normal, QGraphicsItem *parent = 0 );
     ~FmMultiTextQuery();
 
 public:
+    void setLineEditMaxLength( int length );
     void setFirstEditText( const QString &text );
     void setSecondEditText( const QString &text );
     void setFirstLabelText( const QString &text );
--- a/filemanager/src/filemanager/src/components/fmviewdetailsdialog.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/components/fmviewdetailsdialog.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -43,7 +43,8 @@
       mSizeofNativeFiles( 0 ),
       mSizeofDocument( 0 ),
       mSizeofCalendar( 0 ),
-      mSizeofContacts( 0 )
+      mSizeofContacts( 0 ),
+      mSizeofMessages( 0 )
 {
     init();
     
@@ -169,6 +170,13 @@
     sizeOfOthers -= mSizeofContacts;
     
     dataList.clear();
+    dataList << hbTrId ( "Messages:" );
+    dataList << FmUtils::formatStorageSize( mSizeofMessages );
+    mDataListModel->setData(  mDataListModel->index( EMemoryMessages, 0 ), dataList, Qt::DisplayRole );  
+    
+    sizeOfOthers -= mSizeofMessages;
+    
+    dataList.clear();
     dataList << hbTrId ( "Others:" );
     dataList << FmUtils::formatStorageSize( sizeOfOthers );
     mDataListModel->setData(  mDataListModel->index( EMemoryOthers, 0 ), dataList, Qt::DisplayRole );     
@@ -288,6 +296,7 @@
     mSizeofDocument = 0;
     mSizeofCalendar = 0;
     mSizeofContacts = 0;
+    mSizeofMessages = 0;
     
     for( QList< FmDriveDetailsSize* >::const_iterator it = detailsSizeList.begin(); 
             it!= detailsSizeList.end(); ++it ){
@@ -333,6 +342,11 @@
                 mSizeofContacts = ( *it )->size();
                 break;
             }
+            case FmDriveDetailsSize::ETypeMessages:
+            {
+                mSizeofMessages = ( *it )->size();
+                break;
+            } 
             default:
                 break;
         }
--- a/filemanager/src/filemanager/src/components/fmviewdetailsdialog.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/components/fmviewdetailsdialog.h	Wed Sep 29 10:37:03 2010 +0800
@@ -45,6 +45,7 @@
         EMemoryDocuments,
         EMemoryCalendar,
         EMemoryContacts,
+        EMemoryMessages,
         EMemoryOthers,
         EDriveDetailEntryEnd
     };
@@ -109,6 +110,7 @@
     quint64 mSizeofDocument;
     quint64 mSizeofCalendar;
     quint64 mSizeofContacts;
+    quint64 mSizeofMessages;
 };
 
 #endif /* FMVIEWDETAILSDIALOG_H_ */
--- a/filemanager/src/filemanager/src/components/fmviewdetailsitem.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/components/fmviewdetailsitem.h	Wed Sep 29 10:37:03 2010 +0800
@@ -22,6 +22,7 @@
 #include <hblistviewitem.h>
 
 class HbLabel;
+class QGraphicsLinearLayout;
 
 class FmViewDetailsItem : public HbListViewItem
 {
@@ -45,6 +46,8 @@
 private:
     HbLabel *mDetailsContentLabel;
     HbLabel *mDetailsLabel;   
+
+    QGraphicsLinearLayout *mLayout;
 };
 
 #endif /* FMVIEWDETAILSITEM_H */
--- a/filemanager/src/filemanager/src/fmdriverlistwidget.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmdriverlistwidget.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -79,8 +79,8 @@
 	mLayout->addItem( mListView );	
 	mSearchPanel = new HbSearchPanel( this );
 	mSearchPanel->setObjectName( "searchPanel" );
-	mSearchPanel->setSearchOptionsEnabled( true );
-	mSearchPanel->setProgressive( false );
+	mSearchPanel->setSearchOptionsEnabled( false );
+	mSearchPanel->setProgressive( true );
 	mSearchPanel->hide();
 	connect( mListView, SIGNAL( activated( const QModelIndex & ) ),
 		     this, SLOT( on_list_activated( const QModelIndex & ) ) );
@@ -90,11 +90,8 @@
     connect( mListView, SIGNAL( longPressed( HbAbstractViewItem *, const QPointF & ) ),
         this, SLOT( on_list_longPressed( HbAbstractViewItem *, const QPointF & ) ) );
     
-    connect( mSearchPanel, SIGNAL( searchOptionsClicked() ),
-        this, SLOT( on_searchPanel_searchOptionsClicked() ), Qt::QueuedConnection );
-    
     connect( mSearchPanel, SIGNAL( criteriaChanged( const QString & ) ),
-        this, SLOT( on_searchPanel_criteriaChanged( const QString & ) ) );
+        this, SLOT( on_searchPanel_criteriaChanged( const QString & ) ), Qt::QueuedConnection );
        
     connect( mSearchPanel, SIGNAL( exitClicked() ),
         this, SLOT( on_searchPanel_exitClicked() ) );
@@ -251,7 +248,7 @@
     FmDriverInfo driverInfo = FmUtils::queryDriverInfo( diskName );
 
     if ( state & FmDriverInfo::EDriveWriteProtected ){
-        FmDlgUtils::information( hbTrId( "Unable to perform operation. Memory card is read only." ) );
+        FmDlgUtils::warning( hbTrId( "Unable to perform operation. Memory card is read only." ) );
         return;
         }
 
@@ -270,13 +267,13 @@
         }
         int err = FmUtils::renameDrive( diskName, volumeName );
         if ( err == FmErrNone ) {
-            FmDlgUtils::information( hbTrId( "The name has been changed!" ) );
+            FmDlgUtils::information( hbTrId( "The name has been changed!" ), HbMessageBox::Ok, true );
             mModel->refresh();
             break;
         } else if( err == FmErrBadName ) {
-            FmDlgUtils::information( hbTrId( "Illegal characters! Use only letters and numbers." ) );
+            FmDlgUtils::warning( hbTrId( "Illegal characters! Use only letters and numbers." ), HbMessageBox::Ok, true );
         } else{
-            FmDlgUtils::information( hbTrId( "Error occurred, operation cancelled!" ) );
+            FmDlgUtils::warning( hbTrId( "Error occurred, operation cancelled!" ) );
             break;
         }                
     }
@@ -302,10 +299,10 @@
     QString associatedDrives( FmUtils::getDriveLetterFromPath( diskName ) );
     if( FmDlgUtils::showMultiPasswordQuery( firstLabel, secondLabel, newPwd, FmMaxLengthofDrivePassword, associatedDrives ) ) {
        if ( FmUtils::setDrivePwd( diskName, oldPwd, newPwd ) == 0 ){
-            FmDlgUtils::information( hbTrId( "The password has been set!" ) );
+            FmDlgUtils::information( hbTrId( "The password has been set!" ), HbMessageBox::Ok, true );
         }
         else{
-            FmDlgUtils::information( hbTrId( "Error occurred, operation cancelled!" ) );
+            FmDlgUtils::warning( hbTrId( "Error occurred, operation cancelled!" ) );
         }
     }
 }
@@ -328,7 +325,7 @@
                 if ( FmUtils::setDrivePwd( diskName, oldPwd, newPwd ) == 0 ){
                     FmDlgUtils::information( hbTrId( "The password has been changed!" ) );
                 } else {
-                    FmDlgUtils::information( hbTrId( "Error occurred, operation cancelled!" ) );
+                    FmDlgUtils::warning( hbTrId( "Error occurred, operation cancelled!" ) );
                 }
                 break;
             } else {  
@@ -357,12 +354,12 @@
                     FmDlgUtils::information( hbTrId( "The password has been removed!" ) );
                 }
                 else{
-                    FmDlgUtils::information( hbTrId( "Error occurred, operation cancelled!" ) );
+                    FmDlgUtils::warning( hbTrId( "Error occurred, operation cancelled!" ) );
                 }
                 break;
             }
             else {
-                FmDlgUtils::information( hbTrId( "The password is incorrect, try again!" ) );
+                FmDlgUtils::warning( hbTrId( "The password is incorrect, try again!" ), HbMessageBox::Ok, true );
             }
             
         }
@@ -381,18 +378,18 @@
     while( FmDlgUtils::showSinglePasswordQuery( title, oldPwd, FmMaxLengthofDrivePassword ) ) {
         int err = FmUtils::unlockDrive( diskName, oldPwd );
         if( err == FmErrNone ) {
-            FmDlgUtils::information( hbTrId( "The memory is unlocked!" ) );
+            FmDlgUtils::warning( hbTrId( "The memory is unlocked!" ) );
             break;
         } else if ( err == FmErrAccessDenied ) {
-            FmDlgUtils::information( hbTrId( "The password is incorrect, try again!" ) );
+            FmDlgUtils::warning( hbTrId( "The password is incorrect, try again!" ), HbMessageBox::Ok, true );
         } else if (err == FmErrAlreadyExists ) {
             FmDlgUtils::information( hbTrId( "The disk has already been unlocked!" ) );
             break;
         } else if( err == FmErrNotSupported ) {
-            FmDlgUtils::information( hbTrId( "The media does not support password locking!" ) );
+            FmDlgUtils::warning( hbTrId( "The media does not support password locking!" ) );
             break;
         } else {
-            FmDlgUtils::information( hbTrId( "Error occurred, operation cancelled!" ) );
+            FmDlgUtils::warning( hbTrId( "Error occurred, operation cancelled!" ) );
             break;
         }
     }
@@ -425,31 +422,21 @@
 
 void FmDriverListWidget::activeSearchPanel()
 {
-    QStringList driveList;
-    FmUtils::getDriveList( driveList, true );
-    if(driveList.count() > 0 ) {
-        mFindTargetPath =  driveList.first();
-        if( FmUtils::isDriveC( mFindTargetPath ) ) {
-            mFindTargetPath =  QString( Folder_C_Data );
-        }
-    } else {
-        mFindTargetPath.clear();
-    }
     mLayout->addItem( mSearchPanel );
     mSearchPanel->show();
 }
 
-void FmDriverListWidget::on_searchPanel_searchOptionsClicked()
-{
-    mFindTargetPath = FmUtils::fillPathWithSplash( FmFileDialog::getExistingDirectory( 0, hbTrId( "Look in:" ),
-        QString(""), QStringList() ) );
-}
-
 void FmDriverListWidget::on_searchPanel_criteriaChanged( const QString &criteria )
 {
-    emit startSearch( mFindTargetPath, criteria );
+    emit startSearch( criteria );
     mSearchPanel->hide();
     mLayout->removeItem( mSearchPanel );
+
+    // clear keywords in searchpanel without signal criteriaChanged triggered again
+    mSearchPanel->setProgressive( false );
+    mSearchPanel->setCriteria( QString() );
+    mSearchPanel->setProgressive( true );
+    
 }
 
 void FmDriverListWidget::on_searchPanel_exitClicked()
--- a/filemanager/src/filemanager/src/fmdriverlistwidget.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmdriverlistwidget.h	Wed Sep 29 10:37:03 2010 +0800
@@ -45,7 +45,7 @@
 
 signals:
 	void activated( const QString &path );
-	void startSearch( const QString &targetPath, const QString &criteria );
+	void startSearch( const QString &criteria );
     
 private slots:
 	void on_list_activated( const QModelIndex &index );
@@ -63,7 +63,6 @@
     void on_ejectAction_triggered();
     void on_directoryChanged( const QString &path );
     
-    void on_searchPanel_searchOptionsClicked();
     void on_searchPanel_criteriaChanged( const QString &criteria );
     void on_searchPanel_exitClicked();
 private:
@@ -77,7 +76,6 @@
     
     QFileSystemWatcher *mFileSystemWatcher;
     
-    QString mFindTargetPath;
     QGraphicsLinearLayout *mLayout;
 	HbMenu *mContextMenu;
     
--- a/filemanager/src/filemanager/src/fmdriverview.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmdriverview.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -20,7 +20,9 @@
 #include "fmdriverlistwidget.h"
 #include "fmviewmanager.h"
 #include "fmcommon.h"
+#include "fmutils.h"
 
+#include <QDir>
 #include <QApplication>
 
 #include <hbmenu.h>
@@ -80,11 +82,11 @@
 void FmDriverView::initDiskListWidget()
 {
     mDriverList = new FmDriverListWidget( this );
-    connect( mDriverList, SIGNAL( activated( const QString& ) ),
-             this, SLOT( activated( const QString& ) ), Qt::QueuedConnection );
+    connect( mDriverList, SIGNAL( activated( QString ) ),
+             this, SLOT( activated( QString ) ), Qt::QueuedConnection );
     
-    connect( mDriverList, SIGNAL( startSearch( const QString&,  const QString& ) ),
-             this, SLOT( startSearch( const QString&, const QString& ) ) );
+    connect( mDriverList, SIGNAL( startSearch( QString ) ),
+        this, SLOT( startSearch( QString ) ) );
     
     setWidget( mDriverList );
 }
@@ -158,10 +160,22 @@
     mDriverList->activeSearchPanel();  
 }
 
-void FmDriverView::startSearch( const QString &targetPath, const QString &criteria )
+void FmDriverView::startSearch( const QString &criteria )
 {    
-    if ( !criteria.isEmpty() && !targetPath.isEmpty() ) {
-        FmViewManager::viewManager()->createFindView( criteria, targetPath );
+    // search all drives when start find in drive view
+    QStringList findTargetPathList;           
+    QStringList driveList;
+    FmUtils::getDriveList( driveList, true );
+    foreach( const QString &drive, driveList ) {
+        QString targetPath =  FmUtils::fillPathWithSplash( drive );
+        if( FmUtils::isDriveC( targetPath ) ) {
+            targetPath =  QString( Folder_C_Data );
+        }
+        findTargetPathList.append( targetPath );
+    }
+
+    if ( !criteria.isEmpty() ) {
+        FmViewManager::viewManager()->createFindView( criteria, findTargetPathList );
     }
 }
 
--- a/filemanager/src/filemanager/src/fmdriverview.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmdriverview.h	Wed Sep 29 10:37:03 2010 +0800
@@ -44,7 +44,7 @@
 
     void activated( const QString &pathName );
     void refreshDrive();
-    void startSearch( const QString &targetPath, const QString &criteria );
+    void startSearch( const QString &criteria );
 
 #ifdef FM_CHANGE_ORIENT_ENABLE
     void on_rotateAction_triggered();
--- a/filemanager/src/filemanager/src/fmfilebrowsewidget.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmfilebrowsewidget.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -24,7 +24,9 @@
 #include "fmviewmanager.h"
 #include "fmfiledialog.h"
 #include "fmdlgutils.h"
+#include "fmserviceutils.h"
 #include "fmfileiconprovider.h"
+#include "fmfilesystemproxymodel.h"
 
 #include <QFile>
 #include <QFileSystemModel>
@@ -79,6 +81,7 @@
 
     mTreeView->setModel( 0 );
     mListView->setModel( 0 );
+	delete mSourceModel;
     delete mModel;
     
     delete mFileIconProvider;
@@ -133,7 +136,7 @@
             }
         case FmErrPathNotExist:
             {
-            FmDlgUtils::information( hbTrId( "Path is not exist" ) );
+            FmDlgUtils::warning( hbTrId( "Path is not exist" ) );
             break;
             }
         case FmErrDriveNotAvailable:
@@ -144,7 +147,7 @@
         case FmErrDriveDenied:
         case FmErrPathDenied:
             {
-            FmDlgUtils::information( hbTrId( "Can not access" ) );
+            FmDlgUtils::warning( hbTrId( "Can not access" ) );
             break;
             }
         default:
@@ -335,16 +338,18 @@
         this, SLOT( on_renameAction_triggered() ), Qt::QueuedConnection );
     }
     
-//    if( fileInfo.isFile() ){
-//        HbAction *sendAction = new HbAction();
-//        sendAction->setObjectName( "sendAction" );
-//        sendAction->setText( hbTrId( "txt_fmgr_menu_send" ) );
-//        contextMenu->addAction( sendAction );
-//        
-//        connect( sendAction, SIGNAL( triggered() ),
-//        this, SLOT( on_sendAction_triggered() ) );
-//    }
+    if( fileInfo.isFile() ){
+        HbAction *sendAction = new HbAction();
+        sendAction->setObjectName( "sendAction" );
+        sendAction->setText( hbTrId( "txt_fmgr_menu_send" ) );
+        contextMenu->addAction( sendAction );
+        
+        connect( sendAction, SIGNAL( triggered() ),
+        this, SLOT( on_sendAction_triggered() ), Qt::QueuedConnection );
+    }
     
+    // delete itself when close
+    contextMenu->setAttribute(Qt::WA_DeleteOnClose);
     contextMenu->setPreferredPos( coords );
     contextMenu->open();
 }
@@ -408,11 +413,15 @@
 
 void FmFileBrowseWidget::initFileModel()
 {
-    mModel = new QFileSystemModel( this );
-    mModel->setReadOnly( false );
+    mSourceModel = new QFileSystemModel( this );
+    mSourceModel->setReadOnly( false );
     
     mFileIconProvider = new FmFileIconProvider();
-    mModel->setIconProvider( mFileIconProvider );
+    mSourceModel->setIconProvider( mFileIconProvider );
+
+    mModel = new FmFileSystemProxyModel( this );
+    mModel->setSourceModel( mSourceModel );
+
 }
 
 void FmFileBrowseWidget::initLayout()
@@ -427,15 +436,12 @@
 {
     mSearchPanel = new HbSearchPanel( this );
     mSearchPanel->setObjectName( "searchPanel" );
-    mSearchPanel->setSearchOptionsEnabled( true );
-    mSearchPanel->setProgressive( false );
+    mSearchPanel->setSearchOptionsEnabled( false );
+    mSearchPanel->setProgressive( true );
     mSearchPanel->hide();
     
-    connect( mSearchPanel, SIGNAL( searchOptionsClicked() ),
-        this, SLOT( on_searchPanel_searchOptionsClicked() ), Qt::QueuedConnection );
-    
-    connect( mSearchPanel, SIGNAL( criteriaChanged( const QString & ) ),
-        this, SLOT( on_searchPanel_criteriaChanged( const QString & ) ) );
+    connect( mSearchPanel, SIGNAL( criteriaChanged( QString ) ),
+        this, SLOT( on_searchPanel_criteriaChanged( QString ) ), Qt::QueuedConnection );
     
     connect( mSearchPanel, SIGNAL( exitClicked() ),
         this, SLOT( on_searchPanel_exitClicked() ) );
@@ -572,21 +578,16 @@
     mSearchPanel->show();
 }
 
-void FmFileBrowseWidget::on_searchPanel_searchOptionsClicked()
-{
-    mFindTargetPath = FmUtils::fillPathWithSplash( FmFileDialog::getExistingDirectory( 0, hbTrId( "Look in:" ), QString(""),
-        QStringList() ) );
-}
-
 void FmFileBrowseWidget::on_searchPanel_criteriaChanged( const QString &criteria )
 {
-    if( mFindTargetPath.isEmpty() ){
-        mFindTargetPath = currentPath().filePath();
-    }
-    emit startSearch( mFindTargetPath, criteria );
-    
+    emit startSearch( criteria );
     mSearchPanel->hide();
     mLayout->removeItem( mSearchPanel );
+	
+    // clear keywords in searchpanel without signal criteriaChanged triggered again
+    mSearchPanel->setProgressive( false );
+    mSearchPanel->setCriteria( QString() );
+    mSearchPanel->setProgressive( true );
 }
 
 void FmFileBrowseWidget::on_searchPanel_exitClicked()
@@ -600,7 +601,7 @@
     QString filePath = mModel->filePath( mCurrentItem->modelIndex() );
     QStringList list;
     list.append( filePath );
-    FmUtils::sendFiles( list );
+    FmViewManager::viewManager()->serviceUtils()->sendFile( list );
 }
 
 void FmFileBrowseWidget::on_viewAction_triggered()
@@ -628,13 +629,13 @@
                 break;
             case FmErrAlreadyStarted:
                 // last operation have not finished
-                FmDlgUtils::information( hbTrId( "Operatin already started!" ) );
+                FmDlgUtils::warning( hbTrId( "Operatin already started!" ) );
                 break;
             case FmErrWrongParam:
-                FmDlgUtils::information( hbTrId( "Wrong parameters!" ) );
+                FmDlgUtils::warning( hbTrId( "Wrong parameters!" ) );
                 break;
             default:
-                FmDlgUtils::information( hbTrId( "Operation fail to start!" ) );
+                FmDlgUtils::warning( hbTrId( "Operation fail to start!" ) );
         }
     }
 }
@@ -657,13 +658,13 @@
                 break;
             case FmErrAlreadyStarted:
                 // last operation have not finished
-                FmDlgUtils::information( hbTrId( "Operatin already started!" ) );
+                FmDlgUtils::warning( hbTrId( "Operatin already started!" ) );
                 break;
             case FmErrWrongParam:
-                FmDlgUtils::information( hbTrId( "Wrong parameters!" ) );
+                FmDlgUtils::warning( hbTrId( "Wrong parameters!" ) );
                 break;
             default:
-                FmDlgUtils::information( hbTrId( "Operation fail to start!" ) );
+                FmDlgUtils::warning( hbTrId( "Operation fail to start!" ) );
         }
     }
 
@@ -687,13 +688,13 @@
                 break;
             case FmErrAlreadyStarted:
                 // last operation have not finished
-                FmDlgUtils::information( hbTrId( "Operatin already started!" ) );
+                FmDlgUtils::warning( hbTrId( "Operatin already started!" ) );
                 break;
             case FmErrWrongParam:
-                FmDlgUtils::information( hbTrId( "Wrong parameters!" ) );
+                FmDlgUtils::warning( hbTrId( "Wrong parameters!" ) );
                 break;
             default:
-                FmDlgUtils::information( hbTrId( "Operation fail to start!" ) );
+                FmDlgUtils::warning( hbTrId( "Operation fail to start!" ) );
         }
     }
 }
@@ -720,11 +721,11 @@
         // check if name/path is available for use
         // add new Name to check, in order to avoid problem of newName is empty
         if( !FmUtils::checkNewFolderOrFile( newName, newTargetPath, errString ) ) {
-            FmDlgUtils::information( errString );
+            FmDlgUtils::warning( errString, HbMessageBox::Ok, true );
             continue;
         }
         if( !rename( fileInfo.absoluteFilePath(), newTargetPath ) ) {
-            FmDlgUtils::information( hbTrId("Rename failed!") );
+            FmDlgUtils::warning( hbTrId("Rename failed!") );
         }
         else {
             // Rename succeed
--- a/filemanager/src/filemanager/src/fmfilebrowsewidget.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmfilebrowsewidget.h	Wed Sep 29 10:37:03 2010 +0800
@@ -37,6 +37,7 @@
 class HbLabel;
 
 class FmFileIconProvider;
+class FmFileSystemProxyModel;
 
 class FmFileBrowseWidget : public HbWidget
 {
@@ -82,13 +83,12 @@
     // triggered when drive is ejected/inserted
     void on_driveChanged();
     
-    void on_searchPanel_searchOptionsClicked();
     void on_searchPanel_criteriaChanged( const QString &criteria );
     void on_searchPanel_exitClicked();
 
 signals:
     void currentPathChanged( const QString& );
-    void startSearch( const QString &targetPath, const QString &criteria );
+    void startSearch( const QString &criteria );
     void setEmptyMenu( bool isMenuEmpty );
     void setTitle( const QString &title );
     void listActivated();
@@ -123,7 +123,8 @@
 	HbTreeView *mTreeView;
     HbListView *mListView;
     QGraphicsLinearLayout *mLayout;
-    QFileSystemModel *mModel;
+    QFileSystemModel *mSourceModel;
+    FmFileSystemProxyModel *mModel;
     
     bool mSelectable;
     
--- a/filemanager/src/filemanager/src/fmfileview.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmfileview.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -199,12 +199,12 @@
 
 	setLayout( vLayout );
 	
-    connect( mWidget, SIGNAL( startSearch( const QString&,  const QString& ) ),
-             this, SLOT( startSearch( const QString&, const QString& ) ) );
+    connect( mWidget, SIGNAL( startSearch( QString ) ),
+             this, SLOT( startSearch( QString ) ) );
     connect( mWidget, SIGNAL( setEmptyMenu( bool ) ),
              this, SLOT( on_mainWidget_setEmptyMenu( bool ) ) );
-    connect( mWidget, SIGNAL( setTitle( const QString & ) ),
-             this, SLOT( on_mainWidget_setTitle( const QString & ) ) );
+    connect( mWidget, SIGNAL( setTitle( QString ) ),
+             this, SLOT( on_mainWidget_setTitle( QString ) ) );
 }
 
 void FmFileView::initToolBar()
@@ -256,7 +256,7 @@
 
 void FmFileView::infoNoFileSelected()
 {
-	FmDlgUtils::information( hbTrId("No File/Folder selected" ) );
+	FmDlgUtils::warning( hbTrId("No File/Folder selected" ) );
 }
 
 #ifdef FM_CHANGE_ORIENT_ENABLE
@@ -303,13 +303,13 @@
                     break;
                 case FmErrAlreadyStarted:
                     // last operation have not finished
-                    FmDlgUtils::information( hbTrId( "Operatin already started!" ) );
+                    FmDlgUtils::warning( hbTrId( "Operatin already started!" ) );
                     break;
                 case FmErrWrongParam:
-                    FmDlgUtils::information( hbTrId( "Wrong parameters!" ) );
+                    FmDlgUtils::warning( hbTrId( "Wrong parameters!" ) );
                     break;
                 default:
-                    FmDlgUtils::information( hbTrId( "Operation fail to start!" ) );
+                    FmDlgUtils::warning( hbTrId( "Operation fail to start!" ) );
             }
             setSelectable( false );
         }
@@ -341,13 +341,13 @@
                     break;
                 case FmErrAlreadyStarted:
                     // last operation have not finished
-                    FmDlgUtils::information( hbTrId( "Operatin already started!" ) );
+                    FmDlgUtils::warning( hbTrId( "Operatin already started!" ) );
                     break;
                 case FmErrWrongParam:
-                    FmDlgUtils::information( hbTrId( "Wrong parameters!" ) );
+                    FmDlgUtils::warning( hbTrId( "Wrong parameters!" ) );
                     break;
                 default:
-                    FmDlgUtils::information( hbTrId( "Operation fail to start!" ) );
+                    FmDlgUtils::warning( hbTrId( "Operation fail to start!" ) );
             }
             setSelectable( false );
         }
@@ -379,13 +379,13 @@
                     break;
                 case FmErrAlreadyStarted:
                     // last operation have not finished
-                    FmDlgUtils::information( hbTrId( "Operatin already started!" ) );
+                    FmDlgUtils::warning( hbTrId( "Operatin already started!" ) );
                     break;
                 case FmErrWrongParam:
-                    FmDlgUtils::information( hbTrId( "Wrong parameters!" ) );
+                    FmDlgUtils::warning( hbTrId( "Wrong parameters!" ) );
                     break;
                 default:
-                    FmDlgUtils::information( hbTrId( "Operation fail to start!" ) );
+                    FmDlgUtils::warning( hbTrId( "Operation fail to start!" ) );
             }
             setSelectable( false );
         }
@@ -411,11 +411,11 @@
             QString errString;
             // check if name/path is available for use
             if( !FmUtils::checkNewFolderOrFile( dirName, newTargetPath, errString ) ) {
-                FmDlgUtils::information( errString );
+                FmDlgUtils::warning( errString, HbMessageBox::Ok, true );
                 continue;
             }
             if( !dir.mkdir( dirName ) ) {
-                FmDlgUtils::information( hbTrId("Operation failed!") );
+                FmDlgUtils::warning( hbTrId("Operation failed!") );
             }
             break;
         }
@@ -471,10 +471,11 @@
     mWidget->sortFiles( FmFileBrowseWidget::ESortByType );
 }
 
-void FmFileView::startSearch( const QString &targetPath, const QString &criteria )
+void FmFileView::startSearch( const QString &criteria )
 {    
-    if ( !criteria.isEmpty() && !targetPath.isEmpty() ) {
-        FmViewManager::viewManager()->createFindView( criteria, targetPath );
+    if ( !criteria.isEmpty() ) {
+        QString targetPath( mWidget->currentPath().filePath() );
+        FmViewManager::viewManager()->createFindView( criteria, QStringList()<<targetPath );
     }
 }
 
--- a/filemanager/src/filemanager/src/fmfileview.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmfileview.h	Wed Sep 29 10:37:03 2010 +0800
@@ -66,7 +66,7 @@
 	void on_sortSizeAction_triggered();
 	void on_sortTypeAction_triggered();
 	
-    void startSearch( const QString &targetPath, const QString &criteria );
+    void startSearch( const QString &criteria );
     void on_mainWidget_setEmptyMenu( bool isMenuEmpty );
     void on_mainWidget_setTitle( const QString &title );
 
--- a/filemanager/src/filemanager/src/fmfindresultmodel.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmfindresultmodel.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -19,11 +19,21 @@
 #include "fmfindresultmodel.h"
 #include "fmfindthread.h"
 #include "fmfileiconprovider.h"
+#include "fmcommon.h"
 
 #include <QDateTime>
 
 #include <hbglobal.h>
 
+// wait \a circularWaitingTimeForStartFind microsecond to try to start find again
+// Since find can not be started while last find is not stopped.
+const int circularWaitingTimeForStartFind = 200;
+
+// wait \a firstWaitingTimeForStartFind microsecond to start find when accept find from caller.
+// Means user can continuously input words for search, so that find will not immediately start after accept each input event.
+// Search will be started after \a firstWaitingTimeForStartFind time of last user input
+const int firstWaitingTimeForStartFind = 750;
+
 /*!
     \fn void finished()
     This signal is emitted when find is finished.
@@ -39,14 +49,92 @@
 FmFindResultModel::FmFindResultModel( QObject *parent )
     : QAbstractListModel( parent )
 {
+    FM_LOG("FmFindResultModel::FmFindResultModel");
     init();
-    connect( mFindThread, SIGNAL(finished()), this, SIGNAL(finished()) );
+    connect( mFindThread, SIGNAL( finished()), this, SLOT(onThreadFinished()) );
 	connect( mFindThread, SIGNAL(found(QStringList)), this, SLOT(on_findThread_found( QStringList) ), Qt::BlockingQueuedConnection ); 
+    connect( &mTimer, SIGNAL(timeout()), this, SLOT(startFind()));
 }
 
 FmFindResultModel::~FmFindResultModel()
 {
+    FM_LOG("FmFindResultModel::~FmFindResultModel START");
+    mFindThread->stop();
+    if( mFindThread->isRunning() ) {
+        mStopEventLoop.exec();
+    }
 	delete mIconProvider;
+    FM_LOG("FmFindResultModel::~FmFindResultModel END");
+}
+
+/*!
+    Send find \a regExp and \a pathList to find queue
+    last un-stopped find will be stopped and start new find in 0 - 2 seconeds.
+*/
+void FmFindResultModel::find( const QRegExp &regExp, const QStringList &pathList )
+{
+    mFindPath   = pathList;
+    mRegExp     = regExp;
+
+    mTimer.stop();
+
+	if (mFindThread->isRunning()) {
+        mFindThread->stop();
+    }
+    mTimer.start( firstWaitingTimeForStartFind );
+}
+
+/*!
+    Internal start entrance, will be triggered by timer
+    Wait till last find stopped and start new find.
+*/
+void FmFindResultModel::startFind()
+{
+    mTimer.stop();
+    if (mFindThread->isRunning()) {
+        mFindThread->stop();
+        mTimer.start( circularWaitingTimeForStartFind );
+		return;
+    }
+
+    // Find starting. Initialize context.
+    mFindThread->setFindPathList( mFindPath );
+    mFindThread->setPattern( mRegExp );
+	removeRows( 0, rowCount() );
+    emit findStarted();
+    mFindThread->start();
+}
+
+/*!
+    Return if find is inprogress
+*/
+bool FmFindResultModel::isFinding() const
+{
+    return mFindThread->isRunning();
+}
+
+/*!
+    Stop find
+*/
+void FmFindResultModel::stopFind()
+{
+    mFindThread->stop();
+    if( mFindThread->isRunning() ) {
+        mStopEventLoop.exec();
+    }
+}
+
+/*
+    Find finish slot.
+*/
+void FmFindResultModel::onThreadFinished()
+{
+    FM_LOG("FmFindResultModel::onThreadFinished");
+
+    // close event loop so that blocked destructor and stopFind() can be released.
+    mStopEventLoop.exit();
+
+    emit findFinished();
 }
 
 /*!
@@ -67,6 +155,9 @@
     return 0;
 }
 
+/*!
+   Get model column count
+*/
 int FmFindResultModel::columnCount( const QModelIndex &parent ) const
 {
     if ( !parent.isValid() )
@@ -75,6 +166,9 @@
     return 0;
 }
 
+/*!
+   Get model data
+*/
 QVariant FmFindResultModel::data( const QModelIndex &index, int role ) const
 {
     if (!indexValid( index ))
@@ -105,11 +199,17 @@
     return QVariant();
 }
 
+/*!
+   Get filePath by \a index
+*/
 QString FmFindResultModel::filePath ( const QModelIndex & index ) const
 {
    return fileInfo( index ).filePath();
 }
 
+/*!
+   Get header data by column number \a section
+*/
 QVariant FmFindResultModel::headerData( int section, Qt::Orientation orientation, int role ) const
 {
     if (orientation == Qt::Horizontal) {
@@ -184,6 +284,9 @@
 	return true;
 }
 
+/*!
+    Get QFileInfo by \a index
+*/
 QFileInfo FmFindResultModel::fileInfo( const QModelIndex &index ) const
 {
     if (index.row() >= 0 && index.row() < mFindResult.size())
@@ -192,49 +295,6 @@
         return QFileInfo();
 }
 
-QString FmFindResultModel::findPath() const
-{
-    return mFindThread->findPath();
-}
-
-void FmFindResultModel::setFindPath( const QString &path )
-{
-    mFindThread->setFindPath( path );
-}
-
-QRegExp FmFindResultModel::pattern() const
-{
-    return mFindThread->pattern();
-}
-
-void FmFindResultModel::setPattern( const QRegExp &regExp )
-{
-    mFindThread->setPattern( regExp );
-}
-
-void FmFindResultModel::find()
-{
-	if(mFindThread->isRunning())
-		return;
-
-    if( findPath().isEmpty() ){
-        mFindThread->setLastResult( mFindResult );
-    }
-	removeRows( 0, rowCount() );
-    mFindThread->start();
-}
-
-void FmFindResultModel::stop()
-{
-    mFindThread->stop();
-    mFindThread->wait();
-}
-
-bool FmFindResultModel::isFinding() const
-{
-    return mFindThread->isRunning();
-}
-
 /*
     Receive \a dataList as some found result
     Then insert dataList to model
@@ -247,12 +307,23 @@
     insertRows( rowCount(), dataList );
 }
 
+/*
+    Get if \a index is valid
+*/
 bool FmFindResultModel::indexValid( const QModelIndex &index ) const
 {
-    Q_UNUSED( index );
-    return true;
+    if( ( index.row() < 0 ) || ( index.row() >= rowCount() ) ) {
+        return false;
+    } else if( ( index.column() < 0 ) || ( index.column() >= columnCount() ) ) {
+        return false;
+    } else {
+        return true;
+    }
 }
 
+/*
+    Init model
+*/
 void FmFindResultModel::init()
 {
     mFindThread = new FmFindThread( this );
@@ -260,6 +331,9 @@
     mIconProvider = new FmFileIconProvider();
 }
 
+/*
+    Sort by name
+*/
 bool FmFindResultModel::caseNameLessThan(const QPair<QString,int> &s1,
                                          const QPair<QString,int> &s2)
 {
@@ -269,6 +343,9 @@
     return info1.fileName() < info2.fileName();
 }
 
+/*
+    Sort by time
+*/
 bool FmFindResultModel::caseTimeLessThan(const QPair<QString,int> &s1,
                                          const QPair<QString,int> &s2)
 {
@@ -278,6 +355,9 @@
     return info1.lastModified() < info2.lastModified();
 }
 
+/*
+    Sort by size
+*/
 bool FmFindResultModel::caseSizeLessThan(const QPair<QString,int> &s1,
                                          const QPair<QString,int> &s2)
 {
@@ -287,6 +367,9 @@
     return info1.size() < info2.size();
 }
 
+/*
+    Sort by type
+*/
 bool FmFindResultModel::caseTypeLessThan(const QPair<QString,int> &s1,
                                          const QPair<QString,int> &s2)
 {
--- a/filemanager/src/filemanager/src/fmfindresultmodel.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmfindresultmodel.h	Wed Sep 29 10:37:03 2010 +0800
@@ -25,6 +25,8 @@
 #include <QFileInfo>
 #include <QStringList>
 #include <QAbstractListModel>
+#include <QTimer>
+#include <QEventLoop>
 
 class FmFindThread;
 class FmFileIconProvider;
@@ -57,14 +59,8 @@
 
     QFileInfo fileInfo( const QModelIndex &index ) const;
 
-    QString findPath() const;
-    void setFindPath( const QString &path );
-
-    QRegExp pattern() const;
-    void setPattern( const QRegExp &regExp );
-
-    void find();
-    void stop();
+    void find( const QRegExp &regExp, const QStringList &pathList );
+    void stopFind();
     bool isFinding() const;
 
     virtual void sort ( int column, Qt::SortOrder order = Qt::AscendingOrder );
@@ -79,19 +75,39 @@
                                   const QPair<QString,int> &s2 );
 
 signals:
-    void finished();
+
+    // pass modelCountChanged signal to parent widget
+    // so parent widget could change contentWiget between emptyTipsWidget and listWidget
     void modelCountChanged( int count );
 
+    // emit when start find thread. view can set empty menu for itself(sort).
+    // because sort while search inprogress may cause data synchornous problem in model.
+    void findStarted();
+
+    // emit when finished find thread. view can set normal menu for itself(sort).
+    void findFinished();
+
 private slots:
     void on_findThread_found( const QStringList &dataList );
+    void startFind();
+    void onThreadFinished();
 
 private:
     bool indexValid( const QModelIndex &index ) const;
     void init();
+    
 
     FmFindThread *mFindThread;
     QStringList mFindResult;
     FmFileIconProvider *mIconProvider;
+
+    QStringList mFindPath;
+    QRegExp     mRegExp;
+    bool        mIsFindRequestPending;
+    QTimer      mTimer;
+
+    QEventLoop  mStopEventLoop;
+
 };
 
 #endif
--- a/filemanager/src/filemanager/src/fmfindthread.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmfindthread.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -17,6 +17,8 @@
  */
 
 #include "fmfindthread.h"
+#include "fmutils.h"
+#include "fmcommon.h"
 
 #include <QDir>
 
@@ -38,86 +40,99 @@
     Please connect this signal by Qt::BlockingQueuedConnection as dataList will be cleared immediately
 */
 
+/*!
+    Constructor, set thread LowPriority
+*/
 FmFindThread::FmFindThread( QObject *parent )
     : QThread( parent )
 {
     setPriority( LowPriority );
 }
 
+/*!
+    Destructor
+*/
 FmFindThread::~FmFindThread()
 {
-}
-
-QString FmFindThread::findPath() const
-{
-    return mFindPath;
+    FM_LOG("FmFindThread::~FmFindThread()");
 }
 
-void FmFindThread::setFindPath( const QString &path )
+/*!
+    Set find path list \a pathList
+*/
+void FmFindThread::setFindPathList( const QStringList &pathList )
 {
-    mFindPath = path;
+    mFindPathList.clear();
+    mFindPathList = pathList;
 }
 
-QRegExp FmFindThread::pattern() const
-{
-    return findPattern;
-}
-
+/*!
+    Set find pattern
+*/
 void FmFindThread::setPattern( const QRegExp &regExp )
 {
     findPattern = regExp;
 }
 
+/*!
+    Stop find
+*/
 void FmFindThread::stop()
 {
+    FM_LOG("FmFindThread::stop()");
     mStop = true;
 }
 
+/*
+    Thread function
+*/
 void FmFindThread::run()
 {
+    FM_LOG( "FmFindThread::run() started ");
     mStop = false;
-    tempResultList.clear();
-    if (findPattern.isEmpty() || !findPattern.isValid())
-        return;
-
-    QDir dir( mFindPath );
-    if (!dir.exists())
-        return;
-    
-    if( mFindPath.isEmpty() ){
-        findInResult();
+    if (findPattern.isEmpty() || !findPattern.isValid()) {
+        FM_LOG( "FmFindThread::run() canceled because error param ");
         return;
     }
-
+ 
     QList<QDir> findDirs;
-    findDirs.append( dir );
+    foreach( const QString &path, mFindPathList ) {
+        QDir dir( path );
+        findDirs.append( dir );
+    }
+
+    count = 0;
     time.restart();
     mStop = false;
     while (!findDirs.isEmpty()) {
+        if (mStop) {
+            FM_LOG("FmFindThread::run() stopped");
+            return;
+        }
         QFileInfoList infoList = findDirs.first().entryInfoList();
         for (QFileInfoList::Iterator it = infoList.begin(); it != infoList.end(); ++it) {
+            if (mStop) {
+                FM_LOG("FmFindThread::run() stopped");
+                return;
+            }
 			QString name = it->fileName();
 			QString absolutPath = it->absoluteFilePath();
             if (findPattern.exactMatch( it->fileName() )) {
-                tempResultList.append( it->absoluteFilePath() );
-                if (tempResultList.count() > notifyPerCount) {
-                    emitFound();
-                } else if (time.elapsed() > notifyPerElapsedTime && tempResultList.count() > 0) {
-                    emitFound();
+                if( !FmUtils::isSystemFolder( it->absoluteFilePath()) ) {
+                    tempResultList.append( it->absoluteFilePath() );
+                    if (tempResultList.count() > notifyPerCount) {
+                        emitFound();
+                    } else if (time.elapsed() > notifyPerElapsedTime && tempResultList.count() > 0) {
+                        emitFound();
+                    }
                 }
             }
 
-            //We are stopped;
-            if (mStop) {
-                if( tempResultList.count() > 0 ) {
-                    emitFound();
-                }
-                return;
-            }
-
             // exclude directory named ".." and "."
             if (it->isDir() && it->fileName() != ParentDir && it->fileName() != CurrentDir ) {
-                findDirs.append( QDir( it->absoluteFilePath() ) );
+                if( !FmUtils::isSystemFolder( it->absoluteFilePath()) ) {
+                    findDirs.append( QDir( it->absoluteFilePath() ) );
+                }
             }
         }
 
@@ -132,42 +147,13 @@
 */
 void FmFindThread::emitFound()
 {
+    if (mStop) {
+        FM_LOG("FmFindThread::emitFound() return because stopped");
+        return;
+    }
     if( tempResultList.count() > 0 ) {
         emit found( tempResultList );
         tempResultList.clear();
         time.restart();
     }
 }
-
-void FmFindThread::setLastResult( QStringList r )
-{
-    mLastResult = r;
-}
-
-/*
-    Find keyword in last result
-    \sa setLastResult, this function must be called to set last result for findInResult
-*/
-void FmFindThread::findInResult()
-{
-    if( mFindPath.isEmpty() ){
-        for (QStringList::Iterator it = mLastResult.begin(); it != mLastResult.end(); ++it) { 
-            if (mStop){
-                return;
-            }
-            QString absolutPath = (*it);
-            QFileInfo fileInfo( absolutPath );
-            QString fileName = fileInfo.fileName();
-            
-            if (findPattern.exactMatch( fileName ) ) {
-                tempResultList.append( absolutPath );
-                if ( tempResultList.count() > notifyPerCount ) {
-                    emitFound();
-                } else if (time.elapsed() > notifyPerElapsedTime && tempResultList.count() > 0) {
-                    emitFound();
-                }
-            }
-        }    
-    }
-    emitFound();
-}
--- a/filemanager/src/filemanager/src/fmfindthread.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmfindthread.h	Wed Sep 29 10:37:03 2010 +0800
@@ -33,14 +33,9 @@
     explicit FmFindThread( QObject *parent = 0 );
     ~FmFindThread();
 
-    QString findPath() const;
-    void setFindPath( const QString &path );
-
-    QRegExp pattern() const;
+    void setFindPathList( const QStringList &pathList );
     void setPattern( const QRegExp &regExp );
-    
-    void setLastResult( QStringList r );
-
+	
     void stop();
 
 signals:
@@ -51,14 +46,13 @@
 
 private:
     void emitFound();
-    void findInResult();
 
     volatile bool mStop;
     int count;
-    QString mFindPath;
+    QStringList mFindPathList;
     QTime time;
     QRegExp findPattern;
-    QStringList mLastResult;
+
     // Used to store temp search result. if emit found, the result will be cleared.
     QStringList tempResultList;
 };
--- a/filemanager/src/filemanager/src/fmfindview.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmfindview.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -26,20 +26,17 @@
 #include <hbmenu.h>
 
 FmFindView::FmFindView() : FmViewBase( EFindView ),
-                           mWaitNote( 0 ),
                            mMenu( 0 )
 {
     initMenu();
     initMainWidget();
     initToolBar();
-
+    setTitle( hbTrId("find") );
     QMetaObject::connectSlotsByName( this );
 }
 
 FmFindView::~FmFindView()
 {
-    delete mWaitNote;
-    mWaitNote = 0;
 }
 
 void FmFindView::activated( const QString& pathName )
@@ -48,33 +45,13 @@
     FmViewManager::viewManager()->createFileView( pathName, true, true );
 }
 
-void FmFindView::find( const QString &keyword, const QString &path )
-{
-    setTitle( keyword );
-    mFindWidget->find( keyword, path );
-    mWaitNote->open();
-}
-
-void FmFindView::stopFind()
+void FmFindView::find( const QString &keyword, const QStringList &pathList )
 {
-    mFindWidget->stopFind();
-}
-
-void FmFindView::findFinished()
-{
-    if( mWaitNote ){
-        mWaitNote->close();
-    }
-//    mFindWidget->activeSearchPanel();
+    mFindWidget->find( keyword, pathList );
 }
 
 void FmFindView::initMenu()
 {
-    HbAction *findAction = new HbAction( this );
-    findAction->setObjectName( "findAction" );
-    findAction->setText( hbTrId( "Find" ) );
-    menu()->addAction( findAction ); 
-    
     HbMenu *subMenu = new HbMenu( hbTrId( "Sort" ) );
     
     HbAction *sortNameAction = new HbAction( subMenu );
@@ -99,8 +76,6 @@
     
     menu()->addMenu( subMenu );
     
-    connect( findAction, SIGNAL( triggered() ),
-             this, SLOT( on_findAction_triggered() ) );
     connect( sortNameAction, SIGNAL( triggered() ),
              this, SLOT( on_sortNameAction_triggered() ) );
     connect( sortTimeAction, SIGNAL( triggered() ),
@@ -116,17 +91,9 @@
 void FmFindView::initMainWidget()
 {
     mFindWidget = new FmFindWidget( this );
-    connect( mFindWidget, SIGNAL(finished()), this, SLOT(findFinished()) );
     setWidget( mFindWidget );
 
-    if( !mWaitNote ){
-        mWaitNote = new HbProgressDialog( HbProgressDialog::WaitDialog );
-        mWaitNote->setText( hbTrId( "Finding..." ) );
-    }
-    connect( mWaitNote, SIGNAL(cancelled()), this, SLOT(stopFind()) );
     connect( mFindWidget, SIGNAL(activated( const QString&)), this, SLOT( activated(const QString&)) );
-    connect( mFindWidget, SIGNAL( startSearch( const QString&,  const QString& ) ),
-             this, SLOT( startSearch( const QString&, const QString& ) ) );
     connect( mFindWidget, SIGNAL( setEmptyMenu( bool ) ),
              this, SLOT( on_findWidget_setEmptyMenu( bool ) ) );
 }
@@ -155,18 +122,6 @@
     mFindWidget->sortFiles( FmFindResultModel::Type  );
 }
 
-void FmFindView::startSearch( const QString &targetPath, const QString &criteria )
-{  
-    if ( !criteria.isEmpty( ) ) {
-        find( criteria, targetPath );  
-    }
-}
-
-void FmFindView::on_findAction_triggered()
-{
-    mFindWidget->activeSearchPanel();
-}
-
 void FmFindView::on_findWidget_setEmptyMenu( bool isMenuEmpty )
 {
     if( isMenuEmpty ){
@@ -181,3 +136,8 @@
         }
     }
 }
+
+void FmFindView::aboutToClose()
+{
+    mFindWidget->stopFind();
+}
--- a/filemanager/src/filemanager/src/fmfindview.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmfindview.h	Wed Sep 29 10:37:03 2010 +0800
@@ -34,22 +34,17 @@
     FmFindView();
     virtual ~FmFindView();
 
-    void find( const QString &keyword, const QString &path );
+    void find( const QString &keyword, const QStringList &pathList );
 
 public slots:
     void activated( const QString &pathName );
-    void stopFind();
-
+    
 private slots:
-    void findFinished();
-    void on_findAction_triggered();
     void on_sortNameAction_triggered();
     void on_sortTimeAction_triggered();
     void on_sortSizeAction_triggered();
     void on_sortTypeAction_triggered();
     
-    void startSearch( const QString &targetPath, const QString &criteria );
-    
     void on_findWidget_setEmptyMenu( bool isMenuEmpty );
     
 private:
@@ -57,8 +52,10 @@
     void initMainWidget();
     void initToolBar();
 
+    // from FmViewBase
+    virtual void aboutToClose();
+
     FmFindWidget *mFindWidget;
-    HbProgressDialog *mWaitNote;
     HbMenu *mMenu;
 };
 
--- a/filemanager/src/filemanager/src/fmfindwidget.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmfindwidget.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -29,15 +29,20 @@
 #include <hbsearchpanel.h>
 #include <hblabel.h>
 #include <hbwidget.h>
+#include <hbstackedwidget.h>
 
 FmFindWidget::FmFindWidget( QGraphicsItem *parent )
     : HbWidget( parent )
 {
+    FM_LOG("FmFindWidget::FmFindWidget()");
     init();
 }
 
 FmFindWidget::~FmFindWidget()
 {
+    FM_LOG("FmFindWidget::~FmFindWidget() START");
+    delete mModel;
+    FM_LOG("FmFindWidget::~FmFindWidget() END");
 }
 
 void FmFindWidget::itemActivated(const QModelIndex &index)
@@ -55,94 +60,60 @@
     }
 }
 
-void FmFindWidget::find( const QString &keyword, const QString &path )
+void FmFindWidget::find( const QString &keyword, const QStringList &pathList )
 {
-    mModel->setFindPath( path );
-    
-    QRegExp regExp( '*' + keyword + '*' );
-    regExp.setPatternSyntax( QRegExp::Wildcard );
-    regExp.setCaseSensitivity( Qt::CaseInsensitive );
-    mModel->setPattern( regExp );
-
-    mModel->find();
+    mPathList = pathList;
+    // find will auto-start after receive criteria change event.
+    mSearchPanel->setCriteria( keyword );
 }
 
 void FmFindWidget::stopFind()
 {
-    mModel->stop();
-}
-
-void FmFindWidget::on_resultModel_finished()
-{
-    emit finished();
-    //Since layout problem is found, refresh it
-    on_resultModel_refresh();  
+    mModel->stopFind();
 }
 
 void FmFindWidget::on_resultModel_modelCountChanged( int count )
 {
     if( count > 0 ) {
-        activateContentWidget( ResultListView );
+        mContentWidget->setCurrentWidget( mListView );
     } else {
-        activateContentWidget( EmptyTipWidget );
+        mContentWidget->setCurrentWidget( mEmptyTipWidget );
     }
 }
 
-void FmFindWidget::activateContentWidget( ContentWidgetType contentWidgetType )
+void FmFindWidget::on_resultModel_findStarted()
 {
-    switch( contentWidgetType )
-    {
-    case EmptyTipWidget:
-        {
-        if( mLayout->count() > 0 ) {
-            if( mLayout->itemAt( 0 ) == mListView ) {
-                mLayout->removeItem( mListView );
-                mLayout->addItem( mEmptyTipWidget );
-            } 
-        } else {
-            mLayout->addItem( mEmptyTipWidget );
-        }
-        mListView->hide();
-        mEmptyTipWidget->show();
-        deActiveSearchPanel();
-        emit setEmptyMenu( true );
-        }
-        break;
-    case ResultListView:
-        {
-        if( mLayout->count() > 0 ) {
-            if( mLayout->itemAt( 0 ) == mEmptyTipWidget ) {
-                mLayout->removeItem( mEmptyTipWidget );
-                mLayout->addItem( mListView );
-            } 
-        } else {
-            mLayout->addItem( mListView );
-        }
-        mEmptyTipWidget->hide();
-        mListView->show();
-        activeSearchPanel();
-        emit setEmptyMenu( false );
-        }
-        break;
-    }
+    emit setEmptyMenu( true );
+}
+
+void FmFindWidget::on_resultModel_findFinished()
+{
+    emit setEmptyMenu( false );
 }
 
 void FmFindWidget::init()
 {
     mLayout = new QGraphicsLinearLayout( this );
     mLayout->setOrientation( Qt::Vertical );
+ 
+    mContentWidget = new HbStackedWidget( this );
+    mLayout->addItem( mContentWidget );
+    initSearchPanel();
+    mLayout->addItem( mSearchPanel );
+    setLayout( mLayout );
 
     mModel = new FmFindResultModel( this );
     mModel->setObjectName( "resultModel" );
 
-    connect( mModel, SIGNAL(finished()), this, SLOT( on_resultModel_finished()) );
+    connect( mModel, SIGNAL( modelCountChanged( int )),
+        this, SLOT( on_resultModel_modelCountChanged( int )), Qt::QueuedConnection );
 
-    connect( mModel, SIGNAL( modelCountChanged( int )),
-        this, SLOT( on_resultModel_modelCountChanged( int )) );
+    connect( mModel, SIGNAL( findStarteded()),
+        this, SLOT( on_resultModel_findStarted()) );
+
+    connect( mModel, SIGNAL( findFinished()),
+        this, SLOT( on_resultModel_findFinished()) );
     
-    connect( mModel, SIGNAL( refresh()),
-        this, SLOT( on_resultModel_refresh()) );
-
     mListView = new HbListView( this );
     mListView->setModel( mModel );
 
@@ -150,12 +121,13 @@
     QGraphicsLinearLayout *emptyTipLayout = new QGraphicsLinearLayout( mEmptyTipWidget );
     HbLabel *emptyTipLable = new HbLabel( hbTrId( "No found files or folders" ), mEmptyTipWidget );
     emptyTipLayout->addItem( emptyTipLable );
+    emptyTipLayout->setAlignment( emptyTipLable, Qt::AlignCenter );
+    emptyTipLable->setAlignment( Qt::AlignCenter );
  
-    initSearchPanel();
-    activateContentWidget( EmptyTipWidget );
+    mContentWidget->addWidget( mListView );
+    mContentWidget->addWidget( mEmptyTipWidget );
     
-    setLayout( mLayout );
-
+    mContentWidget->setCurrentWidget( mEmptyTipWidget );
     connect( mListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemActivated(QModelIndex)));
 }
 
@@ -163,15 +135,14 @@
 {
     mSearchPanel = new HbSearchPanel( this );
     mSearchPanel->setObjectName( "searchPanel" );
-//    mSearchPanel->setSearchOptionsEnabled( true );
-    mSearchPanel->setProgressive( false );
-    mSearchPanel->hide();
+    mSearchPanel->setSearchOptionsEnabled( false );
+    mSearchPanel->setProgressive( true );
     
     connect( mSearchPanel, SIGNAL( criteriaChanged( const QString & ) ),
-        this, SLOT( on_searchPanel_criteriaChanged( const QString & ) ) );
+        this, SLOT( on_searchPanel_criteriaChanged( const QString & ) ), Qt::QueuedConnection  );
     
     connect( mSearchPanel, SIGNAL( exitClicked() ),
-        this, SLOT( on_searchPanel_exitClicked() ) );
+        this, SLOT( on_searchPanel_exitClicked() ), Qt::QueuedConnection );
 }
 
 void FmFindWidget::sortFiles( FmFindResultModel::SortFlag sortFlag )
@@ -179,35 +150,23 @@
     mModel->sort( sortFlag );
 }
 
-void FmFindWidget::activeSearchPanel()
-{
-    mLayout->addItem( mSearchPanel );
-    mSearchPanel->show();
-}
-
 void FmFindWidget::on_searchPanel_criteriaChanged( const QString &criteria )
 {
-    mFindTargetPath.clear();
-    emit startSearch( mFindTargetPath, criteria );
+    QRegExp regExp;
+    if( !criteria.isEmpty() ) {
+        regExp.setPattern( '*' + criteria + '*' );
+    }
+    // if criteria is empty, then keep regExp empty. find thread will return empty result.
+    
+    regExp.setPatternSyntax( QRegExp::Wildcard );
+    regExp.setCaseSensitivity( Qt::CaseInsensitive );
+
+    mModel->find( regExp, mPathList );
 }
 
 void FmFindWidget::on_searchPanel_exitClicked()
 {
-    mSearchPanel->hide();
-    mLayout->removeItem( mSearchPanel );
-}
-
-void FmFindWidget::deActiveSearchPanel()
-{
-    mSearchPanel->hide();
-    mLayout->removeItem( mSearchPanel );
-
-}
-
-void FmFindWidget::on_resultModel_refresh()
-{
-    mListView->setModel( 0 );
-    mListView->setModel( mModel );  
+    FmViewManager::viewManager()->popViewAndShow();
 }
 
 
--- a/filemanager/src/filemanager/src/fmfindwidget.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmfindwidget.h	Wed Sep 29 10:37:03 2010 +0800
@@ -28,6 +28,7 @@
 class HbListView;
 class HbSearchPanel;
 class HbWidget;
+class HbStackedWidget;
 
 class QGraphicsLinearLayout;
 
@@ -35,26 +36,15 @@
 {
     Q_OBJECT
 public:
-    enum ContentWidgetType
-    {
-        EmptyTipWidget,
-        ResultListView
-    };
     FmFindWidget( QGraphicsItem *parent = 0 );
     ~FmFindWidget();
 
-    void find( const QString &keyword, const QString &path );
+    void find( const QString &keyword, const QStringList &pathList );
     void stopFind();
     void sortFiles( FmFindResultModel::SortFlag sortFlag );
-    
-    void activeSearchPanel();
-    void deActiveSearchPanel();
 
 signals:
-    void finished();
     void activated( const QString &pathName );
-    
-    void startSearch( const QString &targetPath, const QString &criteria );
     void setEmptyMenu( bool isMenuEmpty );
 
 private slots:
@@ -63,14 +53,14 @@
     void on_searchPanel_criteriaChanged( const QString &criteria );
     void on_searchPanel_exitClicked();
 
-    void on_resultModel_finished();
     void on_resultModel_modelCountChanged( int count );
-    void on_resultModel_refresh();
-        
+
+    void on_resultModel_findStarted();
+    void on_resultModel_findFinished();
+    
 private:
     void init();
     void initSearchPanel();
-    void activateContentWidget( ContentWidgetType contentWidgetType );
 
 private:
     HbListView          *mListView;
@@ -78,8 +68,16 @@
     HbWidget            *mEmptyTipWidget;
     
     QGraphicsLinearLayout *mLayout;
-    HbSearchPanel* mSearchPanel;
-    QString mFindTargetPath;
+	
+	// used to stack emptytip widget and list view.
+	// only one widget can be shown at the same time.
+    HbStackedWidget  *mContentWidget;
+	
+    HbSearchPanel*  mSearchPanel;
+	
+	// store the find path list
+	// for example, if start find from drive view. All available drive will be used to find
+    QStringList     mPathList;
 };
 
 #endif
--- a/filemanager/src/filemanager/src/fmmainwindow.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmmainwindow.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -20,10 +20,21 @@
 #include "fmcommon.h"
 
 #include <hbaction.h>
+#include <QTimer>
 
+/*!
+    \fn void applicationReady()
+    This signal is emitted when application is launched and ready to use
+*/
+
+
+/*!
+    constructor
+*/
 FmMainWindow::FmMainWindow() : mViewManager( 0 ), mFirstViewLoaded( false )
 {
-   // connect(this, SIGNAL(viewReady()), this, SLOT(delayedLoading()));
+    // delayedLoading is not used currently but reserved for future
+    // connect(this, SIGNAL(viewReady()), this, SLOT(delayedLoading()));
     init();
 }
 
@@ -34,21 +45,21 @@
     FmViewManager::RemoveViewManager();
 }
 
+/*
+    handle orientation change event. not used yet as views can handle such event by themself
+*/
 void FmMainWindow::onOrientationChanged( Qt::Orientation orientation )
 {
 	Q_UNUSED( orientation );
-	/*
-    if ( orientation == Qt::Vertical ) {
-        activateDriverView();
-    } else {
-        activateSplitView();
-    }
-	*/
 }
 
+/*
+    init main window
+*/
 void FmMainWindow::init()
 {
     FM_LOG("FmMainWindow::init start");
+
     mViewManager = FmViewManager::CreateViewManager( this );
     mViewManager->createDriverView();
     connect(this, SIGNAL(aboutToChangeView(HbView *, HbView *)), 
@@ -56,14 +67,17 @@
     connect( this, SIGNAL( orientationChanged( Qt::Orientation ) ),
              this, SLOT( onOrientationChanged( Qt::Orientation ) ) );
     
+
+    connect(&mShowTimer, SIGNAL(timeout()), this, SLOT(onApplicationReady()));
+    mShowTimer.start();
+
     FM_LOG("FmMainWindow::init end");
-//    if ( orientation() == Qt::Vertical ) {
-//        createDriverView();
-//    } else {
-//        createSplitView();
-//    }
 }
 
+
+/*
+    delayedLoading is not used currently but reserved for future
+*/
 void FmMainWindow::delayedLoading()
 {
     FM_LOG("FmMainWindow::delayedLoading start");
@@ -75,3 +89,11 @@
     FM_LOG("FmMainWindow::delayedLoading end");
 }
 
+/*
+    Slot to receive timer event after application started and emit applicationReady signal
+*/
+void FmMainWindow::onApplicationReady()
+{
+    mShowTimer.stop();
+    emit applicationReady();
+}
--- a/filemanager/src/filemanager/src/fmmainwindow.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmmainwindow.h	Wed Sep 29 10:37:03 2010 +0800
@@ -23,7 +23,7 @@
 #include "fmviewmanager.h"
 
 #include <hbmainwindow.h>
-
+#include <QTimer>
 class HbAction;
 
 class FmMainWindow : public HbMainWindow
@@ -33,13 +33,21 @@
     FmMainWindow();
     ~FmMainWindow();
 
+signals:
+    void applicationReady();
+
 private slots:
     void onOrientationChanged( Qt::Orientation orientation );
-
+    void delayedLoading();
+    void onApplicationReady();
 private:
     void init();
 
     FmViewManager *mViewManager;
+    bool mFirstViewLoaded;
+
+    // timer used to get opportunity for emit applicationReady signal.
+    QTimer mShowTimer;
 };
 
 #endif
--- a/filemanager/src/filemanager/src/fmsplitview.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmsplitview.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -21,7 +21,6 @@
 #include "fmdriverlistwidget.h"
 #include <QGraphicsLinearLayout>
 
-#include <hbmessagebox.h>
 #include <hbmenu.h>
 #include <hbaction.h>
 #include <hbmainwindow.h>
@@ -50,7 +49,7 @@
 
 void FmSplitView::on_normalViewAction_triggered()
 {
-	mainWindow()->setCurrentView( mainWindow()->viewAt(0) );
+	mainWindow()->setCurrentView( mainWindow()->views().first() );
 }
 
 void FmSplitView::initMenu()
--- a/filemanager/src/filemanager/src/fmviewbase.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmviewbase.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -44,3 +44,10 @@
     FmViewManager::viewManager()->popViewAndShow();
 }
 
+/*!
+    called when about to close. used to close some resource before deleted.
+ */
+void FmViewBase::aboutToClose()
+{
+
+}
--- a/filemanager/src/filemanager/src/fmviewbase.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmviewbase.h	Wed Sep 29 10:37:03 2010 +0800
@@ -47,7 +47,7 @@
     {
         return mViewType;
     }
-     
+    virtual void aboutToClose();
 private slots:
     void on_backAction_triggered();
 	
@@ -56,6 +56,7 @@
     
 private:
     void init();
+
 private:
     TViewType mViewType;
     
--- a/filemanager/src/filemanager/src/fmviewmanager.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmviewmanager.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -30,6 +30,7 @@
 #include "fmdrivewatcher.h"
 #include "fmdialog.h"
 #include "fmdlgutils.h"
+#include "fmserviceutils.h"
 
 #include <hbview.h>
 #include <hbmainwindow.h>
@@ -73,7 +74,8 @@
 	return mDialog;
 }
 
-FmViewManager::FmViewManager( FmMainWindow* mainWindow ) : mOperationService( 0 )
+FmViewManager::FmViewManager( FmMainWindow* mainWindow ) 
+    : mOperationService( 0 ), mServiceUtils( 0 )
 {
     mMainWindow = mainWindow;
     mDriveWatcher = new FmDriveWatcher( this );
@@ -98,6 +100,9 @@
     mDriveWatcher->cancelWatch();
     delete mDriveWatcher;
     mDriveWatcher = 0;
+    
+    delete mServiceUtils;
+    mServiceUtils = 0;
 
 }
 
@@ -125,10 +130,22 @@
     if ( !mOperationService ) {
         mOperationService = new FmOperationService( this );
         mOperationService->setObjectName( "operationService" );
+        QMetaObject::connectSlotsByName( this );
     }    
     return mOperationService;
 }
 
+/*
+   return \a FmServiceUtils. 
+ */
+FmServiceUtils *FmViewManager::serviceUtils()
+{
+    if( !mServiceUtils ) {
+        mServiceUtils = new FmServiceUtils;
+    }
+    return mServiceUtils;
+}
+
 void FmViewManager::popViewAndShow()
 {
     FmViewBase *view = static_cast<FmViewBase *>( mMainWindow->currentView() );
@@ -137,7 +154,13 @@
     if( viewCount() == 1 ) {
         mScreenShot = QPixmap::grabWidget(mMainWindow, mMainWindow->rect());
     }
-    mMainWindow->removeView( view );   
+    mMainWindow->removeView( view );  
+	// If call QEventLoop in destructor of HbView, it will panic
+	// So add aboutToClose function to do some prepare when view will be closed
+	// for example, close find view while find is inprogress.
+    // stop find thread in destructor of FmFindView(called by delete container->model...)
+    // and use QEventLoop to wait till thread exit.
+    view->aboutToClose();
     delete view;
 
     if( viewCount() < 1 )
@@ -183,6 +206,7 @@
     mMainWindow->setCurrentView( driverView );
     HbActivityManager* activityManager = qobject_cast<HbApplication*>(qApp)->activityManager();        
     bool ok = activityManager->removeActivity("FMMemoryStoragesList");
+    Q_UNUSED( ok );
 
     connect( this, SIGNAL( driveSpaceChanged() ), 
         driverView, SLOT( refreshDrive() ) );
@@ -214,7 +238,7 @@
     }
    
     if( checkedPath.isEmpty() ) {
-        FmDlgUtils::information( QString( hbTrId("Path: %1 is unavailable!").arg( path )) );
+        FmDlgUtils::warning( QString( hbTrId("Path: %1 is unavailable!").arg( path )) );
         return;
     }
 
@@ -236,14 +260,17 @@
         this, SLOT( popViewAndShow() ), Qt::QueuedConnection );
 }
 
-void FmViewManager::createFindView( const QString &keyword, const QString &path )
+/*
+    Create fild view and search \a keyword in \a pathList
+*/
+void FmViewManager::createFindView( const QString &keyword, const QStringList &pathList )
 {
     FmFindView *findView= new FmFindView();
     
     mMainWindow->addView( findView );
     mMainWindow->setCurrentView( findView );
 
-    findView->find( keyword, path );
+    findView->find( keyword, pathList );
  }
 
 void FmViewManager::createSplitView()
@@ -327,11 +354,8 @@
     HbActivityManager* activityManager = qobject_cast<HbApplication*>(qApp)->activityManager();     
     // add the activity to the activity manager
     bool ok = activityManager->addActivity("FMMemoryStoragesList", QVariant(), metadata);
-    if ( !ok )
-    {
-    qFatal("Add failed" );
-    }
-
+    // do not need check return value
+    Q_UNUSED( ok );
 }
 
 void FmViewManager::onAboutToChangeView(HbView * oldView, HbView *newView)
--- a/filemanager/src/filemanager/src/fmviewmanager.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/fmviewmanager.h	Wed Sep 29 10:37:03 2010 +0800
@@ -32,6 +32,7 @@
 class QFileSystemWatcher;
 class FmDriveWatcher;
 class FmDialog;
+class FmServiceUtils;
 
 /*
  * this class is used to record relationship between dialog and drive name 
@@ -65,12 +66,13 @@
     static void RemoveViewManager();
     static FmViewManager *viewManager();
     FmOperationService *operationService();
+    FmServiceUtils *serviceUtils();
     
     Qt::Orientation orientation(); 
 
     void createFileView( const QString &path,
-        bool enableBackPathCheck = true, bool disableFind = false );
-    void createFindView( const QString &keyword, const QString &path );
+    bool enableBackPathCheck = true, bool disableFind = false );
+    void createFindView( const QString &keyword, const QStringList &pathList );
     void createDriverView();
     void createSplitView();
 	void createBackupView();
@@ -146,6 +148,9 @@
 	QList<FmDlgCloseUnit*> mDlgCloseUnitList;
 	
 	QPixmap mScreenShot;
+
+    // non-static service utils
+    FmServiceUtils *mServiceUtils;
 };
 
 
--- a/filemanager/src/filemanager/src/operationservice/fmoperationcopyormove.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/operationservice/fmoperationcopyormove.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -127,7 +127,8 @@
         QString checkedSource( FmUtils::formatPath( source ) );
         QFileInfo fi( checkedSource );
         if( !fi.exists() ) {
-            mErrString = checkedSource;            
+            mErrString = checkedSource;   
+            emit driveSpaceChanged();
             emit notifyError( FmErrSrcPathDoNotExist, mErrString );
             return;
         }
@@ -168,22 +169,22 @@
             }
         }
         if( ret != FmErrNone ) {
-            emit notifyError( ret, mErrString );
             // refresh drive space no care if cancel, error or finished.
             // as filemanger cannot notify drive space changed
             // do not refresh path as QFileSystemModel will do auto-refresh
             emit driveSpaceChanged();
+            emit notifyError( ret, mErrString );
             return;
         }
         ret = copyOrMove( checkedSource, mTargetPath, newName );
         if( ret != FmErrNone ) {
+            emit driveSpaceChanged();
             emit notifyError( ret, mErrString );            
-            emit driveSpaceChanged();
             return;
         }
-    }
+    }    
+    emit driveSpaceChanged();
     emit notifyFinish();
-    emit driveSpaceChanged();
 }
 
 /*
--- a/filemanager/src/filemanager/src/operationservice/fmoperationformat.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/operationservice/fmoperationformat.h	Wed Sep 29 10:37:03 2010 +0800
@@ -35,7 +35,9 @@
     
 signals:
     void driveSpaceChanged();
-    
+private:
+    void storeVolumeName( int drive );
+    void restoreVolumeName( int drive );
 private:
     QString mDriverName;
     
--- a/filemanager/src/filemanager/src/operationservice/fmoperationformat_s60.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/operationservice/fmoperationformat_s60.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -19,8 +19,11 @@
 #include "fmcommon.h"
 #include "fmoperationbase.h"
 #include "fmutils.h"
+#include "fmviewmanager.h"
+#include "fmserviceutils.h"
 
 #include <QString>
+#include <QSettings>
 
 #include <f32file.h>
 #include <e32property.h>
@@ -71,6 +74,8 @@
         emit notifyError( FmErrWrongParam, QString() );
         return;
     }
+    FmViewManager::viewManager()->serviceUtils()->closeApps();
+    
     
     RFormat format;
     
@@ -84,7 +89,9 @@
 
     TInt drive = 0;
     drive = mDriverName[0].toUpper().toAscii() - 'A' + EDriveA;
-
+    // save volume name for MassStorage
+    storeVolumeName( drive );
+    
     TDriveName formatDriveName( TDriveUnit( drive ).Name() );
 
     int finalValue = 0;
@@ -196,18 +203,60 @@
         format.Close();        
         fs.Close();
         
+        // restore volume name for MassStorage
+        restoreVolumeName( drive );
         FmUtils::createDefaultFolders( mDriverName );
     }
 
+    FmViewManager::viewManager()->serviceUtils()->restartApps();
+    
+    // refresh drive space no care if cancel, error or finished.
+    // as filemanger cannot notify drive space changed
+    // do not refresh path as QFileSystemModel will do auto-refresh
+    emit driveSpaceChanged();   
     if( err == KErrNone ){
         emit notifyFinish();        
     }
     else{
         emit notifyError( FmErrTypeFormatFailed, QString() );
     }
-    // refresh drive space no care if cancel, error or finished.
-    // as filemanger cannot notify drive space changed
-    // do not refresh path as QFileSystemModel will do auto-refresh
-    emit driveSpaceChanged();    
+}
+
+void FmOperationFormat::storeVolumeName( int drive )
+{
+    FmDriverInfo driverInfo = FmUtils::queryDriverInfo( FmUtils::numberToDriveName( drive ) );
+    if ( driverInfo.driveType() == FmDriverInfo::EDriveTypeMassStorage )
+    {
+        QString volumeName( driverInfo.volumeName() );
+        QSettings settings( "Nokia", "FileManager" );
+        settings.beginGroup( "Settings" );
+        settings.setValue( "MassStorageDriveNumber", drive );
+        settings.setValue( "MassStorageVolumeName", volumeName );
+        settings.endGroup();
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CFileManagerEngine::RestoreVolumeNameL()
+//
+// -----------------------------------------------------------------------------
+//  
+void FmOperationFormat::restoreVolumeName( int drive )
+{
+
+    FmDriverInfo driveInfo = FmUtils::queryDriverInfo( FmUtils::numberToDriveName( drive ));
+    if ( driveInfo.driveType() == FmDriverInfo::EDriveTypeMassStorage )
+    {
+        QSettings settings("Nokia", "FileManager");
+        settings.beginGroup("Settings");
+        int massStorageDriveNumber    = settings.value( "MassStorageDriveNumber", -1 ).toInt();
+        QString massStorageVolumeName = settings.value( "MassStorageVolumeName", QString() ).toString();
+        settings.endGroup();
     
+        if ( ( !massStorageVolumeName.isEmpty() ) &&
+                ( massStorageDriveNumber == drive ) )
+        {
+            FmUtils::renameDrive( FmUtils::numberToDriveName( drive ), massStorageVolumeName );
+        }
+    }
 }
--- a/filemanager/src/filemanager/src/operationservice/fmoperationremove.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/operationservice/fmoperationremove.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -95,16 +95,16 @@
     foreach( const QString& srcPath, mPathList ) {
         int ret = remove( srcPath );
         if( ret != FmErrNone ) {
-            emit notifyError( ret, mErrString );
             // refresh drive space no care if cancel, error or finished.
             // as filemanger cannot notify drive space changed
             // do not refresh path as QFileSystemModel will do auto-refresh
             emit driveSpaceChanged();
+            emit notifyError( ret, mErrString );
             return;
         }
-    }
+    }    
+    emit driveSpaceChanged();
     emit notifyFinish();
-    emit driveSpaceChanged();
 }
 
 /*
--- a/filemanager/src/filemanager/src/operationservice/fmoperationresultprocesser.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/operationservice/fmoperationresultprocesser.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -72,7 +72,7 @@
         QString errString;
         // check if name/path is available for use.
         if( !FmUtils::checkNewFolderOrFile( value, newTargetPath, errString ) ) {
-            FmDlgUtils::information( errString );
+            FmDlgUtils::warning( errString, HbMessageBox::Ok, true );
             ret = FmDlgUtils::showTextQuery( questionText, value, regExpList, maxFileNameLength, QString(), false );
             continue;
         } else {
@@ -86,7 +86,7 @@
         if ( ( srcFileInfo.suffix().compare( destFileInfo.suffix(), Qt::CaseInsensitive ) != 0 )
             && srcFileInfo.isFile() ) {
             // popup warning when the suffix of file is changed.
-            FmDlgUtils::information( hbTrId( "File may become unusable when file name extension is changed" ) );        
+            FmDlgUtils::warning( hbTrId( "File may become unusable when file name extension is changed" ) );        
         }   
 	}
 }
@@ -117,7 +117,7 @@
 void FmOperationResultProcesser::onShowNote( FmOperationBase* operationBase, const char *noteString )
 {
     Q_UNUSED( operationBase );
-    FmDlgUtils::information(hbTrId(noteString));
+    FmDlgUtils::information(hbTrId(noteString), HbMessageBox::Ok, true );
 }
 
 /*
@@ -175,6 +175,7 @@
         break;
     case FmOperationService::EOperationTypeFormat:
         title = hbTrId("format preparing");
+        FmUtils::setSystem( true );
         break;
     default:
         break;
@@ -257,7 +258,8 @@
         }
     case FmOperationService::EOperationTypeFormat:
         {
-            FmDlgUtils::information( QString( hbTrId("Format succeed!")) );
+            FmUtils::setSystem( false );
+            FmDlgUtils::information( QString( hbTrId("Format succeed!")), HbMessageBox::Ok, true );
             FmOperationFormat *paramFormat = static_cast<FmOperationFormat*>( operationBase );
             QString title( hbTrId( "Drive name ") );  
             QString driveName( paramFormat->driverName() );
@@ -280,9 +282,9 @@
                         mOperationService->on_operation_driveSpaceChanged();
                         break;
                     } else if( err == FmErrBadName ) {
-                        FmDlgUtils::information( hbTrId( "Illegal characters! Use only letters and numbers." ) );
+                        FmDlgUtils::warning( hbTrId( "Illegal characters! Use only letters and numbers." ), HbMessageBox::Ok, true );
                     } else{
-                        FmDlgUtils::information( hbTrId( "Error occurred, operation cancelled!" ) );
+                        FmDlgUtils::warning( hbTrId( "Error occurred, operation cancelled!" ) );
                         break;
                     }                
                 }
@@ -313,6 +315,9 @@
 {
     Q_UNUSED( errString );
     failAndCloseProgress();
+    if( operationBase->operationType() == FmOperationService::EOperationTypeFormat ) {
+        FmUtils::setSystem( false );
+    }
     switch( error )
     {
         case FmErrCancel:
@@ -325,7 +330,7 @@
 			// If need use QEventLoop::exec to block code execute sequence, It should be invoked in a Qt::QueuedConnection slot.
             return;
         case FmErrAlreadyStarted:
-            FmDlgUtils::information( QString( hbTrId("Operation already started!")) );
+            FmDlgUtils::warning( QString( hbTrId("Operation already started!")) );
             return;
         case FmErrLocked:
             {
@@ -335,14 +340,14 @@
                     QString targetDrive( operationBackup->targetDrive() );
                     QString defaultDriveVolume( FmUtils::getDefaultVolumeName( targetDrive ) );
                     QString driveString( defaultDriveVolume.isEmpty()? targetDrive:defaultDriveVolume );
-                    FmDlgUtils::information( QString( hbTrId("txt_fmgr_info_backup_locked") ).arg( driveString ) );
+                    FmDlgUtils::warning( QString( hbTrId("txt_fmgr_info_backup_locked") ).arg( driveString ) );
                 } else {
-                    FmDlgUtils::information( QString( hbTrId("Operation failed because drive is locked!")) );
+                    FmDlgUtils::warning( QString( hbTrId("Operation failed because drive is locked!")) );
                 }
                 return;
             }
         case FmErrPathNotFound:
-            FmDlgUtils::information( QString( hbTrId("Operation failed because can not find target path or drive is not available!") ) );
+            FmDlgUtils::warning( QString( hbTrId("Operation failed because can not find target path or drive is not available!") ) );
             return;
         case FmErrCorrupt:
             {
@@ -352,9 +357,9 @@
                     QString targetDrive( operationBackup->targetDrive() );
                     QString defaultDriveVolume( FmUtils::getDefaultVolumeName( targetDrive ) );
                     QString driveString( defaultDriveVolume.isEmpty()? targetDrive:defaultDriveVolume );
-                    FmDlgUtils::information( QString( hbTrId("txt_fmgr_info_backup_corrupted") ).arg( driveString ) );
+                    FmDlgUtils::warning( QString( hbTrId("txt_fmgr_info_backup_corrupted") ).arg( driveString ) );
                 } else {
-                    FmDlgUtils::information( QString( hbTrId("Operation failed because target media is corrupted!") ) );
+                    FmDlgUtils::warning( QString( hbTrId("Operation failed because target media is corrupted!") ) );
                 }
                 return;
             }
@@ -366,48 +371,48 @@
                     QString targetDrive( operationBackup->targetDrive() );
                     QString defaultDriveVolume( FmUtils::getDefaultVolumeName( targetDrive ) );
                     QString driveString( defaultDriveVolume.isEmpty()? targetDrive:defaultDriveVolume );
-                    FmDlgUtils::information( QString( hbTrId("txt_fmgr_info_backup_unavailable") ).arg( driveString ) );
+                    FmDlgUtils::warning( QString( hbTrId("txt_fmgr_info_backup_unavailable") ).arg( driveString ) );
                 } else {
-                    FmDlgUtils::information( QString( hbTrId("Operation failed because device is not ready!") ) );
+                    FmDlgUtils::warning( QString( hbTrId("Operation failed because device is not ready!") ) );
                 }
                 return;
             }
         case FmErrDisMounted: // Caused by eject MMC when preparing backup, will be localized later
-            FmDlgUtils::information( QString( hbTrId("Operation failed because backup target drive has been removed!") ) );
+            FmDlgUtils::warning( QString( hbTrId("Operation failed because backup target drive has been removed!") ) );
             return;
         case FmErrDiskFull:
-            FmDlgUtils::information( QString( hbTrId("Not enough space. Operation cancelled!")) );
+            FmDlgUtils::warning( QString( hbTrId("Not enough space. Operation cancelled!")) );
             return;
         case FmErrCopyDestToSubFolderInSrc:
-            FmDlgUtils::information( QString( hbTrId("Can not copy to sub folder!")) );
+            FmDlgUtils::warning( QString( hbTrId("Can not copy to sub folder!")) );
             return;
         case FmErrMoveDestToSubFolderInSrc:
-            FmDlgUtils::information( QString( hbTrId("Can not move to sub folder!")) );
+            FmDlgUtils::warning( QString( hbTrId("Can not move to sub folder!")) );
             return;
         case FmErrCannotRemove:{
             if( operationBase->operationType() == FmOperationService::EOperationTypeCopy ) {
                 // when copy a file/dir to same name destination, and delete dest fail, this error will occur
-                FmDlgUtils::information( QString( hbTrId( "Can not copy because %1 can not be deleted!" ).arg( errString ) ) );
+                FmDlgUtils::warning( QString( hbTrId( "Can not copy because %1 can not be deleted!" ).arg( errString ) ) );
                 return;
             }
             else if( operationBase->operationType() == FmOperationService::EOperationTypeMove ) {
                 // when move a file/dir to same name destination, and delete dest fail, this error will occur
-                FmDlgUtils::information( QString( hbTrId( "Can not move because %1 can not be deleted!" ).arg( errString ) ) );
+                FmDlgUtils::warning( QString( hbTrId( "Can not move because %1 can not be deleted!" ).arg( errString ) ) );
                 return;
             }
             // when delete file/dir fail, this error will occur
-            FmDlgUtils::information( QString( hbTrId( "Can not delete %1!" ).arg( errString ) ) );
+            FmDlgUtils::warning( QString( hbTrId( "Can not delete %1!" ).arg( errString ) ) );
             return; 
         }      
         case FmErrRemoveDefaultFolder:{
             if( operationBase->operationType() == FmOperationService::EOperationTypeMove ) {
                 // when move a default folder
-                FmDlgUtils::information( QString( hbTrId( "Could not move because the default folder %1 can not be deleted!" ).arg( errString ) ) );
+                FmDlgUtils::warning( QString( hbTrId( "Could not move because the default folder %1 can not be deleted!" ).arg( errString ) ) );
                 return;
             }
             else {
                // when delete the default folder
-               FmDlgUtils::information( QString( hbTrId( "Could not remove the default folder %1 " ).arg( errString ) ) );
+               FmDlgUtils::warning( QString( hbTrId( "Could not remove the default folder %1 " ).arg( errString ) ) );
                return;
             }
         }
@@ -416,10 +421,10 @@
     switch( operationBase->operationType() )
     {
     case FmOperationService::EOperationTypeFormat:
-        FmDlgUtils::information( QString( hbTrId("Format failed!")) );
+        FmDlgUtils::warning( QString( hbTrId("Format failed!")) );
         break;
     default:
-        FmDlgUtils::information( QString( hbTrId("Operation failed")) );
+        FmDlgUtils::warning( QString( hbTrId("Operation failed")) );
     }
 
 }
--- a/filemanager/src/filemanager/src/operationservice/fmoperationservice.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/filemanager/src/operationservice/fmoperationservice.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -66,7 +66,7 @@
  * Constructs one operation Service with \a parent.
  */
 FmOperationService::FmOperationService( QObject *parent ) : QObject( parent ),
-        mCurrentOperation( 0 ), mBackupRestoreHandler( 0 )
+        mBackupRestoreHandler( 0 ), mCurrentOperation( 0 )
 {
     mThread = new FmOperationThread( this );
     mThread->setObjectName( "operationThread" );
@@ -353,19 +353,20 @@
 void FmOperationService::connectSignalsAndSlots( FmOperationBase *operation )
 {
     
-    connect( operation, SIGNAL( showNote( QString ) ),
-            this, SLOT( on_operation_showNote( QString )), Qt::BlockingQueuedConnection );
+    connect( operation, SIGNAL( showNote( QString ) ),           // blocking because need wait for show note
+            this, SLOT( on_operation_showNote( QString )),       Qt::BlockingQueuedConnection );
+    connect( operation, SIGNAL( notifyPreparing( bool ) ),       // blocking to show waiting note immediately
+            this, SLOT( on_operation_notifyPreparing( bool )),   Qt::BlockingQueuedConnection );
+    connect( operation, SIGNAL( notifyProgress( int ) ),         // blocking to make progress more accurate
+            this, SLOT( on_operation_notifyProgress( int ) ),    Qt::BlockingQueuedConnection );
+    connect( operation, SIGNAL( notifyStart( bool, int ) ),      // blocking to show waiting note immediately
+            this, SLOT( on_operation_notifyStart( bool, int ) ), Qt::BlockingQueuedConnection );    
+    connect( operation, SIGNAL( notifyWaiting( bool ) ),         // blocking to show waiting note immediately
+            this, SLOT( on_operation_notifyWaiting( bool )),     Qt::BlockingQueuedConnection );    
+    connect( operation, SIGNAL( notifyFinish() ),
+            this, SLOT( on_operation_notifyFinish()) );
     connect( operation, SIGNAL( notifyError( int, QString ) ),
             this, SLOT( on_operation_notifyError( int, QString ) ) );
-    connect( operation, SIGNAL( notifyStart( bool, int ) ),
-            this, SLOT( on_operation_notifyStart( bool, int ) ) );
-    connect( operation, SIGNAL( notifyProgress( int ) ),
-            this, SLOT( on_operation_notifyProgress( int ) ) );
-    connect( operation, SIGNAL( notifyFinish() ),
-            this, SLOT( on_operation_notifyFinish()) );
-    connect( operation, SIGNAL( notifyWaiting( bool ) ),
-            this, SLOT( on_operation_notifyWaiting( bool )) );   
-    
 }
 
 /*
--- a/filemanager/src/fmbkupengine/group/fmbkupengine.mmp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/fmbkupengine/group/fmbkupengine.mmp	Wed Sep 29 10:37:03 2010 +0800
@@ -49,3 +49,6 @@
 
 
 // End of File
+
+
+SMPSAFE
--- a/filemanager/src/fmbkupengine/src/MMCScBkupSBEUtils.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/fmbkupengine/src/MMCScBkupSBEUtils.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -230,20 +230,19 @@
         {
         // Must first create a generic transfer type object... sigh...
         CSBGenericTransferType* transferType = CSBGenericTransferType::NewL( nonConstOriginal->Externalise() );
-        CleanupStack::PushL( transferType );
-        switch(type)
+        CleanupStack::PushL( transferType ); 
+        if ( ESIDTransferDerivedType == type )
             {
-        case ESIDTransferDerivedType:
             ret = CSBSIDTransferType::NewL( transferType );
-            break;
-        case EPackageTransferDerivedType:
+            }
+        else if ( EPackageTransferDerivedType == type )
+            {
             ret = CSBPackageTransferType::NewL( transferType );
-            break;
-        case EJavaTransferDerivedType:
+            }
+        // Type is EJavaTransferDerivedType
+        else
+            {
             ret = CSBJavaTransferType::NewL( transferType );
-            break;
-        default:
-            break;
             }
         CleanupStack::PopAndDestroy( transferType );
         }
--- a/filemanager/src/fmbkupenginewrapper/fmbkupenginewrapper.pro	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/fmbkupenginewrapper/fmbkupenginewrapper.pro	Wed Sep 29 10:37:03 2010 +0800
@@ -36,6 +36,10 @@
     LIBS += -leikcore
     LIBS += -lcone
     LIBS += -lsysutil
-    LIBS +=	-lplatformenv
+    LIBS += -lplatformenv
+    LIBS += -lbafl
 }
 
+
+
+symbian:MMP_RULES += SMPSAFE
--- a/filemanager/src/fmbkupenginewrapper/inc/fmbkupengine.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/fmbkupenginewrapper/inc/fmbkupengine.h	Wed Sep 29 10:37:03 2010 +0800
@@ -84,7 +84,7 @@
     
     void GetRestoreInfoArray( QList<FmBkupDrivesAndOperation* > &drivesAndOperationList,
             QList< FmRestoreInfo > &restoreInfoList,
-            const int aDrive = FmErrNotFound );
+            const QString& aDrive );
     
     void getBackupDriveList( QStringList &driveList );
     
--- a/filemanager/src/fmbkupenginewrapper/private/symbian/fmbkupengine_p.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/fmbkupenginewrapper/private/symbian/fmbkupengine_p.h	Wed Sep 29 10:37:03 2010 +0800
@@ -77,7 +77,7 @@
     bool StartRestoreL( QList<FmBkupDrivesAndOperation* > drivesAndOperationList );
     void GetRestoreInfoArray( QList<FmBkupDrivesAndOperation* > drivesAndOperationList,
             QList< FmRestoreInfo > &restoreInfoList,
-            const TInt aDrive = KErrNotFound );
+            const QString& aDrive );
     
     void getBackupDriveList( QStringList &driveList );
 
--- a/filemanager/src/fmbkupenginewrapper/private/win32/fmbkupengine_p.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/fmbkupenginewrapper/private/win32/fmbkupengine_p.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -149,7 +149,7 @@
 
 void FmBkupEnginePrivate::GetRestoreInfoArray( QList<FmBkupDrivesAndOperation* > drivesAndOperationList,
         QList< FmRestoreInfo > &restoreInfoList,
-        const int aDrive )
+        const QString& aDrive )
 {
     restoreInfoList.clear();
     QString debugString;
@@ -162,7 +162,7 @@
     dateTime.setTime_t( settings.value( "dateTime" ).toUInt() );
     QString drive = settings.value( "drive" ).toString();
     settings.endGroup();
-    if( content != 0 && ( DriverNameToNumber(drive) == aDrive || aDrive < 0 ) )
+	if( content != 0 && ( drive.contains( aDrive, Qt::CaseInsensitive ) || aDrive.isEmpty() ) )
     {
         FmRestoreInfo restoreInfo( content, dateTime, drive );
         restoreInfoList.push_back( restoreInfo );
@@ -173,7 +173,7 @@
     dateTime.setTime_t( settings.value( "dateTime" ).toUInt() );
     drive = settings.value( "drive" ).toString();
     settings.endGroup();
-   if( content != 0 && ( DriverNameToNumber(drive) == aDrive || aDrive < 0 ) )
+   if( content != 0 && ( drive.contains( aDrive, Qt::CaseInsensitive ) || aDrive.isEmpty() ) )
     {
         FmRestoreInfo restoreInfo( content, dateTime, drive );
         restoreInfoList.push_back( restoreInfo );
@@ -184,7 +184,7 @@
     dateTime.setTime_t( settings.value( "dateTime" ).toUInt() );
     drive = settings.value( "drive" ).toString();
     settings.endGroup();
-    if( content != 0 && ( DriverNameToNumber(drive) == aDrive || aDrive < 0 ) )
+    if( content != 0 && ( drive.contains( aDrive, Qt::CaseInsensitive ) || aDrive.isEmpty() ) )
     {
         FmRestoreInfo restoreInfo( content, dateTime, drive );
         restoreInfoList.push_back( restoreInfo );
@@ -195,7 +195,7 @@
     dateTime.setTime_t( settings.value( "dateTime" ).toUInt() );
     drive = settings.value( "drive" ).toString();
     settings.endGroup();
-    if( content != 0 && ( DriverNameToNumber(drive) == aDrive || aDrive < 0 ) )
+    if( content != 0 && ( drive.contains( aDrive, Qt::CaseInsensitive ) || aDrive.isEmpty() ) )
     {
         FmRestoreInfo restoreInfo( content, dateTime, drive );
         restoreInfoList.push_back( restoreInfo );
@@ -206,7 +206,7 @@
     dateTime.setTime_t( settings.value( "dateTime" ).toUInt() );
     drive = settings.value( "drive" ).toString();
     settings.endGroup();
-    if( content != 0 && ( DriverNameToNumber(drive) == aDrive || aDrive < 0 ) )
+    if( content != 0 && ( drive.contains( aDrive, Qt::CaseInsensitive ) || aDrive.isEmpty() ) )
     {
         FmRestoreInfo restoreInfo( content, dateTime, drive );
         restoreInfoList.push_back( restoreInfo );
@@ -217,7 +217,7 @@
     dateTime.setTime_t( settings.value( "dateTime" ).toUInt() );
     drive = settings.value( "drive" ).toString();
     settings.endGroup();
-    if( content != 0 && ( DriverNameToNumber(drive) == aDrive || aDrive < 0 ) )
+    if( content != 0 && ( drive.contains( aDrive, Qt::CaseInsensitive ) || aDrive.isEmpty() ) )
     {
         FmRestoreInfo restoreInfo( content, dateTime, drive );
         restoreInfoList.push_back( restoreInfo );
@@ -425,3 +425,9 @@
     return driverName;
 }
 
+void FmBkupEnginePrivate::getBackupDriveList( QStringList &driveList )
+    {
+    driveList.append("E:/");
+    driveList.append("F:/");
+    }
+
--- a/filemanager/src/fmbkupenginewrapper/src/fmbackupsettings.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/fmbkupenginewrapper/src/fmbackupsettings.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -346,8 +346,11 @@
 {
    
     QStringList driveList;
+    QString defaultDrive;
     mBkupEngine->getBackupDriveList( driveList );
-    QString defaultDrive( driveList.first() );
+    if( !driveList.isEmpty() ) {
+        defaultDrive = driveList.first();
+    }
    
     QDate date;
     QSettings settings("Nokia", "FileManager");
@@ -358,7 +361,7 @@
     mScheduling = (TFileManagerBackupSchedule)(settings.value("scheduling", EFileManagerBackupScheduleNever ).toInt()); // Never schedule for default value
     mWeekday = (TFileManagerBackupWeekday)(settings.value("weekday", EFileManagerBackupWeekdayMonday ).toInt()); // monday for default value
     mTime = (settings.value("time", QTime::currentTime() ).toTime()); // empty for default
-    mTargetDrive = (settings.value("targetDrive", defaultDrive ) ).toString();  // C for default
+    mTargetDrive = (settings.value("targetDrive", defaultDrive ) ).toString();  // empty or first backup-able drive for default value
     mDate = (settings.value("backupDate", date)).toDate();
     settings.endGroup();
     refreshList();
--- a/filemanager/src/fmbkupenginewrapper/src/fmbkupengine.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/fmbkupenginewrapper/src/fmbkupengine.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -30,7 +30,7 @@
 	connect( d, SIGNAL( notifyStart( bool, int ) ), this, SIGNAL( notifyStart( bool, int ) ) );
 	connect( d, SIGNAL( notifyUpdate(int) ), this, SIGNAL( notifyUpdate(int) ) );
 	connect( d, SIGNAL( notifyFinish(int) ), 
-			this, SIGNAL( notifyFinish(int) ) );
+			this, SIGNAL( notifyFinish(int) ), Qt::DirectConnection );
 	connect( d, SIGNAL( notifyMemoryLow(int, int& ) ), this, SIGNAL( notifyMemoryLow(int, int&) ) );
 	connect( d, SIGNAL( notifyBackupFilesExist( bool& )), this, SIGNAL( notifyBackupFilesExist( bool&) ) );
 }
@@ -88,7 +88,7 @@
     
 void FmBkupEngine::GetRestoreInfoArray( QList<FmBkupDrivesAndOperation* > &drivesAndOperationList,
         QList< FmRestoreInfo > &restoreInfoList,
-        const int aDrive )
+        const QString& aDrive )
 {
     d->GetRestoreInfoArray( drivesAndOperationList, restoreInfoList, aDrive );
 }
--- a/filemanager/src/fmbkupenginewrapper/src/fmrestoresettings.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/fmbkupenginewrapper/src/fmrestoresettings.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -60,7 +60,8 @@
 
     QList< FmRestoreInfo > restoreInfoList;
     
-    mEngine.GetRestoreInfoArray( drivesAndOperationList, restoreInfoList );
+    QString targetDrive = mEngine.BackupSettingsL()->availableTargetDrive();
+    mEngine.GetRestoreInfoArray( drivesAndOperationList, restoreInfoList, targetDrive );
     
 
     // fetch info list from engine, and then init the entry list for display
--- a/filemanager/src/fmfiledialog/fmfiledialog.pro	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/fmfiledialog/fmfiledialog.pro	Wed Sep 29 10:37:03 2010 +0800
@@ -29,7 +29,9 @@
             -lefsrv \
             -lapgrfx \
             -lcone \
-            -lsysutil
+            -lsysutil \
+            -lbafl \
+            -leikcore
             
     TARGET.UID3 = 0x2002BCC3
 
@@ -41,3 +43,6 @@
     headers.sources = $$EXPORT_PLATFORM_HEADERS
     for(header, headers.sources):BLD_INF_RULES.prj_exports += "./$$header $$APP_LAYER_PLATFORM_EXPORT_PATH($$basename(header))"
 }
+
+
+symbian:MMP_RULES += SMPSAFE
--- a/filemanager/src/fmfiledialog/src/fmfiledialog.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/fmfiledialog/src/fmfiledialog.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -25,13 +25,15 @@
 #include "fmdrivemodel.h"
 #include "fmcommon.h"
 
-#include "hbwidget.h"
-#include "hblabel.h"
-#include "hbaction.h"
-#include "hbpushbutton.h"
-#include "hblineedit.h"
-
+#include <hbwidget.h>
+#include <hblabel.h>
+#include <hbaction.h>
+#include <hbpushbutton.h>
+#include <hblineedit.h>
+#include <hbtranslator.h>
+    
 #include <QGraphicsLinearLayout>
+#include <QEventLoop>
 
 FmFileDialog::FmFileDialog( QGraphicsItem *parent ) : 
     HbDialog( parent ), d_ptr( new FmFileDialogPrivate( this ) )
@@ -49,7 +51,9 @@
                                     const QStringList &nameFilters,
                                     Options options )
 {
-
+    HbTranslator translator("filemanager");
+    translator.loadCommon();
+    
     QString ret;
 
     FmFileDialogPrivate::FmFileDialogArgs args;
@@ -78,7 +82,9 @@
                                const QStringList &nameFilters,
                                Options options )
 {
-
+    HbTranslator translator("filemanager");
+    translator.loadCommon();
+    
     QString ret;
 
     FmFileDialogPrivate::FmFileDialogArgs args;
@@ -109,6 +115,9 @@
                                const QStringList &nameFilters,
                                Options options )
 {
+    HbTranslator translator("filemanager");
+    translator.loadCommon();
+    
     QString ret;
 
     FmFileDialogPrivate::FmFileDialogArgs args;
@@ -136,13 +145,70 @@
 
 bool FmFileDialog::exec()
 {
-    if ( d_ptr->isOkAction( HbDialog::exec() ) ) {
+    HbDialog::open( this, SLOT(dialogClosed(HbAction*)) );
+    d_ptr->eventLoop().exec();
+    
+    if ( d_ptr->isOkAction( d_ptr->retAction() ) ) {
         return true;
     } else {
         return false ;
     }
 }
 
+void FmFileDialog::dialogClosed(HbAction *action)
+{
+    d_ptr->setRetAction( action );
+    d_ptr->eventLoop().exit();
+}
 
 
+HbAction *FmFileDialog::primaryAction() const
+{
+    QList<QAction *> actionList = QGraphicsWidget::actions();
+    if (actionList.size() > 0) {
+        return (HbAction *)(actionList.at(0));
+    } else {
+        return 0;
+    }
+    
+}
 
+void FmFileDialog::setPrimaryAction( HbAction *action )
+{
+    QList<QAction *> actionList = QGraphicsWidget::actions();
+    if (actionList.size() == 0) {
+        QGraphicsWidget::addAction(action);
+    } else if (actionList.size() ==  1) {
+        actionList.clear();
+        QGraphicsWidget::addAction(action);
+    } else if (actionList.size() == 2) {
+        actionList.removeAt(0);
+        actionList.insert(0, action);
+    }    
+}
+
+HbAction *FmFileDialog::secondaryAction() const
+{
+    QList<QAction *> actionList = QGraphicsWidget::actions();
+    if (actionList.size() > 1) {
+        return (HbAction *)(actionList.at(1));
+    } else {
+        return 0;
+    }    
+}
+
+void FmFileDialog::setSecondaryAction( HbAction *action )
+{
+    QList<QAction *> actionList = QGraphicsWidget::actions();
+    if (actionList.size() == 0) {
+        QGraphicsWidget::addAction(new HbAction(hbTrId("Ok")));
+        QGraphicsWidget::addAction(action);          
+    } else if (actionList.size() == 1) {
+        QGraphicsWidget::addAction(action);
+    } else if (actionList.size() == 2) {
+        actionList.removeAt(1);
+        actionList.insert(1, action);
+    }
+        
+}
+
--- a/filemanager/src/fmfiledialog/src/fmfiledialog_p.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/fmfiledialog/src/fmfiledialog_p.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -28,7 +28,7 @@
 #include <hblineedit.h>
 #include <QGraphicsLinearLayout>
 
-#define backButtonIcon  ":image/qtg_indi_status_back.svg"
+#define backButtonIcon  "qtg_mono_app_exit"
 
 /*!
     constructor
--- a/filemanager/src/fmfiledialog/src/fmfiledialog_p.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/fmfiledialog/src/fmfiledialog_p.h	Wed Sep 29 10:37:03 2010 +0800
@@ -20,8 +20,10 @@
 #ifndef FMFILEDIALOG_P_H
 #define FMFILEDIALOG_P_H
 
+#include "fmfiledialog.h"
+
 #include <QDir>
-#include "fmfiledialog.h"
+#include <QEventLoop>
 
 class HbPushButton;
 class FmFileWidget;
@@ -64,7 +66,11 @@
     QString currentPath() const;
     QString selectedFile() const;
     bool isOkAction( HbAction *action );
-
+    
+    void setRetAction( HbAction *action );
+    HbAction *retAction();
+    QEventLoop &eventLoop();
+        
 protected:
     void createAndSetActions(const QString & primaryActionText,const QString & secondaryActionText);
     void createContentWidget();
@@ -81,7 +87,7 @@
 
     void setTitle( const QString &str );        
     void setRootPath( const QString &pathName );
-
+    
 public:
     void _q_handleUpButton();
     void _q_handleTextChanged(const QString &text);
@@ -111,6 +117,9 @@
 
     QString mCaptionHead;
     FmFileDialogArgs          mArgs;
+    
+    HbAction *mRetAction;
+    QEventLoop mEventLoop;
 };
 
 #endif // FMFILEDIALOG_P_H
--- a/filemanager/src/fmfiledialog/src/fmfilewidget.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/fmfiledialog/src/fmfilewidget.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -18,10 +18,11 @@
 */
 #include "fmfilewidget.h"
 #include "fmutils.h"
+#include "fmcommon.h"
 #include "fmdrivemodel.h"
 #include "fmdrivewatcher.h"
-#include "fmcommon.h"
 #include "fmfileiconprovider.h"
+#include "fmfilesystemproxymodel.h"
 
 #include "hbstyle.h"
 #include "hbabstractitemview.h"
@@ -44,7 +45,8 @@
 FmFileWidget::~FmFileWidget()
 {
     setModel( 0 );
-    delete mFileSystemModel;
+    delete mFileSystemSourceModel;
+    delete mFileModel;
     delete mFileIconProvider;
     delete mDriveModel;
     
@@ -59,8 +61,8 @@
     if( !index.isValid() ) {
         return QFileInfo();
     }
-    if( mCurrentModel == mFileSystemModel ) {
-        return mFileSystemModel->fileInfo( index );
+    if( mCurrentModel == mFileModel ) {
+        return mFileModel->fileInfo( index );
     } else {
         return QFileInfo();
     }
@@ -78,9 +80,9 @@
         emit pathChanged( QString() );
     } else {
         FM_LOG( "FmFileWidget::setRootPath set dir model end" );
-        setModel( mFileSystemModel );
+        setModel( mFileModel );
         FM_LOG( "FmFileWidget::setRootPath set dir model end" );
-		mListView->setRootIndex( mFileSystemModel->setRootPath( pathName ) );
+		mListView->setRootIndex( mFileModel->setRootPath( pathName ) );
         FM_LOG( "FmFileWidget::setRootPath set rootIndex" );
         emit pathChanged( pathName );
     }    
@@ -105,21 +107,21 @@
         }
 
         FM_LOG("FmFileWidget::on_list_activated setModel dir start" );
-        setModel( mFileSystemModel );
+        setModel( mFileModel );
         FM_LOG("FmFileWidget::on_list_activated setModel dir end" );
         setRootPath( checkedPath );
         FM_LOG("FmFileWidget::on_list_activated setRootIndex" );
         emit pathChanged( checkedPath );
         FM_LOG("FmFileWidget::on_list_activated finish emit pathChanged" );
     }
-    else if( mCurrentModel == mFileSystemModel ) {
+    else if( mCurrentModel == mFileModel ) {
     //If current model is FileSystemModel, open path or emit file activate signal.
-        if ( mFileSystemModel->isDir( mActivatedModelIndex ) ) {
+        if ( mFileModel->isDir( mActivatedModelIndex ) ) {
             FM_LOG("FmFileWidget::on_list_activated start changeRootIndex" );
             changeRootIndex( mActivatedModelIndex );
             FM_LOG("FmFileWidget::on_list_activated finish changeRootIndex" );
         } else {
-            QFileInfo fileInfo( mFileSystemModel->filePath( mActivatedModelIndex ) );
+            QFileInfo fileInfo( mFileModel->filePath( mActivatedModelIndex ) );
             if( fileInfo.isFile() ) {
                 emit fileActivated( fileInfo.fileName() );
                 FM_LOG("FmFileWidget::on_list_activated finish emit fileActivated" );
@@ -133,24 +135,24 @@
 
 void FmFileWidget::setModelFilter( QDir::Filters filters )
 {
-    mFileSystemModel->setFilter( filters );
+    mFileModel->setFilter( filters );
 }
 
 void FmFileWidget::setNameFilters( const QStringList &nameFilters )
 {
-    mFileSystemModel->setNameFilters( nameFilters );
+    mFileModel->setNameFilters( nameFilters );
 }
 
 void FmFileWidget::changeRootIndex( const QModelIndex &index )
 {
     FM_LOG("FmFileWidget::changeRootIndex start" );
-    if( mCurrentModel != mFileSystemModel ) {
-        FM_LOG("FmFileWidget::changeRootIndex end because model not equal mFileSystemModel" );
+    if( mCurrentModel != mFileModel ) {
+        FM_LOG("FmFileWidget::changeRootIndex end because model not equal mFileModel" );
         return;
     }
 
-    mFileSystemModel->fetchMore(index);
-	QString filePath = mFileSystemModel->fileInfo( index ).absoluteFilePath();
+    mFileModel->fetchMore(index);
+	QString filePath = mFileModel->fileInfo( index ).absoluteFilePath();
     // pathChanged signal will be emitted in setRootPath
 	setRootPath( filePath );
     FM_LOG("FmFileWidget::changeRootIndex end" );
@@ -170,10 +172,15 @@
         FmDriveModel::FillWithVolume | FmDriveModel::FillWithDefaultVolume | FmDriveModel::HideUnAvailableDrive );
     
     qDebug( QTime::currentTime().toString().toUtf8().data() );
-    mFileSystemModel = new QFileSystemModel( this );
+    mFileSystemSourceModel = new QFileSystemModel( this );
     mFileIconProvider = new FmFileIconProvider();
-    mFileSystemModel->setIconProvider( mFileIconProvider );
-    qDebug("constructed mFileSystemModel");
+    mFileSystemSourceModel->setIconProvider( mFileIconProvider );
+    qDebug("constructed mFileSystemSourceModel");
+
+    
+    mFileModel = new FmFileSystemProxyModel( this );
+    mFileModel->setSourceModel( mFileSystemSourceModel );
+
     
     qDebug( QTime::currentTime().toString().toUtf8().data() );
     setModel( mDriveModel );
@@ -207,7 +214,7 @@
     ViewType viewType = DriveView;
     if( mCurrentModel == mDriveModel ) {
         viewType = DriveView;
-    } else if( mCurrentModel == mFileSystemModel ) {
+    } else if( mCurrentModel == mFileModel ) {
         viewType = DirView;
     } else {
         Q_ASSERT( false );
--- a/filemanager/src/fmfiledialog/src/fmfilewidget.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/fmfiledialog/src/fmfilewidget.h	Wed Sep 29 10:37:03 2010 +0800
@@ -24,13 +24,15 @@
 #include <QDir>
 #include <QString>
 
-class QFileSystemModel;
 class FmDriveModel;
 class FmDriveWatcher;
-class HbListView;
+class FmFileIconProvider;
+class FmFileSystemProxyModel;
+
+class QFileSystemModel;
 class QGraphicsLinearLayout;
 
-class FmFileIconProvider;
+class HbListView;
 
 class FmFileWidget : public HbWidget
 {
@@ -69,9 +71,10 @@
 
 private:
     HbListView *mListView;
-    QGraphicsLinearLayout *mLayout;
-    QFileSystemModel	*mFileSystemModel;
-    FmDriveModel		*mDriveModel;
+    QGraphicsLinearLayout   *mLayout;
+    QFileSystemModel        *mFileSystemSourceModel;
+    FmFileSystemProxyModel  *mFileModel;
+    FmDriveModel		    *mDriveModel;
 
     QAbstractItemModel *mCurrentModel;
     FmDriveWatcher  *mDriveWatcher;
--- a/filemanager/src/inc/commonutils.pri	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/inc/commonutils.pri	Wed Sep 29 10:37:03 2010 +0800
@@ -18,32 +18,44 @@
                     $$PWD/fmdrivemodel.h \
                     $$PWD/fmfileiconprovider.h \
                     $$PWD/fmdrivewatcher/fmdrivewatcher.h \
-                    $$PWD/fmfiletyperecognizer.h
+                    $$PWD/fmfiletyperecognizer.h \
+                    $$PWD/fmfilesystemproxymodel.h \
+                    $$PWD/fmserviceutils/fmserviceutils.h
                     
 INTERNAL_SOURCES += $$PWD/fmdrivemodel.cpp \
                     $$PWD/fmfileiconprovider.cpp \
                     $$PWD/fmdrivewatcher/fmdrivewatcher.cpp \
                     $$PWD/fmfiletyperecognizer.cpp \
-                    $$PWD/fmutils.cpp
+                    $$PWD/fmutils.cpp \
+                    $$PWD/fmfilesystemproxymodel.cpp \
+                    $$PWD/fmserviceutils/fmserviceutils.cpp
 
 symbian {
     INTERNAL_HEADERS += $$PWD/fms60utils.h \
                         $$PWD/fmdrivewatcher/private/symbian/fmdrivewatcherprivate.h \
-                        $$PWD/fmdrivewatcher/private/symbian/fmdriveevent.h
+                        $$PWD/fmdrivewatcher/private/symbian/fmdriveevent.h \
+                        $$PWD/fmserviceutils/private/symbian/fmserviceutilsprivate.h \
+                        $$PWD/fmserviceutils/private/symbian/fmserviceutilshandler.h
 
     INTERNAL_SOURCES += $$PWD/fmutils_s60.cpp \
                         $$PWD/fms60utils.cpp \
                         $$PWD/fmdrivewatcher/private/symbian/fmdrivewatcherprivate.cpp \
-                        $$PWD/fmdrivewatcher/private/symbian/fmdriveevent.cpp
+                        $$PWD/fmdrivewatcher/private/symbian/fmdriveevent.cpp \
+                        $$PWD/fmserviceutils/private/symbian/fmserviceutilsprivate.cpp \
+                        $$PWD/fmserviceutils/private/symbian/fmserviceutilshandler.cpp
 }
 win32 {
     INCLUDEPATH += $$PWD/fmdrivewatcher/
     INCLUDEPATH += $$PWD/fmdrivewatcher/private/win32/
+    INCLUDEPATH += $$PWD/fmserviceutils/
+    INCLUDEPATH += $$PWD/fmserviceutils/private/win32/
 
-    INTERNAL_HEADERS += $$PWD/fmdrivewatcher/private/win32/fmdrivewatcherprivate.h
+    INTERNAL_HEADERS += $$PWD/fmdrivewatcher/private/win32/fmdrivewatcherprivate.h \
+                        $$PWD/fmserviceutils/private/win32/fmserviceutilsprivate.h
 
     INTERNAL_SOURCES += $$PWD/fmutils_win.cpp \
-                        $$PWD/fmdrivewatcher/private/win32/fmdrivewatcherprivate.cpp
+                        $$PWD/fmdrivewatcher/private/win32/fmdrivewatcherprivate.cpp \
+                        $$PWD/fmserviceutils/private/win32/fmserviceutilsprivate.cpp
 
 }
 
--- a/filemanager/src/inc/fmdefine.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/inc/fmdefine.h	Wed Sep 29 10:37:03 2010 +0800
@@ -67,6 +67,8 @@
 
 // define  contact data path for view details.
 #define FmViewDetail_Contacts ( "\\private\\10003a73\\SQLite__Contacts.cdb" )
+// define message data path for view details
+#define FmViewDetail_Messages ( "\\private\\1000484b\\Mail2" )
 
 #define FmMaxLengthofDriveName           11
 #define FmMaxLengthofDrivePassword       8
@@ -89,4 +91,13 @@
 // is not end with dot( trim blank characters in the end first )
 #define Regex_ValidNotEndWithDot QString( "^.*[^\\.\\s][\\s]*$" )
 
+// use slash(/) not backslash(\) or QDir::separator() because QRegExp can not recognize BackSlash(\)
+#define RegexWidecard_SystemFolder      QString( "?:/system/*" )
+#define RegexWidecard_SysFolder         QString( "?:/sys/*" )
+#define RegexWidecard_PrivateFolder     QString( "?:/private/*" )
+#define RegexWidecard_ResourceFolder    QString( "?:/resource/*" )
+
+#define Char_Slash       QChar( '/' )
+#define Char_BackSlash   QChar( '\\' )
+
 #endif 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/src/inc/fmfilesystemproxymodel.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,176 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: proxy model for QFileSystemModel
+*
+*/
+
+#include "fmfilesystemproxymodel.h"
+#include "fmutils.h"
+#include <QFileSystemModel>
+
+#include <hbglobal.h>
+
+// name column number, this define comes from implementation of QFileSystemModel
+const int NameColumn = 0;
+
+/*!
+    Constructor
+*/
+FmFileSystemProxyModel::FmFileSystemProxyModel( QObject *parent ) :
+    QSortFilterProxyModel( parent )
+{
+ 
+}
+
+/*!
+    Destructor
+*/
+FmFileSystemProxyModel::~FmFileSystemProxyModel()
+{
+
+}
+                                                                                   
+/*!
+    return data by \a index and \a role
+    this function will localize the folder by HbDirectoryNameLocalizer
+*/
+QVariant FmFileSystemProxyModel::data ( const QModelIndex & index, int role ) const
+{
+    QAbstractItemModel *itemModel = sourceModel();
+    QFileSystemModel *sourceModel = qobject_cast<QFileSystemModel*>( itemModel );
+    if( sourceModel && ( role == Qt::DisplayRole ) ) {
+        QString name( FmUtils::localize(sourceModel->fileInfo( mapToSource( index ) ).absoluteFilePath()) );
+        if( name.isEmpty() ) {
+            return sourceModel->data( mapToSource( index ), role );
+        } else {
+            return name;
+        }
+    }
+    if( sourceModel )
+    {
+	    return sourceModel->data( mapToSource( index ), role );
+    }
+		else
+    {
+	    return QVariant();
+    }
+}
+
+/*!
+    Return fileInfo by \a index
+    Return empty QFileInfo if sourceModel is not QFileSystemModel
+*/
+QFileInfo FmFileSystemProxyModel::fileInfo ( const QModelIndex & index ) const
+{
+    QAbstractItemModel *itemModel = sourceModel();
+    QFileSystemModel *sourceModel = qobject_cast<QFileSystemModel*>( itemModel );
+    if( sourceModel ) {
+        return sourceModel->fileInfo( mapToSource( index ) );
+    }
+
+    return QFileInfo();
+}
+
+/*!
+    Sets the directory \a newPath as current path to display
+    Return empty QModelIndex if sourceModel is not QFileSystemModel
+*/
+QModelIndex FmFileSystemProxyModel::setRootPath ( const QString & newPath )
+{
+    QAbstractItemModel *itemModel = sourceModel();
+    QFileSystemModel *sourceModel = qobject_cast<QFileSystemModel*>( itemModel );
+    if( sourceModel ) {
+        return mapFromSource( sourceModel->setRootPath( newPath ) );
+    }
+
+    return QModelIndex();
+}
+
+/*!
+    Judge if object pointed by \a index is a directory.
+    Return false also if sourceModel is not QFileSystemModel
+*/
+bool FmFileSystemProxyModel::isDir ( const QModelIndex & index ) const
+{
+    QAbstractItemModel *itemModel = sourceModel();
+    QFileSystemModel *sourceModel = qobject_cast<QFileSystemModel*>( itemModel );
+    if( sourceModel ) {
+        return sourceModel->isDir( mapToSource( index ) );
+    }
+
+    return false;
+}
+
+/*!
+    Get filePath by \a index. 
+    Return empty string if sourceModel is not QFileSystemModel 
+*/
+QString FmFileSystemProxyModel::filePath ( const QModelIndex & index ) const
+{
+    QAbstractItemModel *itemModel = sourceModel();
+    QFileSystemModel *sourceModel = qobject_cast<QFileSystemModel*>( itemModel );
+    if( sourceModel ) {
+        return sourceModel->filePath( mapToSource( index ) );
+    }
+    
+    return QString();
+}
+
+/*!
+    Set model filters 
+    Nothing will be done if sourceModel is not QFileSystemModel 
+*/
+void FmFileSystemProxyModel::setFilter ( QDir::Filters filters )
+{
+    QAbstractItemModel *itemModel = sourceModel();
+    QFileSystemModel *sourceModel = qobject_cast<QFileSystemModel*>( itemModel );
+    if( sourceModel ) {
+        sourceModel->setFilter( filters );
+    }
+}
+
+/*!
+    Set name filters 
+    Nothing will be done if sourceModel is not QFileSystemModel 
+*/
+void FmFileSystemProxyModel::setNameFilters(const QStringList &filters)
+{
+    QAbstractItemModel *itemModel = sourceModel();
+    QFileSystemModel *sourceModel = qobject_cast<QFileSystemModel*>( itemModel );
+    if( sourceModel ) {
+        sourceModel->setNameFilters( filters );
+    }
+}
+
+/*
+    Filter directories that should not be seen by user.
+    For example, return false for such folders: C:\sys\, C:\system\, C:\private\, C:\resource\
+    Return default value(true) if sourceModel is not QFileSystemModel 
+*/
+bool FmFileSystemProxyModel::filterAcceptsRow(int sourceRow,
+        const QModelIndex &sourceParent) const
+{
+    QAbstractItemModel *itemModel = sourceModel();
+    QFileSystemModel *sourceModel = qobject_cast<QFileSystemModel*>( itemModel );
+    if( sourceModel ) {
+        QModelIndex nameIndex = sourceModel->index(sourceRow, NameColumn, sourceParent);
+        QFileInfo fileInfo = sourceModel->fileInfo( nameIndex );
+        QString absoluteFilePath = fileInfo.absoluteFilePath();
+        if( FmUtils::isSystemFolder( absoluteFilePath ) ) {
+            return false;
+        }
+    }
+    return true;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/src/inc/fmfilesystemproxymodel.h	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: file system proxy model, used to filter system folders
+*
+*/
+
+#ifndef FMFILESYSTEMPROXYMODEL_H
+#define FMFILESYSTEMPROXYMODEL_H
+
+#include <QDir>
+#include <QVariant>
+#include <QFileInfo>
+#include <QModelIndex>
+#include <QSortFilterProxyModel>
+
+/*!
+    \class FmFileSystemProxyModel 
+    \brief The class FmFileSystemProxyModel provide file system model
+    that can filter system folder and enable folder localization if source model is QFileSystemModel
+    Most functions only can be used when source model is QFileSystemModel
+*/
+class FmFileSystemProxyModel : public QSortFilterProxyModel
+{
+Q_OBJECT
+public:
+
+    explicit FmFileSystemProxyModel( QObject *parent = 0 );
+    virtual ~FmFileSystemProxyModel();
+
+    virtual QVariant    data ( const QModelIndex & index, int role = Qt::DisplayRole ) const;
+    QFileInfo fileInfo ( const QModelIndex & index ) const;
+    QModelIndex setRootPath ( const QString & newPath );
+    bool isDir ( const QModelIndex & index ) const;
+    QString filePath ( const QModelIndex & index ) const;
+    void setFilter ( QDir::Filters filters );
+    void setNameFilters(const QStringList &filters);
+
+private:
+    virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
+};
+
+
+
+#endif
--- a/filemanager/src/inc/fmfiletyperecognizer.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/inc/fmfiletyperecognizer.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -49,6 +49,7 @@
     mFileExtensionMap.insert( QString( "3g2" ), FileTypeVideo );
     mFileExtensionMap.insert( QString( "rmvb" ),FileTypeVideo );
     mFileExtensionMap.insert( QString( "mkv" ), FileTypeVideo );
+    mFileExtensionMap.insert( QString( "3gpp" ),FileTypeVideo );
     
 
     mFileExtensionMap.insert( QString( "aac" ), FileTypeTone );
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/src/inc/fmserviceutils/fmserviceutils.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+* 
+* Contributors:
+*
+* 
+* Description:
+*     The source file of service utils
+*/
+
+#include "fmserviceutils.h"
+
+#include "fmserviceutilsprivate.h"
+
+FmServiceUtils::FmServiceUtils( QObject *parent ) : QObject( parent )
+{
+    d = new FmServiceUtilsPrivate;
+}
+
+FmServiceUtils::~FmServiceUtils()
+{
+    delete d;
+}
+
+/*!
+    send files that included in \a filePathList via ShareUi
+*/
+void FmServiceUtils::sendFile( const QStringList &filePathList )
+{
+    d->sendFile( filePathList );
+}
+
+/*!
+    call CBaBackupSessionWrapper to close apps, for example, before formant, apps need be closed
+    this is synchronous which will take a while, please call this function in thread
+*/
+void FmServiceUtils::closeApps()
+{
+    d->closeApps();
+}
+
+/*!
+    call CBaBackupSessionWrapper to restart apps
+    for example, after formant, closed apps need be restarted
+    this is synchronous which will return quickly.
+*/
+void FmServiceUtils::restartApps()
+{
+    d->restartApps();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/src/inc/fmserviceutils/fmserviceutils.h	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+* 
+* Contributors:
+*
+* 
+* Description:
+*     The header file of service utils
+*/
+
+#ifndef FMSERVICEUTILS_H
+#define FMSERVICEUTILS_H
+
+#include <QObject>
+#include <QStringList>
+
+class FmServiceUtilsPrivate;
+
+/*!
+    \class FmServiceUtils 
+    \brief The class FmServiceUtils provide some service utils APIs
+    As FmUtils provide static APIs, FmServiceUtils provide non-static APIs
+*/
+class FmServiceUtils : public QObject
+{
+Q_OBJECT
+public:
+    FmServiceUtils( QObject *parent = 0 );
+    virtual ~FmServiceUtils();
+    void sendFile( const QStringList &filePathList );
+    
+    void closeApps();
+    void restartApps();
+
+private:
+    FmServiceUtilsPrivate *d;
+};
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/src/inc/fmserviceutils/private/symbian/fmserviceutilshandler.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,173 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+* 
+* Contributors:
+*
+* 
+* Description:
+*     The source file of service utils handler
+*/
+
+
+
+// INCLUDE FILES
+#include "fmserviceutilshandler.h"
+#include <coreapplicationuisdomainpskeys.h>
+#include <coemain.h>
+#include <apgwgnam.h>
+#include <apgtask.h>
+#include <bautils.h>
+#include <tz.h>
+#include <babackup.h>
+#include <pathinfo.h>
+#include <sysutil.h>
+#include <driveinfo.h>
+#include <e32property.h>
+#include <centralrepository.h>
+
+#include "fmutils.h"
+#include <QSettings>
+#include <XQConversions>
+
+// CONSTANTS
+const TInt KAppCloseTimeout = 1000000;
+
+/*!
+    constructor.
+*/
+CFmServiceUtilsHandler::CFmServiceUtilsHandler() :
+    CActive( CActive::EPriorityStandard )
+{
+}
+
+/*!
+    Two-phased constructor.
+*/
+void CFmServiceUtilsHandler::ConstructL()
+{
+    CActiveScheduler::Add( this );
+}
+
+/*!
+    Two-phased constructor.
+*/
+CFmServiceUtilsHandler* CFmServiceUtilsHandler::NewL()
+    {
+    RFs& fs( CCoeEnv::Static()->FsSession() );
+    CFmServiceUtilsHandler* self =
+        new( ELeave ) CFmServiceUtilsHandler();
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+/*!
+    destructor.
+*/
+CFmServiceUtilsHandler::~CFmServiceUtilsHandler()
+{
+    Cancel();
+    if( iBSWrapper ) {
+        delete iBSWrapper;
+        iBSWrapper = 0;
+    }
+}
+
+/*
+    \sa CActive
+*/
+void CFmServiceUtilsHandler::DoCancel()
+{
+}
+
+/*
+    \sa CActive
+*/ 
+void CFmServiceUtilsHandler::RunL()
+    {
+    iWait.AsyncStop();
+    TInt err( iStatus.Int() );
+    }
+
+/*
+    \sa CActive
+*/
+TInt CFmServiceUtilsHandler::RunError( TInt aError )
+{
+    iWait.AsyncStop();
+    return KErrNone;
+}
+
+/*
+    Call CBaBackupSessionWrapper to close apps
+    this is synchronous which will take a while, please call this function in thread
+*/
+void CFmServiceUtilsHandler::CloseAppsL()
+{
+    if( iBSWrapper ) {
+        delete iBSWrapper;
+        iBSWrapper = 0;
+    }
+
+    iBSWrapper = CBaBackupSessionWrapper::NewL();
+
+    TBackupOperationAttributes atts(
+        MBackupObserver::EReleaseLockNoAccess,
+        MBackupOperationObserver::EStart );
+    iBSWrapper->NotifyBackupOperationL( atts );
+    iBSWrapper->CloseAll( MBackupObserver::EReleaseLockNoAccess, iStatus );
+    SetActive();
+
+    // Memory card formatting cannot be executed if there are open files on it.
+    // It has been detected, that in some cases memory card using applications 
+    // have no time to close file handles before formatting is tried to be executed. 
+    // To address this issue, we need to add a delay here after client-notification 
+    // about pending format and real formatting procedure.
+    User::After( KAppCloseTimeout );
+    StartWait();
+}
+
+/*
+    Call CBaBackupSessionWrapper to restart closed apps
+    this is synchronous which will return quickly.
+*/
+void CFmServiceUtilsHandler::RestartAppsL()
+{
+    if ( !iBSWrapper )
+        {
+        return;
+        }
+    
+    TBackupOperationAttributes atts(
+        MBackupObserver::ETakeLock, MBackupOperationObserver::EEnd );
+    iBSWrapper->NotifyBackupOperationL( atts );
+    iBSWrapper->RestartAll();
+    
+    // Get rid of the wrapper instance
+    delete iBSWrapper;
+    iBSWrapper = 0;
+}
+
+/*
+    wait till request returned in RunL
+*/
+void CFmServiceUtilsHandler::StartWait()
+{
+    if ( iWait.IsStarted() != (TInt)ETrue )
+    {
+        iWait.Start();
+    }
+}
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/src/inc/fmserviceutils/private/symbian/fmserviceutilshandler.h	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+* 
+* Contributors:
+*
+* 
+* Description:
+*     The header file of service utils handler
+*/
+
+
+#ifndef FMSERVICEUTILSHANDLER_H
+#define FMSERVICEUTILSHANDLER_H
+
+#include <e32def.h> 
+#include <e32cmn.h> 
+#include <QString>
+
+
+// INCLUDES
+#include <e32base.h>
+#include <f32file.h>
+
+
+// FORWARD DECLARATIONS
+class CBaBackupSessionWrapper;
+
+/*!
+    \class CFmServiceUtilsHandler 
+    \brief The class CFmServiceUtilsHandler provide implement of service utils APIs
+*/
+NONSHARABLE_CLASS(CFmServiceUtilsHandler) :
+        public CActive
+    {
+
+public:
+    static CFmServiceUtilsHandler* NewL();
+    virtual ~CFmServiceUtilsHandler();
+
+public: // New methods
+    void CloseAppsL();
+    void RestartAppsL();
+
+private: // From CActive
+    void DoCancel();
+    void RunL();
+    TInt RunError( TInt aError );
+
+private:
+
+    CFmServiceUtilsHandler();
+    void ConstructL();
+    void StartWait();
+    
+private:    // Data
+    /**
+     * Last process error
+     */
+    TInt iLastError;
+
+    /**
+     * For closing and restarting open files while formatting
+     */
+    CBaBackupSessionWrapper* iBSWrapper;
+
+    /**
+     * Target drive of the process
+     */
+    TInt iDrive;
+
+    /**
+     * Wait is used to change asynchronous function to synchronous function
+     */
+    CActiveSchedulerWait iWait;
+    };
+
+#endif
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/src/inc/fmserviceutils/private/symbian/fmserviceutilsprivate.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+* 
+* Contributors:
+*
+* 
+* Description:
+*     The source file of service utils private
+*/
+
+#include "fmserviceutilsprivate.h"
+#include "fmserviceutilshandler.h"
+#include "fmcommon.h"
+#include <shareui.h>
+
+FmServiceUtilsPrivate::FmServiceUtilsPrivate()
+    :mShareUi( 0 ), mServiceUtilsHandler( 0 )
+{
+    
+}
+
+FmServiceUtilsPrivate::~FmServiceUtilsPrivate()
+{
+    if( mShareUi ) {
+        delete mShareUi;
+        mShareUi = 0;
+    }
+    
+    if( mServiceUtilsHandler ) {
+        delete mServiceUtilsHandler;
+        mServiceUtilsHandler = 0;
+    }
+    
+}
+
+/*
+   return \a shareUi which is used to send files. 
+*/
+ShareUi *FmServiceUtilsPrivate::shareUi()
+{
+    if( !mShareUi ) {
+        mShareUi = new ShareUi;
+    }
+    return mShareUi;
+}
+
+/*
+   return \a CFmServiceUtilsHandler which is used to closeApps and restartApps
+*/
+CFmServiceUtilsHandler *FmServiceUtilsPrivate::serviceUtilsHandler()
+{
+    if( !mServiceUtilsHandler ) {
+        TRAPD(err, mServiceUtilsHandler = CFmServiceUtilsHandler::NewL());
+        if( err != KErrNone ) {
+            mServiceUtilsHandler = 0;
+        }
+    }
+    return mServiceUtilsHandler;
+}
+
+/*!
+    send files that included in \a filePathList via ShareUi
+*/
+void FmServiceUtilsPrivate::sendFile( const QStringList &filePathList )
+{
+    // send do not accept const QStringList, so use QStringList()<<filePathList
+    shareUi()->send( QStringList()<<filePathList, true );
+}
+
+/*!
+    call CBaBackupSessionWrapper to close apps, for example, before formant, apps need be closed
+    this is synchronous which will take a while, please call this function in thread
+*/
+void FmServiceUtilsPrivate::closeApps()
+{
+    CFmServiceUtilsHandler *utilsHandler = serviceUtilsHandler();
+    if( utilsHandler ) {
+        TRAP_IGNORE( utilsHandler->CloseAppsL() );
+    }
+}
+
+/*!
+    call CBaBackupSessionWrapper to restart apps
+    for example, after formant, closed apps need be restarted
+    this is synchronous which will return quickly.
+*/
+void FmServiceUtilsPrivate::restartApps()
+{
+    CFmServiceUtilsHandler *utilsHandler = serviceUtilsHandler();
+    if( utilsHandler ) {
+        TRAP_IGNORE( serviceUtilsHandler()->RestartAppsL() );
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/src/inc/fmserviceutils/private/symbian/fmserviceutilsprivate.h	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+* 
+* Contributors:
+*
+* 
+* Description:
+*     The header file of service utils private
+*/
+
+#ifndef FMSERVICEUTILSPRIVATE_H
+#define FMSERVICEUTILSPRIVATE_H
+
+#include <QObject>
+#include <QStringList>
+
+class ShareUi;
+class CFmServiceUtilsHandler;
+
+/*!
+    \class FmServiceUtilsPrivate
+    \brief The class FmServiceUtilsPrivate provide service utils APIs private wrapper
+*/
+class FmServiceUtilsPrivate
+{
+public:
+    FmServiceUtilsPrivate();
+    virtual ~FmServiceUtilsPrivate();
+
+    void sendFile( const QStringList &filePath );
+    void closeApps();
+    void restartApps();
+    
+private:
+    ShareUi *shareUi();
+    CFmServiceUtilsHandler *serviceUtilsHandler();
+    
+private:
+    // used to send files
+    ShareUi *mShareUi;
+    
+    // used for some service utils
+    CFmServiceUtilsHandler *mServiceUtilsHandler;
+    
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/src/inc/fmserviceutils/private/win32/fmserviceutilsprivate.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+* 
+* Contributors:
+*
+* 
+* Description:
+*     The source file of service utils private for win32 wrapper
+*/
+
+#include "fmserviceutilsprivate.h"
+
+/*!
+    constructor
+*/
+FmServiceUtilsPrivate::FmServiceUtilsPrivate()
+{
+}
+
+/*!
+    destructor
+*/
+FmServiceUtilsPrivate::~FmServiceUtilsPrivate()
+{
+}
+
+/*!
+    dummy function for win32 build
+*/
+void FmServiceUtilsPrivate::sendFile( const QStringList &filePathList )
+{
+    Q_UNUSED( filePathList );
+}
+
+/*!
+    dummy function for win32 build
+*/
+void FmServiceUtilsPrivate::closeApps()
+{
+
+}
+
+/*!
+    dummy function for win32 build
+*/
+void FmServiceUtilsPrivate::restartApps()
+{
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/src/inc/fmserviceutils/private/win32/fmserviceutilsprivate.h	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+* 
+* Contributors:
+*
+* 
+* Description:
+*     The header file of service utils private for win32 wrapper
+*/
+
+#ifndef FMSERVICEUTILSPRIVATE_H
+#define FMSERVICEUTILSPRIVATE_H
+
+#include <QStringList>
+
+class FmServiceUtilsPrivate
+{
+public:
+    FmServiceUtilsPrivate();
+    virtual ~FmServiceUtilsPrivate();
+
+    void sendFile( const QStringList &filePathList );
+    void closeApps();
+    void restartApps();
+
+};
+
+#endif
--- a/filemanager/src/inc/fmutils.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/inc/fmutils.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -18,11 +18,12 @@
 
 #include "fmutils.h"
 
-#include <QDir>
+#include <QRegExp>
 #include <QFileInfo>
 
 #include <hbglobal.h>
 
+
 /*!
     Used to get drive type for convenience.
 */
@@ -117,10 +118,11 @@
 }
 
 /*!
-    All "/" and "\" in \a path will be changed to QDir::separator
+    All "/" and "\" in \a path will be changed to \a splitter
+    QDir::separator is default value for splitter
     \sa fillPathWithSplash, fillPathWithSplash will append QDir::separator in the end
 */
-QString FmUtils::formatPath( const QString &path  )
+QString FmUtils::formatPath( const QString &path, const QChar &splitter )
 {
     QString formatPath;
     if( path.isEmpty() ) {
@@ -129,7 +131,7 @@
     
     foreach( const QChar &ch, path ) {
         if( ch == QChar('\\') || ch == QChar('/') ) {
-            formatPath.append( QDir::separator() );
+            formatPath.append( splitter );
         } else {
             formatPath.append( ch );
         }
@@ -139,22 +141,23 @@
 }
 
 /*!
-    Fill splash in the end of \a filePath. And all "/" and "\" will be changed to QDir::separator
+    Fill splash in the end of \a filePath. And all "/" and "\" will be changed to \a splitter
+    QDir::separator is default value for splitter
     Please do not call this function if path is a file.
     Use \a formatPath instead, \a formatPath will not append QDir::separator in the end.
     \sa formatPath only changed "/" and "\" to QDir::separator
 */
-QString FmUtils::fillPathWithSplash( const QString &filePath )
+QString FmUtils::fillPathWithSplash( const QString &filePath, const QChar &splitter )
 {
     QString newFilePath;
     if( filePath.isEmpty() ) {
         return newFilePath;
     }
 
-    newFilePath = formatPath( filePath );
+    newFilePath = formatPath( filePath, splitter );
     
-    if( newFilePath.right( 1 )!= QDir::separator() ){
-        newFilePath.append( QDir::separator() );
+    if( newFilePath.right( 1 )!= splitter ){
+        newFilePath.append( splitter );
     }
     return newFilePath;
 }
@@ -410,3 +413,27 @@
     FM_LOG("FmUtils::isSubFolder: false");
     return false;
 }
+
+/*!
+    Check if \a path is system path.
+*/
+bool FmUtils::isSystemFolder( const QString &path )
+{
+    QFileInfo fileInfo( path );
+    if( fileInfo.isDir() ) {
+        QString checkedPath( fillPathWithSplash( path, Char_Slash ) );
+
+        QRegExp systemFolder  ( RegexWidecard_SystemFolder,   Qt::CaseInsensitive, QRegExp::Wildcard );
+        QRegExp sysFolder     ( RegexWidecard_SysFolder,      Qt::CaseInsensitive, QRegExp::Wildcard );
+        QRegExp privateFolder ( RegexWidecard_PrivateFolder,  Qt::CaseInsensitive, QRegExp::Wildcard );
+        QRegExp resourceFolder( RegexWidecard_ResourceFolder, Qt::CaseInsensitive, QRegExp::Wildcard );
+
+        if( systemFolder.exactMatch( checkedPath ) ||
+            sysFolder.exactMatch( checkedPath ) ||
+            privateFolder.exactMatch( checkedPath ) ||
+            resourceFolder.exactMatch( checkedPath ) ) {
+            return true;
+        }
+    }
+    return false;
+}
--- a/filemanager/src/inc/fmutils.h	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/inc/fmutils.h	Wed Sep 29 10:37:03 2010 +0800
@@ -21,6 +21,7 @@
 
 #include "fmcommon.h"
 
+#include <QDir>
 #include <QString>
 
 /*!
@@ -148,8 +149,8 @@
     static QString  getDriveLetterFromPath( const QString &path );
     static QString  formatStorageSize( quint64 size );
     static bool     isDrive( const QString &path );
-    static QString  formatPath( const QString &path  );
-    static QString  fillPathWithSplash( const QString &filePath );
+    static QString  formatPath( const QString &path, const QChar &splitter = QDir::separator() );
+    static QString  fillPathWithSplash( const QString &filePath, const QChar &splitter = QDir::separator() );
     static QString  removePathSplash( const QString &filePath );
     static void     getDriveList( QStringList &driveList, bool isHideUnAvailableDrive );
     static QString  fillDriveVolume( QString driveName, bool isFillWithDefaultVolume );
@@ -159,6 +160,7 @@
     static bool     checkFolderFileName( const QString& name );
     static bool     checkNewFolderOrFile( const QString& fileName, const QString &path, QString &errString );
     static bool     isSubLevelPath( const QString &src, const QString &dest );
+    static bool     isSystemFolder( const QString &path );
     // </QtBasedFunctions>
     //////////////////////////////////////////////////////////////////
     
@@ -197,12 +199,13 @@
 	
     // other fucntions
     static int      launchFile( const QString &filePath );
-    static void     sendFiles( QStringList &filePathList );
     static QString  getBurConfigPath( QString appPath );
     static QString  getFileType( const QString &filePath  );
     static bool     isDriveC( const QString &driverName );
     static int      getMaxFileNameLength();
     static bool     checkMaxPathLength( const QString& path );
+    static void     setSystem( bool isSystem );
+    static QString  numberToDriveName( int drive );
     // </platformBasedFunctions>
     //////////////////////////////////////////////////////////////////
 };
--- a/filemanager/src/inc/fmutils_s60.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/inc/fmutils_s60.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -21,6 +21,8 @@
 #include "fmcommon.h"
 #include "fms60utils.h"
 
+#include <COEMAIN.H>
+#include <eikenv.H> 
 #include <apgcli.h>
 #include <sysutil.h>
 #include <f32file.h>
@@ -40,7 +42,6 @@
 #include <XQConversions>
 #include <xqaiwrequest.h>
 
-#include <shareui.h>
 #include <hbglobal.h>
 #include <hbdirectorynamelocalizer.h>
 
@@ -55,8 +56,11 @@
     if( driveName.isEmpty() ) {
         return FmDriverInfo( 0, 0, driveName, QString(), FmDriverInfo::EDriveNotPresent );
     }
-    CCoeEnv *env = CCoeEnv::Static();
-    RFs& fs = env->FsSession();
+    //    CCoeEnv *env = CCoeEnv::Static();
+    //    RFs& fs = env->FsSession();
+    // make new fs so that this function can be called in thread
+    RFs fs;
+    fs.Connect();
 
     TVolumeInfo volumeInfo;
     TInt drive = 0;
@@ -187,6 +191,7 @@
             "_errorCode:" + QString::number( errorCode ) + 
             "_driveSatus:" + QString::number( state ) );
     FM_LOG( logString );
+    fs.Close();
     return FmDriverInfo( volumeInfo.iSize, volumeInfo.iFree, driveName, volumeName, state );
 }
 
@@ -384,8 +389,11 @@
         }   
     }
         
-    CCoeEnv *env = CCoeEnv::Static();
-	RFs& fs = env->FsSession();
+    //  CCoeEnv *env = CCoeEnv::Static();
+    //	RFs& fs = env->FsSession();
+    // make new fs so that this function can be called in thread
+    RFs fs;
+    fs.Connect();
 
     TInt drive = 0;
 	drive = driveName[0].toUpper().toAscii() - 'A' + EDriveA;
@@ -397,6 +405,7 @@
     QString logString = "Rename error:" + QString::number( err );
     FM_LOG( logString );
 
+    fs.Close();
     if( err == KErrNone ){
         return FmErrNone;   
     }
@@ -513,6 +522,12 @@
         FM_LOG( QString( "isPathAccessabel false: path contain C and not in data folder" ) );
         return FmErrPathDenied;
     }
+    
+    if( isSystemFolder( fileInfo.absoluteFilePath() ) ) {
+        FM_LOG( QString( "isPathAccessabel false: path is system path that not accessable" ) );
+        return FmErrPathDenied;
+    }
+
     if( !checkDriveAccessFilter( FmUtils::getDriveNameFromPath( fileInfo.absoluteFilePath() ) ) ){
         return FmErrDriveDenied;
     }
@@ -656,8 +671,9 @@
 }
 
 /*!
+    return localized file name by \a path, empty string returned for non-localized path.
     In Symbian system, default folders will be localized.
-    So localize is used to check if a path is a default folder
+    So localize also can be used to check if a path is a default folder
     \sa isDefaultFolder
 */
 QString FmUtils::localize( const QString &path )
@@ -775,15 +791,6 @@
 }
 
 /*!
-    Send files( \a filePathList ) with share ui.
-*/
-void FmUtils::sendFiles( QStringList &filePathList )
-{
-    ShareUi shareui;
-    shareui.send( filePathList, false );
-}
-
-/*!
     return path for backup restore config file.
     Currently \a appPath is not used.
 */
@@ -857,3 +864,28 @@
     }
     return true;
 }
+
+/*!
+    Set appliation as system mode if \a isSystem is true.
+    Otherwise set application as non-system mode
+*/
+void FmUtils::setSystem( bool isSystem )
+{
+    CCoeEnv* coeEnv = CCoeEnv::Static();
+    CEikonEnv* eikonEnv = (STATIC_CAST(CEikonEnv*,coeEnv));
+    if( isSystem ) {
+        eikonEnv->SetSystem(ETrue);
+    } else {
+        eikonEnv->SetSystem(EFalse);
+    }
+}
+
+/*!
+    return drive name by \a drive
+*/
+QString FmUtils::numberToDriveName( int drive )
+{
+    QChar driveChar( drive - EDriveA + 'A' );
+    QString driveName = QString( driveChar ) + ':';
+    return driveName;
+}
--- a/filemanager/src/inc/fmutils_win.cpp	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/src/inc/fmutils_win.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -32,6 +32,9 @@
 const int KMaxFileName=0x100;
 const int KMaxPath=0x100;
 
+// EDriveA means number of A drive
+const int EDriveA = 0;
+
 FmDriverInfo FmUtils::queryDriverInfo( const QString &driveName )
 {
     quint64 size = 0;
@@ -168,6 +171,19 @@
 }
 
 /*!
+    return localized file name by \a path, empty string returned for non-localized path.
+    In Symbian system, default folders will be localized.
+    So localize also can be used to check if a path is a default folder
+    Do not need localize on windows.
+    \sa isDefaultFolder
+*/
+QString FmUtils::localize( const QString &path )
+{
+    Q_UNUSED( path );
+    return QString();
+}
+
+/*!
     set the \a desFile attributes as the same with \a srcFile
 */
 int FmUtils::setFileAttributes( const QString &srcFile, const QString &desFile )
@@ -208,11 +224,6 @@
     }
 }
 
-void FmUtils::sendFiles( QStringList &filePathList )
-{
-    Q_UNUSED( filePathList );
-}
-
 QString FmUtils::getBurConfigPath( QString appPath )
 {
     QFileInfo fileInfo( appPath );
@@ -251,3 +262,15 @@
     }
     return true;
 }
+
+void FmUtils::setSystem( bool isSystem )
+{
+    Q_UNUSED( isSystem );
+}
+
+QString FmUtils::numberToDriveName( int drive )
+{
+    QChar driveChar( drive - EDriveA + 'A' );
+    QString driveName = QString( driveChar ) + ':';
+    return driveName;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/tsrc.pro	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,30 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE = subdirs
+SUBDIRS = unit/unit_backuprestoresettings \
+          unit/ut_fminternaldrivermodel \
+          unit/ut_fminternalfmutils \
+          unit/ut_fmfiletypeprovider \
+          unit/ut_fmfiletyperecognizer \
+
+CONFIG += ordered
+#CONFIG += symbian_test
+test.depends = first
+test.CONFIG += recursive
+autotest.depends = first
+autotest.CONFIG += recursive
+QMAKE_EXTRA_TARGETS += test autotest
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/unit/unit_backuprestoresettings/runtest.bat	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,19 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+
+\epoc32\RELEASE\WINSCW\udeb\unit_backuprestoresettings.exe -xml -o c:\unit_backuprestoresettings.xml
+copy \epoc32\winscw\c\unit_backuprestoresettings.xml
+del \epoc32\winscw\c\unit_backuprestoresettings.xml
\ No newline at end of file
--- a/filemanager/tsrc/unit/unit_backuprestoresettings/unit_backuprestoresettings.pro	Tue Aug 24 10:24:14 2010 +0800
+++ b/filemanager/tsrc/unit/unit_backuprestoresettings/unit_backuprestoresettings.pro	Wed Sep 29 10:37:03 2010 +0800
@@ -42,4 +42,6 @@
         autotest.commands =/epoc32/RELEASE/WINSCW/udeb/unit_backuprestoresettings -xml -o c:/unit_backuprestoresettings.xml
         }
 }
-QMAKE_EXTRA_TARGETS += test autotest
\ No newline at end of file
+QMAKE_EXTRA_TARGETS += test autotest
+
+symbian:MMP_RULES += SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/unit/ut_common.pri	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+LIBS += -lfmbkupenginewrapper
+LIBS += -lfmfiledialog
+
+symbian { 
+    LIBS += -lplatformenv \ 
+            -lapmime \ 
+            -lxqservice \ 
+            -lxqutils \ 
+            -lshareui \ 
+            -lefsrv \ 
+            -lapgrfx \ 
+            -lcone \ 
+            -ldirectorylocalizer \
+            -lsysutil \
+            -lbafl \
+            -leikcore
+}
+
+QMAKE_EXTRA_TARGETS += test autotest
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/unit/ut_fmfiletypeprovider/src/ut_fmfiletypeprovider.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class is test case for file manager internal api class.
+*
+*/
+
+#include "fmfileiconprovider.h"
+#include "fmfiletyperecognizer.h"
+#include <QtTest/QtTest>
+#include <QMap>
+#include <QString>
+#include <QStringList>
+#include <qdebug.h>
+
+
+class TestFmFileTypeProvider: public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void initTestCase();
+    
+    void testFmFileIconProvider(); // test the FmFileIconProvider() constructor funtion.
+    
+    void testIconKnown(); // test the icon() funtion.
+//    void testIconUnKnown();
+    
+    void cleanupTestCase();       // Finalize test data
+};
+
+/*!
+    \class TestFmFileTypeProvider
+    \brief describe the test case's goal, like: \n
+      class name:  FmDriveModel \n
+      class's description: Test the File Manager internal api functions. \n
+      type of test case: unit test\n 
+      test cases' number totally: \n
+ */
+
+void TestFmFileTypeProvider::initTestCase()
+{    
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        FmFileIconProvider(); \n
+     2. Case Descrition: test the constructor function. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> no \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> no crash \n 
+ */
+void TestFmFileTypeProvider::testFmFileIconProvider()
+{
+    FmFileIconProvider *testProvider = new FmFileIconProvider();
+//QMap<QString, FileType>     mFileExtensionMap is a private member, can not verify the result.
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        virtual QIcon icon(const QFileInfo &info) const; \n
+     2. Case Descrition: Verify the right file type is returned \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retType = FileTypeDrive \n 
+ */
+void TestFmFileTypeProvider::testIconKnown()
+{
+    QFileInfo path1("C:\\image.jpg");
+    QFileInfo path2("D:\\Video.rm");
+    QFileInfo path3("D:\\Tone.wav");
+    QFileInfo path4("Z:\\Text.doc");
+    QFileInfo path5("Z:\\Install.sisx");
+    QFileInfo path6("D:\\Java.jar");
+    QFileInfo path7("C:\\Flash.swf");
+    
+    FmFileIconProvider *testProvider = new FmFileIconProvider();
+    QIcon retIcon1 = testProvider->icon(Drive_C);
+//    QVERIFY(retIcon1 != QIcon());
+    
+    QIcon retIcon2 = testProvider->icon(Drive_D);
+//    QVERIFY(retIcon2 != 0);
+    
+    QIcon retIcon3 = testProvider->icon(Drive_Z);
+//    QVERIFY(retIcon3 != 0);
+    
+    QIcon retIcon4 = testProvider->icon(Folder_C_Data);
+//    QVERIFY(retIcon4 != 0);
+    
+    QIcon retIcon01 = testProvider->icon(path1);
+//    QVERIFY(retIcon01 != 0);
+    
+    QIcon retIcon02 = testProvider->icon(path2);
+//    QVERIFY(retIcon02 != 0);
+    
+    QIcon retIcon03 = testProvider->icon(path3);
+//    QVERIFY(retIcon03 != 0);
+    
+    QIcon retIcon04 = testProvider->icon(path4);
+//    QVERIFY(retIcon04 != 0);
+    
+    QIcon retIcon05 = testProvider->icon(path5);
+//    QVERIFY(retIcon05 != 0);
+    
+    QIcon retIcon06 = testProvider->icon(path6);
+//    QVERIFY(retIcon06 != 0);
+    
+    QIcon retIcon07 = testProvider->icon(path7);
+//    QVERIFY(retIcon07 != 0);
+    
+    delete testProvider;
+}
+
+void TestFmFileTypeProvider::cleanupTestCase()
+{
+
+}
+
+QTEST_MAIN(TestFmFileTypeProvider)
+#include "ut_fmfiletypeprovider.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/unit/ut_fmfiletypeprovider/ut_fmfiletypeprovider.pro	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+QT += testlib
+CONFIG += hb qtestlib
+CONFIG += symbian_test
+TEMPLATE = app
+TARGET = ut_fmfiletypeprovider
+include ( ../../../src/common.pri )
+include ( ../../../src/inc/commoninc.pri )
+include ( ../../../src/inc/commonutils.pri )
+include ( ../ut_common.pri )
+
+DEPENDPATH += .
+INCLUDEPATH += .
+
+symbian:MMP_RULES += SMPSAFE
+
+TARGET.CAPABILITY = ALL -TCB
+
+SOURCES += src/ut_fmfiletypeprovider.cpp
Binary file filemanager/tsrc/unit/ut_fmfiletyperecognizer/data/Flash.swf has changed
Binary file filemanager/tsrc/unit/ut_fmfiletyperecognizer/data/Install.sisx has changed
Binary file filemanager/tsrc/unit/ut_fmfiletyperecognizer/data/Java.jar has changed
Binary file filemanager/tsrc/unit/ut_fmfiletyperecognizer/data/Tone.wav has changed
Binary file filemanager/tsrc/unit/ut_fmfiletyperecognizer/data/Video.rm has changed
Binary file filemanager/tsrc/unit/ut_fmfiletyperecognizer/data/image.jpg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/unit/ut_fmfiletyperecognizer/src/ut_fmfiletyperecognizer.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,189 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class is test case for file manager internal api class.
+*
+*/
+
+#include "fmfiletyperecognizer.h"
+#include <QtTest/QtTest>
+#include <QMap>
+#include <QString>
+#include <QStringList>
+
+class TestFmFileTypeRcognizer: public QObject
+{
+    Q_OBJECT
+
+private slots:
+    void initTestCase();
+    
+    void testFmFileTypeRecognizer(); // test the FmFileTypeRecognizer() constructor.   
+    
+    void testGetTypeDrive(); // test the getType() function
+    void testGetTypePath();
+    void testGetTypeKnown();
+    void testGetTypeUnKnown();
+    
+    void cleanupTestCase();       // Finalize test data
+};
+
+/*!
+    \class TestFmFileTypeRcognizer
+    \brief \n
+      class name:  FmDriveModel \n
+      class's description: Test the File Manager internal api functions. \n
+      type of test case: unit test\n 
+      test cases' number totally: 5 \n
+ */
+
+void TestFmFileTypeRcognizer::initTestCase()
+{ 
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        FmFileTypeRecognizer(); \n
+     2. Case Descrition: test the constructor function. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> no \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> no crash \n 
+ */
+void TestFmFileTypeRcognizer::testFmFileTypeRecognizer()
+{
+    FmFileTypeRecognizer *testRcognizer = new FmFileTypeRecognizer();
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        FmFileTypeRecognizer::FileType getType( const QString& path ) const ; \n
+     2. Case Descrition: Verify the right file type is returned \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retType = FileTypeDrive \n 
+ */
+void TestFmFileTypeRcognizer::testGetTypeDrive()
+{
+    FmFileTypeRecognizer *testRcognizer = new FmFileTypeRecognizer();
+    FmFileTypeRecognizer::FileType retType = testRcognizer->getType( "C:\\" );
+    qDebug() << retType;
+    QVERIFY(retType == FmFileTypeRecognizer::FileTypeDrive);
+    delete testRcognizer;    
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        FmFileTypeRecognizer::FileType getType( const QString& path ) const ; \n
+     2. Case Descrition: Verify the right file type is returned \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retType = FileTypeFolder \n 
+ */
+void TestFmFileTypeRcognizer::testGetTypePath()
+{
+    FmFileTypeRecognizer *testRcognizer = new FmFileTypeRecognizer();
+    FmFileTypeRecognizer::FileType retType = testRcognizer->getType( Folder_C_Data);
+    qDebug() << retType;
+    QVERIFY(retType == FmFileTypeRecognizer::FileTypeFolder);
+    delete testRcognizer;
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        FmFileTypeRecognizer::FileType getType( const QString& path ) const ; \n
+     2. Case Descrition: Verify the right file type is returned \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> return the correct file type \n 
+ */
+void TestFmFileTypeRcognizer::testGetTypeKnown()
+{
+    QString path1 = "image.jpg";
+    QString path2 = "Video.rm";
+    QString path3 = "Tone.wav";
+    QString path4 = "Text.doc";
+    QString path5 = "Install.sisx";
+    QString path6 = "Java.jar";
+    QString path7 = "Flash.swf";
+#ifdef FEATURE_NOT_IMPLEMENTED_TYPERECOG
+    QString pathWidget = "widget.wgz"; 
+    QString pathWebLink = "abc.lnk";// Need confirm the suffix
+#endif
+    FmFileTypeRecognizer *testRcognizer = new FmFileTypeRecognizer();
+    
+    FmFileTypeRecognizer::FileType retType1 = testRcognizer->getType( path1);
+    QVERIFY(retType1 == FmFileTypeRecognizer::FileTypeImage);
+    
+    FmFileTypeRecognizer::FileType retType2 = testRcognizer->getType( path2);
+//    qDebug() << retType1;
+    QVERIFY(retType2 == FmFileTypeRecognizer::FileTypeVideo);
+    
+    FmFileTypeRecognizer::FileType retType3 = testRcognizer->getType( path3);
+    QVERIFY(retType3 == FmFileTypeRecognizer::FileTypeTone);
+    
+    FmFileTypeRecognizer::FileType retType4 = testRcognizer->getType( path4);
+    QVERIFY(retType4 == FmFileTypeRecognizer::FileTypeText);
+    
+    FmFileTypeRecognizer::FileType retType5 = testRcognizer->getType( path5);
+    QVERIFY(retType5 == FmFileTypeRecognizer::FileTypeSisx);
+    
+    FmFileTypeRecognizer::FileType retType6 = testRcognizer->getType( path6);
+    QVERIFY(retType6 == FmFileTypeRecognizer::FileTypeJava);
+    
+    FmFileTypeRecognizer::FileType retType7 = testRcognizer->getType( path7);
+    QVERIFY(retType7 == FmFileTypeRecognizer::FileTypeFlash);
+    
+#ifdef FEATURE_NOT_IMPLEMENTED_TYPERECOG
+    FmFileTypeRecognizer::FileType retType8 = testRcognizer->getType( pathWidget); 
+//    QVERIFY(retType8 == FmFileTypeRecognizer::FileTypeWidget);
+    
+    FmFileTypeRecognizer::FileType retType9 = testRcognizer->getType( pathWebLink); 
+//    QVERIFY(retType9 == FmFileTypeRecognizer::FileTypeWebLink);
+#endif    
+    delete testRcognizer;
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        FmFileTypeRecognizer::FileType getType( const QString& path ) const ; \n
+     2. Case Descrition: Verify the right file type is returned \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retType = FileTypeUnKnown \n 
+ */
+void TestFmFileTypeRcognizer::testGetTypeUnKnown()
+{
+    FmFileTypeRecognizer *testRcognizer = new FmFileTypeRecognizer();
+    
+    FmFileTypeRecognizer::FileType retType = testRcognizer->getType( "unknown.unknow");
+    QVERIFY(retType == FmFileTypeRecognizer::FileTypeUnKnown);
+    delete testRcognizer;
+}
+
+void TestFmFileTypeRcognizer::cleanupTestCase()
+{
+
+}
+
+QTEST_MAIN(TestFmFileTypeRcognizer)
+#include "ut_fmfiletyperecognizer.moc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/unit/ut_fmfiletyperecognizer/ut_fmfiletyperecognizer.pro	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+QT += testlib
+CONFIG += hb qtestlib
+CONFIG += symbian_test
+TEMPLATE = app
+TARGET = ut_fmfiletyperecognizer
+
+include ( ../../../src/common.pri )
+include ( ../../../src/inc/commoninc.pri )
+include ( ../../../src/inc/commonutils.pri )
+include ( ../ut_common.pri )
+
+DEPENDPATH += .
+INCLUDEPATH += .
+
+TARGET.CAPABILITY = ALL -TCB
+
+symbian:MMP_RULES += SMPSAFE
+
+SOURCES += src/ut_fmfiletyperecognizer.cpp  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/unit/ut_fminternaldrivermodel/runtest.bat	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,19 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+
+\epoc32\RELEASE\WINSCW\udeb\ut_fminternaldrivemodel.exe -xml -o c:\ut_fminternaldrivemodel.xml
+copy \epoc32\winscw\c\ut_fminternaldrivemodel.xml
+del \epoc32\winscw\c\ut_fminternaldrivemodel.xml
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/unit/ut_fminternaldrivermodel/src/testclassdatafmdrivelistprovider.h	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,38 @@
+/*
+ * testDataClassFmDriveListProvider.h
+ *
+ *  Created on: Jul 13, 2010
+ *  
+ */
+
+#ifndef TESTCLASSDATAFMDRIVELISTPROVIDER_H
+#define TESTCLASSDATAFMDRIVELISTPROVIDER_H
+#include "fmdrivemodel.h"
+
+class TestDataClassFmDriveListProvider: public FmDriveListProvider
+{
+public:
+    TestDataClassFmDriveListProvider();
+    ~TestDataClassFmDriveListProvider();
+    virtual void getDriveList( QStringList &driveList );
+    
+};
+
+#endif //TESTCLASSDATAFMDRIVELISTPROVIDER_H
+
+TestDataClassFmDriveListProvider::TestDataClassFmDriveListProvider()
+{
+    
+}
+
+TestDataClassFmDriveListProvider::~TestDataClassFmDriveListProvider()
+{
+    
+}
+
+void TestDataClassFmDriveListProvider::getDriveList(QStringList &driveList)
+{
+    driveList<<"drive1:"
+             <<"drive2:"
+             <<"drive3:";             
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/unit/ut_fminternaldrivermodel/src/ut_fminternaldrivemodel.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,350 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0""
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*       test the file manager internal apis.
+*/
+
+#include "ut_fminternaldrivemodel.h"
+#include "testclassdatafmdrivelistprovider.h"
+#include "fmdrivemodel.h"
+#include <QtTest/QtTest>
+#include <hbapplication.h>
+#include "fmutils.h"
+/*!
+    \class TestFmInternalDriveModel
+    \brief \n
+      class name:  FmDriveModel \n
+      class's description: Test the File Manager internal api functions. \n
+      type of test case: unit test\n 
+      test cases' number totally: 10 \n
+ */
+
+void TestFmInternalDriveModel::initTestCase()
+{
+    // translate the related text. 
+    QString lang = QLocale::system().name(); 
+    QString path = "z:/resource/qt/translations/"; 
+    mTranslator.load( path + "filemanager_" + lang );
+    qApp->installTranslator(&mTranslator);
+    
+    // get all the drives which can be shown, the parameters should be according to the parameter (Options) of FmDriveModel.
+    FmUtils::getDriveList(mDriverList, false);
+    qDebug() << mDriverList;        
+}
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        explicit FmDriveModel( QObject *parent = 0, Options options = 0,
+            FmDriveListProvider *driveListProvider = 0 ); \n
+     2. Case Descrition: test the constructor function. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> parent = new QObject(), 
+            Options = FmDriveModel::FillWithVolume, 
+            driveListProvider = new TestDataClassFmDriveListProvider();\n &nbsp;&nbsp;
+        <2> parent = new QObject(),
+            Options = FmDriveModel::FillWithVolume | FillWithDefaultVolume, 
+            driveListProvider = 0 \n&nbsp;&nbsp;
+        <3> parent = new QObject(); 
+            Options = FmDriveModel::FillWithVolume | FillWithDefaultVolume |HideUnAvailableDrive, 
+            driveListProvider = 0 \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> no crash \n &nbsp;&nbsp;
+        <2> no crash \n &nbsp;&nbsp;
+        <3> no crash \n
+ */
+void TestFmInternalDriveModel::testConstructor()
+{
+    QObject *pObject = new QObject();
+    // the class TestDataClassFmDriveListProvider is a sub class from FmDriveListProvider.
+    TestDataClassFmDriveListProvider *driveListProvider = new TestDataClassFmDriveListProvider();    
+    FmDriveModel *fmDriveModel = new FmDriveModel( pObject,FmDriveModel::FillWithVolume,driveListProvider );
+    QVERIFY ( fmDriveModel != 0 );
+
+    // the drive number in class TestDataClassFmDriveListProvider is "3".
+    QVERIFY ( fmDriveModel->rowCount() == 3 );
+    delete fmDriveModel;
+    fmDriveModel = 0;
+    
+    fmDriveModel = new FmDriveModel( pObject,FmDriveModel::FillWithVolume | FmDriveModel::FillWithDefaultVolume ,0 );
+    QVERIFY ( fmDriveModel != 0 );
+    QVERIFY ( fmDriveModel->rowCount() > 0 );
+    delete fmDriveModel;
+    fmDriveModel = 0;
+    
+    fmDriveModel = new FmDriveModel( pObject, FmDriveModel::FillWithVolume | FmDriveModel::FillWithDefaultVolume | FmDriveModel::HideUnAvailableDrive ,0 );
+    QVERIFY ( fmDriveModel != 0 );
+    QVERIFY ( fmDriveModel->rowCount() > 0 );
+    
+    delete fmDriveModel;
+    delete pObject;
+    delete driveListProvider;
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: int rowCount( const QModelIndex &parent = QModelIndex() ) const; \n
+     2. Case Descrition: Verify it return the right row count. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> parent = QModelIndex() \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retColumnCount = 1 \n
+ */
+void TestFmInternalDriveModel::testRowCount()
+{
+    FmDriveModel *fmDriveModel = new FmDriveModel(0);
+    QModelIndex testIndex1 = fmDriveModel->index(1,0);
+
+    int retRowCount1 = fmDriveModel->rowCount(testIndex1);
+    QVERIFY(retRowCount1 == 0);    
+    int retRowCount2 = fmDriveModel->rowCount();
+    delete fmDriveModel;
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: int columnCount( const QModelIndex &parent = QModelIndex() ) const; \n
+     2. Case Descrition:  \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> parent = QModelIndex() \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retColumnCount = 1 \n
+ */
+void TestFmInternalDriveModel::testColumnCount()
+{
+    FmDriveModel *fmDriveModel = new FmDriveModel(0);
+    QModelIndex testIndex = QModelIndex();
+    int retColumnCount = fmDriveModel->columnCount(testIndex);
+    QVERIFY(retColumnCount == 1);    
+    delete fmDriveModel;
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name:  \n &nbsp;&nbsp;
+        QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const; \n
+     2. Case Descrition:  \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> index = QModelIndex(), role = Qt::DisplayRole \n &nbsp;&nbsp;
+        <2> index = QModelIndex(), role = Qt::UserRole \n &nbsp;&nbsp;
+        <3> index = QModelIndex(), role = Qt::DecorationRole \n &nbsp;&nbsp;
+        <4> index = QModelIndex(), role = Qt::TextAlignmentRole \n &nbsp;&nbsp;
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retData1 = "C:" \n &nbsp;&nbsp;
+        <2> retData2 = "C:\"  \n &nbsp;&nbsp;
+        <3> return the right icon
+        <4> to be delete...
+ */
+void TestFmInternalDriveModel::testData()
+{
+    QObject *pObject = new QObject();  
+    TestDataClassFmDriveListProvider *driveListProvider = new TestDataClassFmDriveListProvider();
+    
+    FmDriveModel *fmDriveModel = new FmDriveModel( 0 );
+    QModelIndex index = fmDriveModel->index(0,0);
+    
+    QVariant retData1 = fmDriveModel->data(index, Qt::DisplayRole);
+    QString strTemp1 = retData1.toString();
+    QVERIFY( strTemp1.trimmed() == "C:" );
+
+//  unable to verify the return icon is the right one.
+    QVariant retData3 = fmDriveModel->data(index, Qt::DecorationRole); 
+    
+// need to delete the  "if (index.column() == 1 && role == Qt::TextAlignmentRole)", because only one column is defined.
+    QVariant retData4 = fmDriveModel->data(index, Qt::TextAlignmentRole);
+    
+    delete driveListProvider;
+    driveListProvider = 0;
+    delete fmDriveModel;
+    fmDriveModel = 0; 
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name:  \n &nbsp;&nbsp;
+        bool indexValid( const QModelIndex &index ) const; \n
+     2. Case Descrition:  \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> index = QModelIndex() \n &nbsp;&nbsp;     
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retBool = true \n
+ */
+void TestFmInternalDriveModel::testIndexValid()
+{
+    FmDriveModel *fmDriveModel = new FmDriveModel(0);
+    QModelIndex aIndex = fmDriveModel->index(0,0);
+    QModelIndex bIndex = fmDriveModel->index(0,1); 
+    bool a = fmDriveModel->indexValid(aIndex);
+    QVERIFY(a == true);
+    bool b = fmDriveModel->indexValid(bIndex);
+    QVERIFY(b == true);
+    delete fmDriveModel;
+    fmDriveModel = 0;
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name:  \n &nbsp;&nbsp;
+        QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const; \n
+     2. Case Descrition:  \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> section = 0, orientation =  Qt::Horizontal, role = Qt::DisplayRole \n &nbsp;&nbsp;
+        <2> section = 1, orientation =  Qt::Horizontal, role = Qt::DisplayRole \n &nbsp;&nbsp;
+        <3> section = 2, orientation =  Qt::Horizontal, role = Qt::DisplayRole \n &nbsp;&nbsp;
+        <4> section = 3, orientation =  Qt::Horizontal, role = Qt::DisplayRole \n &nbsp;&nbsp;
+        <5> section = 4, orientation =  Qt::Horizontal, role = Qt::DisplayRole \n &nbsp;&nbsp; 
+        <6> section = 1, orientation =  Qt::Vertical, role = Qt::DisplayRole \n &nbsp;&nbsp;
+        <7> section = 1, orientation =  Qt::Horizontal, role = Qt::UserRole \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retHeaderData.toString() = "Name" \n &nbsp;&nbsp;
+        <2> retHeaderData.toString() = "Size" \n &nbsp;&nbsp;
+        <3> retHeaderData.toString() = "Type" \n &nbsp;&nbsp;
+        <4> retHeaderData.toString() = "Date Modified" \n &nbsp;&nbsp;
+        <5> no crash \n &nbsp;&nbsp;
+        <6> no crash \n &nbsp;&nbsp;
+        <7> no crash \n 
+ */
+void TestFmInternalDriveModel::testHeaderData()
+{
+    FmDriveModel *fmDriveModel = new FmDriveModel(0);
+    // 
+    QVariant retHeaderData1 = fmDriveModel->headerData(0, Qt::Horizontal, Qt::DisplayRole);
+    QVERIFY(retHeaderData1.toString() == "Name");
+    
+    QVariant retHeaderData2 = fmDriveModel->headerData(1, Qt::Horizontal, Qt::DisplayRole);
+    QVERIFY(retHeaderData2.toString() == "Size");
+    
+    QVariant retHeaderData3 = fmDriveModel->headerData(2, Qt::Horizontal, Qt::DisplayRole);
+    QVERIFY(retHeaderData3.toString() == "Type");
+    
+    QVariant retHeaderData4 = fmDriveModel->headerData(3, Qt::Horizontal, Qt::DisplayRole);
+    QVERIFY(retHeaderData4.toString() == "Date Modified");
+    
+    QVariant retHeaderData5 = fmDriveModel->headerData(4, Qt::Horizontal, Qt::DisplayRole);    
+    QVERIFY(retHeaderData5.toString().isEmpty());// "");
+    
+#ifdef TO_BE_INVESTIGATE    
+    QVariant retHeaderData6 = fmDriveModel->headerData(0, Qt::Vertical, Qt::DisplayRole);  
+    QString a = retHeaderData6.toString(); // to be investigated.
+//    QVERIFY(retHeaderData6.toString() == ""); 
+#endif
+    
+    QVariant retHeaderData7 = fmDriveModel->headerData(1, Qt::Horizontal, Qt::UserRole);  
+    QVERIFY(retHeaderData7.toString().isEmpty()); //== "");
+    
+    delete fmDriveModel;
+    fmDriveModel = 0;
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name:  \n &nbsp;&nbsp;
+        QString displayString( const QModelIndex &index ) const; \n
+     2. Case Descrition: Verify the correct display string is shown. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> index = QModelIndex() \n &nbsp;&nbsp;     
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retBool = true \n
+ */
+void TestFmInternalDriveModel::testDisplayStringWithVolume()
+{
+    // option = FillWithVolume | FillWithDefaultVolume
+    FmDriveModel *fmDriveModel = new FmDriveModel( 0,FmDriveModel::FillWithVolume | FmDriveModel::FillWithDefaultVolume, 0);
+    
+    for(int i=0; i < mDriverList.count(); i++){
+        QModelIndex indexValid = fmDriveModel->index(i,0);
+        // get the display string.
+        QVariant retData = fmDriveModel->displayString(indexValid); 
+        QVERIFY(retData.toString() == FmUtils::fillDriveVolume(mDriverList[i], true));
+    }
+    delete fmDriveModel;
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name:  \n &nbsp;&nbsp;
+        QString displayString( const QModelIndex &index ) const; \n
+     2. Case Descrition: Verify the correct display string is shown. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> index = QModelIndex() \n &nbsp;&nbsp;     
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retBool = true \n
+ */
+void TestFmInternalDriveModel::testDisplayStringWithoutVolume()
+{ 
+    FmDriveModel *fmDriveModel = new FmDriveModel();
+    
+    for(int i=0; i < mDriverList.count(); i++){
+        QModelIndex indexValid = fmDriveModel->index(i,0);
+        // get the display string.
+        QVariant retData = fmDriveModel->displayString(indexValid); 
+//        QString retString = retData.toString();
+//        qDebug()<<retString;
+        QVERIFY(retData.toString() == FmUtils::removePathSplash( mDriverList[i] ));
+    }
+    delete fmDriveModel;
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name:  \n &nbsp;&nbsp;
+        QString displayString( const QModelIndex &index ) const; \n
+     2. Case Descrition: Verify it doesn't crash when using an invalid index. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> index = QModelIndex() \n &nbsp;&nbsp;     
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retString = QString() \n
+ */
+void TestFmInternalDriveModel::testDisplayStringEmpty()
+{ 
+    FmDriveModel *fmDriveModel = new FmDriveModel();
+    QModelIndex indexInValid = fmDriveModel->index(-1,0);
+    QVariant retData = fmDriveModel->displayString(indexInValid); 
+    QVERIFY(retData.toString() == QString());
+}
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name:  \n &nbsp;&nbsp;
+        QString driveName( const QModelIndex &index ) const; \n
+     2. Case Descrition:  \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> indexValid = QModelIndex() \n &nbsp;&nbsp;
+        <2> indexInValid = QModelIndex() \n     
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> return the rignt drive name. \n &nbsp;&nbsp;
+        <2> no crash. \n
+ */
+void TestFmInternalDriveModel::testDriveName()
+{
+    FmDriveModel *fmDriveModel = new FmDriveModel();
+    QModelIndex indexValid = fmDriveModel->index(0,0);    
+    QModelIndex indexInValid1 = fmDriveModel->index(0,2);
+    QModelIndex indexInValid2 = fmDriveModel->index(18);
+    QModelIndex indexInValid3 = fmDriveModel->index(5,0);
+    QString retDriveName1 = fmDriveModel->driveName(indexValid);
+    QVERIFY(retDriveName1 == "C:/");
+    QString retDriveName2 = fmDriveModel->driveName(indexInValid1);
+    QVERIFY(retDriveName2.isEmpty());
+    QString retDriveName3 = fmDriveModel->driveName(indexInValid2);
+    QVERIFY(retDriveName3.isEmpty());
+    QString retDriveName4 = fmDriveModel->driveName(indexInValid3);
+    QVERIFY(retDriveName4.isEmpty());
+    delete fmDriveModel;
+    fmDriveModel = 0;
+}
+
+void TestFmInternalDriveModel::cleanupTestCase()
+{
+}
+
+QTEST_MAIN(TestFmInternalDriveModel)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/unit/ut_fminternaldrivermodel/src/ut_fminternaldrivemodel.h	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0""
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*       test application for qt control panel public apis.
+*/
+
+#ifndef UT_FMINTERNALDRIVEMODEL_H_
+#define UT_FMINTERNALDRIVEMODEL_H_
+
+#include <QObject>
+#include <QTranslator>
+#include <QStringList>
+class TestFmInternalDriveModel :public QObject
+{
+    Q_OBJECT
+private slots:    
+    void initTestCase();    
+    void testConstructor(); //test the constructor function. 
+    void testRowCount(); // test the rowCount() function.
+    void testColumnCount(); // test the columnCount() function.
+    void testData();
+    void testIndexValid(); // test the indexValid() function.
+    void testHeaderData(); // test the headerData() function.
+    
+    void testDisplayStringWithVolume(); // test the displayString() function.
+    void testDisplayStringWithoutVolume();
+    void testDisplayStringEmpty();
+    
+    void testDriveName(); // test the driveName() function.        
+    void cleanupTestCase();    
+private:
+    QTranslator mTranslator;
+    QStringList mDriverList;
+};
+#endif /* UT_FMINTERNALDRIVEMODEL_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/unit/ut_fminternaldrivermodel/ut_fminternaldrivermodel.pro	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,39 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE = app
+TARGET = ut_fminternaldrivemodel
+
+QT += testlib
+CONFIG += hb qtestlib
+CONFIG += symbian_test
+
+include ( ../../../src/common.pri )
+include ( ../../../src/inc/commoninc.pri )
+include ( ../../../src/inc/commonutils.pri )
+include ( ../ut_common.pri )
+
+symbian:MMP_RULES += SMPSAFE
+
+DEPENDPATH += .
+INCLUDEPATH += .
+
+#TARGET.CAPABILITY = ALL -TCB
+TARGET.CAPABILITY = CAP_APPLICATION DiskAdmin AllFiles PowerMgmt
+
+HEADERS += src/testclassdatafmdrivelistprovider.h \
+           src/ut_fminternaldrivemodel.h
+SOURCES += src/ut_fminternaldrivemodel.cpp
Binary file filemanager/tsrc/unit/ut_fminternalfmutils/data/Image.jpg has changed
Binary file filemanager/tsrc/unit/ut_fminternalfmutils/data/Imageformove.jpg has changed
Binary file filemanager/tsrc/unit/ut_fminternalfmutils/data/Tone.mp3 has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/unit/ut_fminternalfmutils/data/unknow.unknow	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,1 @@
+unknow type
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/unit/ut_fminternalfmutils/runtest.bat	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,19 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+
+\epoc32\RELEASE\WINSCW\udeb\ut_fminternalfmutils.exe -xml -o c:\ut_fminternalfmutils.xml
+copy \epoc32\winscw\c\ut_fminternalfmutils.xml
+del \epoc32\winscw\c\ut_fminternalfmutils.xml
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/unit/ut_fminternalfmutils/src/ut_fminternalfmutils.cpp	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,1568 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0""
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*       test the file manager internal apis.
+*/
+
+#include "ut_fminternalfmutils.h"
+#include "fmutils.h"
+#include "fmdrivemodel.h"
+#include <QtTest/QtTest>
+#include <qdir.h>
+#include <qdebug.h>
+#include <hbglobal.h>
+
+/*!
+    \class TestFmInternalFmUtils
+    \brief \n
+      class name:  FmDriveModel \n
+      class's description: Test the File Manager internal api functions. \n
+      type of test case: unit test\n 
+      test cases' number totally: 63 \n
+ */
+
+/*!
+     Description of test data 
+ */
+void TestFmInternalFmUtils::initTestCase()
+{
+    QString lang = QLocale::system().name(); 
+    QString path = "z:/resource/qt/translations/"; 
+    mTranslator.load( path + "filemanager_" + lang );
+    qApp->installTranslator(&mTranslator);
+    
+    // init the path of test data.
+    mFilePath = Drive_C + QString("data") + QDir::separator() + QString("resource") + QDir::separator() + QString( "fmtestdata" ) + QDir::separator();
+    // get all the drives
+    QFileInfoList fileInfoList = QDir::drives();
+    foreach(const QFileInfo &fileInfo,fileInfoList) {
+        QString str = fileInfo.filePath();
+        if (str.length() > 2) {
+            str = str.left(3);
+        }
+        // append the drives to mDrives1 which drive type is USB or Memory card.
+        FmDriverInfo driverInfo = FmUtils::queryDriverInfo( str );
+        FmDriverInfo::DriveType driveType = driverInfo.driveType();
+        if( driveType == FmDriverInfo::EDriveTypeMemoryCard || 
+            driveType == FmDriverInfo::EDriveTypeUsbMemory){ 
+            mDrives1.append(str);
+            mDrives.append(str);
+        }else{
+            mDrives2.append(str);
+            mDrives.append(str);
+        }
+    }
+    qDebug() << mDrives;
+    qDebug() << mDrives1;
+    qDebug() << mDrives2;
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString getDriveNameFromPath( const QString &path ); \n &nbsp;&nbsp;
+        static QString fillPathWithSplash( const QString &filePath ); \n
+     2. Case Descrition: verify that it return the right drive name. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> strpath = QString() \n &nbsp;&nbsp;
+        <2> strpath = QString(XX) [XX.length() < 3] \n &nbsp;&nbsp;
+        <3> strpath = QString(XX) [XX.length() >= 3] \n &nbsp;&nbsp;
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retPath = QString() \n &nbsp;&nbsp;
+        <2> retPath = QString() \n &nbsp;&nbsp;
+        <3> retPath = checkpath.left(3) \n 
+ */
+void TestFmInternalFmUtils::testGetDriveNameFromPath()
+{
+    QString strPath1 = "C";
+    QString strPath2 = "D:\\dir\\subdir";
+    QString strPath3 = "T:/dir/subdir";
+    QString strPath4 = "pathwithoutLetter";
+    QString strPath5 = "C:";
+    QString strPath6 = "C:\\";
+    // path = QString().
+    QString retDriveName1 = FmUtils::getDriveNameFromPath(QString());
+    QVERIFY(retDriveName1.isEmpty());
+    // path1.length() < 3
+    QString retDriveName2 = FmUtils::getDriveNameFromPath(strPath1);
+    QVERIFY(retDriveName2.isEmpty());
+    // path1.length() >= 3
+    QString retDriveName3 = FmUtils::getDriveNameFromPath(strPath2);
+    QVERIFY(retDriveName3 == QString("D:") + QDir::separator());
+    
+    QString retDriveName4 = FmUtils::getDriveNameFromPath(strPath3);
+    QVERIFY(retDriveName4 == QString("T:") + QDir::separator());
+    
+    QString retDriveName5 = FmUtils::getDriveNameFromPath(strPath5);
+    QVERIFY(retDriveName5 == QString("C:") + QDir::separator());
+    
+    QString retDriveName6 = FmUtils::getDriveNameFromPath(strPath6);
+    QVERIFY(retDriveName6 == QString("C:") + QDir::separator());
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString getDriveLetterFromPath( const QString &path ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify that it return the right first drive letter. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> strpath = QString(XX) [XX.length() < 2] \n &nbsp;&nbsp;
+        <2> strpath = QString(XX) [XX.length() >= 2] \n 
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retPath = QString() \n &nbsp;&nbsp;
+        <2> retPath = strPath.left(1) \n &nbsp;&nbsp;
+ */
+void TestFmInternalFmUtils::testGetDriveLetterFromPath()
+{
+    QString strPath1 = "C";
+    QString strPath2 = "X:\\dir\\subdir";
+    // path = QString().
+    QString retDriveName1 = FmUtils::getDriveLetterFromPath(QString());
+    QVERIFY(retDriveName1.isEmpty());
+    // path1.length() < 2
+    QString retDriveName2 = FmUtils::getDriveLetterFromPath(strPath1);
+    QVERIFY(retDriveName2.isEmpty());
+    // path1.length() >= 2
+    QString retDriveName3 = FmUtils::getDriveLetterFromPath(strPath2);
+    QVERIFY(retDriveName3 == QString("X"));
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString formatStorageSize( quint64 size ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify that it return the correct storage size. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> size = Q_UINT64_C( 555 ) \n &nbsp;&nbsp;
+        <2> size = Q_UINT64_C( 1024 ) \n &nbsp;&nbsp;
+        <3> size = Q_UINT64_C( 1200000 ) \n &nbsp;&nbsp;
+        <4> size = Q_UINT64_C( 1000*1000*1000 + 1024 ) \n &nbsp;&nbsp;
+        <5> size = Q_UINT64_C( -5 ) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retSize = QString( "555 B" ) \n &nbsp;&nbsp;
+        <2> retSize = QString( "1.00 KB" ) \n &nbsp;&nbsp;
+        <3> retSize = QString( "1.1 MB" ) \n &nbsp;&nbsp;
+        <4> retSize = QString( "0.9 GB" ) \n &nbsp;&nbsp;
+        <5> no crash. \n
+ */
+void TestFmInternalFmUtils::testFormatStorageSize()
+{
+    quint64 size1 = Q_UINT64_C(555);
+//    quint64 sizetemp = Q_UINT64_C(1000);
+    quint64 size2 = Q_UINT64_C( 1024 );
+    quint64 size3 = Q_UINT64_C( 1200000 );
+    quint64 size4 = Q_UINT64_C( 1000*1000*1000 + 1024 );
+#ifdef BUG_TO_BE_FIX
+    quint64 sizeInvalid = Q_UINT64_C( -5 );
+#endif
+//    X < 1000
+    QString retSize1 = FmUtils::formatStorageSize(size1);
+    QVERIFY( retSize1 == QString::number(size1) + QString(" B") );
+//    1000 < X < 1000*1000 
+    QString retSize2 = FmUtils::formatStorageSize(size2);
+    QVERIFY( retSize2 == QString::number( size2 / 1024.0, 'f', 2 ) + " KB" );
+//   1000*1000 < X < 1000*1000*1000 
+     QString retSize3 = FmUtils::formatStorageSize(size3);
+    QVERIFY( retSize3 == QString::number( size3 / (1024.0 * 1024.0), 'f', 1 ) + " MB" );
+//    X > 1000*1000*1000
+     QString retSize4 = FmUtils::formatStorageSize(size4);
+    QVERIFY( retSize4 == QString::number( size4 / ( 1024.0 * 1024.0 * 1024.0 ), 'f', 1 ) + " GB" );     
+
+#ifdef BUG_TO_BE_FIX
+     QString retSize5 = FmUtils::formatStorageSize(sizeInvalid);
+     qDebug()<<retSize5;
+#endif
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool     isDrive( const QString &path ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify it is a drive with correct path. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driverName = "C:\" \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retResult = true \n
+ */
+void TestFmInternalFmUtils::testIsDriveYes()
+{
+    bool retResult = FmUtils::isDrive("C:/");
+    QVERIFY( retResult == true );
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool     isDrive( const QString &path ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify it is not a drive with wrong path. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driverName = "C" \n &nbsp;&nbsp;
+        <2> driverName = "D:\path" \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retResult = false \n &nbsp;&nbsp;
+        <2> retResult = false \n
+ */
+void TestFmInternalFmUtils::testIsDriveNo()
+{
+    bool retResult1 = FmUtils::isDrive("C");
+    QVERIFY( retResult1 == false );
+    
+    bool retResult2 = FmUtils::isDrive("D:\\path");
+    QVERIFY( retResult2 == false );
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  formatPath( const QString &path  ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify it doesn't crash with empty path. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString() \n 
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retPath = QString() \n 
+ */
+void TestFmInternalFmUtils::testFormatPathWithEmptyPath()
+{
+    QString retPath = FmUtils::formatPath(QString());
+    QVERIFY( retPath.isEmpty() );
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  formatPath( const QString &path  ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify it doesn't crash with empty path. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString("C:\\path1\\subpath") \n &nbsp;&nbsp;
+        <2> path = QString("C:/path2/subpath") \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retPath = QString("C:")+QDir::QDir::separator()+QString("path1")+QDir::separator()+QString("subpath") \n &nbsp;&nbsp;
+        <2> retPath = QString("C:")+QDir::QDir::separator()+QString("path2")+QDir::separator()+QString("subpath") \n
+ */
+void TestFmInternalFmUtils::testFormatPath()
+{
+    QString retPath1 = FmUtils::formatPath("C:\\path1\\subpath");
+    QVERIFY( retPath1 == QString("C:") + QDir::separator() +QString("path1") +QDir::separator() + QString("subpath") );
+    
+    QString retPath2 = FmUtils::formatPath("C:/path2/subpath");
+    QVERIFY( retPath2 == QString("C:")+ QDir::separator()+QString("path2")+ QDir::separator()+QString("subpath") );
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  fillPathWithSplash( const QString &filePath ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify it doesn't crash with empty path. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString() \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retPath = QString() \n 
+ */
+void TestFmInternalFmUtils::testFillPathWithSplashUseEmptyPath()
+{
+    QString retPath = FmUtils::fillPathWithSplash(QString());
+    QVERIFY( retPath.isEmpty() );
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  fillPathWithSplash( const QString &filePath ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify it doesn't add splash again when the path has the splash in the end. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retPath = path \n 
+ */
+void TestFmInternalFmUtils::testFillPathWithSplashHasSplash()
+{
+    QString path1 = "C:\\hasSplash\\";
+    QString path2 = "D:/hasSplash/";
+    QString retPath1 = FmUtils::fillPathWithSplash(path1);
+    QVERIFY(retPath1 == QString("C:") + QDir::separator() + QString("hasSplash") + QDir::separator());
+    
+    QString retPath2 = FmUtils::fillPathWithSplash(path2);
+    QVERIFY(retPath2 == QString("D:") + QDir::separator() + QString("hasSplash") + QDir::separator());
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  fillPathWithSplash( const QString &filePath ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify the splash is added at the end of the path. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retPath = QString(XX) + QDir::separator() \n 
+ */
+void TestFmInternalFmUtils::testFillPathWithSplashWithoutSplash()
+{
+    QString path1 = "C:\\noSplash";
+    QString path2 = "D:/noSplash";
+    QString retPath1 = FmUtils::fillPathWithSplash(path1);
+    QVERIFY(retPath1 == QString("C:") + QDir::separator() + QString("noSplash") + QDir::separator());
+    
+    QString retPath2 = FmUtils::fillPathWithSplash(path2);
+    QVERIFY(retPath2 == QString("D:") + QDir::separator() + QString("noSplash") + QDir::separator());
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  removePathSplash( const QString &filePath ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify it doesn't crash with empty path. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString() \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retPath = QString() \n 
+ */
+void TestFmInternalFmUtils::testRemovePathSplashUseEmptyPath()
+{
+    QString retPath = FmUtils::removePathSplash(QString());
+    QVERIFY( retPath.isEmpty());
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  removePathSplash( const QString &filePath ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify the splash at the end is removed. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retPath = QString(XX) \n 
+ */
+void TestFmInternalFmUtils::testRemovePathSplashHasSplash()
+{
+    QString path1 = "C:\\hasSplash\\";
+    QString path2 = "D:/hasSplash/";
+    QString path3 = "/";
+    QString path4 = "\\";
+    
+    QString retPath1 = FmUtils::removePathSplash(path1);
+    QVERIFY(retPath1 == QString("C:") + QDir::separator() + QString("hasSplash"));
+    
+    QString retPath2 = FmUtils::removePathSplash(path2);
+    QVERIFY(retPath2 == "D:/hasSplash");
+    
+    QString retPath3 = FmUtils::removePathSplash( path3 );
+    QVERIFY(retPath3.isEmpty());
+    
+    QString retPath4 = FmUtils::removePathSplash( path4 );
+    QVERIFY(retPath4.isEmpty());
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  removePathSplash( const QString &filePath ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify it doesn't crash with empty path. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString() \n
+     4. Expected result: \n 
+        <1> retPath = QString() \n 
+ */
+void TestFmInternalFmUtils::testRemovePathSplashWithoutSplash()
+{
+    QString path1 = "C:\\withoutSplash";
+    QString path2 = "D:/withoutSplash";
+    QString retPath1 = FmUtils::removePathSplash(path1);
+    QVERIFY(retPath1 == QString("C:") + QDir::separator() + QString("withoutSplash"));
+    
+    QString retPath2 = FmUtils::removePathSplash(path2);
+    QVERIFY(retPath2 == "D:/withoutSplash");
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static void getDriveList( QStringList &driveList, bool isHideUnAvailableDrive ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify the correct drives are returned.  \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveList = QStringList, isHideUnAvailableDrive = false \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> driveList == driveListForVerify\n 
+ */
+void TestFmInternalFmUtils::testGetDriveListAll()
+{
+    QStringList driveList;
+    QStringList driveListForVerify;
+    
+    FmUtils::getDriveList(driveList, false);
+    qDebug()<<driveList;
+    
+    QFileInfoList fileInfoList = QDir::drives();
+    foreach(const QFileInfo &fileInfo,fileInfoList) {
+        QString str = fileInfo.filePath();
+        if (str.length() > 2) {
+            str = str.left(3);
+        }
+        // append the drives to driveListForVerify except the drive type are EDriveRam and EDriveRom.
+        FmDriverInfo driverInfo = FmUtils::queryDriverInfo( str );
+        FmDriverInfo::DriveType driveType = driverInfo.driveType();
+        // fliter the drives which drive type are EDriveRam and EDriveRom.
+        bool driveFilter = ( driverInfo.driveState()& FmDriverInfo::EDriveRam ) ||( driverInfo.driveState()& FmDriverInfo::EDriveRom );
+        if( !driveFilter ){ 
+        driveListForVerify.append(str);
+        }
+    }
+    qDebug()<<driveListForVerify;
+    // verify all the drives in driveListForVerify are get in driveList too.
+    foreach(QString driveName, driveListForVerify){
+        QVERIFY(driveList.contains(driveName, Qt::CaseSensitive));
+    }
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static void getDriveList( QStringList &driveList, bool isHideUnAvailableDrive ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify the correct drives are returned. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveList = QStringList, isHideUnAvailableDrive = true \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> driveList == driveListForVerify \n 
+ */
+void TestFmInternalFmUtils::testGetDriveListPart()
+{
+    QStringList driveList;
+    QStringList driveListForVerify;
+    
+    FmUtils::getDriveList(driveList, true);
+    qDebug() << driveList;
+    
+    QFileInfoList fileInfoList = QDir::drives();
+    foreach(const QFileInfo &fileInfo,fileInfoList) {
+        QString str = fileInfo.filePath();
+        if (str.length() > 2) {
+            str = str.left(3);
+        }
+        FmDriverInfo driverInfo = FmUtils::queryDriverInfo( str );
+        FmDriverInfo::DriveType driveType = driverInfo.driveType();
+        // fliter the drives which drive type are EDriveRam and EDriveRom.
+        bool driveFilter = ( driverInfo.driveState()& FmDriverInfo::EDriveRam ) ||( driverInfo.driveState()& FmDriverInfo::EDriveRom );
+        // filter the unavailable drive
+        if( !driveFilter && FmUtils::isDriveAvailable( str ) ){         
+        driveListForVerify.append(str);
+        }
+    }
+    qDebug()<<driveListForVerify;    
+
+    // verify all the drives in driveListForVerify are get in driveList too.
+    foreach(QString driveName, driveListForVerify){
+        QVERIFY(driveList.contains(driveName, Qt::CaseSensitive));
+    }
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  fillDriveVolume( QString driveName, bool isFillWithDefaultVolume ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify it doesn't crash with empty path. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = QString(), isFillWithDefaultVolume = false \n &nbsp;&nbsp;
+        <2> driveName = QString(), isFillWithDefaultVolume = true \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retDriveVolume2 == QString() \n
+ */
+void TestFmInternalFmUtils::testFillDriveVolumeEmptyName()
+{
+    QString retDriveVolume1 = FmUtils::fillDriveVolume( QString(), false );
+    QVERIFY(retDriveVolume1.isEmpty());
+
+    QString retDriveVolume2 = FmUtils::fillDriveVolume( QString(), false );
+    QVERIFY(retDriveVolume2.isEmpty());
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  fillDriveVolume( QString driveName, bool isFillWithDefaultVolume ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify the default volume is set when the isFillWithDefaultVolume is true. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = QString(XX), isFillWithDefaultVolume = true \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> return the right drive volume(e.g.: C:memory) \n 
+ */
+void TestFmInternalFmUtils::testFillDriveVolumeDefaultVolume()
+{
+    foreach(QString strDriveName, mDrives ){
+        QString retDriveVolume = FmUtils::fillDriveVolume(strDriveName, true );
+            
+            QString tempDriveName = FmUtils::fillPathWithSplash( strDriveName );
+            FmDriverInfo driverInfo = FmUtils::queryDriverInfo( tempDriveName );
+            QString checkedDriveName( FmUtils::removePathSplash( strDriveName ) );
+            QString volumeName = driverInfo.volumeName();
+            if(volumeName.isEmpty()){
+            switch ( driverInfo.driveType() )
+                        {
+                        case FmDriverInfo::EDriveTypeMassStorage:
+                            QVERIFY(retDriveVolume == hbTrId("txt_fmgr_dblist_1_mass_storage").arg(checkedDriveName));
+                            break;
+                        case FmDriverInfo::EDriveTypeUsbMemory:
+                            QVERIFY(retDriveVolume == hbTrId("txt_fmgr_dblist_1_usb_memory").arg(checkedDriveName));
+                            break;
+                        case FmDriverInfo::EDriveTypeMemoryCard:
+                            QVERIFY(retDriveVolume == hbTrId("txt_fmgr_dblist_1_memory_card").arg(checkedDriveName));
+                            break;
+                        case FmDriverInfo::EDriveTypePhoneMemory:
+                            QVERIFY(retDriveVolume == hbTrId("txt_fmgr_dblist_1_device_memory").arg(checkedDriveName));
+                            break;
+                        default:
+                            break;
+                        }
+            }
+    }        
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  fillDriveVolume( QString driveName, bool isFillWithDefaultVolume ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify it doesn't crash with empty path. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveList = QStringList, isHideUnAvailableDrive = false \n
+     4. Expected result: \n 
+        <1>  \n 
+ */
+void TestFmInternalFmUtils::testFillDriveVolume()
+{
+    foreach(QString strDriveName, mDrives ){
+        QString retDriveVolume = FmUtils::fillDriveVolume(strDriveName, false );
+        
+        FmDriverInfo driverInfo = FmUtils::queryDriverInfo( strDriveName );
+        QString checkedDriveName( FmUtils::removePathSplash( strDriveName ) );
+        QString volumeName = driverInfo.volumeName();
+        QString volumeNameForVerify = hbTrId( "%1 %2" ).arg( checkedDriveName ).arg( volumeName );
+        QVERIFY(retDriveVolume == volumeNameForVerify);
+    }
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  getDefaultVolumeName( const QString &driveName ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify the correct default volume is returned \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> return the right drive volume(e.g.: "Device memory" when crive name is "C:") \n 
+ */
+void TestFmInternalFmUtils::testGetDefaultVolumeName()
+{  
+    foreach(QString strDriveName, mDrives ){
+        // get the volume using getDefaultVolumeName function.
+        QString retDriveVolume = FmUtils::getDefaultVolumeName(strDriveName);
+            
+            FmDriverInfo driverInfo = FmUtils::queryDriverInfo( strDriveName );
+            switch ( driverInfo.driveType() )
+                        {
+                        case FmDriverInfo::EDriveTypeMassStorage:
+                            QVERIFY(retDriveVolume == hbTrId("Mass storage")); 
+                            break;
+                        case FmDriverInfo::EDriveTypeUsbMemory:
+                            QVERIFY(retDriveVolume == hbTrId("USB memory")); 
+                            break;
+                        case FmDriverInfo::EDriveTypeMemoryCard:
+                            QVERIFY(retDriveVolume == hbTrId("Memory card"));
+                            break;
+                        case FmDriverInfo::EDriveTypePhoneMemory:
+                            QVERIFY(retDriveVolume == hbTrId("Device memory"));
+                            break;
+                        case FmDriverInfo::EDriveTypeNotExist:
+                        default:
+                            break;
+                        }
+            }
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  getVolumeNameWithDefaultNameIfNull( const QString &diskName, bool &defaultName ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify the right volume name is returned. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> return the right drive volume(e.g.: "Device memory" when drive name is "C:" & is empty) \n 
+ */
+void TestFmInternalFmUtils::testGetVolumeNameWithDefaultNameIfNull()
+{  
+    foreach(QString strDriveName, mDrives ){
+        // get the volume using getVolumeNameWithDefaultNameIfNull() function.
+        bool isDefaultName = false;
+        QString retDriveVolume = FmUtils::getVolumeNameWithDefaultNameIfNull(strDriveName, isDefaultName);
+        
+            FmDriverInfo driverInfo = FmUtils::queryDriverInfo( strDriveName );
+            QString volumeName = driverInfo.volumeName(); 
+            if ( volumeName.isEmpty() ){
+                switch ( driverInfo.driveType() )
+                        {
+                        case FmDriverInfo::EDriveTypeMassStorage:
+                            QVERIFY(retDriveVolume == hbTrId("Mass storage")); 
+                            break;
+                        case FmDriverInfo::EDriveTypeUsbMemory:
+                            QVERIFY(retDriveVolume == hbTrId("USB memory")); 
+                            break;
+                        case FmDriverInfo::EDriveTypeMemoryCard:
+                            QVERIFY(retDriveVolume == hbTrId("Memory card"));
+                            break;
+                        case FmDriverInfo::EDriveTypePhoneMemory:
+                            QVERIFY(retDriveVolume == hbTrId("Device memory"));
+                            break;
+                        case FmDriverInfo::EDriveTypeNotExist:
+                        default:
+                            break;
+                        }
+            }
+            }
+}
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool isPathEqual( const QString &pathFst, const QString &pathLast ); \n &nbsp;&nbsp;
+     2. Case Descrition: Verify the two path are the same. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> pathFst = QString(X), pathLast = QString(X)\n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isEqual = true \n 
+ */
+void TestFmInternalFmUtils::testisPathEqualWithSamePath()
+{
+    QString path1 = "C:\\the path is same";
+    QString path2 = "C:\\the path is same";
+    QString path3 = "C:\\ frontbland\\isSame";
+    QString path4 = "C:\\ frontbland\\isSame";
+    QString path5 = "C:\\endwithbland \\isSame";
+    QString path6 = "C:\\endwithbland \\isSame";
+    bool isEqual1 = FmUtils::isPathEqual(QString(), QString());
+    QVERIFY(isEqual1 == true);
+    
+    bool isEqual2 = FmUtils::isPathEqual(path1, path2);
+    QVERIFY(isEqual2 == true);
+    
+    bool isEqual3 = FmUtils::isPathEqual(path3, path4);
+    QVERIFY(isEqual3 == true);
+    
+    bool isEqual4 = FmUtils::isPathEqual(path5, path6);
+    QVERIFY(isEqual4 == true);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool isPathEqual( const QString &pathFst, const QString &pathLast ); \n &nbsp;&nbsp;
+     2. Case Descrition: Verify the two path are different. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> pathFst = QString(X), pathLast = QString(Y)\n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isEqual = false \n 
+ */
+void TestFmInternalFmUtils::testisPathEqualWithDiffPath()
+{
+    QString path1 = "C:\\the path is different";
+    QString path2 = "C:\\the path is not same\\subdir\\";
+    bool isEqual = FmUtils::isPathEqual(path1, path2);
+    QVERIFY(isEqual == false);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool checkFolderFileName( const QString& name ); \n &nbsp;&nbsp;
+     2. Case Descrition: Verify folder or file name is OK. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> pathFst = QString(XX)\n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isValid= true \n 
+ */
+void TestFmInternalFmUtils::testcheckFolderFileNameNormal()
+{
+    QString name = "This is a valid name";
+    bool isValid = FmUtils::checkFolderFileName(name);
+    QVERIFY(isValid == true);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool checkFolderFileName( const QString& name ); \n &nbsp;&nbsp;
+     2. Case Descrition: Verify the folder or file name is invalid. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> pathFst = QString(XX)\n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isValid= false \n 
+ */
+void TestFmInternalFmUtils::testcheckFolderFileNameUnNormal()
+{
+    QList<QChar> list;
+    list << '\\' << '/' << ':' << '*' << '?' << '\"' << '<' << '>' <<'|';
+    foreach(QChar ilegelChar, list){
+        QString name = QString("This is an invalid name") + ilegelChar;
+        bool isValid = FmUtils::checkFolderFileName(name);
+        QVERIFY(isValid == false);
+    }
+    // end with "."
+    QString nameEndWithDot = "End with dot.";
+    bool isValid1 = FmUtils::checkFolderFileName(nameEndWithDot);
+    QVERIFY(isValid1 == false);
+    // more than max size
+    QString nameMax;
+    nameMax.fill('x', 300);
+    bool isValid2 = FmUtils::checkFolderFileName(nameMax);
+    QVERIFY(isValid2 == false);
+    // name is empty
+    bool isValid3 = FmUtils::checkFolderFileName(QString());
+    QVERIFY(isValid3 == false);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool     checkNewFolderOrFile( const QString& fileName, const QString &path, QString &errString ); \n &nbsp;&nbsp;
+     2. Case Descrition: Verify it is a new folder or file.\n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> fileName = QString(XX), path = QString(XX), errString = QString(XX)\n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isNew = true \n 
+ */
+void TestFmInternalFmUtils::testCheckNewFolderOrFileUnNormal()
+{
+    QString fileName = "newFolder";
+    QString path = mFilePath + "newFolder";
+    QString errStr;
+    bool isNew = FmUtils::checkNewFolderOrFile(fileName, path, errStr);
+    QVERIFY(isNew == true);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool     checkNewFolderOrFile( const QString& fileName, const QString &path, QString &errString ); \n &nbsp;&nbsp;
+     2. Case Descrition: Verify the function when the folder/file name with ilegel characters.\n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> fileName = QString(XX), path = QString(XX), errString = QString(XX)\n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isNew = false \n 
+ */
+void TestFmInternalFmUtils::testCheckNewFolderOrFileIlegel()
+{
+    QString validName = "Image.jpg";
+    QString ilegelFileName = "isInvalidName?";
+    QString validPath = mFilePath + "newFolder";
+    QString inValidPath;
+    inValidPath.fill('x', 300);
+    QString errStr;
+    
+    // file name is invalid
+    bool isNew1 = FmUtils::checkNewFolderOrFile(ilegelFileName, validPath, errStr);
+    QVERIFY(isNew1 == false);
+    QVERIFY(errStr == hbTrId( "Invalid file or folder name!" ));
+    // path is too long
+    bool isNew2 = FmUtils::checkNewFolderOrFile(validName, inValidPath, errStr);
+    QVERIFY(isNew2 == false);
+    QVERIFY(errStr == hbTrId( "the path you specified is too long!" ));
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool     checkNewFolderOrFile( const QString& fileName, const QString &path, QString &errString ); \n &nbsp;&nbsp;
+     2. Case Descrition: Verify it is not a new folder or file.\n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> fileName = QString(XX), path = QString(XX), errString = QString(XX)\n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isNew = false \n 
+ */
+void TestFmInternalFmUtils::testCheckNewFolderOrFileNo()
+{
+    QString validName = "Image.jpg";
+    QString exsitPath = mFilePath;
+    QString errStr;
+    // the file\folder has been exsit
+    bool isNew3 = FmUtils::checkNewFolderOrFile(validName, exsitPath, errStr);
+    QVERIFY(isNew3 == false);
+    QFileInfo fileInfo( exsitPath );
+    QVERIFY(errStr == hbTrId( "%1 already exist!" ).arg( fileInfo.fileName()));
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool     isSubLevelPath( const QString &src, const QString &dest ); \n &nbsp;&nbsp;
+     2. Case Descrition: Verify the path is a sub level path.\n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> src = QString(XX), dest = QString(XX)\n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isSubLevelPath = true \n 
+ */
+void TestFmInternalFmUtils::testIsSubLevelPathYes()
+{
+    QString src = "C:\\dir";
+    QString dest = "C:\\dir\\subdir";
+    bool isSubLevelPath = FmUtils::isSubLevelPath(src, dest);
+    QVERIFY(isSubLevelPath == true);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool     isSubLevelPath( const QString &src, const QString &dest ); \n &nbsp;&nbsp;
+     2. Case Descrition: Verify the path is a sub level path.\n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> src = QString(XX), dest = QString(XX)\n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isSubLevelPath = false \n 
+ */
+void TestFmInternalFmUtils::testIsSubLevelPathNo()
+{
+    QString src1 = "C:\\dir1";
+    QString dest1 = "C:\\dir2\\subdir";
+    QString src2 = "C:\\dir1\\subdir";
+    QString dest2 = "C:\\dir1";
+    // dest does not contain src.
+    bool isSubLevelPath1 = FmUtils::isSubLevelPath(src1, dest1);
+    QVERIFY(isSubLevelPath1 == false);
+    // dest.length < src.length
+    bool isSubLevelPath2 = FmUtils::isSubLevelPath(src2, dest2);
+    QVERIFY(isSubLevelPath2 == false);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static int removeDrivePwd( const QString &driverName, const QString &Pwd ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify this function can remove the password successfully. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driverName = QString(), password = QString(XX) \n &nbsp;&nbsp;
+     4. Expected result: \n 
+        <1> retErr = FmErrNone, \n 
+ */
+void TestFmInternalFmUtils::testRemoveDrivePwdNormal()
+{
+    if( ! mDrives1.empty() ){
+    //  set the password.
+    FmUtils::setDrivePwd( mDrives1[0], QString(), QString("123456") );
+    FmDriverInfo driverInfo = FmUtils::queryDriverInfo( mDrives1[0] );
+    int a = driverInfo.driveState()& FmDriverInfo::EDrivePasswordProtected;
+    QVERIFY( a == FmDriverInfo::EDrivePasswordProtected );
+    //remove the password and verify the drive state.
+    int retRemovePwdErr = FmUtils::removeDrivePwd( mDrives1[0], QString("123456") );
+    driverInfo = FmUtils::queryDriverInfo( mDrives1[0] );
+//    int b = driverInfo.driveState()& FmDriverInfo::EDrivePasswordProtected;
+    QVERIFY( !(driverInfo.driveState()& FmDriverInfo::EDrivePasswordProtected) );
+     
+    QVERIFY( retRemovePwdErr == FmErrNone );
+   }
+    else
+        QWARN("No memory crad or USB device are available.");
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static int removeDrivePwd( const QString &driverName, const QString &Pwd ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify this function can remove the password successfully. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driverName = QString(), password = QString(XX) \n &nbsp;&nbsp;
+        <2> driverName = QString(XX), password = QString(XX) \n &nbsp;&nbsp;
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retErr = FmErrWrongParam, \n &nbsp;&nbsp;
+        <2> no crash. \n
+ */
+void TestFmInternalFmUtils::testRemoveDrivePwdUnNormal()
+{
+    int retErr1 = FmUtils::removeDrivePwd( QString(), QString() );
+    QVERIFY( retErr1 == FmErrWrongParam );   
+    
+    int retErr2 = FmUtils::removeDrivePwd( QString("C:/"), QString("5t0Lfezb") );
+    QVERIFY( retErr2 == FmErrUnKnown );
+
+    int retErr3 = FmUtils::removeDrivePwd( QString("U:/"), QString("5t0Lfezb") );
+    QVERIFY( retErr3 == FmErrUnKnown );
+}
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static int setDrivePwd( const QString &driverName, const QString &oldPwd, const QString &newPwd); \n &nbsp;&nbsp;
+     2. Case Descrition: verify this function can set the password correctly. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driverName = QString(XX), oldPwd = QString(), newPwd = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retErr = FmErrNone
+ */
+void TestFmInternalFmUtils::testSetDrivePwdNormal()
+{
+    if( ! mDrives1.empty() ){
+    //set the password
+    int retErr = FmUtils::setDrivePwd( mDrives1[0], QString(), QString("123456") );
+    // get the drive state and verify it.
+    FmDriverInfo driverInfo = FmUtils::queryDriverInfo( mDrives1[0] );
+    int a = driverInfo.driveState()& FmDriverInfo::EDrivePasswordProtected;
+    QVERIFY( a == FmDriverInfo::EDrivePasswordProtected );  
+    QVERIFY( retErr == FmErrNone );  
+    
+    FmUtils::removeDrivePwd( mDrives1[0], QString("123456") );
+    }
+    else
+        QWARN("No memory crad or USB device are available.");
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static int setDrivePwd( const QString &driverName, const QString &oldPwd, const QString &newPwd); \n &nbsp;&nbsp;
+     2. Case Descrition: verify this function can set the password correctly. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driverName = QString(), oldPwd = QString(), newPwd = QString(X) \n &nbsp;&nbsp;
+        <2> driverName = QString(X), oldPwd = QString(), newPwd = QString(X.length()>8) \n &nbsp;&nbsp;
+        <3> driverName = QString(C:), oldPwd = QString(), newPwd = QString(X) \n 
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retErr = FmErrWrongParam \n &nbsp;&nbsp;
+        <2> retErr = FmErrWrongParam \n &nbsp;&nbsp;
+        <3> retErr = FmErrNotSupported \n 
+ */
+void TestFmInternalFmUtils::testSetDrivePwdUnNormal()
+{
+    // The drive name is empty
+    int retSetPwdErr1 = FmUtils::setDrivePwd( QString(""), QString(""), QString("123456") );
+    QVERIFY( retSetPwdErr1 == FmErrWrongParam );
+    
+    if( !mDrives1.empty() ){
+    int retSetPwdEr2 = FmUtils::setDrivePwd( mDrives1[0], QString(""), QString("1234567890123456") );
+    FmDriverInfo driverInfo = FmUtils::queryDriverInfo( mDrives1[0] );
+    QVERIFY( !(driverInfo.driveState()& FmDriverInfo::EDrivePasswordProtected) );
+    QVERIFY( retSetPwdEr2 == FmErrWrongParam );
+    }else
+         QWARN("No memory crad or USB device are available.");
+    
+    int retSetPwdErr3 = FmUtils::setDrivePwd( mDrives2[0], QString(""), QString("123456") );
+    QVERIFY( retSetPwdErr3 == FmErrNotSupported );
+    
+    // return 
+    int retSetPwdErr4 = FmUtils::setDrivePwd( QString("9527"), QString("oldpwd"), QString("123456") );
+    QVERIFY( retSetPwdErr4 == FmErrUnKnown );  
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static int checkDrivePwd( const QString &driverName, const QString &pwd); \n &nbsp;&nbsp;
+     2. Case Descrition: verify this function can check whether the drive having password . \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driverName = QString(), password = QString(X.length()<8) \n &nbsp;&nbsp;
+        <2> driverName = QString(X), password = QString(X.length()>8) \n &nbsp;&nbsp;
+        <3> driverName = QString(X), password = QString(X.length()<8) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retErr = FmErrWrongParam \n &nbsp;&nbsp;
+        <2> retErr = FmErrWrongParam \n &nbsp;&nbsp;
+        <3> retErr = FmErrNone\n 
+ */
+void TestFmInternalFmUtils::testCheckDrivePwd()
+{
+    if( !mDrives1.empty() ){
+    //the drive name is empty
+    int retCheckStatus1 = FmUtils::checkDrivePwd( QString(), QString("password"));
+    FmDriverInfo driverInfo = FmUtils::queryDriverInfo( mDrives1[0] );
+
+    QVERIFY( !(driverInfo.driveState()& FmDriverInfo::EDrivePasswordProtected) );
+    QVERIFY( retCheckStatus1 == FmErrWrongParam );
+    
+    // the length of the password is more than 8
+    int retCheckStatus2 = FmUtils::checkDrivePwd( mDrives1[0], QString("oldpassword"));
+    driverInfo = FmUtils::queryDriverInfo( mDrives1[0] );
+
+    QVERIFY( !(driverInfo.driveState()& FmDriverInfo::EDrivePasswordProtected) );  
+    QVERIFY( retCheckStatus2 == FmErrWrongParam );
+    
+    int retCheckStatus3 = FmUtils::checkDrivePwd( mDrives1[0], QString("password"));
+    driverInfo = FmUtils::queryDriverInfo( mDrives1[0] );
+#ifdef BUG_TO_FIX
+    QVERIFY( !(driverInfo.driveState()& FmDriverInfo::EDrivePasswordProtected) );  //The drive state of FmDriverInfo::EDrivePasswordProtected should not be changed with a valid pwd parameter.
+    QVERIFY( retCheckStatus3 == FmErrNone );
+#endif
+    }
+    else
+        QWARN("No memory crad or USB device are available.");
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static void emptyPwd( QString &pwd ); \n &nbsp;&nbsp;
+     2. Case Descrition: verify this function can empty the password . \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> pwd = QString() \n &nbsp;&nbsp;
+        <2> pwd = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> no crash \n &nbsp;&nbsp;
+        <2> no crash. \n
+ */
+void TestFmInternalFmUtils::testEmptyPwd()
+{
+    QString strPassword= QString("password");
+    QString pwdEmpty = QString();
+    FmUtils::emptyPwd( pwdEmpty );
+    FmUtils::emptyPwd( strPassword );
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static int renameDrive( const QString &driverName, const QString &newVolumeName); \n
+     2. Case Descrition: verify that it does not crash with bad names. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = QString(), newVolumeName = QString(XX) \n &nbsp;&nbsp;
+        <2> driveName = "C:", newVolumeName = QString() \n &nbsp;&nbsp;
+        <3> driveName = "C:", newVolumeName = QString("!$@^#*#dsfljlke").  \n &nbsp;&nbsp;
+        <4> driveName = "C:", newVolumeName = QString("more than maximum words").  \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> return FmErrWrongParam \n &nbsp;&nbsp;
+        <2> return FmErrUnKnown \n &nbsp;&nbsp;
+        <3> return FmErrBadName \n &nbsp;&nbsp;
+        <4> return FmErrBadName \n
+ */
+void TestFmInternalFmUtils::testRenameDriveWithBadName()
+{
+    int retInfo1 = FmUtils::renameDrive( QString(),QString("new volume name") );
+    QVERIFY( retInfo1 == FmErrWrongParam );
+    
+    if( !mDrives1.empty() ){
+    int retInfo2 = FmUtils::renameDrive( mDrives1[0],QString("") );
+    QVERIFY( retInfo2 == FmErrNone );
+    
+    int retInfo3 = FmUtils::renameDrive( mDrives1[0],QString("!$@^#*e") );
+    QVERIFY( retInfo3 == FmErrBadName );
+    
+    int retInfo4 = FmUtils::renameDrive( mDrives1[0],QString("more than maximum words") );
+    QVERIFY( retInfo4 == FmErrUnKnown );
+    }else
+        QWARN("No memory crad or USB device are available.");
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static int renameDrive( const QString &driverName, const QString &newVolumeName); \n
+     2. Case Descrition: verify this function can empty the password . \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = QString(X), newVolumeName = QString(XX) \n &nbsp;&nbsp;
+        <2> driveName = "C:", newVolumeName = QString() \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> return FmErrWrongParam \n &nbsp;&nbsp;
+        <2> return FmErrBadName \n
+ */
+void TestFmInternalFmUtils::testRenameDriveWithNormalName()
+{
+    if( !mDrives1.empty() ){
+    int retInfo1 = FmUtils::renameDrive(mDrives1[0],QString("newname") );
+    bool defaultName = false;
+    QString retVolumeName = FmUtils::getVolumeNameWithDefaultNameIfNull( mDrives1[0], defaultName );
+    QVERIFY( retVolumeName == "newname" );
+    QVERIFY( retInfo1 == FmErrNone );
+    //set the name back
+    FmUtils::renameDrive(mDrives1[0],QString());
+    }else
+        QWARN("No memory crad or USB device are available.");
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool     checkDriveAccessFilter( const QString &driveName ); \n
+     2. Case Descrition: verify whether the drive can be accessable. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = QString() \n &nbsp;&nbsp;
+        <2> driveName = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isAccessable == false \n &nbsp;&nbsp;
+        <2> return true if it's accessful, or return false \n 
+ */
+void TestFmInternalFmUtils::testCheckDriveAccessFilter()
+{
+    foreach(QString strDriveName, mDrives ){
+        bool isAccessable1 = FmUtils::checkDriveAccessFilter(strDriveName);
+        
+        FmDriverInfo driveInfo = FmUtils::queryDriverInfo( strDriveName );
+        if ((driveInfo.driveState()& FmDriverInfo::EDriveRam ) ||
+            +( driveInfo.driveState()& FmDriverInfo::EDriveRom ) ) {
+            QVERIFY(isAccessable1 == false);
+        }else
+        QVERIFY(isAccessable1 == true);
+    }
+    // set drive name as QString
+    bool isAccessable2 = FmUtils::checkDriveAccessFilter(QString());
+    QVERIFY(isAccessable2 == false);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  checkDriveToFolderFilter( const QString &path ); \n
+     2. Case Descrition: Verify the correct path is returned. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString("C:") \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retPath == path + QDir::separator() + QString( "data" ) + QDir::separator() \n &nbsp;&nbsp;       
+ */
+void TestFmInternalFmUtils::testCheckDriveToFolderFilterC()
+{
+    QString path = Drive_C;
+    QString retPath = FmUtils::checkDriveToFolderFilter(path);
+    QVERIFY(retPath == path + QString( "data" ) + QDir::separator());
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  checkDriveToFolderFilter( const QString &path ); \n
+     2. Case Descrition: Verify the correct path is returned. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retPath == path \n &nbsp;&nbsp;       
+ */
+void TestFmInternalFmUtils::testCheckDriveToFolderFilterNormal()
+{
+    QString path = "D:";
+    QString retPath1 = FmUtils::checkDriveToFolderFilter(path);
+    QVERIFY(retPath1 == path);
+    
+    QString retPath2 = FmUtils::checkDriveToFolderFilter(QString());
+    QVERIFY(retPath2.isEmpty());
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  checkFolderToDriveFilter( const QString &path );\n
+     2. Case Descrition:  \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = "C:\\data" \n 
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retPath == "C:" \n
+ */
+void TestFmInternalFmUtils::testCheckFolderToDriveFilterC()
+{
+    QString path = "C:\\data";
+    QString retPath = FmUtils::checkFolderToDriveFilter(path);
+    QVERIFY(retPath == Drive_C);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  checkFolderToDriveFilter( const QString &path );\n
+     2. Case Descrition: Verify the correct path is returned. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString() \n &nbsp;&nbsp;
+        <2> path = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retPath == QString() \n &nbsp;&nbsp;
+        <2> retPath == path \n 
+ */
+void TestFmInternalFmUtils::testCheckFolderToDriveFilterNormal()
+{
+    QString path = "E:\\thisIsNotCDrive";
+    QString retPath1 = FmUtils::checkDriveToFolderFilter(path);
+    QVERIFY(retPath1 == path);
+    
+    QString retPath2 = FmUtils::checkDriveToFolderFilter(QString());
+    QVERIFY(retPath2.isEmpty());
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static int      isPathAccessabel( const QString &path );\n
+     2. Case Descrition: Verify the right info is returned when using empty path \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString() \n 
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retInfo == FmErrPathNotExist \n 
+ */
+void TestFmInternalFmUtils::testIsPathAccessableEmpty()
+{
+    int retInfo = FmUtils::isPathAccessabel(QString());
+    QVERIFY(retInfo == FmErrPathNotExist);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static int      isPathAccessabel( const QString &path );\n
+     2. Case Descrition: Verify the right info is returned when using valid path \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = Folder_C_Data\n 
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retInfo == FmErrNone \n 
+ */
+void TestFmInternalFmUtils::testIsPathAccessableOK()
+{
+    QString path = Folder_C_Data;
+    int retInfo = FmUtils::isPathAccessabel(path);
+    QVERIFY(retInfo == FmErrNone);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static int      isPathAccessabel( const QString &path );\n
+     2. Case Descrition: Verify the right info is returned when using unAccessable path \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = Drive_C +QString(XX) \n &nbsp;&nbsp;
+        <2> path = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> retInfo == FmErrDriveDenied \n
+        <2> retInfo == FmErrPathNotExist \n 
+ */
+void TestFmInternalFmUtils::testIsPathAccessableNo()
+{
+     QString path = "cannotaccesspath";
+    int retInfo = FmUtils::isPathAccessabel(path);
+    QVERIFY(retInfo == FmErrPathNotExist);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool     isDriveAvailable( const QString &path );\n
+     2. Case Descrition: Verify the drive is available of the path. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path = QString(XX) \n &nbsp;&nbsp;
+        <2> path = QString() \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1>  \n &nbsp;&nbsp;
+        <2> isAvailable == fasle \n
+ */
+void TestFmInternalFmUtils::testIsDriveAvailable()
+{
+    foreach(QString strDriveName, mDrives ){
+        bool isAvailable1 = FmUtils::isDriveAvailable(strDriveName + QString("availableOrNot"));
+        
+        FmDriverInfo::DriveState driveState = FmUtils::queryDriverInfo( strDriveName + QString("availableOrNot") ).driveState();
+        if( ( driveState & FmDriverInfo::EDriveAvailable ) ) {
+        QVERIFY(isAvailable1 == true);
+        }else
+            QVERIFY(isAvailable1 == false);
+    }
+    // set drive name as QString
+    bool isAccessable2 = FmUtils::isDriveAvailable(QString());
+    QVERIFY(isAccessable2 == false);
+    
+    QString pathNotAvailable = "A:\\notAvailabel";
+    bool isAccessable3 = FmUtils::isDriveAvailable(pathNotAvailable);
+    QVERIFY(isAccessable3 == false);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool     isDefaultFolder( const QString &folderPath  );\n
+     2. Case Descrition: Verify the folder is default folder. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> filePath = QString(XX) \n 
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isDefault == true \n  
+ */
+void TestFmInternalFmUtils::testIsDefaultFolder()
+{
+    QString filePath1 = "C:\\data\\Games";
+    QString filePath2 = "C:\\data\\Images";
+    QString filePath3 = "C:\\data\\Installs";
+    bool isDefault1 = FmUtils::isDefaultFolder(filePath1);
+    QVERIFY(isDefault1 == true);
+    bool isDefault2 = FmUtils::isDefaultFolder(filePath2);
+    QVERIFY(isDefault2 == true);
+    bool isDefault3 = FmUtils::isDefaultFolder(filePath3);
+    QVERIFY(isDefault3 == true);
+    
+    bool isDefaultPath1 = FmUtils::isDefaultFolder(QString());
+    QVERIFY(isDefaultPath1 == false);
+    bool isDefaultPath2 = FmUtils::isDefaultFolder(mFilePath);
+    QVERIFY(isDefaultPath2 == false);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static void     createDefaultFolders( const QString &driverName );\n
+     2. Case Descrition:  \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = QString() \n &nbsp;&nbsp;
+        <2> driveName = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isAccessable == false \n &nbsp;&nbsp;
+        <2> return true if it's accessful, or return false \n 
+ */
+void TestFmInternalFmUtils::testCreateDefaultFolders()
+{
+    FmUtils::createDefaultFolders( Folder_C_Data );
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static int      setFileAttributes( const QString &srcFile, const QString &desFile );\n
+     2. Case Descrition:  \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = QString() \n &nbsp;&nbsp;
+        <2> driveName = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isAccessable == false \n &nbsp;&nbsp;
+        <2> return true if it's accessful, or return false \n 
+ */
+void TestFmInternalFmUtils::testSetFileAttributes()
+{
+    QString srcFile = mFilePath +"Image.jpg";
+    QString desFile = mFilePath +"Tone.mp3";
+    int err = FmUtils::setFileAttributes( srcFile, desFile );
+    QVERIFY(err == 0);
+    //crash when run to these lines below.    
+//    User::LeaveIfError( src.Open( fsSession, *buf1, EFileRead | EFileShareReadersOnly ) );
+//    User::LeaveIfError( des.Open( fsSession, *buf2, EFileWrite | EFileShareExclusive ) );
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool     hasEnoughSpace( const QString &targetDrive, qint64 size );\n
+     2. Case Descrition: Verify the Specified drive has enough space. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = QString(XX), size = qint64 \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isHasSpace == true \n 
+ */
+void TestFmInternalFmUtils::testHasEnoughSpaceYes()
+{
+    qint64 size = 1024;
+    bool isHasSpace = FmUtils::hasEnoughSpace(mDrives[0], size);
+    QVERIFY(isHasSpace == true);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool     hasEnoughSpace( const QString &targetDrive, qint64 size );\n
+     2. Case Descrition: Verify the Specified drive does not has enough space when using large size. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = QString(XX), size = qint64 \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isHasSpace == false \n 
+ */
+void TestFmInternalFmUtils::testHasEnoughSpaceNo()
+{
+    qint64 size = 999999999999999;
+    bool isHasSpace = FmUtils::hasEnoughSpace(mDrives[0], size);
+    QVERIFY(isHasSpace == false);
+}
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static int      moveInsideDrive( const QString &source, const QString &target );\n
+     2. Case Descrition:  \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> source = QString(XX) \n &nbsp;&nbsp;
+        <2> target = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isAccessable == false \n 
+ */
+void TestFmInternalFmUtils::testMoveInsideDrive()
+{
+    QString source = mFilePath + "Imageformove.jpg";
+    QString target = Drive_C + QString("data") + QDir::separator() + QString("resource") + QDir::separator() + "Imagenew.jpg";
+    QString errStr1;
+    QString errStr2;
+    FmUtils::moveInsideDrive(source,target);
+    FmUtils::checkNewFolderOrFile("Imagenew.jpg", target, errStr1);
+    bool isNotExsit = FmUtils::checkNewFolderOrFile("Imageformove.jpg", source, errStr2);
+    qDebug()<<errStr1;
+    //verify the image.jpg is moved to the new path with the new name.
+    QVERIFY(errStr1 == "Imagenew.jpg already exist!");
+    qDebug()<<isNotExsit;
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static int      launchFile( const QString &filePath );\n
+     2. Case Descrition: Verify the file can be launched or not. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = QString() \n &nbsp;&nbsp;
+        <2> driveName = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isAccessable == false \n &nbsp;&nbsp;
+        <2> return true if it's accessful, or return false \n 
+ */
+void TestFmInternalFmUtils::testLaunchFile()
+{
+//    QString filePath = mFilePath + "Image.jpg";
+//    int retInfo = FmUtils::launchFile(filePath); // switch to other thread, test app will shut down.
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static void     sendFiles( QStringList &filePathList );\n
+     2. Case Descrition:  \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = QString() \n &nbsp;&nbsp;
+        <2> driveName = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isAccessable == false \n &nbsp;&nbsp;
+        <2> return true if it's accessful, or return false \n 
+ */
+void TestFmInternalFmUtils::testSendFiles()
+{
+    // will delete this case in future
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString  getBurConfigPath( QString appPath );\n
+     2. Case Descrition: verify the right path for backup restore config file. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = QString() \n 
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isAccessable == false \n 
+ */
+void TestFmInternalFmUtils::testGetBurConfigPath()
+{
+    QString retPath = FmUtils::getBurConfigPath(QString());
+    QVERIFY(retPath == "z:/private/2002BCC0/burconfig.xml");
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool     isDriveC( const QString &driverName );\n
+     2. Case Descrition: Verify the drive is C. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = Drive_C + QString("ItisCDrive") \n 
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isDriveC == true \n 
+ */
+void TestFmInternalFmUtils::testIsDriveCYes()
+{
+    QString pathToVerify = Drive_C +"ItisCDrive";
+    bool isDriveC = FmUtils::isDriveC(pathToVerify);
+    QVERIFY(isDriveC == true);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool     isDriveC( const QString &driverName );\n
+     2. Case Descrition: Verify the drive is C. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = Drive_C + QString("ItisCDrive") \n 
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isDriveC == true \n 
+ */
+void TestFmInternalFmUtils::testIsDriveCNo()
+{
+    QString pathToVerify ="A:\\ItisCDrive";
+    bool isDriveC1 = FmUtils::isDriveC(pathToVerify);
+    QVERIFY(isDriveC1 == false);
+    
+    bool isDriveC2 = FmUtils::isDriveC(QString());
+    QVERIFY(isDriveC2 == false);
+}
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static int      getMaxFileNameLength();\n
+     2. Case Descrition:  \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = QString() \n &nbsp;&nbsp;
+        <2> driveName = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isAccessable == false \n &nbsp;&nbsp;
+        <2> return true if it's accessful, or return false \n 
+ */
+void TestFmInternalFmUtils::testGetMaxFileNameLength()
+{
+    QVERIFY( FmUtils::getMaxFileNameLength() == KMaxFileName );
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static bool     checkMaxPathLength( const QString& path );\n
+     2. Case Descrition: Verify whether the path length is exceed max path length.  \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> driveName = QString() \n &nbsp;&nbsp;
+        <2> driveName = QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> isAccessable == false \n &nbsp;&nbsp;
+        <2> return true if it's accessful, or return false \n 
+ */
+void TestFmInternalFmUtils::testCheckMaxPathLength()
+{
+    QString nameMaxPath;
+    nameMaxPath.fill('x',320);
+    QString nameNormalPath = "D:\\ThisIsNormalName";
+    
+    bool isMax1 = FmUtils::checkMaxPathLength(nameMaxPath);
+    QVERIFY(isMax1 == false);
+    
+    bool isMax2 = FmUtils::checkMaxPathLength(nameNormalPath);
+    QVERIFY(isMax2 == true);
+}
+
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString getFileType( const QString &filePath  ); \n
+     2. Case Descrition: verify the right file type is returned. \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path =QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1> return the right file type(e.g.: the file is "*.jpg", then return "image/jpeg" \n 
+ */
+void TestFmInternalFmUtils::testGetFileTypeWithSupportType()
+{
+    QString path1 = mFilePath + QString("Image.jpg");
+    QString path2 = mFilePath + QString("Tone.mp3");
+    
+    QString retType = FmUtils::getFileType(path2);   
+    QVERIFY( FmUtils::getFileType(path1) == "image/jpeg");
+    QVERIFY( FmUtils::getFileType(path2) == "audio/mpeg");    
+}
+/*!
+     Test Case Description:\n 
+     1. Fucntion Name: \n &nbsp;&nbsp;
+        static QString getFileType( const QString &filePath  ); \n
+     2. Case Descrition: verify the funtion when using unsupported file type \n
+     3. Input Parameters:  \n &nbsp;&nbsp;
+        <1> path =QString(XX) \n
+     4. Expected result: \n &nbsp;&nbsp;
+        <1>  \n 
+ */
+void TestFmInternalFmUtils::testGetFileTypeWithUnSupportType()
+{
+    QString path1 = mFilePath + QString("unknow.unknow");
+    
+    QString retType = FmUtils::getFileType(path1);   
+//    QVERIFY( FmUtils::getFileType(path1) == ""); 
+}
+/*!
+    Descrition of what you will do in this function
+ */
+void TestFmInternalFmUtils::cleanupTestCase()
+{
+}
+
+QTEST_MAIN(TestFmInternalFmUtils)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/unit/ut_fminternalfmutils/src/ut_fminternalfmutils.h	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0""
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*       test application for File manager internal apis.
+*/
+
+#ifndef UT_FMINTERNALFMUTILS_H_
+#define UT_FMINTERNALFMUTILS_H_
+
+#include <QObject>
+#include <QStringList>
+#include <hbtranslator.h>
+#include <QTranslator>
+class TestFmInternalFmUtils :public QObject
+{
+    Q_OBJECT
+private slots:    
+    void initTestCase();    
+    
+    void testGetDriveNameFromPath(); //test the getDriveNameFromPath() and fillPathWithSplash() functions.
+    
+    void testGetDriveLetterFromPath(); // test the getDriveLetterFromPath() function.
+    
+    void testFormatStorageSize(); // test the formatStorageSize() function.
+    
+    void testIsDriveYes(); // test isDrive() function with normal drive path
+    void testIsDriveNo(); // test isDrive() function with an unnormal drive path
+    
+    void testFormatPathWithEmptyPath(); // test formatPath() with empty path
+    void testFormatPath(); // test formatPath() using path with "/" or "\"
+    
+    void testFillPathWithSplashUseEmptyPath(); // fillPathWithSplash()
+    void testFillPathWithSplashHasSplash(); // fillPathWithSplash()
+    void testFillPathWithSplashWithoutSplash(); // fillPathWithSplash()
+    
+    void testRemovePathSplashUseEmptyPath(); // removePathSplash()
+    void testRemovePathSplashHasSplash(); // removePathSplash()
+    void testRemovePathSplashWithoutSplash(); // removePathSplash()
+    
+    void testGetDriveListAll();//getDriveList()
+    void testGetDriveListPart();//getDriveList()
+    
+    void testFillDriveVolumeEmptyName(); // fillDriveVolume()
+    void testFillDriveVolumeDefaultVolume(); // fillDriveVolume()
+    void testFillDriveVolume(); // fillDriveVolume()
+    
+    void testGetDefaultVolumeName(); // test getDefaultVolumeName() funtion
+    
+    void testGetVolumeNameWithDefaultNameIfNull();
+    
+    void testisPathEqualWithSamePath(); // test isPathEqual() with same path parameter
+    void testisPathEqualWithDiffPath(); // test isPathEqual() with different path parameter
+    
+    void testcheckFolderFileNameNormal(); // test checkFolderFileName() with valid name
+    void testcheckFolderFileNameUnNormal(); //test checkFolderFileName() with invalid name
+    
+    void testCheckNewFolderOrFileUnNormal(); // test checkNewFolderOrFile() function
+    void testCheckNewFolderOrFileIlegel();
+    void testCheckNewFolderOrFileNo();
+    
+    void testIsSubLevelPathYes(); // test isSubLevelPath() function
+    void testIsSubLevelPathNo();
+    
+    void testRemoveDrivePwdNormal(); // test the removeDrivePwd() function
+    void testRemoveDrivePwdUnNormal(); 
+    
+    void testSetDrivePwdNormal(); // test the setDrivePwd() function.
+    void testSetDrivePwdUnNormal(); 
+    
+    void testCheckDrivePwd(); // test the checkDrivePwd() function.
+    void testEmptyPwd(); 
+    
+    void testRenameDriveWithBadName(); // test renameDrive() function with bad names.
+    void testRenameDriveWithNormalName(); // test renameDrive() function with normal names.
+    
+    void testCheckDriveAccessFilter(); // test the checkDriveAccessFilter() function.
+    
+    void testCheckDriveToFolderFilterC(); // test the checkDriveToFolderFilter() function.
+    void testCheckDriveToFolderFilterNormal();
+    
+    void testCheckFolderToDriveFilterC(); // test CheckFolderToDriveFilter() function.
+    void testCheckFolderToDriveFilterNormal();
+    
+    void testIsPathAccessableEmpty();
+    void testIsPathAccessableOK();
+    void testIsPathAccessableNo();
+    
+    void testIsDriveAvailable(); // test the isDriveAvailable() function.
+    
+    void testIsDefaultFolder(); // test the isDefaultFolder() function.
+    
+    void testCreateDefaultFolders(); // test the createDefaultFolders() function.
+    
+    void testSetFileAttributes(); // test teh setFileAttributes() function.
+    
+    void testHasEnoughSpaceYes(); // test the hasEnoughSpace() function.
+    void testHasEnoughSpaceNo();
+    
+    void testMoveInsideDrive(); // test the moveInsideDrive() function.
+    
+    void testLaunchFile(); // test the launchFile() funtion.
+    
+    void testSendFiles();
+    
+    void testGetBurConfigPath();
+    
+    void testGetFileTypeWithSupportType(); // test the GetFileType() function using file manager supported types. 
+    void testGetFileTypeWithUnSupportType();
+    
+    void testIsDriveCYes();
+    void testIsDriveCNo();
+    
+    void testGetMaxFileNameLength();
+    
+    void testCheckMaxPathLength();
+    
+    void cleanupTestCase();    
+private:
+    QString mFilePath;
+    QStringList mDrives; // all drives
+    QStringList mDrives1;// drives which type is USB or MemCard
+    QStringList mDrives2;// drives except USB and MemCard
+    
+    QTranslator mTranslator;
+};
+#endif /* UT_FMINTERNALFMUTILS_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filemanager/tsrc/unit/ut_fminternalfmutils/ut_fminternalfmutils.pro	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,51 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+QT += testlib
+CONFIG += hb qtestlib
+CONFIG += symbian_test
+
+TEMPLATE = app
+TARGET = ut_fminternalfmutils
+
+include ( ../ut_common.pri )
+include ( ../../../src/common.pri )
+include ( ../../../src/inc/commoninc.pri )
+include ( ../../../src/inc/commonutils.pri )
+
+DEPENDPATH += .
+INCLUDEPATH += .
+
+#TARGET.CAPABILITY = ALL -TCB
+TARGET.CAPABILITY = CAP_APPLICATION DiskAdmin AllFiles PowerMgmt
+
+HEADERS += src/*.h
+SOURCES += src/*.cpp
+
+symbian:MMP_RULES += SMPSAFE
+
+symbian { 
+    deploy.path = C:
+    files.sources += data/Image.jpg \
+                     data/Tone.mp3 \
+                     data/unknow.unknow \
+                     data/Imageformove.jpg
+    files.path = /data/resource/fmtestdata
+    DEPLOYMENT += files
+    
+    # This is for new exporting system coming in garden
+    for(file, files.sources):BLD_INF_RULES.prj_exports += "./$$file $$deploy.path$$files.path/$$basename(file)"
+}
--- a/layers.sysdef.xml	Tue Aug 24 10:24:14 2010 +0800
+++ b/layers.sysdef.xml	Wed Sep 29 10:37:03 2010 +0800
@@ -6,8 +6,9 @@
 <SystemDefinition name="files" schema="1.5.1">
   <systemModel>
     <layer name="bldfirst_app_layer">
-      <module name="fmbkupengine">
+      <module name="filemanager_components">
         <unit name="fmbkupengine" unitID="presdo.fmbkupengine" bldFile="&layer_real_source_path;/filemanager/src/fmbkupengine/group" mrp="" />
+        <unit name="fmfiledialog" unitID="presdo.fmfiledialog" mrp="" bldFile="&layer_real_source_path;/filemanager/src/fmfiledialog" proFile="fmfiledialog.pro" qmakeArgs="-r -config rom"/>
       </module>
     </layer>
     <layer name="app_layer">
@@ -15,5 +16,10 @@
         <unit unitID="filemanager" mrp="" bldFile="&layer_real_source_path;/filemanager" name="filemanager" proFile="filemanager.pro" qmakeArgs="-r -config rom"/>
       </module>
     </layer>
+    <layer name="qt_unit_test_layer">
+      <module name="filemanager_tests">
+        <unit unitID="presdoe.filemanager_tests" mrp="" bldFile="&layer_real_source_path;/filemanager/tsrc" proFile="tsrc.pro" name="filemanager_tests" qmakeArgs="-r"/>
+      </module>
+    </layer>
   </systemModel>
 </SystemDefinition>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_definition.xml	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SystemDefinition schema="3.0.0" xmlns:qt="http://www.nokia.com/qt">
+ <package id="files" name="File Manager Apps" levels="support apps">
+  <collection id="filemanager" name="File Manager" level="apps">
+   <component id="filemanager_plat" name="File Manager Platform Interfaces" class="api" filter="s60" introduced="^4">
+    <unit base="filemanager/filemanager_plat"/>
+   </component>
+   <component id="fmbkupengine" filter="s60,bldfirst" name="File Manager Backup Engine" introduced="^4">
+       <unit bldFile="filemanager/src/fmbkupengine/group"/>
+   </component>
+   <component id="fmfiledialog" filter="s60,bldfirst" name="File Manager File Dialog" introduced="^4">
+       <unit bldFile="filemanager/src/fmfiledialog" qt:proFile="fmfiledialog.pro" qt:qmakeArgs="-r -config rom"/>
+   </component>
+   <component id="filemanager_rom" filter="s60" name="File Manager ROM" class="config"  introduced="^4">
+    <unit bldFile="filemanager/rom"/>
+   </component>
+   <component id="fmbkupenginewrapper" filter="s60" name="File Manager Build"  introduced="^4">
+    <unit bldFile="filemanager/src/fmbkupenginewrapper" qt:proFile="fmbkupenginewrapper.pro"/>
+   </component>
+   <component id="filemanager_src" filter="s60" name="File Manager Build"  introduced="^4">
+    <unit bldFile="filemanager/src/filemanager" qt:proFile="filemanager.pro"/>
+   </component>
+   <component id="filemanager_tests" name="File Manager Tests" filter="s60,test,qt_unit_test">
+     <unit bldFile="filemanager/tsrc" qt:proFile="tsrc.pro"/>
+   </component>
+  </collection>
+ </package>
+</SystemDefinition>
+        
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_map.xml	Wed Sep 29 10:37:03 2010 +0800
@@ -0,0 +1,1 @@
+<PackageMap root="sf" layer="app"/>