filemanager/src/filemanager/src/fmdriverlistwidget.cpp
changeset 37 15bc28c9dd51
parent 16 ada7962b4308
child 46 d58987eac7e8
--- a/filemanager/src/filemanager/src/fmdriverlistwidget.cpp	Mon May 03 12:24:39 2010 +0300
+++ b/filemanager/src/filemanager/src/fmdriverlistwidget.cpp	Tue Aug 24 10:24:14 2010 +0800
@@ -16,7 +16,6 @@
  *     The driver model file for file manager
  */
 #include "fmdriverlistwidget.h"
-#include "listviewitems.h"
 #include "fmutils.h"
 #include "fmdlgutils.h"
 #include "fmviewmanager.h"
@@ -24,25 +23,23 @@
 #include "fmoperationbase.h"
 #include "fmdrivemodel.h"
 #include "fmfiledialog.h"
-
-#include <QDirModel>
+#include "fmoperationservice.h"
+#include <hbabstractviewitem.h>
+#include <QDir>
 #include <QGraphicsLinearLayout>
 #include <QFileSystemWatcher>
 
 #include <hblistview.h>
 #include <hbmenu.h>
 #include <hbaction.h>
-#include <hbmessagebox.h>
 #include <hbsearchpanel.h>
 
 FmDriverListWidget::FmDriverListWidget( QGraphicsItem *parent )
-: HbWidget( parent ),
-  mCurrentItem( 0 ),
-  mOperationService( 0 )
+: HbWidget( parent ), mListView(0), mModel(0),
+  mCurrentItem(0), mSearchPanel(0),
+  mFileSystemWatcher(0), mLayout(0), mContextMenu(0), mListLongPressed( false )
 {
-	init();
-	mOperationService = FmViewManager::viewManager()->operationService();
-
+	init();	
     mFileSystemWatcher = new QFileSystemWatcher( this );
     connect( mFileSystemWatcher, SIGNAL( directoryChanged ( const QString & ) ), 
             this, SLOT( on_directoryChanged( const QString & ) ) ); 
@@ -52,11 +49,20 @@
 
 FmDriverListWidget::~FmDriverListWidget()
 {
+	if (mContextMenu) {
+        mContextMenu->deleteLater();
+	}
 }
 
 void FmDriverListWidget::on_list_activated( const QModelIndex &index )
 {
-	emit activated( mModel->driveName( index ) );
+    FM_LOG("FmDriverListWidget::on_list_activated");
+    if( mListLongPressed ) {
+        FM_LOG("FmDriverListWidget::on_list_activated return because long pressed");
+        return;
+    }
+    FM_LOG("FmDriverListWidget::on_list_activated emit activate to open drive");
+    emit activated( mModel->driveName( index ) );
 }
 
 void FmDriverListWidget::init()
@@ -64,31 +70,28 @@
 	mLayout = new QGraphicsLinearLayout( this );
 	mLayout->setOrientation( Qt::Vertical );
 
-	mListView = new HbListView( this );
-	mListView->setSelectionMode( HbAbstractItemView::SingleSelection );
-
+	mListView = new HbListView( this );	
+	mListView->setLayoutName( "drive" );
 	mModel = new FmDriveModel( this,
-         FmDriveModel::FillWithVolume | FmDriveModel::FillWithDefaultVolume );
+         FmDriveModel::FillWithVolume | FmDriveModel::FillWithDefaultVolume |
+         FmDriveModel::FillWithTotalSize | FmDriveModel::FillWithFreeSize );
 	mListView->setModel( mModel );
-
-	mLayout->addItem( mListView );
-	
+	mLayout->addItem( mListView );	
 	mSearchPanel = new HbSearchPanel( this );
 	mSearchPanel->setObjectName( "searchPanel" );
 	mSearchPanel->setSearchOptionsEnabled( true );
 	mSearchPanel->setProgressive( false );
 	mSearchPanel->hide();
-//	mLayout->addItem( mSearchPanel );
-    
-	mListView->setItemPrototype( new DiskListViewItem( mListView ) );
 	connect( mListView, SIGNAL( activated( const QModelIndex & ) ),
 		     this, SLOT( on_list_activated( const QModelIndex & ) ) );
+	connect( mListView, SIGNAL( pressed( const QModelIndex & ) ),
+	             this, SLOT( on_list_pressed( const QModelIndex & ) ) );
 
     connect( mListView, SIGNAL( longPressed( HbAbstractViewItem *, const QPointF & ) ),
         this, SLOT( on_list_longPressed( HbAbstractViewItem *, const QPointF & ) ) );
     
     connect( mSearchPanel, SIGNAL( searchOptionsClicked() ),
-        this, SLOT( on_searchPanel_searchOptionsClicked() ) );
+        this, SLOT( on_searchPanel_searchOptionsClicked() ), Qt::QueuedConnection );
     
     connect( mSearchPanel, SIGNAL( criteriaChanged( const QString & ) ),
         this, SLOT( on_searchPanel_criteriaChanged( const QString & ) ) );
@@ -99,125 +102,145 @@
     setLayout( mLayout );
 }
 
-void FmDriverListWidget::refreshModel( const QString &path )
+void FmDriverListWidget::refreshDrive()
 {
-    Q_UNUSED( path );
     mModel->refresh();
 }
 
 void FmDriverListWidget::on_list_longPressed( HbAbstractViewItem *item, const QPointF &coords )
 {   
-    HbMenu *contextMenu = new HbMenu();
-
+    FM_LOG("FmDriverListWidget::on_list_longPressed");
+    mListLongPressed = true;
     mCurrentItem = item;
     QString diskName = mModel->driveName( mCurrentItem->modelIndex() );
-    
-    FmDriverInfo driverInfo = FmUtils::queryDriverInfo( diskName );
+
+	if( !mContextMenu ) {
+		mContextMenu = new HbMenu();
+	} else {
+		mContextMenu->clearActions();
+	}
+	FmDriverInfo driverInfo = FmUtils::queryDriverInfo( diskName );
+	FmDriverInfo::DriveType driveType = driverInfo.driveType();
     FmDriverInfo::DriveState state = driverInfo.driveState();
-
-    if( !( state & FmDriverInfo::EDriveNotPresent ) && !( state & FmDriverInfo::EDriveLocked ) &&
-            !( state & FmDriverInfo::EDriveCorrupted ) ) {
-        HbAction *viewAction = new HbAction();
-        viewAction->setObjectName( "viewAction" );
-        viewAction->setText( hbTrId( "txt_fmgr_menu_view_details_memory" ) );
-        contextMenu->addAction( viewAction );
-
-        //state = 0x210;
-    
-        connect( viewAction, SIGNAL( triggered() ),
-        this, SLOT( on_viewAction_triggered() ) );
-    }
-
-    if( ( state & FmDriverInfo::EDriveRemovable ) && !( state & FmDriverInfo::EDriveMassStorage ) ){
-        if ( driverInfo.volumeName().length() ){
-            HbAction *renameAction = new HbAction();
-            renameAction->setObjectName( "renameAction" );
-            renameAction->setText( hbTrId( "txt_fmgr_menu_rename" ) );
-            contextMenu->addAction( renameAction );
-
-            connect( renameAction, SIGNAL( triggered() ),
-		     this, SLOT( on_renameAction_triggered() ) );
-        }
-        else{
-            HbAction *nameAction = new HbAction();
-            nameAction->setObjectName( "nameAction" );
-            nameAction->setText( hbTrId( "txt_fmgr_menu_name" ) );
-            contextMenu->addAction( nameAction );
-
-            connect( nameAction, SIGNAL( triggered() ),
-		     this, SLOT( on_nameAction_triggered() ) );
-        }
-
-        if( state & FmDriverInfo::EDrivePasswordProtected ){
-            HbAction *changePwdAction = new HbAction();
-            changePwdAction->setObjectName( "changePwdAction" );
-            changePwdAction->setText( hbTrId( "txt_fmgr_menu_change_password" ) );
-            contextMenu->addAction( changePwdAction );
-
-            HbAction *removePwdAction = new HbAction();
-            removePwdAction->setObjectName( "removePwdAction" );
-            removePwdAction->setText( hbTrId( "txt_fmgr_menu_remove_password" ) );
-            contextMenu->addAction( removePwdAction );
-
-            connect( changePwdAction, SIGNAL( triggered() ),
-		     this, SLOT( on_changePwdAction_triggered() ) );
-            connect( removePwdAction, SIGNAL( triggered() ),
-		     this, SLOT( on_removePwdAction_triggered() ) );
-        }
-        else{
-            HbAction *setPwdAction = new HbAction();
-            setPwdAction->setObjectName( "setPwdAction" );
-            setPwdAction->setText( hbTrId( "txt_fmgr_menu_set_password" ) );
-            contextMenu->addAction( setPwdAction );
-
-            connect( setPwdAction, SIGNAL( triggered() ),
-		     this, SLOT( on_setPwdAction_triggered() ) );
-        }
-         
+    if( !( state & FmDriverInfo::EDriveNotPresent ) ) {
+        if( state & FmDriverInfo::EDriveAvailable ) {
+            HbAction *viewAction = new HbAction();
+            viewAction->setObjectName( "viewAction" );
+            viewAction->setText( hbTrId( "txt_fmgr_menu_view_details_memory" ) );
+            mContextMenu->addAction( viewAction );
+            connect( viewAction, SIGNAL( triggered() ),
+                this, SLOT( on_viewAction_triggered() ), Qt::QueuedConnection );
+            
+            if( driveType == FmDriverInfo::EDriveTypeMemoryCard || driveType == FmDriverInfo::EDriveTypeUsbMemory ) {
+                // MMC or Usb memory
+            
+                // Name/Rename action
+                if ( driverInfo.volumeName().length() ){
+                    HbAction *renameAction = new HbAction();
+                    renameAction->setObjectName( "renameAction" );
+                    renameAction->setText( hbTrId( "txt_fmgr_menu_rename" ) );
+                    mContextMenu->addAction( renameAction );
+        
+                    connect( renameAction, SIGNAL( triggered() ),
+                     this, SLOT( on_renameAction_triggered() ), Qt::QueuedConnection );
+                } else {
+                    HbAction *nameAction = new HbAction();
+                    nameAction->setObjectName( "nameAction" );
+                    nameAction->setText( hbTrId( "txt_fmgr_menu_name" ) );
+                    mContextMenu->addAction( nameAction );
+        
+                    connect( nameAction, SIGNAL( triggered() ),
+                     this, SLOT( on_nameAction_triggered() ), Qt::QueuedConnection );
+                }
+                
+                // Set/Change/Remove password action
+                if( driveType == FmDriverInfo::EDriveTypeMemoryCard ) { // MMC
+                    if( state & FmDriverInfo::EDrivePasswordProtected ){
+                        HbAction *changePwdAction = new HbAction();
+                        changePwdAction->setObjectName( "changePwdAction" );
+                        changePwdAction->setText( hbTrId( "txt_fmgr_menu_change_password" ) );
+                        mContextMenu->addAction( changePwdAction );
+            
+                        HbAction *removePwdAction = new HbAction();
+                        removePwdAction->setObjectName( "removePwdAction" );
+                        removePwdAction->setText( hbTrId( "txt_fmgr_menu_remove_password" ) );
+                        mContextMenu->addAction( removePwdAction );
+            
+                        connect( changePwdAction, SIGNAL( triggered() ),
+                         this, SLOT( on_changePwdAction_triggered() ), Qt::QueuedConnection );
+                        connect( removePwdAction, SIGNAL( triggered() ),
+                         this, SLOT( on_removePwdAction_triggered() ), Qt::QueuedConnection );
+                    }
+                    else{
+                        HbAction *setPwdAction = new HbAction();
+                        setPwdAction->setObjectName( "setPwdAction" );
+                        setPwdAction->setText( hbTrId( "txt_fmgr_menu_set_password" ) );
+                        mContextMenu->addAction( setPwdAction );
+            
+                        connect( setPwdAction, SIGNAL( triggered() ),
+                         this, SLOT( on_setPwdAction_triggered() ), Qt::QueuedConnection );
+                    }
+                }
+            } //if( driveType == FmDriverInfo::EDriveTypeMemoryCard || driveType == FmDriverInfo::EDriveTypeUsbMemory )
+        } //if( state & FmDriverInfo::EDriveAvailable )
+        
+        // Eject action
+        // put outside of EDriveAvailable so that removable drive which is corrupted or locked can be removed
         if( state & FmDriverInfo::EDriveEjectable ){
             HbAction *ejectAction = new HbAction();
             ejectAction->setObjectName( "ejectAction" );
             ejectAction->setText( hbTrId( "txt_fmgr_menu_eject" ) );
-            contextMenu->addAction( ejectAction );
+            mContextMenu->addAction( ejectAction );
             
             connect( ejectAction, SIGNAL( triggered() ),
-            this, SLOT( on_ejectAction_triggered() ) );
-        }         
-    }
-#ifndef _DEBUG_ENABLE_FORMATMENU_
-if ( ( state & FmDriverInfo::EDriveRemovable ) || ( state & FmDriverInfo::EDriveCorrupted )
-         || ( state & FmDriverInfo::EDriveLocked ) ){
-        if( !( state & FmDriverInfo::EDriveNotPresent ) ){
-#endif
-            HbAction *formatAction = new HbAction();
-            formatAction->setObjectName( "formatAction" );
-            formatAction->setText( hbTrId( "txt_fmgr_menu_format" ) );
-            contextMenu->addAction( formatAction );
-
-            connect( formatAction, SIGNAL( triggered() ),
-             this, SLOT( on_formatAction_triggered() ) );
-#ifndef _DEBUG_ENABLE_FORMATMENU_
+            this, SLOT( on_ejectAction_triggered() ), Qt::QueuedConnection );
+        } 
+        
+        // Format action
+        if ( ( state & FmDriverInfo::EDriveRemovable ) || ( state & FmDriverInfo::EDriveCorrupted )
+             || ( state & FmDriverInfo::EDriveLocked ) ){
+                HbAction *formatAction = new HbAction();
+                formatAction->setObjectName( "formatAction" );
+                formatAction->setText( hbTrId( "txt_fmgr_menu_format" ) );
+                mContextMenu->addAction( formatAction );
+    
+                connect( formatAction, SIGNAL( triggered() ),
+                    this, SLOT( on_formatAction_triggered() ), Qt::QueuedConnection );
         }
-    }
-#endif
+    } //if( !( state & FmDriverInfo::EDriveNotPresent ) )
     
+    // Unlock action
+    // put ouside of !EDriveNotPresent judgment so that
+    // user could unlock drive if connected to PC with mass storage mode
     if( state & FmDriverInfo::EDriveLocked ){
         HbAction *unLockedAction = new HbAction();
         unLockedAction->setObjectName( "unLockedAction" );
         unLockedAction->setText( hbTrId( "Unlock" ) );
-        contextMenu->addAction( unLockedAction );
+        mContextMenu->addAction( unLockedAction );
 
         connect( unLockedAction, SIGNAL( triggered() ),
-         this, SLOT( on_unLockedAction_triggered() ) );
-    } 
+         this, SLOT( on_unLockedAction_triggered() ), Qt::QueuedConnection );
+    }
+    
+    // Pop up menu or open drive
+	if( mContextMenu->actions().count() > 0 ) {
+		mContextMenu->setPreferredPos( coords );
+		mContextMenu->open();
+	} else {
+		emit activated( diskName );
+	}
+}
 
-    contextMenu->exec( coords );   
+void FmDriverListWidget::on_list_pressed( const QModelIndex &  index )
+{
+    Q_UNUSED( index );
+    mListLongPressed = false;
 }
 
 void FmDriverListWidget::on_viewAction_triggered()
 {
-    QString diskName = mModel->driveName( mCurrentItem->modelIndex() );
-    mOperationService->asyncViewDriveDetails( diskName );
+    QString diskName = mModel->driveName( mCurrentItem->modelIndex() );    
+    FmViewManager::viewManager()->operationService()->asyncViewDriveDetails( diskName );
 }
 
 void FmDriverListWidget::on_renameAction_triggered()
@@ -228,24 +251,32 @@
     FmDriverInfo driverInfo = FmUtils::queryDriverInfo( diskName );
 
     if ( state & FmDriverInfo::EDriveWriteProtected ){
-        HbMessageBox::information( hbTrId( "Unable to perform operation. Memory card is read only." ) );
+        FmDlgUtils::information( hbTrId( "Unable to perform operation. Memory card is read only." ) );
         return;
         }
 
-    QString title( tr( "Drive name ") );  
-    QString volumeName = driverInfo.volumeName();
-
+    QString title( hbTrId( "Drive name ") );
+    //save the volume status, empty or set
+    bool needToSetVolume = false;
+    QString volumeName = FmUtils::getVolumeNameWithDefaultNameIfNull( diskName, needToSetVolume );    
+    QString oldVolumeName( volumeName );
     QString associatedDrives( FmUtils::getDriveLetterFromPath( diskName ) );
-    while( FmDlgUtils::showTextQuery( title, volumeName, false, FmMaxLengthofDriveName, associatedDrives ) ){
+    //use isReturnFalseWhenNoTextChanged = false in order that FmUtils::renameDrive( driveName, volumeName ) will
+    //be excuted at lease once to set the volume name.
+    while( FmDlgUtils::showTextQuery( title, volumeName, QStringList(), FmMaxLengthofDriveName, associatedDrives, false ) ){
+        //if volume is not set or oldVolumeName != volumeName , FmUtils::renameDrive will be called
+        if ( oldVolumeName == volumeName && !needToSetVolume ) {
+            break;
+        }
         int err = FmUtils::renameDrive( diskName, volumeName );
-        if ( err == FmErrNone ){
-            HbMessageBox::information( hbTrId( "The name has been changed!" ) );
+        if ( err == FmErrNone ) {
+            FmDlgUtils::information( hbTrId( "The name has been changed!" ) );
             mModel->refresh();
             break;
         } else if( err == FmErrBadName ) {
-            HbMessageBox::information( hbTrId( "Illegal characters! Use only letters and numbers." ) );
+            FmDlgUtils::information( hbTrId( "Illegal characters! Use only letters and numbers." ) );
         } else{
-            HbMessageBox::information( hbTrId( "Error occurred, operation cancelled!" ) );
+            FmDlgUtils::information( hbTrId( "Error occurred, operation cancelled!" ) );
             break;
         }                
     }
@@ -269,20 +300,20 @@
     QString diskName = mModel->driveName( mCurrentItem->modelIndex() );
 
     QString associatedDrives( FmUtils::getDriveLetterFromPath( diskName ) );
-    if( FmDlgUtils::showMultiPasswordQuery( firstLabel, secondLabel, newPwd, associatedDrives ) ) {
+    if( FmDlgUtils::showMultiPasswordQuery( firstLabel, secondLabel, newPwd, FmMaxLengthofDrivePassword, associatedDrives ) ) {
        if ( FmUtils::setDrivePwd( diskName, oldPwd, newPwd ) == 0 ){
-            HbMessageBox::information( hbTrId( "The password has been set!" ) );
+            FmDlgUtils::information( hbTrId( "The password has been set!" ) );
         }
         else{
-            HbMessageBox::information( hbTrId( "Error occurred, operation cancelled!" ) );
+            FmDlgUtils::information( hbTrId( "Error occurred, operation cancelled!" ) );
         }
     }
 }
 
 void FmDriverListWidget::on_changePwdAction_triggered()
 {
-    QString title( hbTrId( "Password: ")  );
-    QString firstLabel( hbTrId( "New Password: ") );
+    QString title( hbTrId( "txt_common_dialog_password")  );
+    QString firstLabel( hbTrId( "txt_common_dialog_new_password") );
     QString secondLabel( hbTrId( "Confirm new Password: ") );
 
     QString oldPwd;
@@ -291,13 +322,13 @@
     QString diskName = mModel->driveName( mCurrentItem->modelIndex() );
     
     QString associatedDrives( FmUtils::getDriveLetterFromPath( diskName ) );
-    while( FmDlgUtils::showSinglePasswordQuery( title, oldPwd, associatedDrives ) ) {
+    while( FmDlgUtils::showSinglePasswordQuery( title, oldPwd, FmMaxLengthofDrivePassword, associatedDrives ) ) {
        if ( FmUtils::checkDrivePwd( diskName, oldPwd ) == 0 ){
-            if( FmDlgUtils::showMultiPasswordQuery( firstLabel, secondLabel, newPwd ) ){
+            if( FmDlgUtils::showMultiPasswordQuery( firstLabel, secondLabel, newPwd, FmMaxLengthofDrivePassword, associatedDrives ) ){
                 if ( FmUtils::setDrivePwd( diskName, oldPwd, newPwd ) == 0 ){
-                    HbMessageBox::information( hbTrId( "The password has been changed!" ) );
+                    FmDlgUtils::information( hbTrId( "The password has been changed!" ) );
                 } else {
-                    HbMessageBox::information( hbTrId( "Error occurred, operation cancelled!" ) );
+                    FmDlgUtils::information( hbTrId( "Error occurred, operation cancelled!" ) );
                 }
                 break;
             } else {  
@@ -305,7 +336,7 @@
                 break;
             }
        } else {
-            HbMessageBox::information( hbTrId( "The password is incorrect, try again!" ) );
+            FmDlgUtils::information( hbTrId( "The password is incorrect, try again!" ) );
        }
          
     }
@@ -318,21 +349,20 @@
     QString oldPwd;
 
     QString diskName = mModel->driveName( mCurrentItem->modelIndex() );
-    //QString password( tr( "a ") );
-    if( HbMessageBox::question( tr( "Do you want to remove the password? Memory card becomes unlocked." ) ) ){
+    if( FmDlgUtils::question( hbTrId( "Do you want to remove the password? Memory card becomes unlocked." ) ) ){
         QString associatedDrives( FmUtils::getDriveLetterFromPath( diskName ) );
-        while( FmDlgUtils::showSinglePasswordQuery( title, oldPwd, associatedDrives ) ) {
+        while( FmDlgUtils::showSinglePasswordQuery( title, oldPwd, FmMaxLengthofDrivePassword, associatedDrives ) ) {
             if ( FmUtils::checkDrivePwd( diskName, oldPwd ) == 0 ) {
                 if ( FmUtils::removeDrivePwd( diskName, oldPwd ) == 0 ){
-                    HbMessageBox::information( hbTrId( "The password has been removed!" ) );
+                    FmDlgUtils::information( hbTrId( "The password has been removed!" ) );
                 }
                 else{
-                    HbMessageBox::information( hbTrId( "Error occurred, operation cancelled!" ) );
+                    FmDlgUtils::information( hbTrId( "Error occurred, operation cancelled!" ) );
                 }
                 break;
             }
             else {
-                HbMessageBox::information( hbTrId( "The password is incorrect, try again!" ) );
+                FmDlgUtils::information( hbTrId( "The password is incorrect, try again!" ) );
             }
             
         }
@@ -348,21 +378,21 @@
     QString diskName = mModel->driveName( mCurrentItem->modelIndex() );
     
     //Do not add associatedDrives as Locked MMC is not available Drive but only present Drive
-    while( FmDlgUtils::showSinglePasswordQuery( title, oldPwd ) ) {
+    while( FmDlgUtils::showSinglePasswordQuery( title, oldPwd, FmMaxLengthofDrivePassword ) ) {
         int err = FmUtils::unlockDrive( diskName, oldPwd );
         if( err == FmErrNone ) {
-            HbMessageBox::information( hbTrId( "The memory is unlocked!" ) );
+            FmDlgUtils::information( hbTrId( "The memory is unlocked!" ) );
             break;
         } else if ( err == FmErrAccessDenied ) {
-            HbMessageBox::information( hbTrId( "The password is incorrect, try again!" ) );
+            FmDlgUtils::information( hbTrId( "The password is incorrect, try again!" ) );
         } else if (err == FmErrAlreadyExists ) {
-            HbMessageBox::information( hbTrId( "The disk has already been unlocked!" ) );
+            FmDlgUtils::information( hbTrId( "The disk has already been unlocked!" ) );
             break;
         } else if( err == FmErrNotSupported ) {
-            HbMessageBox::information( hbTrId( "The media does not support password locking!" ) );
+            FmDlgUtils::information( hbTrId( "The media does not support password locking!" ) );
             break;
         } else {
-            HbMessageBox::information( hbTrId( "Error occurred, operation cancelled!" ) );
+            FmDlgUtils::information( hbTrId( "Error occurred, operation cancelled!" ) );
             break;
         }
     }
@@ -372,9 +402,9 @@
 {
     QString diskName = mModel->driveName( mCurrentItem->modelIndex() );
     
-    if( HbMessageBox::question( hbTrId( "Format? Data will be deleted during formatting." ) ) ){
-        if( FmErrNone != mOperationService->asyncFormat( diskName ) )
-            HbMessageBox::information( hbTrId( "Formatting failed." ) );
+    if( FmDlgUtils::question( hbTrId( "Format? Data will be deleted during formatting." ) ) ){
+        if( FmErrNone != FmViewManager::viewManager()->operationService()->asyncFormat( diskName ) )
+            FmDlgUtils::information( hbTrId( "Formatting failed." ) );
         }
 }
 
@@ -382,7 +412,7 @@
 {
     QString diskName = mModel->driveName( mCurrentItem->modelIndex() );
     
-    if( HbMessageBox::question( hbTrId( "Eject memory card? Some applications will be closed." ) ) ){
+    if( FmDlgUtils::question( hbTrId( "Eject memory card? Some applications will be closed." ) ) ){
         FmUtils::ejectDrive( diskName );
     }
 }
@@ -395,15 +425,24 @@
 
 void FmDriverListWidget::activeSearchPanel()
 {
-    mFindTargetPath.clear();
+    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 = FmFileDialog::getExistingDirectory( 0, hbTrId( "Look in:" ),
-        QString(""), QStringList() );
+    mFindTargetPath = FmUtils::fillPathWithSplash( FmFileDialog::getExistingDirectory( 0, hbTrId( "Look in:" ),
+        QString(""), QStringList() ) );
 }
 
 void FmDriverListWidget::on_searchPanel_criteriaChanged( const QString &criteria )