# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1278414388 -10800 # Node ID 6e96d2143d46be7a2591ce8a83a225bbb9db5ba7 # Parent b3155376f2b4dd7bfd0779e11728ba66033b9ada Revision: 201025 Kit: 2010127 diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/rom/filemngr.iby --- a/filemanager/rom/filemngr.iby Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/rom/filemngr.iby Tue Jul 06 14:06:28 2010 +0300 @@ -23,6 +23,7 @@ #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\filemngr.exe SHARED_LIB_DIR\filemngr.exe +data = ZRESOURCE\apps\filemngr.mif APP_RESOURCE_DIR\filemngr.mif HB_UPGRADABLE_APP_REG_RSC(filemngr) diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/bwins/fmbkupenginewrapperu.def --- a/filemanager/src/bwins/fmbkupenginewrapperu.def Wed Jun 23 18:03:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -EXPORTS - ??0FmRestoreSettings@@QAE@AAVFmBkupEngine@@@Z @ 1 NONAME ; FmRestoreSettings::FmRestoreSettings(class FmBkupEngine &) - ?tr@FmBkupEngine@@SA?AVQString@@PBD0@Z @ 2 NONAME ; class QString FmBkupEngine::tr(char const *, char const *) - ?getStaticMetaObject@FmBkupEngine@@SAABUQMetaObject@@XZ @ 3 NONAME ; struct QMetaObject const & FmBkupEngine::getStaticMetaObject(void) - ?trUtf8@FmBkupEngine@@SA?AVQString@@PBD0H@Z @ 4 NONAME ; class QString FmBkupEngine::trUtf8(char const *, char const *, int) - ?error@FmBkupEngine@@QBEHXZ @ 5 NONAME ; int FmBkupEngine::error(void) const - ?availableTargetDrive@FmBackupSettings@@QBE?AVQString@@XZ @ 6 NONAME ; class QString FmBackupSettings::availableTargetDrive(void) const - ?GetSelectionL@FmRestoreSettings@@QBEXAAV?$QList@VFmRestoreInfo@@@@@Z @ 7 NONAME ; void FmRestoreSettings::GetSelectionL(class QList &) const - ?content@FmBackupSettings@@QBEIXZ @ 8 NONAME ; unsigned int FmBackupSettings::content(void) const - ?getBackupDriveList@FmBkupEngine@@QAEXAAVQStringList@@@Z @ 9 NONAME ; void FmBkupEngine::getBackupDriveList(class QStringList &) - ?resetAndDestoryRestoreEntry@FmRestoreSettings@@AAEXXZ @ 10 NONAME ; void FmRestoreSettings::resetAndDestoryRestoreEntry(void) - ?targetDriveToString@FmBackupSettings@@QAE?AVQString@@ABV2@@Z @ 11 NONAME ; class QString FmBackupSettings::targetDriveToString(class QString const &) - ?setScheduling@FmBackupSettings@@QAEXW4TFileManagerBackupSchedule@1@@Z @ 12 NONAME ; void FmBackupSettings::setScheduling(enum FmBackupSettings::TFileManagerBackupSchedule) - ?notifyFinish@FmBkupEngine@@IAEXH@Z @ 13 NONAME ; void FmBkupEngine::notifyFinish(int) - ?qt_metacast@FmBkupEngine@@UAEPAXPBD@Z @ 14 NONAME ; void * FmBkupEngine::qt_metacast(char const *) - ??0FmBackupSettings@@QAE@PAVFmBkupEngine@@@Z @ 15 NONAME ; FmBackupSettings::FmBackupSettings(class FmBkupEngine *) - ?SetSelection@FmRestoreSettings@@QAEXAB_K@Z @ 16 NONAME ; void FmRestoreSettings::SetSelection(unsigned long long const &) - ?startBackup@FmBkupEngine@@QAE_NV?$QList@PAVFmBkupDrivesAndOperation@@@@V?$QList@PAVFmBkupBackupCategory@@@@VQString@@I@Z @ 17 NONAME ; bool FmBkupEngine::startBackup(class QList, class QList, class QString, unsigned int) - ?notifyMemoryLow@FmBkupEngine@@IAEXHAAH@Z @ 18 NONAME ; void FmBkupEngine::notifyMemoryLow(int, int &) - ?CreateEntry@FmRestoreSettings@@AAEPAVFmRestoreEntry@@ABVFmRestoreInfo@@@Z @ 19 NONAME ; class FmRestoreEntry * FmRestoreSettings::CreateEntry(class FmRestoreInfo const &) - ?startRestore@FmBkupEngine@@QAE_NV?$QList@PAVFmBkupDrivesAndOperation@@@@@Z @ 20 NONAME ; bool FmBkupEngine::startRestore(class QList) - ?resetAndDestoryBackupEntry@FmBackupSettings@@AAEXXZ @ 21 NONAME ; void FmBackupSettings::resetAndDestoryBackupEntry(void) - ?weekdayToString@FmBackupSettings@@SA?AVQString@@W4TFileManagerBackupWeekday@1@@Z @ 22 NONAME ; class QString FmBackupSettings::weekdayToString(enum FmBackupSettings::TFileManagerBackupWeekday) - ?tr@FmBkupEngine@@SA?AVQString@@PBD0H@Z @ 23 NONAME ; class QString FmBkupEngine::tr(char const *, char const *, int) - ?contentToString@FmBackupSettings@@SA?AVQString@@I@Z @ 24 NONAME ; class QString FmBackupSettings::contentToString(unsigned int) - ?RestoreSettingsL@FmBkupEngine@@QAEPAVFmRestoreSettings@@XZ @ 25 NONAME ; class FmRestoreSettings * FmBkupEngine::RestoreSettingsL(void) - ?createBackupDateEntry@FmBackupSettings@@AAEPAVFmBackupEntry@@XZ @ 26 NONAME ; class FmBackupEntry * FmBackupSettings::createBackupDateEntry(void) - ?GetRestoreInfoArray@FmBkupEngine@@QAEXAAV?$QList@PAVFmBkupDrivesAndOperation@@@@AAV?$QList@VFmRestoreInfo@@@@ABVQString@@@Z @ 27 NONAME ; void FmBkupEngine::GetRestoreInfoArray(class QList &, class QList &, class QString const &) - ?time@FmBackupSettings@@QBEABVQTime@@XZ @ 28 NONAME ; class QTime const & FmBackupSettings::time(void) const - ?createWeekdayEntry@FmBackupSettings@@AAEPAVFmBackupEntry@@XZ @ 29 NONAME ; class FmBackupEntry * FmBackupSettings::createWeekdayEntry(void) - ?cancelBackup@FmBkupEngine@@QAEXXZ @ 30 NONAME ; void FmBkupEngine::cancelBackup(void) - ?notifyUpdate@FmBkupEngine@@IAEXH@Z @ 31 NONAME ; void FmBkupEngine::notifyUpdate(int) - ?save@FmBackupSettings@@QAEXXZ @ 32 NONAME ; void FmBackupSettings::save(void) - ??_EFmBkupEngine@@UAE@I@Z @ 33 NONAME ; FmBkupEngine::~FmBkupEngine(unsigned int) - ?restoreEntryList@FmRestoreSettings@@QAE?AV?$QList@PAVFmRestoreEntry@@@@XZ @ 34 NONAME ; class QList FmRestoreSettings::restoreEntryList(void) - ?createTimeEntry@FmBackupSettings@@AAEPAVFmBackupEntry@@XZ @ 35 NONAME ; class FmBackupEntry * FmBackupSettings::createTimeEntry(void) - ?weekday@FmBackupSettings@@QBE?AW4TFileManagerBackupWeekday@1@XZ @ 36 NONAME ; enum FmBackupSettings::TFileManagerBackupWeekday FmBackupSettings::weekday(void) const - ?deleteBackup@FmBkupEngine@@QAEHV?$QList@PAVFmBkupDrivesAndOperation@@@@@Z @ 37 NONAME ; int FmBkupEngine::deleteBackup(class QList) - ??1FmBackupSettings@@QAE@XZ @ 38 NONAME ; FmBackupSettings::~FmBackupSettings(void) - ?setTime@FmBackupSettings@@QAEXABVQTime@@@Z @ 39 NONAME ; void FmBackupSettings::setTime(class QTime const &) - ?backupEntryList@FmBackupSettings@@QAE?AV?$QList@PAVFmBackupEntry@@@@XZ @ 40 NONAME ; class QList FmBackupSettings::backupEntryList(void) - ?contentsSelected@FmBackupSettings@@ABEHXZ @ 41 NONAME ; int FmBackupSettings::contentsSelected(void) const - ?refreshList@FmBackupSettings@@AAEXXZ @ 42 NONAME ; void FmBackupSettings::refreshList(void) - ?trUtf8@FmBkupEngine@@SA?AVQString@@PBD0@Z @ 43 NONAME ; class QString FmBkupEngine::trUtf8(char const *, char const *) - ?CreateEntry@FmBackupSettings@@AAEPAVFmBackupEntry@@ABVQString@@0W4TSettingType@2@@Z @ 44 NONAME ; class FmBackupEntry * FmBackupSettings::CreateEntry(class QString const &, class QString const &, enum FmBackupEntry::TSettingType) - ?targetDrive@FmBackupSettings@@QBE?AVQString@@XZ @ 45 NONAME ; class QString FmBackupSettings::targetDrive(void) const - ??0FmBkupEngine@@QAE@PAVQObject@@@Z @ 46 NONAME ; FmBkupEngine::FmBkupEngine(class QObject *) - ?notifyPreparing@FmBkupEngine@@IAEX_N@Z @ 47 NONAME ; void FmBkupEngine::notifyPreparing(bool) - ?load@FmRestoreSettings@@QAEXV?$QList@PAVFmBkupDrivesAndOperation@@@@@Z @ 48 NONAME ; void FmRestoreSettings::load(class QList) - ?setWeekday@FmBackupSettings@@QAEXW4TFileManagerBackupWeekday@1@@Z @ 49 NONAME ; void FmBackupSettings::setWeekday(enum FmBackupSettings::TFileManagerBackupWeekday) - ??1FmRestoreSettings@@QAE@XZ @ 50 NONAME ; FmRestoreSettings::~FmRestoreSettings(void) - ?createContentsEntry@FmBackupSettings@@AAEPAVFmBackupEntry@@XZ @ 51 NONAME ; class FmBackupEntry * FmBackupSettings::createContentsEntry(void) - ?notifyBackupFilesExist@FmBkupEngine@@IAEXAA_N@Z @ 52 NONAME ; void FmBkupEngine::notifyBackupFilesExist(bool &) - ?updateBackupDate@FmBackupSettings@@QAEXXZ @ 53 NONAME ; void FmBackupSettings::updateBackupDate(void) - ?createSchedulingEntry@FmBackupSettings@@AAEPAVFmBackupEntry@@XZ @ 54 NONAME ; class FmBackupEntry * FmBackupSettings::createSchedulingEntry(void) - ?metaObject@FmBkupEngine@@UBEPBUQMetaObject@@XZ @ 55 NONAME ; struct QMetaObject const * FmBkupEngine::metaObject(void) const - ?createTargetDriveEntry@FmBackupSettings@@AAEPAVFmBackupEntry@@XZ @ 56 NONAME ; class FmBackupEntry * FmBackupSettings::createTargetDriveEntry(void) - ?load@FmBackupSettings@@QAEXXZ @ 57 NONAME ; void FmBackupSettings::load(void) - ??1FmBkupEngine@@UAE@XZ @ 58 NONAME ; FmBkupEngine::~FmBkupEngine(void) - ?BackupSettingsL@FmBkupEngine@@QAEPAVFmBackupSettings@@XZ @ 59 NONAME ; class FmBackupSettings * FmBkupEngine::BackupSettingsL(void) - ?setContent@FmBackupSettings@@QAEXI@Z @ 60 NONAME ; void FmBackupSettings::setContent(unsigned int) - ?schedulingToString@FmBackupSettings@@QAE?AVQString@@W4TFileManagerBackupSchedule@1@@Z @ 61 NONAME ; class QString FmBackupSettings::schedulingToString(enum FmBackupSettings::TFileManagerBackupSchedule) - ?setTargetDrive@FmBackupSettings@@QAEXABVQString@@@Z @ 62 NONAME ; void FmBackupSettings::setTargetDrive(class QString const &) - ?staticMetaObject@FmBkupEngine@@2UQMetaObject@@B @ 63 NONAME ; struct QMetaObject const FmBkupEngine::staticMetaObject - ?refreshList@FmRestoreSettings@@AAEXAAV?$QList@PAVFmBkupDrivesAndOperation@@@@@Z @ 64 NONAME ; void FmRestoreSettings::refreshList(class QList &) - ?notifyStart@FmBkupEngine@@IAEX_NH@Z @ 65 NONAME ; void FmBkupEngine::notifyStart(bool, int) - ?scheduling@FmBackupSettings@@QBE?AW4TFileManagerBackupSchedule@1@XZ @ 66 NONAME ; enum FmBackupSettings::TFileManagerBackupSchedule FmBackupSettings::scheduling(void) const - ?qt_metacall@FmBkupEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 67 NONAME ; int FmBkupEngine::qt_metacall(enum QMetaObject::Call, int, void * *) - diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/bwins/fmfiledialogu.def --- a/filemanager/src/bwins/fmfiledialogu.def Wed Jun 23 18:03:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -EXPORTS - ??_EFmFileDialog@@UAE@I@Z @ 1 NONAME ; FmFileDialog::~FmFileDialog(unsigned int) - ?qt_metacall@FmFileDialog@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 2 NONAME ; int FmFileDialog::qt_metacall(enum QMetaObject::Call, int, void * *) - ??1FmFileDialog@@EAE@XZ @ 3 NONAME ; FmFileDialog::~FmFileDialog(void) - ?tr@FmFileDialog@@SA?AVQString@@PBD0H@Z @ 4 NONAME ; class QString FmFileDialog::tr(char const *, char const *, int) - ?getOpenFileName@FmFileDialog@@SA?AVQString@@PAVHbWidget@@ABV2@1ABVQStringList@@V?$QFlags@W4Option@FmFileDialog@@@@@Z @ 5 NONAME ; class QString FmFileDialog::getOpenFileName(class HbWidget *, class QString const &, class QString const &, class QStringList const &, class QFlags) - ??0FmFileDialog@@AAE@PAVQGraphicsItem@@@Z @ 6 NONAME ; FmFileDialog::FmFileDialog(class QGraphicsItem *) - ?tr@FmFileDialog@@SA?AVQString@@PBD0@Z @ 7 NONAME ; class QString FmFileDialog::tr(char const *, char const *) - ?getStaticMetaObject@FmFileDialog@@SAABUQMetaObject@@XZ @ 8 NONAME ; struct QMetaObject const & FmFileDialog::getStaticMetaObject(void) - ?d_func@FmFileDialog@@ABEPBVFmFileDialogPrivate@@XZ @ 9 NONAME ; class FmFileDialogPrivate const * FmFileDialog::d_func(void) const - ?exec@FmFileDialog@@AAE_NXZ @ 10 NONAME ; bool FmFileDialog::exec(void) - ?trUtf8@FmFileDialog@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString FmFileDialog::trUtf8(char const *, char const *) - ?trUtf8@FmFileDialog@@SA?AVQString@@PBD0H@Z @ 12 NONAME ; class QString FmFileDialog::trUtf8(char const *, char const *, int) - ?metaObject@FmFileDialog@@UBEPBUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const * FmFileDialog::metaObject(void) const - ?staticMetaObject@FmFileDialog@@2UQMetaObject@@B @ 14 NONAME ; struct QMetaObject const FmFileDialog::staticMetaObject - ?getSaveFileName@FmFileDialog@@SA?AVQString@@PAVHbWidget@@ABV2@1ABVQStringList@@V?$QFlags@W4Option@FmFileDialog@@@@@Z @ 15 NONAME ; class QString FmFileDialog::getSaveFileName(class HbWidget *, class QString const &, class QString const &, class QStringList const &, class QFlags) - ?d_func@FmFileDialog@@AAEPAVFmFileDialogPrivate@@XZ @ 16 NONAME ; class FmFileDialogPrivate * FmFileDialog::d_func(void) - ?getExistingDirectory@FmFileDialog@@SA?AVQString@@PAVHbWidget@@ABV2@1ABVQStringList@@V?$QFlags@W4Option@FmFileDialog@@@@@Z @ 17 NONAME ; class QString FmFileDialog::getExistingDirectory(class HbWidget *, class QString const &, class QString const &, class QStringList const &, class QFlags) - ?qt_metacast@FmFileDialog@@UAEPAXPBD@Z @ 18 NONAME ; void * FmFileDialog::qt_metacast(char const *) - ?dialogClosed@FmFileDialog@@AAEXPAVHbAction@@@Z @ 19 NONAME ; void FmFileDialog::dialogClosed(class HbAction *) - ?setSecondaryAction@FmFileDialog@@AAEXPAVHbAction@@@Z @ 20 NONAME ; void FmFileDialog::setSecondaryAction(class HbAction *) - ?secondaryAction@FmFileDialog@@ABEPAVHbAction@@XZ @ 21 NONAME ; class HbAction * FmFileDialog::secondaryAction(void) const - ?setPrimaryAction@FmFileDialog@@AAEXPAVHbAction@@@Z @ 22 NONAME ; void FmFileDialog::setPrimaryAction(class HbAction *) - ?primaryAction@FmFileDialog@@ABEPAVHbAction@@XZ @ 23 NONAME ; class HbAction * FmFileDialog::primaryAction(void) const - diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/eabi/fmbkupenginewrapperu.def --- a/filemanager/src/eabi/fmbkupenginewrapperu.def Wed Jun 23 18:03:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -EXPORTS - _ZN12FmBkupEngine11notifyStartEbi @ 1 NONAME - _ZN12FmBkupEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME - _ZN12FmBkupEngine11qt_metacastEPKc @ 3 NONAME - _ZN12FmBkupEngine11startBackupE5QListIP24FmBkupDrivesAndOperationES0_IP20FmBkupBackupCategoryE7QStringj @ 4 NONAME - _ZN12FmBkupEngine12cancelBackupEv @ 5 NONAME - _ZN12FmBkupEngine12deleteBackupE5QListIP24FmBkupDrivesAndOperationE @ 6 NONAME - _ZN12FmBkupEngine12notifyFinishEi @ 7 NONAME - _ZN12FmBkupEngine12notifyUpdateEi @ 8 NONAME - _ZN12FmBkupEngine12startRestoreE5QListIP24FmBkupDrivesAndOperationE @ 9 NONAME - _ZN12FmBkupEngine15BackupSettingsLEv @ 10 NONAME - _ZN12FmBkupEngine15notifyMemoryLowEiRi @ 11 NONAME - _ZN12FmBkupEngine15notifyPreparingEb @ 12 NONAME - _ZN12FmBkupEngine16RestoreSettingsLEv @ 13 NONAME - _ZN12FmBkupEngine16staticMetaObjectE @ 14 NONAME DATA 16 - _ZN12FmBkupEngine18getBackupDriveListER11QStringList @ 15 NONAME - _ZN12FmBkupEngine19GetRestoreInfoArrayER5QListIP24FmBkupDrivesAndOperationERS0_I13FmRestoreInfoERK7QString @ 16 NONAME - _ZN12FmBkupEngine19getStaticMetaObjectEv @ 17 NONAME - _ZN12FmBkupEngine22notifyBackupFilesExistERb @ 18 NONAME - _ZN12FmBkupEngineC1EP7QObject @ 19 NONAME - _ZN12FmBkupEngineC2EP7QObject @ 20 NONAME - _ZN12FmBkupEngineD0Ev @ 21 NONAME - _ZN12FmBkupEngineD1Ev @ 22 NONAME - _ZN12FmBkupEngineD2Ev @ 23 NONAME - _ZN16FmBackupSettings10setContentEj @ 24 NONAME - _ZN16FmBackupSettings10setWeekdayENS_25TFileManagerBackupWeekdayE @ 25 NONAME - _ZN16FmBackupSettings11CreateEntryERK7QStringS2_N13FmBackupEntry12TSettingTypeE @ 26 NONAME - _ZN16FmBackupSettings11refreshListEv @ 27 NONAME - _ZN16FmBackupSettings13setSchedulingENS_26TFileManagerBackupScheduleE @ 28 NONAME - _ZN16FmBackupSettings14setTargetDriveERK7QString @ 29 NONAME - _ZN16FmBackupSettings15backupEntryListEv @ 30 NONAME - _ZN16FmBackupSettings15contentToStringEj @ 31 NONAME - _ZN16FmBackupSettings15createTimeEntryEv @ 32 NONAME - _ZN16FmBackupSettings15weekdayToStringENS_25TFileManagerBackupWeekdayE @ 33 NONAME - _ZN16FmBackupSettings16updateBackupDateEv @ 34 NONAME - _ZN16FmBackupSettings18createWeekdayEntryEv @ 35 NONAME - _ZN16FmBackupSettings18schedulingToStringENS_26TFileManagerBackupScheduleE @ 36 NONAME - _ZN16FmBackupSettings19createContentsEntryEv @ 37 NONAME - _ZN16FmBackupSettings19targetDriveToStringERK7QString @ 38 NONAME - _ZN16FmBackupSettings21createBackupDateEntryEv @ 39 NONAME - _ZN16FmBackupSettings21createSchedulingEntryEv @ 40 NONAME - _ZN16FmBackupSettings22createTargetDriveEntryEv @ 41 NONAME - _ZN16FmBackupSettings26resetAndDestoryBackupEntryEv @ 42 NONAME - _ZN16FmBackupSettings4loadEv @ 43 NONAME - _ZN16FmBackupSettings4saveEv @ 44 NONAME - _ZN16FmBackupSettings7setTimeERK5QTime @ 45 NONAME - _ZN16FmBackupSettingsC1EP12FmBkupEngine @ 46 NONAME - _ZN16FmBackupSettingsC2EP12FmBkupEngine @ 47 NONAME - _ZN16FmBackupSettingsD1Ev @ 48 NONAME - _ZN16FmBackupSettingsD2Ev @ 49 NONAME - _ZN17FmRestoreSettings11CreateEntryERK13FmRestoreInfo @ 50 NONAME - _ZN17FmRestoreSettings11refreshListER5QListIP24FmBkupDrivesAndOperationE @ 51 NONAME - _ZN17FmRestoreSettings12SetSelectionERKy @ 52 NONAME - _ZN17FmRestoreSettings16restoreEntryListEv @ 53 NONAME - _ZN17FmRestoreSettings27resetAndDestoryRestoreEntryEv @ 54 NONAME - _ZN17FmRestoreSettings4loadE5QListIP24FmBkupDrivesAndOperationE @ 55 NONAME - _ZN17FmRestoreSettingsC1ER12FmBkupEngine @ 56 NONAME - _ZN17FmRestoreSettingsC2ER12FmBkupEngine @ 57 NONAME - _ZN17FmRestoreSettingsD1Ev @ 58 NONAME - _ZN17FmRestoreSettingsD2Ev @ 59 NONAME - _ZNK12FmBkupEngine10metaObjectEv @ 60 NONAME - _ZNK12FmBkupEngine5errorEv @ 61 NONAME - _ZNK16FmBackupSettings10schedulingEv @ 62 NONAME - _ZNK16FmBackupSettings11targetDriveEv @ 63 NONAME - _ZNK16FmBackupSettings16contentsSelectedEv @ 64 NONAME - _ZNK16FmBackupSettings20availableTargetDriveEv @ 65 NONAME - _ZNK16FmBackupSettings4timeEv @ 66 NONAME - _ZNK16FmBackupSettings7contentEv @ 67 NONAME - _ZNK16FmBackupSettings7weekdayEv @ 68 NONAME - _ZNK17FmRestoreSettings13GetSelectionLER5QListI13FmRestoreInfoE @ 69 NONAME - _ZTI12FmBkupEngine @ 70 NONAME - _ZTV12FmBkupEngine @ 71 NONAME - diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/eabi/fmfiledialogu.def --- a/filemanager/src/eabi/fmfiledialogu.def Wed Jun 23 18:03:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -EXPORTS - _ZN12FmFileDialog11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME - _ZN12FmFileDialog11qt_metacastEPKc @ 2 NONAME - _ZN12FmFileDialog15getOpenFileNameEP8HbWidgetRK7QStringS4_RK11QStringList6QFlagsINS_6OptionEE @ 3 NONAME - _ZN12FmFileDialog15getSaveFileNameEP8HbWidgetRK7QStringS4_RK11QStringList6QFlagsINS_6OptionEE @ 4 NONAME - _ZN12FmFileDialog16staticMetaObjectE @ 5 NONAME DATA 16 - _ZN12FmFileDialog19getStaticMetaObjectEv @ 6 NONAME - _ZN12FmFileDialog20getExistingDirectoryEP8HbWidgetRK7QStringS4_RK11QStringList6QFlagsINS_6OptionEE @ 7 NONAME - _ZN12FmFileDialog4execEv @ 8 NONAME - _ZN12FmFileDialogC1EP13QGraphicsItem @ 9 NONAME - _ZN12FmFileDialogC2EP13QGraphicsItem @ 10 NONAME - _ZN12FmFileDialogD0Ev @ 11 NONAME - _ZN12FmFileDialogD1Ev @ 12 NONAME - _ZN12FmFileDialogD2Ev @ 13 NONAME - _ZNK12FmFileDialog10metaObjectEv @ 14 NONAME - _ZTI12FmFileDialog @ 15 NONAME - _ZTV12FmFileDialog @ 16 NONAME - _ZThn16_N12FmFileDialogD0Ev @ 17 NONAME - _ZThn16_N12FmFileDialogD1Ev @ 18 NONAME - _ZThn8_N12FmFileDialogD0Ev @ 19 NONAME - _ZThn8_N12FmFileDialogD1Ev @ 20 NONAME - _ZN12FmFileDialog12dialogClosedEP8HbAction @ 21 NONAME - _ZN12FmFileDialog16setPrimaryActionEP8HbAction @ 22 NONAME - _ZN12FmFileDialog18setSecondaryActionEP8HbAction @ 23 NONAME - _ZNK12FmFileDialog13primaryActionEv @ 24 NONAME - _ZNK12FmFileDialog15secondaryActionEv @ 25 NONAME - diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/burconfig.xml --- a/filemanager/src/filemanager/burconfig.xml Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/burconfig.xml Tue Jul 06 14:06:28 2010 +0300 @@ -51,6 +51,8 @@ 0x1000484b 0x100058db 0x100058eb + 0x2001FE79 + 0x2002A542 0x10003a73 0x101f4cce 0x10003a5b @@ -73,6 +75,8 @@ 0x1000484b 0x100058db 0x100058eb + 0x2001FE79 + 0x2002A542 diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/filemanager.pri --- a/filemanager/src/filemanager/filemanager.pri Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/filemanager.pri Tue Jul 06 14:06:28 2010 +0300 @@ -52,7 +52,6 @@ src/components/fmcombinedquery.h \ src/components/fmdlgutils.h \ src/components/fmtimequery.h \ - src/components/fmdatalistmodel.h \ src/components/fmsingletextquery.h \ src/components/fmmultitextquery.h \ src/components/fmviewdetailsdialog.h \ @@ -95,7 +94,6 @@ src/components/fmcombinedquery.cpp \ src/components/fmdlgutils.cpp \ src/components/fmtimequery.cpp \ - src/components/fmdatalistmodel.cpp \ src/components/fmsingletextquery.cpp \ src/components/fmmultitextquery.cpp \ src/components/fmviewdetailsdialog.cpp \ diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/filemanager.pro --- a/filemanager/src/filemanager/filemanager.pro Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/filemanager.pro Tue Jul 06 14:06:28 2010 +0300 @@ -18,6 +18,7 @@ CONFIG += hb TEMPLATE = app TARGET = filemngr +ICON = resources/qtg_large_filemgr.svg RESOURCES += filemanager.qrc INCLUDEPATH += ../fmbkupenginewrapper/inc # remove this path when export plat header to app layer path @@ -32,7 +33,7 @@ LIBS += -lfmfiledialog symbian { - + SKINICON = qtg_large_filemgr LIBS += -lplatformenv \ -lapmime \ -lxqservice \ diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/resources/qtg_large_filemgr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/filemanager/src/filemanager/resources/qtg_large_filemgr.svg Tue Jul 06 14:06:28 2010 +0300 @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/backuprestore/fmbackupview.cpp --- a/filemanager/src/filemanager/src/backuprestore/fmbackupview.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/backuprestore/fmbackupview.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -31,7 +31,7 @@ FmBackupView::FmBackupView() : FmViewBase( EBackupView ) { - setTitle( tr( "Backup" ) ); + setTitle( hbTrId( "Backup" ) ); initToolBar(); initMainWidget(); diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/backuprestore/fmbackupwidget.cpp --- a/filemanager/src/filemanager/src/backuprestore/fmbackupwidget.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/backuprestore/fmbackupwidget.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -147,7 +147,7 @@ void FmBackupWidget::initModel() { mContentsGroup = mModel->appendDataFormGroup( - QString( tr( "Contents" ) ), mModel->invisibleRootItem()); + QString( hbTrId( "Contents" ) ), mModel->invisibleRootItem()); mContentsItem = mModel->appendDataFormItem( HbDataFormModelItem::TextItem, QString( "" ), mContentsGroup ); @@ -158,7 +158,7 @@ mTargetItem->setContentWidgetData( QString("readOnly"), QString("true") ); mSchedulingGroup = mModel->appendDataFormGroup( - QString( tr( "Scheduling" ) ), mModel->invisibleRootItem()); + QString( hbTrId( "Scheduling" ) ), mModel->invisibleRootItem()); mSchedulingItem = mModel->appendDataFormItem( HbDataFormModelItem::TextItem, QString( "" ), mSchedulingGroup ); @@ -271,12 +271,10 @@ expandAllGroup(); } - - void FmBackupWidget::on_changeContents() { - QString title = constFileManagerBackupSettingsTitleContents; + QString title = mContentsItem->label(); QStringList queryStringList; quint32 contentMask = FmBackupSettings::EFileManagerBackupContentAll; while ( contentMask <= FmBackupSettings::EFileManagerBackupContentLast) @@ -296,7 +294,7 @@ void FmBackupWidget::on_changeScheduling() { - QString title = constFileManagerBackupSettingsTitleScheduling; + QString title = mSchedulingItem->label(); QStringList queryStringList; FmBackupSettings::TFileManagerBackupSchedule schedule = FmBackupSettings::EFileManagerBackupScheduleNever; @@ -318,7 +316,7 @@ void FmBackupWidget::on_changeWeekday() { - QString title = constFileManagerBackupSettingsTitleWeekday; + QString title = mWeekdayItem->label(); QStringList queryStringList; FmBackupSettings::TFileManagerBackupWeekday weekday = FmBackupSettings::EFileManagerBackupWeekdayMonday; @@ -340,7 +338,7 @@ void FmBackupWidget::on_changeTime() { - QString title = constFileManagerBackupSettingsTitleTime; + QString title = mTimeItem->label(); QTime queryTime = mBackupSettings->time(); if( FmDlgUtils::showTimeSettingQuery( title, queryTime ) ) @@ -353,10 +351,10 @@ void FmBackupWidget::on_changeTargetDrive() { - QString title = constFileManagerBackupSettingsTitleTargetDrive; + QString title = mTargetItem->label(); QString drive = FmDlgUtils::showBackupDriveQuery( title ); - if( !drive.isEmpty() && - mBackupSettings->targetDrive().compare( drive, Qt::CaseInsensitive ) != 0 ) { + if( ( !drive.isEmpty() ) && + ( mBackupSettings->targetDrive().compare( drive, Qt::CaseInsensitive ) != 0 ) ) { mBackupSettings->setTargetDrive( drive ); emit doModelRefresh(); } diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/backuprestore/fmdeletebackupview.cpp --- a/filemanager/src/filemanager/src/backuprestore/fmdeletebackupview.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/backuprestore/fmdeletebackupview.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -93,11 +93,6 @@ toolBar()->addAction( mLeftAction ); mLeftAction->setEnabled(false); toolBar()->setOrientation( Qt::Horizontal ); - - //action = new HbAction( this ); - //action->setObjectName( "rightAction" ); - //action->setText( tr( "" ) ); - //toolBar()->addAction( action ); } void FmDeleteBackupView::on_leftAction_triggered() @@ -120,7 +115,7 @@ void FmDeleteBackupView::on_deleteAction_triggered() { QList items = mDeleteBackupWidget->selectionIndexes(); - if( items.count() <= 0 || !FmDlgUtils::question( tr("Confirm Deletion?" ) ) ){ + if( items.count() <= 0 || !FmDlgUtils::question( hbTrId("Confirm Deletion?" ) ) ){ return; } diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/backuprestore/fmrestoreview.cpp --- a/filemanager/src/filemanager/src/backuprestore/fmrestoreview.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/backuprestore/fmrestoreview.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -103,7 +103,7 @@ FmDlgUtils::information( QString( hbTrId("Operation canceled because already started!") ) ); break; default: - FmDlgUtils::information(tr("restore failed")); + FmDlgUtils::information(hbTrId("restore failed")); break; } } diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/backuprestore/fmrestoreviewitem.cpp --- a/filemanager/src/filemanager/src/backuprestore/fmrestoreviewitem.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/backuprestore/fmrestoreviewitem.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -73,11 +73,7 @@ if (stringList.size() > 1) { QIcon icon = mIconProvider->icon(QFileInfo(stringList.at(2))); - if (icon.isNull()) - { - QFileIconProvider fileIconProvider; - icon = fileIconProvider.icon(QFileIconProvider::Drive); - } + // FmFileIconProvider already handle null icon issue mIconLabel->setIcon(HbIcon(icon)); } diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/backuprestore/fmrestorewidget.cpp --- a/filemanager/src/filemanager/src/backuprestore/fmrestorewidget.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/backuprestore/fmrestorewidget.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -17,6 +17,7 @@ */ #include "fmrestorewidget.h" #include "fmrestoresettings.h" +#include "fmbackupsettings.h" #include "fmrestoreviewitem.h" #include "fmoperationservice.h" #include "fmviewmanager.h" @@ -75,6 +76,9 @@ mListView->setModel( mModel ); mRestoreSettings = FmViewManager::viewManager()->operationService()->backupRestoreHandler()->bkupEngine()->RestoreSettingsL(); mBackupConfigLoader = FmViewManager::viewManager()->operationService()->backupRestoreHandler()->backupConfigLoader(); + + // load backup settings to refresh default target drive + FmViewManager::viewManager()->operationService()->backupRestoreHandler()->bkupEngine()->BackupSettingsL()->load(); mRestoreSettings->load( mBackupConfigLoader->driversAndOperationList() ); int index = 0; diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/components/fmdatalistmodel.cpp --- a/filemanager/src/filemanager/src/components/fmdatalistmodel.cpp Wed Jun 23 18:03:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +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 data list model of file manager - */ - -#include "fmdatalistmodel.h" - - -FmDataListModel::FmDataListModel( QObject *parent ) - : QAbstractListModel( parent ) -{ -} - -int FmDataListModel::rowCount( const QModelIndex &parent ) const -{ - if (parent.isValid()) - return 0; - - return mDisplayLst.count(); -} - -QVariant FmDataListModel::data( const QModelIndex &index, int role ) const -{ - if ( index.row() < 0 || index.row() >= mDisplayLst.size() ) - return QVariant(); - - if ( role == Qt::DisplayRole || role == Qt::EditRole ) - return mDisplayLst.at( index.row() ); - - if ( role == Qt::UserRole ) - return mUserDataLst.at( index.row() ); - - return QVariant(); -} - -Qt::ItemFlags FmDataListModel::flags( const QModelIndex &index ) const -{ - if ( !index.isValid() ) - return QAbstractItemModel::flags( index ) | Qt::ItemIsDropEnabled; - - return QAbstractItemModel::flags( index ) | Qt::ItemIsEditable; -} - -bool FmDataListModel::setData( const QModelIndex &index, const QVariant &value, int role ) -{ - if ( index.row() >= 0 && index.row() < mDisplayLst.size() - && ( role == Qt::EditRole || role == Qt::DisplayRole ) ){ - mDisplayLst.replace( index.row(), value.toString() ); - emit dataChanged( index, index ); - return true; - } - - if ( index.row() >= 0 && index.row() < mUserDataLst.size() - && ( role == Qt::UserRole ) ) { - mUserDataLst.replace( index.row(), value.toString() ); - emit dataChanged( index, index ); - return true; - } - return false; -} - -bool FmDataListModel::insertRows( int row, int count, const QModelIndex &parent ) -{ - if ( count < 1 || row < 0 || row > rowCount( parent ) ) - return false; - - beginInsertRows( QModelIndex(), row, row + count - 1 ); - - for ( int r = 0; r < count; ++r ) - { - mDisplayLst.insert( row, QString() ); - mUserDataLst.insert( row, QString() ); - } - - endInsertRows(); - - return true; -} - -bool FmDataListModel::removeRows( int row, int count, const QModelIndex &parent ) -{ - if ( count <= 0 || row < 0 || ( row + count ) > rowCount( parent ) ) - return false; - - beginRemoveRows( QModelIndex(), row, row + count - 1 ); - - for ( int r = 0; r < count; ++r ) - { - mDisplayLst.removeAt( row ); - mUserDataLst.removeAt( row ); - } - - endRemoveRows(); - return true; -} diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/components/fmdatalistmodel.h --- a/filemanager/src/filemanager/src/components/fmdatalistmodel.h Wed Jun 23 18:03:11 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +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 data list model of file manager - */ - -#ifndef FMDATALISTMODEL_H -#define FMDATALISTMODEL_H - -#include "fmcommon.h" - -#include -#include - -class FmDataListModel : public QAbstractListModel -{ - Q_OBJECT -public: - FmDataListModel(QObject *parent = 0); - - /** - * Return row count - * @param parent ModelIndex - * @return row count - */ - int rowCount(const QModelIndex &parent = QModelIndex()) const; - - /** - * Return data of designated role - * @param index ModelIndex - * @param role role of data, DisplayRole for show and UserRole for data - * @return data - */ - QVariant data(const QModelIndex &index, int role) const; - - /** - * Set data of designated role - * @param index ModelIndex - * @param role role of data, DisplayRole for show and UserRole for data - * @return if operation succeed - */ - bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::DisplayRole); - - /** - * Get flags - * @param index ModelIndex - * @return flags - */ - Qt::ItemFlags flags(const QModelIndex &index) const; - - /** - * Insert count rows into the model before the given row. - * @param row the given row, - * @param count count of rows - * @param parent parent ModelIndex - * @return if operation succeed - */ - bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()); - - /** - * Remove count rows from the model at the given row. - * @param row the given row, - * @param count count of rows - * @param parent parent ModelIndex - * @return if operation succeed - */ - bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); - -private: - QStringList mDisplayLst; - QStringList mUserDataLst; -}; - -#endif // FMDATALISTMODEL_H diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/components/fmdlgutils.cpp --- a/filemanager/src/filemanager/src/components/fmdlgutils.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/components/fmdlgutils.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -83,8 +83,8 @@ cQuery->setMarkedListItem( selectedIndex ); } - QString sk1 ( tr ( "ok" ) ); - QString sk2 ( tr ("cancel" ) ); + QString sk1 ( hbTrId( "txt_common_button_ok" ) ); + QString sk2 ( hbTrId("txt_common_button_cancel" ) ); if( !sk1.isEmpty() ) { HbAction *primary = new HbAction( sk1 ); @@ -159,8 +159,8 @@ } - QString sk1 ( hbTrId( "ok" ) ); - QString sk2 ( hbTrId( "cancel" ) ); + QString sk1 ( hbTrId( "txt_common_button_ok" ) ); + QString sk2 ( hbTrId( "txt_common_button_cancel" ) ); if( !sk1.isEmpty() ) { HbAction *primary = new HbAction( sk1 ); @@ -213,8 +213,8 @@ cQuery->setHeadingWidget( new HbLabel( title ) ); cQuery->setTime( time ); - QString sk1 ( hbTrId( "ok" ) ); - QString sk2 ( hbTrId( "cancel" ) ); + QString sk1 ( hbTrId( "txt_common_button_ok" ) ); + QString sk2 ( hbTrId( "txt_common_button_cancel" ) ); if( !sk1.isEmpty() ) { HbAction *primary = new HbAction( sk1 ); @@ -262,8 +262,8 @@ } cQuery->setHeadingWidget( new HbLabel( title ) ); - QString sk1 ( hbTrId ( "ok" ) ); - QString sk2 ( hbTrId ( "cancel" ) ); + QString sk1 ( hbTrId ( "txt_common_button_ok" ) ); + QString sk2 ( hbTrId ( "txt_common_button_cancel" ) ); if( !sk1.isEmpty() ) { HbAction *primary = new HbAction( sk1 ); @@ -314,8 +314,8 @@ } cQuery->setHeadingWidget( new HbLabel( title ) ); - QString sk1 ( tr ("ok" ) ); - QString sk2 ( tr ("cancel" ) ); + QString sk1 ( hbTrId("txt_common_button_ok" ) ); + QString sk2 ( hbTrId("txt_common_button_cancel" ) ); if( !sk1.isEmpty() ) { HbAction *primary = new HbAction( sk1 ); @@ -353,8 +353,8 @@ cQuery->setFirstLabelText( firstLabel ); cQuery->setSecondLabelText( secondLabel ); - QString sk1 = ( hbTrId( "ok" ) ); - QString sk2 = ( hbTrId( "cancel" ) ); + QString sk1 = ( hbTrId( "txt_common_button_ok" ) ); + QString sk2 = ( hbTrId( "txt_common_button_cancel" ) ); if( !sk1.isEmpty() ) { HbAction *primary = new HbAction( sk1 ); @@ -404,7 +404,7 @@ FmDriveQuery *cQuery = new FmDriveQuery(); cQuery->setHeadingWidget( new HbLabel( title ) ); - QString sk = ( hbTrId( "cancel" ) ); + QString sk = ( hbTrId( "txt_common_button_cancel" ) ); HbAction *primary = new HbAction( sk ); cQuery->setPrimaryAction( primary ); diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/components/fmdlgutils.h --- a/filemanager/src/filemanager/src/components/fmdlgutils.h Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/components/fmdlgutils.h Tue Jul 06 14:06:28 2010 +0300 @@ -25,6 +25,8 @@ #include #include +#include + class FmDialog; class HbAction; @@ -86,8 +88,8 @@ const QString &firstLabel, const QString &secondLabel, QString &pwd, int maxLength = -1, const QString &associatedDrives = QString() ); - static bool question( const QString &questionText, const QString &primaryButtonText = tr("Yes"), - const QString &secondaryButtonText = tr("No") ); + static bool question( const QString &questionText, const QString &primaryButtonText = QString( hbTrId("Yes") ), + const QString &secondaryButtonText = QString( hbTrId("No") ) ); static void information( const QString &informationText ); diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/components/fmdrivedetailstype.cpp --- a/filemanager/src/filemanager/src/components/fmdrivedetailstype.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/components/fmdrivedetailstype.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -44,7 +44,8 @@ typeFilters.append( QString( "*.ico" ) ); typeFilters.append( QString( "*.vcf" ) ); - dataGroupList.append( new FmDriveDetailsDataGroup( FmDriveDetailsDataGroup::EGroupImages, typeFilters )); + dataGroupList.append( new FmDriveDetailsDataGroup( FmDriveDetailsDataGroup::EGroupImages, + typeFilters, FmDriveDetailsDataGroup::EDataRecognizeExtName )); typeFilters.clear(); typeFilters.append( QString( "*.aac" ) ); @@ -64,19 +65,22 @@ typeFilters.append( QString( "*.ott" ) ); typeFilters.append( QString( "*.mxmf" ) ); - dataGroupList.append( new FmDriveDetailsDataGroup( FmDriveDetailsDataGroup::EGroupSoundFiles, typeFilters )); + dataGroupList.append( new FmDriveDetailsDataGroup( FmDriveDetailsDataGroup::EGroupSoundFiles, + typeFilters, FmDriveDetailsDataGroup::EDataRecognizeExtName )); typeFilters.clear(); typeFilters.append( QString( "*.jad" ) ); typeFilters.append( QString( "*.jar" ) ); - dataGroupList.append( new FmDriveDetailsDataGroup( FmDriveDetailsDataGroup::EGroupMidpJava, typeFilters )); + dataGroupList.append( new FmDriveDetailsDataGroup( FmDriveDetailsDataGroup::EGroupMidpJava, + typeFilters, FmDriveDetailsDataGroup::EDataRecognizeExtName )); typeFilters.clear(); typeFilters.append( QString( "*.sis" ) ); typeFilters.append( QString( "*.sisx" ) ); - dataGroupList.append( new FmDriveDetailsDataGroup( FmDriveDetailsDataGroup::EGroupNativeApps, typeFilters )); + dataGroupList.append( new FmDriveDetailsDataGroup( FmDriveDetailsDataGroup::EGroupNativeApps, + typeFilters, FmDriveDetailsDataGroup::EDataRecognizeExtName )); typeFilters.clear(); typeFilters.append( QString( "*.3gp" ) ); @@ -89,7 +93,8 @@ typeFilters.append( QString( "*.rmvb") ); typeFilters.append( QString( "*.mkv" ) ); - dataGroupList.append( new FmDriveDetailsDataGroup( FmDriveDetailsDataGroup::EGroupVideos, typeFilters )); + dataGroupList.append( new FmDriveDetailsDataGroup( FmDriveDetailsDataGroup::EGroupVideos, + typeFilters, FmDriveDetailsDataGroup::EDataRecognizeExtName )); typeFilters.clear(); typeFilters.append( QString( "*.doc" ) ); @@ -99,22 +104,63 @@ typeFilters.append( QString( "*.txt" ) ); typeFilters.append( QString( "*.xls" ) ); - dataGroupList.append( new FmDriveDetailsDataGroup( FmDriveDetailsDataGroup::EGroupDocuments, typeFilters )); + dataGroupList.append( new FmDriveDetailsDataGroup( FmDriveDetailsDataGroup::EGroupDocuments, + typeFilters, FmDriveDetailsDataGroup::EDataRecognizeExtName )); typeFilters.clear(); typeFilters.append( QString( "*.vcs" ) ); - dataGroupList.append( new FmDriveDetailsDataGroup( FmDriveDetailsDataGroup::EGroupCalendar, typeFilters )); + dataGroupList.append( new FmDriveDetailsDataGroup( FmDriveDetailsDataGroup::EGroupCalendar, + typeFilters, FmDriveDetailsDataGroup::EDataRecognizeExtName )); + // Add absolute path and use EDataRecognizeAbsolutePath method for Contacts + typeFilters.clear(); + typeFilters.append( QString( FmViewDetail_Contacts ) ); + dataGroupList.append( new FmDriveDetailsDataGroup( FmDriveDetailsDataGroup::EGroupContacts, + typeFilters, FmDriveDetailsDataGroup::EDataRecognizeAbsolutePath )); return dataGroupList; } int FmDriveDetailsContent::querySizeofContent( const QString &driveName, QList &detailsSizeList, volatile bool *isStopped ) -{ - quint64 totalSize = 0; - +{ + int err = FmErrNone; + QList< FmDriveDetailsDataGroup* > dataGroupList = queryDetailsContent(); + detailsSizeList.clear(); + for( QList< FmDriveDetailsDataGroup* >::iterator it = dataGroupList.begin(); + it!= dataGroupList.end(); ++it ) { + if ( *isStopped ){ + return FmErrCancel; + } + FmDriveDetailsDataGroup* driveDetailsDataGroup = *it; + + switch( (*it)->dataRecognizeType() ) + { + case FmDriveDetailsDataGroup::EDataRecognizeExtName: + err = getDataSizeByExtName(driveName, driveDetailsDataGroup, detailsSizeList, isStopped) ; + break; + case FmDriveDetailsDataGroup::EDataRecognizeAbsolutePath: + err = getDataSizeByAbsolutePath(driveName, driveDetailsDataGroup, detailsSizeList, isStopped); + break; + default: + Q_ASSERT_X( false, "querySizeofContent", "please handle all recognize methods "); + break; + } + + // return if error occur. + if( err != FmErrNone ) { + return err; + } + } + return FmErrNone; +} + +int FmDriveDetailsContent::getDataSizeByExtName( const QString &driveName, + const FmDriveDetailsDataGroup* const dataGroup, + QList &detailsSizeList, volatile bool *isStopped ) +{ + quint64 totalSize = 0; QString path; path.clear(); @@ -123,54 +169,57 @@ } else{ path = driveName; - } - - QList< FmDriveDetailsDataGroup* > dataGroupList = queryDetailsContent(); + } + QStringList typeFilter = dataGroup->typeFilters(); + QList dirs; + dirs.append( QDir( path ) ); + while (!dirs.isEmpty()) { + QFileInfoList infoList = dirs.first().entryInfoList( QDir::NoDotAndDotDot | QDir::AllEntries ); + QFileInfoList filterInforList = dirs.first().entryInfoList( typeFilter, QDir::NoDotAndDotDot | QDir::Files ); + + for ( QFileInfoList::Iterator it = filterInforList.begin(); it != filterInforList.end(); ++it ) { + if ( *isStopped ){ + return FmErrCancel; + } + if ( it->isFile() ) { + totalSize += it->size(); + } + } + for ( QFileInfoList::Iterator it = infoList.begin(); it != infoList.end(); ++it ) { + if ( *isStopped ){ + return FmErrCancel; + } + if ( it->isDir() ) { + dirs.append( QDir( it->absoluteFilePath() ) ); + } + } + dirs.removeFirst(); + } + detailsSizeList.append( new FmDriveDetailsSize( dataGroup->dataGroups(), totalSize ) ); + return FmErrNone; + +} + +int FmDriveDetailsContent::getDataSizeByAbsolutePath( const QString &driveName, + const FmDriveDetailsDataGroup* const dataGroup, + QList &detailsSizeList, volatile bool *isStopped ) +{ + quint64 totalSize = 0; + QStringList typeFilter = dataGroup->typeFilters(); - QStringList typeFilter; - detailsSizeList.clear(); - QDir dir( path ); - - for( QList< FmDriveDetailsDataGroup* >::iterator it = dataGroupList.begin(); - it!= dataGroupList.end(); ++it ){ + for( QStringList::iterator it = typeFilter.begin(); + it!= typeFilter.end(); ++it ) { if ( *isStopped ){ return FmErrCancel; + } + QString driver(FmUtils::removePathSplash(FmUtils::getDriveNameFromPath(driveName))); + QFileInfo fileInfo(QString(driver + (*it))); + if (fileInfo.exists()) { + totalSize += fileInfo.size(); } - totalSize = 0; - typeFilter = ( *it )->typeFilters(); - - QList dirs; - dirs.append( QDir( path ) ); - - while (!dirs.isEmpty()) { - QFileInfoList infoList = dirs.first().entryInfoList( QDir::NoDotAndDotDot | QDir::AllEntries ); - QFileInfoList filterInforList = dirs.first().entryInfoList( typeFilter, QDir::NoDotAndDotDot | QDir::Files ); - - for ( QFileInfoList::Iterator it = filterInforList.begin(); it != filterInforList.end(); ++it ) { - if ( *isStopped ){ - return FmErrCancel; - } - - if ( it->isFile() ) { - totalSize += it->size(); - } - } - - for ( QFileInfoList::Iterator it = infoList.begin(); it != infoList.end(); ++it ) { - if ( *isStopped ){ - return FmErrCancel; - } - - if ( it->isDir() ) { - dirs.append( QDir( it->absoluteFilePath() ) ); - } - } - - dirs.removeFirst(); - } - - detailsSizeList.append( new FmDriveDetailsSize( ( *it )->dataGroups(), totalSize ) ); } + + detailsSizeList.append( new FmDriveDetailsSize( dataGroup->dataGroups(), totalSize ) ); return FmErrNone; } diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/components/fmdrivedetailstype.h --- a/filemanager/src/filemanager/src/components/fmdrivedetailstype.h Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/components/fmdrivedetailstype.h Tue Jul 06 14:06:28 2010 +0300 @@ -26,6 +26,12 @@ class FmDriveDetailsDataGroup { public: + // used to identify recognize method + enum TDataRecognizeType{ + EDataRecognizeExtName = 0, // recognize data by extension of filename + EDataRecognizeAbsolutePath // recognize data by ablsolute file path + }; + enum TDataGroups{ EGroupImages = 0, EGroupSoundFiles, @@ -40,8 +46,13 @@ }; public: - FmDriveDetailsDataGroup( TDataGroups dataGroups, QStringList typeFilters ) - : mDataGroups( dataGroups ), mTypeFilters( typeFilters ) {} + FmDriveDetailsDataGroup( TDataGroups dataGroups, + QStringList typeFilters, + TDataRecognizeType recognizeType ) + : mDataGroups( dataGroups ), mTypeFilters( typeFilters ), + mDataRecognizeType( recognizeType ) + { + } FmDriveDetailsDataGroup( const FmDriveDetailsDataGroup &other ) { *this = other; @@ -56,10 +67,12 @@ TDataGroups dataGroups() const { return mDataGroups; } QStringList typeFilters() const { return mTypeFilters; } + TDataRecognizeType dataRecognizeType() const { return mDataRecognizeType; } private: TDataGroups mDataGroups; QStringList mTypeFilters; + TDataRecognizeType mDataRecognizeType; }; class FmDriveDetailsSize @@ -93,7 +106,27 @@ static QList queryDetailsContent(); static int querySizeofContent( const QString &driveName, QList &detailsSizeList, volatile bool *isStopped ); - + /** + * Gets data size for single FmDriveDetailsDataGroup, the method is scan files for extension. + * @param driveName which drive is searching + * @param dataGroup which dataGroup is searching, for example, EGroupImages, EGroupSoundFiles... + * @param detailsSizeList if got result, new FmDriveDetailsSize will be appended to detailsSizeList + * @param isStopped isStopped will be set as true if user cancel this operation + * @return Filemanage wide error. Please refer to fmdefine.h + */ + static int getDataSizeByExtName( const QString &driveName, const FmDriveDetailsDataGroup* const dataGroup, + QList &detailsSizeList, volatile bool *isStopped ); + + /** + * Gets data size for single FmDriveDetailsDataGroup, the method is find file of absolute path + * @param driveName which drive is searching + * @param dataGroup which dataGroup is searching, for example, EGroupContacts... + * @param detailsSizeList if got result, new FmDriveDetailsSize will be appended to detailsSizeList + * @param isStopped isStopped will be set as true if user cancel this operation + * @return Filemanage wide error. Please refer to fmdefine.h + */ + static int getDataSizeByAbsolutePath( const QString &driveName, const FmDriveDetailsDataGroup* const dataGroup, + QList &detailsSizeList, volatile bool *isStopped ); }; class FmFolderDetails diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/components/fmdrivequery.cpp --- a/filemanager/src/filemanager/src/components/fmdrivequery.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/components/fmdrivequery.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -54,7 +54,8 @@ FmDriveQuery::~FmDriveQuery(void) { - + delete mDriveModel; + mDriveModel = 0; } void FmDriveQuery::getDriveList( QStringList &driveList ) diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/components/fmviewdetailsdialog.cpp --- a/filemanager/src/filemanager/src/components/fmviewdetailsdialog.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/components/fmviewdetailsdialog.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -19,13 +19,14 @@ #include "fmviewdetailsdialog.h" #include "fmutils.h" #include "fmviewdetailsitem.h" -#include "fmdatalistmodel.h" #include "fmdrivedetailstype.h" #include "fmviewmanager.h" -#include #include #include +#include +#include +#include #include #include @@ -42,7 +43,8 @@ mSizeofJava( 0 ), mSizeofNativeFiles( 0 ), mSizeofDocument( 0 ), - mSizeofCalendar( 0 ) + mSizeofCalendar( 0 ), + mSizeofContacts( 0 ) { init(); @@ -55,11 +57,6 @@ mListView->setModel( 0 ); delete mListView; } - - if( mDirModel ){ - delete mDirModel; - } - } void FmViewDetailsDialog::init() @@ -70,20 +67,20 @@ mListView = new HbListView( this ); setContentWidget( mListView ); - mDataListModel = new FmDataListModel(); + // init QStardardItemModel as 0 row and 1 column + mDataListModel = new QStandardItemModel( 0, 1 ); mListView->setModel( mDataListModel ); - mListView->setItemPrototype( new FmViewDetailsItem( this ) ); + mListView->listItemPrototype()->setStretchingStyle(HbListViewItem::StretchLandscape); mOkAction = new HbAction( this ); - mOkAction->setText( tr("ok") ); + mOkAction->setText( hbTrId("txt_common_button_ok") ); setPrimaryAction( mOkAction ); - - mDirModel = new QDirModel(); } void FmViewDetailsDialog::setDriveDetails( const QString &driverName ) { const QString dataDir = "C:\\data"; + QStringList dataList; mHeaderLabel->setPlainText( hbTrId( "txt_fmgr_title_memory_details" ) ); quint64 sizeOfOthers = 0; @@ -94,132 +91,85 @@ mDataListModel->removeRows( 0, mDataListModel->rowCount() ); mDataListModel->insertRows( 0, EDriveDetailEntryEnd ); - detailString.append( hbTrId ( "txt_fmgr_dblist_memory_name" ) ); - QVariant variant( detailString ); - mDataListModel->setData( mDataListModel->index( EMemoryName ), variant, Qt::DisplayRole ); - - detailString.clear(); - detailString.append( FmUtils::fillDriveVolume( driverInfo.name(), true ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EMemoryName ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "txt_fmgr_dblist_memory_name" ); + dataList << FmUtils::fillDriveVolume( driverInfo.name(), true ) ; + mDataListModel->setData( mDataListModel->index( EMemoryName, 0 ), dataList, Qt::DisplayRole ); - detailString.clear(); - detailString.append( hbTrId ( "txt_fmgr_dblist_size_memory" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EMemorySize ), variant, Qt::DisplayRole ); + dataList.clear(); + dataList << hbTrId ( "txt_fmgr_dblist_size_memory" ); + dataList << FmUtils::formatStorageSize( driverInfo.size() ) ; + mDataListModel->setData( mDataListModel->index( EMemorySize, 0 ), dataList, Qt::DisplayRole ); - detailString.clear(); - detailString.append( FmUtils::formatStorageSize( driverInfo.size() ) ); - variant = QVariant( detailString );; - mDataListModel->setData( mDataListModel->index( EMemorySize ), variant, Qt::UserRole ); - - detailString.clear(); - detailString.append( hbTrId ( "txt_fmgr_dblist_free_memory" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EMemoryFree ), variant, Qt::DisplayRole ); - - detailString.clear(); - detailString.append( FmUtils::formatStorageSize( driverInfo.freeSize() ) ); - variant = QVariant( detailString );; - mDataListModel->setData( mDataListModel->index( EMemoryFree ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "txt_fmgr_dblist_free_memory" ); + dataList << FmUtils::formatStorageSize( driverInfo.freeSize() ); + mDataListModel->setData( mDataListModel->index( EMemoryFree, 0 ), dataList, Qt::DisplayRole ); sizeOfOthers = driverInfo.size() - driverInfo.freeSize(); // getContentDetails( dataDir ); - detailString.clear(); - detailString.append( hbTrId ( "Images:" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EMemoryImages ), variant, Qt::DisplayRole ); - - detailString.clear(); - detailString.append( FmUtils::formatStorageSize( mSizeofImage ) ); - variant = QVariant( detailString );; - mDataListModel->setData( mDataListModel->index( EMemoryImages ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "Images:" ) ; + dataList << FmUtils::formatStorageSize( mSizeofImage ); + mDataListModel->setData( mDataListModel->index( EMemoryImages, 0 ), dataList, Qt::DisplayRole ); sizeOfOthers -= mSizeofImage; - detailString.clear(); - detailString.append( hbTrId ( "Sounds:" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EMemorySounds ), variant, Qt::DisplayRole ); - - detailString.clear(); - detailString.append( FmUtils::formatStorageSize( mSizeofSounds ) ); - variant = QVariant( detailString );; - mDataListModel->setData( mDataListModel->index( EMemorySounds ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "Sounds:" ); + dataList << FmUtils::formatStorageSize( mSizeofSounds ); + mDataListModel->setData( mDataListModel->index( EMemorySounds, 0 ), dataList, Qt::DisplayRole ); sizeOfOthers -= mSizeofSounds; - detailString.clear(); - detailString.append( hbTrId ( "Video:" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EMemoryVideos ), variant, Qt::DisplayRole ); - - detailString.clear(); - detailString.append( FmUtils::formatStorageSize( mSizeofVideo ) ); - variant = QVariant( detailString );; - mDataListModel->setData( mDataListModel->index( EMemoryVideos ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "Video:" ); + dataList << FmUtils::formatStorageSize( mSizeofVideo ); + mDataListModel->setData( mDataListModel->index( EMemoryVideos, 0 ), dataList, Qt::DisplayRole ); sizeOfOthers -= mSizeofVideo; - detailString.clear(); - detailString.append( hbTrId ( "Java Files:" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EMemoryMidpJava ), variant, Qt::DisplayRole ); - - detailString.clear(); - detailString.append( FmUtils::formatStorageSize( mSizeofJava ) ); - variant = QVariant( detailString );; - mDataListModel->setData( mDataListModel->index( EMemoryMidpJava ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "Java Files:" ); + dataList << FmUtils::formatStorageSize( mSizeofJava ); + mDataListModel->setData( mDataListModel->index( EMemoryMidpJava, 0 ), dataList, Qt::DisplayRole ); sizeOfOthers -= mSizeofJava; - detailString.clear(); - detailString.append( hbTrId ( "Sis files:" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EMemoryNativeApps ), variant, Qt::DisplayRole ); - - detailString.clear(); - detailString.append( FmUtils::formatStorageSize( mSizeofNativeFiles ) ); - variant = QVariant( detailString );; - mDataListModel->setData( mDataListModel->index( EMemoryNativeApps ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "Sis files:" ); + dataList << FmUtils::formatStorageSize( mSizeofNativeFiles ); + mDataListModel->setData( mDataListModel->index( EMemoryNativeApps, 0 ), dataList, Qt::DisplayRole ); sizeOfOthers -= mSizeofNativeFiles; - detailString.clear(); - detailString.append( hbTrId ( "Documents:" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EMemoryDocuments ), variant, Qt::DisplayRole ); - - detailString.clear(); - detailString.append( FmUtils::formatStorageSize( mSizeofDocument ) ); - variant = QVariant( detailString );; - mDataListModel->setData( mDataListModel->index( EMemoryDocuments ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "Documents:" ); + dataList << FmUtils::formatStorageSize( mSizeofDocument ); + mDataListModel->setData( mDataListModel->index( EMemoryDocuments, 0 ), dataList, Qt::DisplayRole ); sizeOfOthers -= mSizeofDocument; - detailString.clear(); - detailString.append( hbTrId ( "Calendars:" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EMemoryCalendar ), variant, Qt::DisplayRole ); - - detailString.clear(); - detailString.append( FmUtils::formatStorageSize( mSizeofCalendar ) ); - variant = QVariant( detailString );; - mDataListModel->setData( mDataListModel->index( EMemoryCalendar ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "Calendars:" ); + dataList << FmUtils::formatStorageSize( mSizeofCalendar ); + mDataListModel->setData( mDataListModel->index( EMemoryCalendar, 0 ), dataList, Qt::DisplayRole ); sizeOfOthers -= mSizeofCalendar; - detailString.clear(); - detailString.append( hbTrId ( "Others:" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EMemoryOthers ), variant, Qt::DisplayRole ); + dataList.clear(); + dataList << hbTrId ( "Contacts:" ); + dataList << FmUtils::formatStorageSize( mSizeofContacts ); + mDataListModel->setData( mDataListModel->index( EMemoryContacts, 0 ), dataList, Qt::DisplayRole ); - detailString.clear(); - detailString.append( FmUtils::formatStorageSize( sizeOfOthers ) ); - variant = QVariant( detailString );; - mDataListModel->setData( mDataListModel->index( EMemoryOthers ), variant, Qt::UserRole ); + sizeOfOthers -= mSizeofContacts; + + dataList.clear(); + dataList << hbTrId ( "Others:" ); + dataList << FmUtils::formatStorageSize( sizeOfOthers ); + mDataListModel->setData( mDataListModel->index( EMemoryOthers, 0 ), dataList, Qt::DisplayRole ); } void FmViewDetailsDialog::setFolderDetails( const QString &folderPath ) @@ -227,75 +177,44 @@ mHeaderLabel->setPlainText( hbTrId( "txt_fmgr_title_folder_details" ) ); QString detailString( "" ); - - QModelIndex modelIndex = mDirModel->index( folderPath ); - + QStringList dataList; + QFileInfo fileInfo( folderPath ); + mDataListModel->removeRows( 0, mDataListModel->rowCount() ); mDataListModel->insertRows( 0, EFolderDetailEntryEnd ); - detailString.append( hbTrId ( "txt_fmgr_dblist_name_folder" ) ); - QVariant variant( detailString ); - mDataListModel->setData( mDataListModel->index( EFolderName ), variant, Qt::DisplayRole ); + dataList << hbTrId ( "txt_fmgr_dblist_name_folder" ); + dataList << fileInfo.fileName(); + mDataListModel->setData( mDataListModel->index( EFolderName, 0 ), dataList, Qt::DisplayRole ); - detailString.clear(); - detailString.append( mDirModel->fileName( modelIndex ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EFolderName ), variant, Qt::UserRole ); - - QFileInfo fileInfo = mDirModel->fileInfo( mDirModel->index( folderPath ) ); QDateTime modifiedDateTime = fileInfo.lastModified (); QDate modifiedDate = modifiedDateTime.date(); QTime modifiedTime = modifiedDateTime.time(); - detailString.clear(); - detailString.append( hbTrId ( "txt_fmgr_dblist_date_folder" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EModifiedDate ), variant, Qt::DisplayRole ); - - detailString.clear(); - detailString.append( modifiedDate.toString() ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EModifiedDate ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "txt_fmgr_dblist_date_folder" ); + dataList << modifiedDate.toString(); + mDataListModel->setData( mDataListModel->index( EModifiedDate, 0 ), dataList, Qt::DisplayRole ); - detailString.clear(); - detailString.append( hbTrId ( "txt_fmgr_dblist_time_folder" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EModifiedTime ), variant, Qt::DisplayRole ); - - detailString.clear(); - detailString.append( modifiedTime.toString() ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EModifiedTime ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "txt_fmgr_dblist_time_folder" ); + dataList << modifiedTime.toString(); + mDataListModel->setData( mDataListModel->index( EModifiedTime, 0 ), dataList, Qt::DisplayRole ); - detailString.clear(); - detailString.append( hbTrId ( "txt_fmgr_dblist_size_folder" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EFolderSize ), variant, Qt::DisplayRole ); - - detailString.clear(); - detailString.append( FmUtils::formatStorageSize( mSizeofFolder ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EFolderSize ), variant, Qt::UserRole ); - - detailString.clear(); - detailString.append( hbTrId ( "txt_fmgr_dblist_subfolders" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( ENumofSubFolders ), variant, Qt::DisplayRole ); + dataList.clear(); + dataList << hbTrId ( "txt_fmgr_dblist_size_folder" ); + dataList << FmUtils::formatStorageSize( mSizeofFolder ); + mDataListModel->setData( mDataListModel->index( EFolderSize, 0 ), dataList, Qt::DisplayRole ); - detailString.clear(); - detailString = QString::number( mNumofSubFolers ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( ENumofSubFolders ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "txt_fmgr_dblist_subfolders" ); + dataList << QString::number( mNumofSubFolers ); + mDataListModel->setData( mDataListModel->index( ENumofSubFolders, 0 ), dataList, Qt::DisplayRole ); - detailString.clear(); - detailString.append( hbTrId ( "txt_fmgr_dblist_files" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( ENumofFiles ), variant, Qt::DisplayRole ); - - detailString.clear(); - detailString = QString::number( mNumofFiles ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( ENumofFiles ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "txt_fmgr_dblist_files" ); + dataList << QString::number( mNumofFiles ); + mDataListModel->setData( mDataListModel->index( ENumofFiles, 0 ), dataList, Qt::DisplayRole ); } void FmViewDetailsDialog::setFileDetails( const QString &filePath ) @@ -303,70 +222,47 @@ mHeaderLabel->setPlainText( hbTrId( "txt_fmgr_title_file_details") ); QString detailString( "" ); - - QModelIndex modelIndex = mDirModel->index( filePath ); + QStringList dataList; + + QFileInfo fileInfo( filePath ); mDataListModel->removeRows( 0, mDataListModel->rowCount() ); mDataListModel->insertRows( 0, EFileDetailEntryEnd ); - detailString.append( hbTrId ( "txt_fmgr_dblist_name_file" ) ); - QVariant variant( detailString ); - mDataListModel->setData( mDataListModel->index( EFileName ), variant, Qt::DisplayRole ); + dataList << hbTrId ( "txt_fmgr_dblist_name_file" ); + dataList << fileInfo.fileName(); + mDataListModel->setData( mDataListModel->index( EFileName, 0 ), dataList, Qt::DisplayRole ); - detailString.clear(); - detailString.append( mDirModel->fileName( modelIndex ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EFileName ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "txt_fmgr_dblist_type_file" ); - detailString.clear(); - detailString.append( hbTrId ( "txt_fmgr_dblist_type_file" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EFileType ), variant, Qt::DisplayRole ); - QFileInfo fileInfo = mDirModel->fileInfo( mDirModel->index( filePath ) ); QString fileType = FmUtils::getFileType( filePath ); if( fileType.isEmpty() ){ fileType.append( fileInfo.suffix() ); } - detailString.clear(); - detailString.append( fileType ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EFileType ), variant, Qt::UserRole ); + dataList << fileType; + mDataListModel->setData( mDataListModel->index( EFileType, 0 ), dataList, Qt::DisplayRole ); QDateTime modifiedDateTime = fileInfo.lastModified (); QDate modifiedDate = modifiedDateTime.date(); QTime modifiedTime = modifiedDateTime.time(); - detailString.clear(); - detailString.append( hbTrId ( "txt_fmgr_dblist_date_file" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EFileModifiedDate ), variant, Qt::DisplayRole ); - - detailString.clear(); - detailString.append( modifiedDate.toString() ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EFileModifiedDate ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "txt_fmgr_dblist_date_file" ); + dataList << modifiedDate.toString(); + mDataListModel->setData( mDataListModel->index( EFileModifiedDate, 0 ), dataList, Qt::DisplayRole ); - detailString.clear(); - detailString.append( hbTrId ( "txt_fmgr_dblist_time_file" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EFileModifiedTime ), variant, Qt::DisplayRole ); - - detailString.clear(); - detailString.append( modifiedTime.toString() ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EFileModifiedTime ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "txt_fmgr_dblist_time_file" ); + dataList << modifiedTime.toString(); + mDataListModel->setData( mDataListModel->index( EFileModifiedTime, 0 ), dataList, Qt::DisplayRole ); - detailString.clear(); - detailString.append( hbTrId ( "txt_fmgr_dblist_size_file" ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EFileSize ), variant, Qt::DisplayRole ); - - detailString.clear(); - detailString.append( FmUtils::formatStorageSize( fileInfo.size() ) ); - variant = QVariant( detailString ); - mDataListModel->setData( mDataListModel->index( EFileSize ), variant, Qt::UserRole ); + dataList.clear(); + dataList << hbTrId ( "txt_fmgr_dblist_size_file" ); + dataList << FmUtils::formatStorageSize( fileInfo.size() ); + mDataListModel->setData( mDataListModel->index( EFileSize, 0 ), dataList, Qt::DisplayRole ); } void FmViewDetailsDialog::setNumofSubfolders( int numofSubFolders, int numofFiles, quint64 sizeofFolder ) @@ -388,7 +284,8 @@ mSizeofJava = 0; mSizeofNativeFiles = 0; mSizeofDocument = 0; - mSizeofCalendar = 0; + mSizeofCalendar = 0; + mSizeofContacts = 0; for( QList< FmDriveDetailsSize* >::iterator it = detailsSizeList.begin(); it!= detailsSizeList.end(); ++it ){ @@ -396,44 +293,47 @@ switch( ( *it )->dataGroups() ){ case FmDriveDetailsDataGroup::EGroupImages: { - mSizeofImage = ( *it )->size(); + mSizeofImage = ( *it )->size(); + break; } - break; case FmDriveDetailsDataGroup::EGroupSoundFiles: { - mSizeofSounds = ( *it )->size(); + mSizeofSounds = ( *it )->size(); + break; } - break; case FmDriveDetailsDataGroup::EGroupMidpJava: { - mSizeofJava = ( *it )->size(); + mSizeofJava = ( *it )->size(); + break; } - break; case FmDriveDetailsDataGroup::EGroupNativeApps: { - mSizeofNativeFiles = ( *it )->size(); + mSizeofNativeFiles = ( *it )->size(); + break; } - break; case FmDriveDetailsDataGroup::EGroupVideos: { - mSizeofVideo = ( *it )->size(); + mSizeofVideo = ( *it )->size(); + break; } - break; case FmDriveDetailsDataGroup::EGroupDocuments: { - mSizeofDocument = ( *it )->size(); + mSizeofDocument = ( *it )->size(); + break; } - break; case FmDriveDetailsDataGroup::EGroupCalendar: { - mSizeofCalendar = ( *it )->size(); + mSizeofCalendar = ( *it )->size(); + break; } + case FmDriveDetailsDataGroup::EGroupContacts: + { + mSizeofContacts = ( *it )->size(); break; + } default: break; - } - } } diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/components/fmviewdetailsdialog.h --- a/filemanager/src/filemanager/src/components/fmviewdetailsdialog.h Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/components/fmviewdetailsdialog.h Tue Jul 06 14:06:28 2010 +0300 @@ -22,8 +22,7 @@ #include "fmcommon.h" #include "fmdialog.h" -class FmDataListModel; -class QDirModel; +class QStandardItemModel; class HbListView; class HbLabel; class HbAction; @@ -45,6 +44,7 @@ EMemoryNativeApps, EMemoryDocuments, EMemoryCalendar, + EMemoryContacts, EMemoryOthers, EDriveDetailEntryEnd }; @@ -95,20 +95,20 @@ HbLabel *mHeaderLabel; HbAction *mOkAction; - FmDataListModel *mDataListModel; - QDirModel *mDirModel; + QStandardItemModel *mDataListModel; QString mDrive; int mNumofSubFolers; int mNumofFiles; - int mSizeofFolder; - int mSizeofImage; - int mSizeofSounds; - int mSizeofVideo; - int mSizeofJava; - int mSizeofNativeFiles; - int mSizeofDocument; - int mSizeofCalendar; + quint64 mSizeofFolder; + quint64 mSizeofImage; + quint64 mSizeofSounds; + quint64 mSizeofVideo; + quint64 mSizeofJava; + quint64 mSizeofNativeFiles; + quint64 mSizeofDocument; + quint64 mSizeofCalendar; + quint64 mSizeofContacts; }; #endif /* FMVIEWDETAILSDIALOG_H_ */ diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/fmdriverlistwidget.cpp --- a/filemanager/src/filemanager/src/fmdriverlistwidget.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/fmdriverlistwidget.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -25,7 +25,7 @@ #include "fmdrivemodel.h" #include "fmfiledialog.h" -#include +#include #include #include @@ -257,7 +257,7 @@ return; } - QString title( tr( "Drive name ") ); + QString title( hbTrId( "Drive name ") ); QString volumeName = driverInfo.volumeName(); QString associatedDrives( FmUtils::getDriveLetterFromPath( diskName ) ); @@ -343,8 +343,7 @@ QString oldPwd; QString diskName = mModel->driveName( mCurrentItem->modelIndex() ); - //QString password( tr( "a ") ); - if( FmDlgUtils::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, FmMaxLengthofDrivePassword, associatedDrives ) ) { if ( FmUtils::checkDrivePwd( diskName, oldPwd ) == 0 ) { diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/fmfilebrowsewidget.cpp --- a/filemanager/src/filemanager/src/fmfilebrowsewidget.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/fmfilebrowsewidget.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -24,9 +24,10 @@ #include "fmviewmanager.h" #include "fmfiledialog.h" #include "fmdlgutils.h" +#include "fmfileiconprovider.h" #include -#include +#include #include #include @@ -38,6 +39,12 @@ #include #include +// These define comes from implementation of QFileSystemModel +#define QFileSystemSortName 0 +#define QFileSystemSortSize 1 +#define QFileSystemSortType 2 +#define QFileSystemSortTime 3 + FmFileBrowseWidget::FmFileBrowseWidget( HbWidget *parent, FmFileBrowseWidget::Style style ) : HbWidget( parent ), mTreeView( 0 ), @@ -70,19 +77,11 @@ //since there is a thread running in background //if the model destroy later, the thread might not quit properly. - if( mStyle == ListStyle || mStyle == TreeStyle ) { - QFileInfo oldFileInfo = mModel->fileInfo( mListView->rootIndex() ); - if( oldFileInfo.exists() ) { - FmViewManager *viewManager = FmViewManager::viewManager(); - if( viewManager ) { - viewManager->removeWatchPath( oldFileInfo.absoluteFilePath() ); - } - } - } - mTreeView->setModel( 0 ); mListView->setModel( 0 ); delete mModel; + + delete mFileIconProvider; } QFileInfo FmFileBrowseWidget::currentPath() const @@ -123,18 +122,35 @@ QString logString = "FmFileBrowseWidget::setRootPath(" + pathName + ')'; FmLogger::log( logString ); - if( checkPathAndSetStyle( pathName ) ) { - mListView->setModel(0); - mTreeView->setModel(0); - delete mModel; - mModel = new QDirModel(this); - mListView->setModel(mModel); - mTreeView->setModel(mModel); - - mListView->setRootIndex( mModel->index( pathName ) ); - mTreeView->setRootIndex( mModel->index( pathName ) ); - FmViewManager::viewManager()->addWatchPath( pathName ); - } + int err = checkPathAndSetStyle( pathName ); + switch( err ) + { + case FmErrNone: + { + mListView->setRootIndex( mModel->setRootPath( pathName ) ); + emit currentPathChanged( pathName ); + break; + } + case FmErrPathNotExist: + { + FmDlgUtils::information( hbTrId( "Path is not exist" ) ); + break; + } + case FmErrDriveNotAvailable: + { + // do not take any action as widget set note in label already. + break; + } + case FmErrDriveDenied: + case FmErrPathDenied: + { + FmDlgUtils::information( hbTrId( "Can not access" ) ); + break; + } + default: + Q_ASSERT_X( false, "setRootPath", "please handle all error from isPathAccessabel" ); + break; + } mCurrentDrive = pathName.left( 3 ); } @@ -214,11 +230,11 @@ bool FmFileBrowseWidget::cdUp() { - if (mStyle == ListStyle) { - QModelIndex index = mListView->rootIndex().parent(); - mModel->refresh(index); - if (index.isValid()) { - changeRootIndex( index ); + if (mStyle == ListStyle) { + QModelIndex parentIndex = mListView->rootIndex().parent(); + // QFileSystemModel will auto refresh for file/folder change + if (parentIndex.isValid()) { + changeRootIndex( parentIndex ); return true; } } @@ -392,9 +408,11 @@ void FmFileBrowseWidget::initFileModel() { - mModel = new QDirModel( this ); + mModel = new QFileSystemModel( this ); mModel->setReadOnly( false ); - disconnect( mModel, SIGNAL( rowsInserted( const QModelIndex &, int, int ) ), 0 ,0 ); + + mFileIconProvider = new FmFileIconProvider(); + mModel->setIconProvider( mFileIconProvider ); } void FmFileBrowseWidget::initLayout() @@ -433,19 +451,8 @@ void FmFileBrowseWidget::changeRootIndex( const QModelIndex &index ) { - QFileInfo oldFileInfo = mModel->fileInfo( mListView->rootIndex() ); - FmViewManager::viewManager()->removeWatchPath( oldFileInfo.absoluteFilePath() ); - - mModel->refresh(index); - if ( mStyle == ListStyle ) { - mListView->setRootIndex( index ); - } else if ( mStyle == TreeStyle ) { - mTreeView->setRootIndex( index ); - } - QFileInfo fileInfo = mModel->fileInfo( mListView->rootIndex() ); - QString string = fileInfo.absoluteFilePath(); - emit currentPathChanged( string ); - FmViewManager::viewManager()->addWatchPath( string ); + QString filePath = mModel->fileInfo( index ).absoluteFilePath(); + setRootPath( filePath ); } bool FmFileBrowseWidget::isDriver(const QModelIndex &index) const @@ -471,77 +478,90 @@ void FmFileBrowseWidget::refreshModel( const QString& path ) { FmLogger::log( "FmFileBrowseWidget::refreshModel start" ); + // This slot will be triggered when drive inserted/ejected + // Because filemanger do not notify dir/files changed yet( QFileSystem will auto refresh.) QString currPath( currentPath().absoluteFilePath() ); - QString refreshPath( path ); + + if( currPath.isEmpty() ) { + // label style and no data shown( dirve is not present or locked, or corrupt ) - if( !currPath.isEmpty() ) { - if( refreshPath.isEmpty() ) { - refreshPath = currPath; - } - if( !FmUtils::isPathEqual( refreshPath, currPath ) ) { - // no need refresh other path - return; + //set path as drive root, cause refresh, so that data can be shown when insert MMC in device. + setRootPath( mCurrentDrive ); + // update title + } else { + // display drive data normally + // ignore path refresh event as QFileSystemModel will auto refresh. + + // Handle drive refresh event as drive may be ejected. + if( path.isEmpty() ) { // path is empty means drive is changed. + checkPathAndSetStyle( currPath ); } - if( checkPathAndSetStyle( refreshPath ) ) { - mModel->refresh( mModel->index( refreshPath ) ); - } else { - FmViewManager *viewManager = FmViewManager::viewManager(); - if( viewManager ) { - viewManager->removeWatchPath( currentPath().absoluteFilePath() ); - } - } - } else { - // current path is empty, so change root path to Drive root. - refreshPath = mCurrentDrive; - setRootPath( refreshPath ); - emit setTitle( FmUtils::fillDriveVolume( mCurrentDrive, true ) ); } + emit setTitle( FmUtils::fillDriveVolume( mCurrentDrive, true ) ); FmLogger::log( "FmFileBrowseWidget::refreshModel end" ); } -bool FmFileBrowseWidget::checkPathAndSetStyle( const QString& path ) +int FmFileBrowseWidget::checkPathAndSetStyle( const QString& path ) { - if( !FmUtils::isPathAccessabel( path ) ){ - QString driveName = FmUtils::getDriveNameFromPath( path ); - FmDriverInfo::DriveState state = FmUtils::queryDriverInfo( driveName ).driveState(); - - if( state & FmDriverInfo::EDriveLocked ) { - mEmptyTipLabel->setPlainText( hbTrId( "Drive is locked" ) ); - } else if( state & FmDriverInfo::EDriveNotPresent ) { - mEmptyTipLabel->setPlainText( hbTrId( "Drive is not present" ) ); - } else if( state & FmDriverInfo::EDriveCorrupted ) { - mEmptyTipLabel->setPlainText( hbTrId( "Drive is Corrupted" ) ); - } else { - mEmptyTipLabel->setPlainText( hbTrId( "Drive can not be opened " ) ); + int err = FmUtils::isPathAccessabel( path ); + switch( err ) + { + case FmErrNone: + { + setStyle( mFileBrowseStyle ); + emit setEmptyMenu( false ); + break; + } + case FmErrDriveNotAvailable: + { + QString driveName = FmUtils::getDriveNameFromPath( path ); + FmDriverInfo::DriveState state = FmUtils::queryDriverInfo( driveName ).driveState(); + + if( state & FmDriverInfo::EDriveLocked ) { + mEmptyTipLabel->setPlainText( hbTrId( "Drive is locked" ) ); + } else if( state & FmDriverInfo::EDriveNotPresent ) { + mEmptyTipLabel->setPlainText( hbTrId( "Drive is not present" ) ); + } else if( state & FmDriverInfo::EDriveCorrupted ) { + mEmptyTipLabel->setPlainText( hbTrId( "Drive is Corrupted" ) ); + } else { + mEmptyTipLabel->setPlainText( hbTrId( "Drive can not be opened " ) ); + } + setStyle( LabelStyle ); + emit setEmptyMenu( true ); + break; + } + case FmErrPathNotExist: + case FmErrDriveDenied: + case FmErrPathDenied: + { + // do not tack any action, error note shoule be shown by invoker. + // checkPathAndSetStyle just check path and set style. + break; + } + default: + Q_ASSERT_X( false, "checkPathAndSetStyle", "please handle all error from isPathAccessabel" ); + break; } - setStyle( LabelStyle ); - emit setEmptyMenu( true ); - return false; - } else { - setStyle( mFileBrowseStyle ); - emit setEmptyMenu( false ); - return true; - } - + return err; } void FmFileBrowseWidget::sortFiles( TSortType sortType ) { switch( sortType ){ case ESortByName:{ - mModel->setSorting( QDir::Name ); + mModel->sort( QFileSystemSortName ); } break; case ESortByTime:{ - mModel->setSorting( QDir::Time ); + mModel->sort( QFileSystemSortTime ); } break; case ESortBySize:{ - mModel->setSorting( QDir::Size ); + mModel->sort( QFileSystemSortSize ); } break; case ESortByType:{ - mModel->setSorting( QDir::Type | QDir::DirsFirst ); + mModel->sort( QFileSystemSortType ); } break; default: @@ -658,7 +678,7 @@ QStringList fileList; fileList.push_back( mModel->filePath( mCurrentItem->modelIndex() ) ); - QString targetPathName = FmFileDialog::getExistingDirectory( 0, tr( "move to" ), + QString targetPathName = FmFileDialog::getExistingDirectory( 0, hbTrId( "move to" ), QString(""), QStringList() ); if( !targetPathName.isEmpty() ) { @@ -697,28 +717,21 @@ QString newTargetPath = FmUtils::fillPathWithSplash( fileInfo.absolutePath() ) + newName; QFileInfo newFileInfo( newTargetPath ); - if( !FmUtils::checkFolderFileName( newName ) ) { - FmDlgUtils::information( hbTrId( "Invalid file or folder name!" ) ); + QString errString; + // check if name/path is available for use + if( !FmUtils::checkNewFolderOrFile( newTargetPath, errString ) ) { + FmDlgUtils::information( errString ); continue; } - if( !FmUtils::checkMaxPathLength( newTargetPath ) ) { - FmDlgUtils::information( hbTrId( "the path you specified is too long!" ) ); - continue; - } - if( newFileInfo.exists() ) { - FmDlgUtils::information( hbTrId( "%1 already exist!" ).arg( newName ) ); - continue; - } - if( !rename( fileInfo.absoluteFilePath(), newTargetPath ) ) { FmDlgUtils::information( hbTrId("Rename failed!") ); } else { - QString newSuffix( newFileInfo.suffix() ); - if ( oldSuffix != newSuffix ) { + if ( oldSuffix != newFileInfo.suffix() ) { FmDlgUtils::information( hbTrId( "File may become unusable when file name extension is changed" ) ); } } break; } } + diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/fmfilebrowsewidget.h --- a/filemanager/src/filemanager/src/fmfilebrowsewidget.h Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/fmfilebrowsewidget.h Tue Jul 06 14:06:28 2010 +0300 @@ -28,7 +28,7 @@ #include #include -class QDirModel; +class QFileSystemModel; class QGraphicsLinearLayout; class HbListView; class HbTreeView; @@ -36,6 +36,8 @@ class HbSearchPanel; class HbLabel; +class FmFileIconProvider; + class FmFileBrowseWidget : public HbWidget { Q_OBJECT @@ -69,7 +71,7 @@ bool rename( const QString &oldName, const QString &newName ); void setModelFilter( QDir::Filters filters ); - bool checkPathAndSetStyle( const QString& path ); + int checkPathAndSetStyle( const QString& path ); void refreshModel( const QString& path ); void sortFiles( TSortType sortType ); void activeSearchPanel(); @@ -83,7 +85,7 @@ void on_searchPanel_exitClicked(); signals: - void currentPathChanged( QString& ); + void currentPathChanged( const QString& ); void startSearch( const QString &targetPath, const QString &criteria ); void setEmptyMenu( bool isMenuEmpty ); void setTitle( const QString &title ); @@ -119,7 +121,7 @@ HbTreeView *mTreeView; HbListView *mListView; QGraphicsLinearLayout *mLayout; - QDirModel *mModel; + QFileSystemModel *mModel; bool mSelectable; @@ -140,6 +142,9 @@ //used to avoid activate when long press list. bool mListLongPressed; QModelIndex mActivatedModelIndex; + + // provide iocn from filemanger + FmFileIconProvider *mFileIconProvider; }; #endif diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/fmfileview.cpp --- a/filemanager/src/filemanager/src/fmfileview.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/fmfileview.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -142,7 +142,7 @@ action = new HbAction(); action->setObjectName( "newFolder" ); - action->setText( hbTrId( "New Folder" ) ); + action->setText( hbTrId( "txt_fmgr_opt_new_folder" ) ); menu()->addAction( action ); connect( action, SIGNAL( triggered() ), this, SLOT( on_newFolder_triggered() ), Qt::QueuedConnection ); @@ -225,7 +225,7 @@ connect( mFindAction, SIGNAL( triggered() ), this, SLOT( on_leftAction_triggered() ) ); connect( mToolBarRightAction, SIGNAL( triggered() ), - this, SLOT( on_rightAction_triggered() ) ); + this, SLOT( on_rightAction_triggered() ), Qt::QueuedConnection ); } @@ -254,7 +254,7 @@ void FmFileView::infoNoFileSelected() { - FmDlgUtils::information( tr("No File/Folder selected" ) ); + FmDlgUtils::information( hbTrId("No File/Folder selected" ) ); } #ifdef FM_CHANGE_ORIENT_ENABLE @@ -289,7 +289,7 @@ if (files.size() == 0) { infoNoFileSelected(); } else { - if (FmDlgUtils::question( tr("Confirm Deletion?" ) )) { + if (FmDlgUtils::question( hbTrId("Confirm Deletion?" ) )) { QStringList fileList; for (int i = 0; i < files.size(); ++i) { fileList.push_back( files[i].absoluteFilePath() ); @@ -360,7 +360,7 @@ if (files.size() == 0) { infoNoFileSelected(); } else { - QString targetPathName = FmFileDialog::getExistingDirectory( 0, tr( "move to" ), + QString targetPathName = FmFileDialog::getExistingDirectory( 0, hbTrId( "move to" ), QString(""), QStringList() ); if( !targetPathName.isEmpty() && files.size() > 0 ) { @@ -377,13 +377,13 @@ break; case FmErrAlreadyStarted: // last operation have not finished - FmDlgUtils::information( tr( "Operatin already started!" ) ); + FmDlgUtils::information( hbTrId( "Operatin already started!" ) ); break; case FmErrWrongParam: - FmDlgUtils::information( tr( "Wrong parameters!" ) ); + FmDlgUtils::information( hbTrId( "Wrong parameters!" ) ); break; default: - FmDlgUtils::information( tr( "Operation fail to start!" ) ); + FmDlgUtils::information( hbTrId( "Operation fail to start!" ) ); } setSelectable( false ); } @@ -399,26 +399,18 @@ QDir dir( path ); if( dir.exists() ) { - while( FmDlgUtils::showTextQuery( hbTrId( "Enter name for " ), dirName, + while( FmDlgUtils::showTextQuery( hbTrId( "txt_fmgr_title_new_folder" ), dirName, true, maxFileNameLength, associatedDrive , false ) ){ // remove whitespace from the start and the end. dirName = dirName.trimmed(); QString newTargetPath = FmUtils::fillPathWithSplash( dir.absolutePath() ) + dirName; - QFileInfo newFileInfo( newTargetPath ); - if( !FmUtils::checkFolderFileName( dirName ) ) { - FmDlgUtils::information( hbTrId( "Invalid file or folder name!" ) ); + QString errString; + // check if name/path is available for use + if( !FmUtils::checkNewFolderOrFile( newTargetPath, errString ) ) { + FmDlgUtils::information( errString ); continue; } - if( !FmUtils::checkMaxPathLength( newTargetPath ) ) { - FmDlgUtils::information( hbTrId( "the path you specified is too long!" ) ); - continue; - } - if( newFileInfo.exists() ) { - FmDlgUtils::information( hbTrId( "%1 already exist!" ).arg( dirName ) ); - continue; - } - if( !dir.mkdir( dirName ) ) { FmDlgUtils::information( hbTrId("Operation failed!") ); } @@ -515,21 +507,22 @@ QString FmFileView::createDefaultFolderName( const QString &path ) { - QString dirBaseName( hbTrId( "New folder" ) ); - QString dirName( dirBaseName ); - QString dirAbsolutePath( path + dirName ); + // create new folder name, for example, New folder(01), New folder(02) + QString checkedPath( FmUtils::fillPathWithSplash( path ) ); + QString dirName( hbTrId( "txt_fmgr_dialog_entry_new_folder" ) ); + QString dirAbsolutePath( checkedPath + dirName ); QFileInfo fileInfo( dirAbsolutePath ); int i = 0; while ( fileInfo.exists() ) { ++i; - dirName = dirBaseName; - dirName.append( hbTrId("(") ); + QString numName; if ( i < 10 ) { - dirName.append( hbTrId("0") ); + numName.append( QString::number(0) ); } - dirName.append( QString::number(i) ); - dirName.append( hbTrId(")") ); - dirAbsolutePath = path + dirName; + numName.append( QString::number(i) ); + // txt_fmgr_dialog_entry_new_folder_l1 is not available now. use actual text instead of it. + dirName = hbTrId( "New folder (%L1)" ).arg( numName ); + dirAbsolutePath = checkedPath + dirName; fileInfo.setFile( dirAbsolutePath ); } return dirName; diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/fmfileview.h --- a/filemanager/src/filemanager/src/fmfileview.h Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/fmfileview.h Tue Jul 06 14:06:28 2010 +0300 @@ -85,7 +85,7 @@ /** * Create Default folder name while create folder. * - * @param Current path. + * @param path Current path. * @return Default folder name for new folder. */ QString createDefaultFolderName( const QString &path ); diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/fmfindresultmodel.cpp --- a/filemanager/src/filemanager/src/fmfindresultmodel.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/fmfindresultmodel.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -18,9 +18,11 @@ #include "fmfindresultmodel.h" #include "fmfindthread.h" +#include "fmfileiconprovider.h" #include -#include + +#include FmFindResultModel::FmFindResultModel( QObject *parent ) : QAbstractListModel( parent ) @@ -93,10 +95,10 @@ return QVariant(); switch (section) { - case 0: return tr("Name"); - case 1: return tr("Size"); - case 2: return tr("Type"); - case 3: return tr("Date Modified"); + case 0: return hbTrId("Name"); + case 1: return hbTrId("Size"); + case 2: return hbTrId("Type"); + case 3: return hbTrId("Date Modified"); default: return QVariant(); } } @@ -204,7 +206,7 @@ { mFindThread = new FmFindThread( &mFindResult, this ); mFindThread->setObjectName( "findThread" ); - mIconProvider = new QFileIconProvider(); + mIconProvider = new FmFileIconProvider(); } bool FmFindResultModel::caseNameLessThan(const QString &s1, const QString &s2) @@ -251,10 +253,7 @@ // emit layoutAboutToBeChanged(); - QStringList lst; - for (int i = 0; i < mFindResult.size(); ++i) - lst.append( mFindResult.at(i) ); - + QStringList lst( mFindResult ); removeRows( 0, mFindResult.size() ); switch( ( SortFlag )column ) @@ -273,8 +272,7 @@ break; } - for (int i = 0; i < lst.count(); ++i) - mFindResult.append( lst.at(i) ); + mFindResult = lst; insertRows( 0, mFindResult.size() ); emit modelCountChanged( mFindResult.size() ); } diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/fmfindresultmodel.h --- a/filemanager/src/filemanager/src/fmfindresultmodel.h Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/fmfindresultmodel.h Tue Jul 06 14:06:28 2010 +0300 @@ -26,7 +26,7 @@ #include class FmFindThread; -class QFileIconProvider; +class FmFileIconProvider; class FmFindResultModel : public QAbstractListModel { @@ -89,7 +89,7 @@ FmFindThread *mFindThread; QStringList mFindResult; - QFileIconProvider *mIconProvider; + FmFileIconProvider *mIconProvider; }; #endif diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/fmviewmanager.cpp --- a/filemanager/src/filemanager/src/fmviewmanager.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/fmviewmanager.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -153,12 +153,17 @@ void FmViewManager::on_operationService_notifyFinish( FmOperationBase *operationBase ) { + if( !operationBase ){ + Q_ASSERT_X( false, "FmViewManager", + "NULL is not accepted in on_operationService_notifyFinish()" ); + return; + } + if( operationBase->operationType() == FmOperationService::EOperationTypeBackup ) { // after finish backup, we need refresh backup date in backup view. emit refreshBackupDate(); } - } @@ -187,7 +192,7 @@ QString checkedPath = FmUtils::checkDriveToFolderFilter( absolutePath ); if( FmUtils::isDriveAvailable( path ) ) { - if( !FmUtils::isPathAccessabel( checkedPath ) ) { + if( FmErrNone != FmUtils::isPathAccessabel( checkedPath ) ) { checkedPath.clear(); } } diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/listviewitems.cpp --- a/filemanager/src/filemanager/src/listviewitems.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/listviewitems.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -20,7 +20,6 @@ #include "listviewitems.h" #include "fmutils.h" -#include #include #include @@ -70,10 +69,7 @@ } QVariant variant = modelIndex().data( Qt::DecorationRole ); QIcon icon = qvariant_cast( variant ); - if( icon.isNull() ) { - QFileIconProvider fileIconProvider; - icon = fileIconProvider.icon( QFileIconProvider::Drive ); - } + // FmFileIconProvider in FmDriveModel already handle null icon issue QString displayString = modelIndex().data( Qt::DisplayRole ).toString(); QString diskName = modelIndex().data( Qt::UserRole ).toString(); diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/main.cpp --- a/filemanager/src/filemanager/src/main.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/main.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -31,7 +31,6 @@ { FmLogger::log( "main start" ); HbApplication app( argc, argv ); - app.setApplicationName( "filemanager" ); QTranslator translator; QString lang = QLocale::system().name(); @@ -39,6 +38,8 @@ translator.load( path + "filemanager_" + lang ); app.installTranslator(&translator); + app.setApplicationName( hbTrId("txt_fmgr_title_file_manager") ); + FmLogger::log( "main_createMainwindow start" ); FmMainWindow mw; FmLogger::log( "main_createMainwindow end" ); diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/operationservice/fmoperationbase.cpp --- a/filemanager/src/filemanager/src/operationservice/fmoperationbase.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/operationservice/fmoperationbase.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -17,6 +17,8 @@ */ #include "fmoperationbase.h" +#include "fmdrivedetailstype.h" +#include FmOperationBase::FmOperationBase( QObject *parent, FmOperationService::TOperationType operationType ) : QObject( parent ), mOperationType( operationType ) @@ -56,6 +58,7 @@ } FmOperationDriveDetails::~FmOperationDriveDetails() { + qDeleteAll(mDetailsSizeList); } QString FmOperationDriveDetails::driverName() diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/filemanager/src/operationservice/fmoperationresultprocesser.cpp --- a/filemanager/src/filemanager/src/operationservice/fmoperationresultprocesser.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/filemanager/src/operationservice/fmoperationresultprocesser.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -48,25 +48,14 @@ QFileInfo fileInfo(srcFile); bool ret = FmDlgUtils::showTextQuery( questionText, value, true, maxFileNameLength, QString(), false ); while ( ret ) { - bool checkResult = true; // remove whitespace from the start and the end. value = value.trimmed(); QString newTargetPath = FmUtils::fillPathWithSplash( fileInfo.absolutePath() ) + value; - QFileInfo newFileInfo( newTargetPath ); - if (!FmUtils::checkFolderFileName(value)) { - FmDlgUtils::information( hbTrId( "Invalid file or folder name, try again!" ) ); - checkResult = false; - } - if( !FmUtils::checkMaxPathLength( newTargetPath ) ) { - FmDlgUtils::information( hbTrId( "the path you specified is too long, try again!" ) ); - checkResult = false; - } - if (newFileInfo.exists()) { - FmDlgUtils::information( hbTrId( "%1 already exist!" ).arg( value ) ); - checkResult = false; - } - if( !checkResult ) { + QString errString; + // check if name/path is available for use. + if( !FmUtils::checkNewFolderOrFile( newTargetPath, errString ) ) { + FmDlgUtils::information( errString ); ret = FmDlgUtils::showTextQuery( questionText, value, true, maxFileNameLength, QString(), false ); continue; } else { @@ -100,7 +89,7 @@ void FmOperationResultProcesser::onNotifyWaiting( FmOperationBase* operationBase, bool cancelable ) { - QString title = tr("Operation"); + QString title = hbTrId("Operation"); switch( operationBase->operationType() ) { case FmOperationService::EOperationTypeBackup: @@ -155,7 +144,7 @@ void FmOperationResultProcesser::onNotifyStart( FmOperationBase* operationBase, bool cancelable, int maxSteps ) { - QString title = tr("Operation"); + QString title = hbTrId("Operation"); switch( operationBase->operationType() ) { case FmOperationService::EOperationTypeBackup: @@ -217,7 +206,7 @@ { FmDlgUtils::information( QString( hbTrId("Format succeed!")) ); FmOperationFormat *paramFormat = static_cast( operationBase ); - QString title( tr( "Drive name ") ); + QString title( hbTrId( "Drive name ") ); QString driveName( paramFormat->driverName() ); FmDriverInfo driverInfo = FmUtils::queryDriverInfo( driveName ); FmDriverInfo::DriveState state = driverInfo.driveState(); diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/fmbkupenginewrapper/bwins/fmbkupenginewrapperu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/filemanager/src/fmbkupenginewrapper/bwins/fmbkupenginewrapperu.def Tue Jul 06 14:06:28 2010 +0300 @@ -0,0 +1,69 @@ +EXPORTS + ??0FmRestoreSettings@@QAE@AAVFmBkupEngine@@@Z @ 1 NONAME ; FmRestoreSettings::FmRestoreSettings(class FmBkupEngine &) + ?tr@FmBkupEngine@@SA?AVQString@@PBD0@Z @ 2 NONAME ; class QString FmBkupEngine::tr(char const *, char const *) + ?getStaticMetaObject@FmBkupEngine@@SAABUQMetaObject@@XZ @ 3 NONAME ; struct QMetaObject const & FmBkupEngine::getStaticMetaObject(void) + ?trUtf8@FmBkupEngine@@SA?AVQString@@PBD0H@Z @ 4 NONAME ; class QString FmBkupEngine::trUtf8(char const *, char const *, int) + ?error@FmBkupEngine@@QBEHXZ @ 5 NONAME ; int FmBkupEngine::error(void) const + ?availableTargetDrive@FmBackupSettings@@QBE?AVQString@@XZ @ 6 NONAME ; class QString FmBackupSettings::availableTargetDrive(void) const + ?GetSelectionL@FmRestoreSettings@@QBEXAAV?$QList@VFmRestoreInfo@@@@@Z @ 7 NONAME ; void FmRestoreSettings::GetSelectionL(class QList &) const + ?content@FmBackupSettings@@QBEIXZ @ 8 NONAME ; unsigned int FmBackupSettings::content(void) const + ?getBackupDriveList@FmBkupEngine@@QAEXAAVQStringList@@@Z @ 9 NONAME ; void FmBkupEngine::getBackupDriveList(class QStringList &) + ?resetAndDestoryRestoreEntry@FmRestoreSettings@@AAEXXZ @ 10 NONAME ; void FmRestoreSettings::resetAndDestoryRestoreEntry(void) + ?targetDriveToString@FmBackupSettings@@QAE?AVQString@@ABV2@@Z @ 11 NONAME ; class QString FmBackupSettings::targetDriveToString(class QString const &) + ?setScheduling@FmBackupSettings@@QAEXW4TFileManagerBackupSchedule@1@@Z @ 12 NONAME ; void FmBackupSettings::setScheduling(enum FmBackupSettings::TFileManagerBackupSchedule) + ?notifyFinish@FmBkupEngine@@IAEXH@Z @ 13 NONAME ; void FmBkupEngine::notifyFinish(int) + ?qt_metacast@FmBkupEngine@@UAEPAXPBD@Z @ 14 NONAME ; void * FmBkupEngine::qt_metacast(char const *) + ??0FmBackupSettings@@QAE@PAVFmBkupEngine@@@Z @ 15 NONAME ; FmBackupSettings::FmBackupSettings(class FmBkupEngine *) + ?SetSelection@FmRestoreSettings@@QAEXAB_K@Z @ 16 NONAME ; void FmRestoreSettings::SetSelection(unsigned long long const &) + ?startBackup@FmBkupEngine@@QAE_NV?$QList@PAVFmBkupDrivesAndOperation@@@@V?$QList@PAVFmBkupBackupCategory@@@@VQString@@I@Z @ 17 NONAME ; bool FmBkupEngine::startBackup(class QList, class QList, class QString, unsigned int) + ?notifyMemoryLow@FmBkupEngine@@IAEXHAAH@Z @ 18 NONAME ; void FmBkupEngine::notifyMemoryLow(int, int &) + ?CreateEntry@FmRestoreSettings@@AAEPAVFmRestoreEntry@@ABVFmRestoreInfo@@@Z @ 19 NONAME ; class FmRestoreEntry * FmRestoreSettings::CreateEntry(class FmRestoreInfo const &) + ?startRestore@FmBkupEngine@@QAE_NV?$QList@PAVFmBkupDrivesAndOperation@@@@@Z @ 20 NONAME ; bool FmBkupEngine::startRestore(class QList) + ?resetAndDestoryBackupEntry@FmBackupSettings@@AAEXXZ @ 21 NONAME ; void FmBackupSettings::resetAndDestoryBackupEntry(void) + ?weekdayToString@FmBackupSettings@@SA?AVQString@@W4TFileManagerBackupWeekday@1@@Z @ 22 NONAME ; class QString FmBackupSettings::weekdayToString(enum FmBackupSettings::TFileManagerBackupWeekday) + ?tr@FmBkupEngine@@SA?AVQString@@PBD0H@Z @ 23 NONAME ; class QString FmBkupEngine::tr(char const *, char const *, int) + ?contentToString@FmBackupSettings@@SA?AVQString@@I@Z @ 24 NONAME ; class QString FmBackupSettings::contentToString(unsigned int) + ?RestoreSettingsL@FmBkupEngine@@QAEPAVFmRestoreSettings@@XZ @ 25 NONAME ; class FmRestoreSettings * FmBkupEngine::RestoreSettingsL(void) + ?createBackupDateEntry@FmBackupSettings@@AAEPAVFmBackupEntry@@XZ @ 26 NONAME ; class FmBackupEntry * FmBackupSettings::createBackupDateEntry(void) + ?GetRestoreInfoArray@FmBkupEngine@@QAEXAAV?$QList@PAVFmBkupDrivesAndOperation@@@@AAV?$QList@VFmRestoreInfo@@@@ABVQString@@@Z @ 27 NONAME ; void FmBkupEngine::GetRestoreInfoArray(class QList &, class QList &, class QString const &) + ?time@FmBackupSettings@@QBEABVQTime@@XZ @ 28 NONAME ; class QTime const & FmBackupSettings::time(void) const + ?createWeekdayEntry@FmBackupSettings@@AAEPAVFmBackupEntry@@XZ @ 29 NONAME ; class FmBackupEntry * FmBackupSettings::createWeekdayEntry(void) + ?cancelBackup@FmBkupEngine@@QAEXXZ @ 30 NONAME ; void FmBkupEngine::cancelBackup(void) + ?notifyUpdate@FmBkupEngine@@IAEXH@Z @ 31 NONAME ; void FmBkupEngine::notifyUpdate(int) + ?save@FmBackupSettings@@QAEXXZ @ 32 NONAME ; void FmBackupSettings::save(void) + ??_EFmBkupEngine@@UAE@I@Z @ 33 NONAME ; FmBkupEngine::~FmBkupEngine(unsigned int) + ?restoreEntryList@FmRestoreSettings@@QAE?AV?$QList@PAVFmRestoreEntry@@@@XZ @ 34 NONAME ; class QList FmRestoreSettings::restoreEntryList(void) + ?createTimeEntry@FmBackupSettings@@AAEPAVFmBackupEntry@@XZ @ 35 NONAME ; class FmBackupEntry * FmBackupSettings::createTimeEntry(void) + ?weekday@FmBackupSettings@@QBE?AW4TFileManagerBackupWeekday@1@XZ @ 36 NONAME ; enum FmBackupSettings::TFileManagerBackupWeekday FmBackupSettings::weekday(void) const + ?deleteBackup@FmBkupEngine@@QAEHV?$QList@PAVFmBkupDrivesAndOperation@@@@@Z @ 37 NONAME ; int FmBkupEngine::deleteBackup(class QList) + ??1FmBackupSettings@@QAE@XZ @ 38 NONAME ; FmBackupSettings::~FmBackupSettings(void) + ?setTime@FmBackupSettings@@QAEXABVQTime@@@Z @ 39 NONAME ; void FmBackupSettings::setTime(class QTime const &) + ?backupEntryList@FmBackupSettings@@QAE?AV?$QList@PAVFmBackupEntry@@@@XZ @ 40 NONAME ; class QList FmBackupSettings::backupEntryList(void) + ?contentsSelected@FmBackupSettings@@ABEHXZ @ 41 NONAME ; int FmBackupSettings::contentsSelected(void) const + ?refreshList@FmBackupSettings@@AAEXXZ @ 42 NONAME ; void FmBackupSettings::refreshList(void) + ?trUtf8@FmBkupEngine@@SA?AVQString@@PBD0@Z @ 43 NONAME ; class QString FmBkupEngine::trUtf8(char const *, char const *) + ?CreateEntry@FmBackupSettings@@AAEPAVFmBackupEntry@@ABVQString@@0W4TSettingType@2@@Z @ 44 NONAME ; class FmBackupEntry * FmBackupSettings::CreateEntry(class QString const &, class QString const &, enum FmBackupEntry::TSettingType) + ?targetDrive@FmBackupSettings@@QBE?AVQString@@XZ @ 45 NONAME ; class QString FmBackupSettings::targetDrive(void) const + ??0FmBkupEngine@@QAE@PAVQObject@@@Z @ 46 NONAME ; FmBkupEngine::FmBkupEngine(class QObject *) + ?notifyPreparing@FmBkupEngine@@IAEX_N@Z @ 47 NONAME ; void FmBkupEngine::notifyPreparing(bool) + ?load@FmRestoreSettings@@QAEXV?$QList@PAVFmBkupDrivesAndOperation@@@@@Z @ 48 NONAME ; void FmRestoreSettings::load(class QList) + ?setWeekday@FmBackupSettings@@QAEXW4TFileManagerBackupWeekday@1@@Z @ 49 NONAME ; void FmBackupSettings::setWeekday(enum FmBackupSettings::TFileManagerBackupWeekday) + ??1FmRestoreSettings@@QAE@XZ @ 50 NONAME ; FmRestoreSettings::~FmRestoreSettings(void) + ?createContentsEntry@FmBackupSettings@@AAEPAVFmBackupEntry@@XZ @ 51 NONAME ; class FmBackupEntry * FmBackupSettings::createContentsEntry(void) + ?notifyBackupFilesExist@FmBkupEngine@@IAEXAA_N@Z @ 52 NONAME ; void FmBkupEngine::notifyBackupFilesExist(bool &) + ?updateBackupDate@FmBackupSettings@@QAEXXZ @ 53 NONAME ; void FmBackupSettings::updateBackupDate(void) + ?createSchedulingEntry@FmBackupSettings@@AAEPAVFmBackupEntry@@XZ @ 54 NONAME ; class FmBackupEntry * FmBackupSettings::createSchedulingEntry(void) + ?metaObject@FmBkupEngine@@UBEPBUQMetaObject@@XZ @ 55 NONAME ; struct QMetaObject const * FmBkupEngine::metaObject(void) const + ?createTargetDriveEntry@FmBackupSettings@@AAEPAVFmBackupEntry@@XZ @ 56 NONAME ; class FmBackupEntry * FmBackupSettings::createTargetDriveEntry(void) + ?load@FmBackupSettings@@QAEXXZ @ 57 NONAME ; void FmBackupSettings::load(void) + ??1FmBkupEngine@@UAE@XZ @ 58 NONAME ; FmBkupEngine::~FmBkupEngine(void) + ?BackupSettingsL@FmBkupEngine@@QAEPAVFmBackupSettings@@XZ @ 59 NONAME ; class FmBackupSettings * FmBkupEngine::BackupSettingsL(void) + ?setContent@FmBackupSettings@@QAEXI@Z @ 60 NONAME ; void FmBackupSettings::setContent(unsigned int) + ?schedulingToString@FmBackupSettings@@QAE?AVQString@@W4TFileManagerBackupSchedule@1@@Z @ 61 NONAME ; class QString FmBackupSettings::schedulingToString(enum FmBackupSettings::TFileManagerBackupSchedule) + ?setTargetDrive@FmBackupSettings@@QAEXABVQString@@@Z @ 62 NONAME ; void FmBackupSettings::setTargetDrive(class QString const &) + ?staticMetaObject@FmBkupEngine@@2UQMetaObject@@B @ 63 NONAME ; struct QMetaObject const FmBkupEngine::staticMetaObject + ?refreshList@FmRestoreSettings@@AAEXAAV?$QList@PAVFmBkupDrivesAndOperation@@@@@Z @ 64 NONAME ; void FmRestoreSettings::refreshList(class QList &) + ?notifyStart@FmBkupEngine@@IAEX_NH@Z @ 65 NONAME ; void FmBkupEngine::notifyStart(bool, int) + ?scheduling@FmBackupSettings@@QBE?AW4TFileManagerBackupSchedule@1@XZ @ 66 NONAME ; enum FmBackupSettings::TFileManagerBackupSchedule FmBackupSettings::scheduling(void) const + ?qt_metacall@FmBkupEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 67 NONAME ; int FmBkupEngine::qt_metacall(enum QMetaObject::Call, int, void * *) + diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/fmbkupenginewrapper/eabi/fmbkupenginewrapperu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/filemanager/src/fmbkupenginewrapper/eabi/fmbkupenginewrapperu.def Tue Jul 06 14:06:28 2010 +0300 @@ -0,0 +1,73 @@ +EXPORTS + _ZN12FmBkupEngine11notifyStartEbi @ 1 NONAME + _ZN12FmBkupEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME + _ZN12FmBkupEngine11qt_metacastEPKc @ 3 NONAME + _ZN12FmBkupEngine11startBackupE5QListIP24FmBkupDrivesAndOperationES0_IP20FmBkupBackupCategoryE7QStringj @ 4 NONAME + _ZN12FmBkupEngine12cancelBackupEv @ 5 NONAME + _ZN12FmBkupEngine12deleteBackupE5QListIP24FmBkupDrivesAndOperationE @ 6 NONAME + _ZN12FmBkupEngine12notifyFinishEi @ 7 NONAME + _ZN12FmBkupEngine12notifyUpdateEi @ 8 NONAME + _ZN12FmBkupEngine12startRestoreE5QListIP24FmBkupDrivesAndOperationE @ 9 NONAME + _ZN12FmBkupEngine15BackupSettingsLEv @ 10 NONAME + _ZN12FmBkupEngine15notifyMemoryLowEiRi @ 11 NONAME + _ZN12FmBkupEngine15notifyPreparingEb @ 12 NONAME + _ZN12FmBkupEngine16RestoreSettingsLEv @ 13 NONAME + _ZN12FmBkupEngine16staticMetaObjectE @ 14 NONAME DATA 16 + _ZN12FmBkupEngine18getBackupDriveListER11QStringList @ 15 NONAME + _ZN12FmBkupEngine19GetRestoreInfoArrayER5QListIP24FmBkupDrivesAndOperationERS0_I13FmRestoreInfoERK7QString @ 16 NONAME + _ZN12FmBkupEngine19getStaticMetaObjectEv @ 17 NONAME + _ZN12FmBkupEngine22notifyBackupFilesExistERb @ 18 NONAME + _ZN12FmBkupEngineC1EP7QObject @ 19 NONAME + _ZN12FmBkupEngineC2EP7QObject @ 20 NONAME + _ZN12FmBkupEngineD0Ev @ 21 NONAME + _ZN12FmBkupEngineD1Ev @ 22 NONAME + _ZN12FmBkupEngineD2Ev @ 23 NONAME + _ZN16FmBackupSettings10setContentEj @ 24 NONAME + _ZN16FmBackupSettings10setWeekdayENS_25TFileManagerBackupWeekdayE @ 25 NONAME + _ZN16FmBackupSettings11CreateEntryERK7QStringS2_N13FmBackupEntry12TSettingTypeE @ 26 NONAME + _ZN16FmBackupSettings11refreshListEv @ 27 NONAME + _ZN16FmBackupSettings13setSchedulingENS_26TFileManagerBackupScheduleE @ 28 NONAME + _ZN16FmBackupSettings14setTargetDriveERK7QString @ 29 NONAME + _ZN16FmBackupSettings15backupEntryListEv @ 30 NONAME + _ZN16FmBackupSettings15contentToStringEj @ 31 NONAME + _ZN16FmBackupSettings15createTimeEntryEv @ 32 NONAME + _ZN16FmBackupSettings15weekdayToStringENS_25TFileManagerBackupWeekdayE @ 33 NONAME + _ZN16FmBackupSettings16updateBackupDateEv @ 34 NONAME + _ZN16FmBackupSettings18createWeekdayEntryEv @ 35 NONAME + _ZN16FmBackupSettings18schedulingToStringENS_26TFileManagerBackupScheduleE @ 36 NONAME + _ZN16FmBackupSettings19createContentsEntryEv @ 37 NONAME + _ZN16FmBackupSettings19targetDriveToStringERK7QString @ 38 NONAME + _ZN16FmBackupSettings21createBackupDateEntryEv @ 39 NONAME + _ZN16FmBackupSettings21createSchedulingEntryEv @ 40 NONAME + _ZN16FmBackupSettings22createTargetDriveEntryEv @ 41 NONAME + _ZN16FmBackupSettings26resetAndDestoryBackupEntryEv @ 42 NONAME + _ZN16FmBackupSettings4loadEv @ 43 NONAME + _ZN16FmBackupSettings4saveEv @ 44 NONAME + _ZN16FmBackupSettings7setTimeERK5QTime @ 45 NONAME + _ZN16FmBackupSettingsC1EP12FmBkupEngine @ 46 NONAME + _ZN16FmBackupSettingsC2EP12FmBkupEngine @ 47 NONAME + _ZN16FmBackupSettingsD1Ev @ 48 NONAME + _ZN16FmBackupSettingsD2Ev @ 49 NONAME + _ZN17FmRestoreSettings11CreateEntryERK13FmRestoreInfo @ 50 NONAME + _ZN17FmRestoreSettings11refreshListER5QListIP24FmBkupDrivesAndOperationE @ 51 NONAME + _ZN17FmRestoreSettings12SetSelectionERKy @ 52 NONAME + _ZN17FmRestoreSettings16restoreEntryListEv @ 53 NONAME + _ZN17FmRestoreSettings27resetAndDestoryRestoreEntryEv @ 54 NONAME + _ZN17FmRestoreSettings4loadE5QListIP24FmBkupDrivesAndOperationE @ 55 NONAME + _ZN17FmRestoreSettingsC1ER12FmBkupEngine @ 56 NONAME + _ZN17FmRestoreSettingsC2ER12FmBkupEngine @ 57 NONAME + _ZN17FmRestoreSettingsD1Ev @ 58 NONAME + _ZN17FmRestoreSettingsD2Ev @ 59 NONAME + _ZNK12FmBkupEngine10metaObjectEv @ 60 NONAME + _ZNK12FmBkupEngine5errorEv @ 61 NONAME + _ZNK16FmBackupSettings10schedulingEv @ 62 NONAME + _ZNK16FmBackupSettings11targetDriveEv @ 63 NONAME + _ZNK16FmBackupSettings16contentsSelectedEv @ 64 NONAME + _ZNK16FmBackupSettings20availableTargetDriveEv @ 65 NONAME + _ZNK16FmBackupSettings4timeEv @ 66 NONAME + _ZNK16FmBackupSettings7contentEv @ 67 NONAME + _ZNK16FmBackupSettings7weekdayEv @ 68 NONAME + _ZNK17FmRestoreSettings13GetSelectionLER5QListI13FmRestoreInfoE @ 69 NONAME + _ZTI12FmBkupEngine @ 70 NONAME + _ZTV12FmBkupEngine @ 71 NONAME + diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/fmbkupenginewrapper/fmbkupenginewrapper.pro --- a/filemanager/src/fmbkupenginewrapper/fmbkupenginewrapper.pro Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/fmbkupenginewrapper/fmbkupenginewrapper.pro Tue Jul 06 14:06:28 2010 +0300 @@ -14,6 +14,7 @@ # Description: The project file of FmBkupEngineWrapper # +CONFIG += hb TARGET = TEMPLATE = lib QT = core diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/fmbkupenginewrapper/inc/fmbackupsettings.h --- a/filemanager/src/fmbkupenginewrapper/inc/fmbackupsettings.h Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/fmbkupenginewrapper/inc/fmbackupsettings.h Tue Jul 06 14:06:28 2010 +0300 @@ -24,31 +24,7 @@ #include #include -const QString constFileManagerBackupWeekdayMonday = "Monday"; -const QString constFileManagerBackupWeekdayTuesday = "Tuesday"; -const QString constFileManagerBackupWeekdayWednesday = "Wednesday"; -const QString constFileManagerBackupWeekdayThursday = "Thursday"; -const QString constFileManagerBackupWeekdayFirday = "Friday"; -const QString constFileManagerBackupWeekdaySaturday = "Saturday"; -const QString constFileManagerBackupWeekdaySunday = "Sunday"; - -const QString constFileManagerBackupScheduleNever = "Never"; -const QString constFileManagerBackupScheduleDaily = "Daily"; -const QString constFileManagerBackupScheduleWeekly = "Weekly"; - -const QString constFileManagerBackupSettingsTitleContents = "Backup Contents"; -const QString constFileManagerBackupSettingsTitleScheduling = "Backup scheduling"; -const QString constFileManagerBackupSettingsTitleWeekday = "Weekday"; -const QString constFileManagerBackupSettingsTitleTime = "Time"; -const QString constFileManagerBackupSettingsTitleTargetDrive = "Backup destination"; - -const QString constFileManagerBackupSettingsContentAll = "All"; -const QString constFileManagerBackupSettingsContentSettings = "Settings"; -const QString constFileManagerBackupSettingsContentMessages = "Messages"; -const QString constFileManagerBackupSettingsContentContacts = "Contacts"; -const QString constFileManagerBackupSettingsContentCalendar = "Calendar"; -const QString constFileManagerBackupSettingsContentBookmarks = "Bookmarks"; -const QString constFileManagerBackupSettingsContentUserFiles = "Files"; +#include class FmBkupEngine; diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/fmbkupenginewrapper/private/win32/fmbkupengine_p.h --- a/filemanager/src/fmbkupenginewrapper/private/win32/fmbkupengine_p.h Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/fmbkupenginewrapper/private/win32/fmbkupengine_p.h Tue Jul 06 14:06:28 2010 +0300 @@ -66,10 +66,15 @@ signals: void notifyPreparing( bool cancelable ); - void notifyStart( bool cancelable, int totalCount ); - void notifyUpdate( int count ); - void notifyFinish( int err ); - void notifyMemoryLow( int memoryValue, int &userError ); + void notifyStart( bool cancelable, int totalCount ); + void notifyUpdate( int count ); + void notifyFinish( int err ); + void notifyMemoryLow( int memoryValue, int &userError ); + + // win32 source code is used to simulator backup action. + // add this signal in win32 to avoid warning when run test case + // though it is not used in win32 source code currently + void notifyBackupFilesExist( bool &isContinue ); public slots: void onNotifyPreparing( bool cancelable ); diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/fmbkupenginewrapper/src/fmbackupsettings.cpp --- a/filemanager/src/fmbkupenginewrapper/src/fmbackupsettings.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/fmbkupenginewrapper/src/fmbackupsettings.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -25,6 +25,8 @@ #include #include +#include + FmBackupSettings::FmBackupSettings( FmBkupEngine *aFmBkupEngine ) : mBkupEngine( aFmBkupEngine ) { @@ -130,7 +132,7 @@ QString title; QString tips; - title = constFileManagerBackupSettingsTitleContents; + title = hbTrId( "Backup Contents" ); int selected( contentsSelected() ); if ( !( mContent & EFileManagerBackupContentAll ) && selected > 1 ){ @@ -151,7 +153,7 @@ QString title; QString tips; - title = constFileManagerBackupSettingsTitleScheduling; + title = hbTrId( "Backup scheduling" ); tips = schedulingToString( mScheduling ); return CreateEntry( title, tips, FmBackupEntry::EScheduling ); @@ -162,7 +164,7 @@ QString title; QString tips; - title = constFileManagerBackupSettingsTitleWeekday; + title = hbTrId( "Weekday" ); tips = weekdayToString( mWeekday ); return CreateEntry( title, tips, FmBackupEntry::EWeekday ); @@ -173,7 +175,7 @@ QString title; QString tips; - title = constFileManagerBackupSettingsTitleTime; + title = hbTrId( "Time" ); tips = mTime.toString( "hh:mm" ); return CreateEntry( title, tips, FmBackupEntry::ETime ); @@ -184,7 +186,7 @@ QString title; QString tips; - title = constFileManagerBackupSettingsTitleTargetDrive; + title = hbTrId( "Backup destination" ); tips = targetDriveToString( mTargetDrive ); return CreateEntry( title, tips, FmBackupEntry::ETarget ); @@ -195,38 +197,38 @@ QString tips; if( mDate.isNull() ) { - tips = "No previous backups created" ; + tips = hbTrId( "No previous backups created"); } else { - tips = QString( "Backup Created " + mDate.toString( "dd.MM.yyyy" ) ); + tips = hbTrId( "Backup Created " ) + mDate.toString( "dd.MM.yyyy" ); } return CreateEntry( QString(""), tips, FmBackupEntry::EBackupdate); } QString FmBackupSettings::contentToString( const quint32 content ) { - QString ret( constFileManagerBackupSettingsContentAll ); + QString ret( hbTrId( "All" ) ); if ( content & EFileManagerBackupContentAll ){ - ret = constFileManagerBackupSettingsContentAll; + ret = hbTrId( "All" ); } else if ( content & EFileManagerBackupContentSettings ){ - ret = constFileManagerBackupSettingsContentSettings; + ret = hbTrId( "Settings" ); } else if ( content & EFileManagerBackupContentMessages ){ - ret = constFileManagerBackupSettingsContentMessages; + ret = hbTrId( "Messages" ); } else if ( content & EFileManagerBackupContentContacts ){ - ret = constFileManagerBackupSettingsContentContacts; + ret = hbTrId( "Contacts" ); } else if ( content & EFileManagerBackupContentCalendar ){ - ret = constFileManagerBackupSettingsContentCalendar; + ret = hbTrId( "Calendar" ); } else if ( content & EFileManagerBackupContentBookmarks ){ - ret = constFileManagerBackupSettingsContentBookmarks; + ret = hbTrId( "Bookmarks" ); } else if ( content & EFileManagerBackupContentUserFiles ){ - ret = constFileManagerBackupSettingsContentUserFiles; + ret = hbTrId( "Files" ); } return ret; } @@ -237,25 +239,25 @@ switch (weekday) { case EFileManagerBackupWeekdayMonday: - ret = constFileManagerBackupWeekdayMonday; + ret = hbTrId( "Monday" ); break; case EFileManagerBackupWeekdayTuesday: - ret = constFileManagerBackupWeekdayTuesday; + ret = hbTrId( "Tuesday" ); break; case EFileManagerBackupWeekdayWednesday: - ret = constFileManagerBackupWeekdayWednesday; + ret = hbTrId( "Wednesday" ); break; case EFileManagerBackupWeekdayThursday: - ret = constFileManagerBackupWeekdayThursday; + ret = hbTrId( "Thursday" ); break; case EFileManagerBackupWeekdayFriday: - ret = constFileManagerBackupWeekdayFirday; + ret = hbTrId( "Friday" ); break; case EFileManagerBackupWeekdaySaturday: - ret = constFileManagerBackupWeekdaySaturday; + ret = hbTrId( "Saturday" ); break; case EFileManagerBackupWeekdaySunday: - ret = constFileManagerBackupWeekdaySunday; + ret = hbTrId( "Sunday" ); break; } return ret; @@ -268,13 +270,13 @@ switch (scheduling) { case EFileManagerBackupScheduleNever: - ret = constFileManagerBackupScheduleNever; + ret = hbTrId( "Never" ); break; case EFileManagerBackupScheduleDaily: - ret = constFileManagerBackupScheduleDaily; + ret = hbTrId ("Daily" ); break; case EFileManagerBackupScheduleWeekly: - ret = constFileManagerBackupScheduleWeekly; + ret = hbTrId( "Weekly" ); break; } return ret; diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/fmfiledialog/bwins/fmfiledialogu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/filemanager/src/fmfiledialog/bwins/fmfiledialogu.def Tue Jul 06 14:06:28 2010 +0300 @@ -0,0 +1,25 @@ +EXPORTS + ??_EFmFileDialog@@UAE@I@Z @ 1 NONAME ; FmFileDialog::~FmFileDialog(unsigned int) + ?qt_metacall@FmFileDialog@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 2 NONAME ; int FmFileDialog::qt_metacall(enum QMetaObject::Call, int, void * *) + ??1FmFileDialog@@EAE@XZ @ 3 NONAME ; FmFileDialog::~FmFileDialog(void) + ?tr@FmFileDialog@@SA?AVQString@@PBD0H@Z @ 4 NONAME ; class QString FmFileDialog::tr(char const *, char const *, int) + ?getOpenFileName@FmFileDialog@@SA?AVQString@@PAVHbWidget@@ABV2@1ABVQStringList@@V?$QFlags@W4Option@FmFileDialog@@@@@Z @ 5 NONAME ; class QString FmFileDialog::getOpenFileName(class HbWidget *, class QString const &, class QString const &, class QStringList const &, class QFlags) + ??0FmFileDialog@@AAE@PAVQGraphicsItem@@@Z @ 6 NONAME ; FmFileDialog::FmFileDialog(class QGraphicsItem *) + ?tr@FmFileDialog@@SA?AVQString@@PBD0@Z @ 7 NONAME ; class QString FmFileDialog::tr(char const *, char const *) + ?getStaticMetaObject@FmFileDialog@@SAABUQMetaObject@@XZ @ 8 NONAME ; struct QMetaObject const & FmFileDialog::getStaticMetaObject(void) + ?d_func@FmFileDialog@@ABEPBVFmFileDialogPrivate@@XZ @ 9 NONAME ; class FmFileDialogPrivate const * FmFileDialog::d_func(void) const + ?exec@FmFileDialog@@AAE_NXZ @ 10 NONAME ; bool FmFileDialog::exec(void) + ?trUtf8@FmFileDialog@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString FmFileDialog::trUtf8(char const *, char const *) + ?trUtf8@FmFileDialog@@SA?AVQString@@PBD0H@Z @ 12 NONAME ; class QString FmFileDialog::trUtf8(char const *, char const *, int) + ?metaObject@FmFileDialog@@UBEPBUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const * FmFileDialog::metaObject(void) const + ?staticMetaObject@FmFileDialog@@2UQMetaObject@@B @ 14 NONAME ; struct QMetaObject const FmFileDialog::staticMetaObject + ?getSaveFileName@FmFileDialog@@SA?AVQString@@PAVHbWidget@@ABV2@1ABVQStringList@@V?$QFlags@W4Option@FmFileDialog@@@@@Z @ 15 NONAME ; class QString FmFileDialog::getSaveFileName(class HbWidget *, class QString const &, class QString const &, class QStringList const &, class QFlags) + ?d_func@FmFileDialog@@AAEPAVFmFileDialogPrivate@@XZ @ 16 NONAME ; class FmFileDialogPrivate * FmFileDialog::d_func(void) + ?getExistingDirectory@FmFileDialog@@SA?AVQString@@PAVHbWidget@@ABV2@1ABVQStringList@@V?$QFlags@W4Option@FmFileDialog@@@@@Z @ 17 NONAME ; class QString FmFileDialog::getExistingDirectory(class HbWidget *, class QString const &, class QString const &, class QStringList const &, class QFlags) + ?qt_metacast@FmFileDialog@@UAEPAXPBD@Z @ 18 NONAME ; void * FmFileDialog::qt_metacast(char const *) + ?dialogClosed@FmFileDialog@@AAEXPAVHbAction@@@Z @ 19 NONAME ; void FmFileDialog::dialogClosed(class HbAction *) + ?setSecondaryAction@FmFileDialog@@AAEXPAVHbAction@@@Z @ 20 NONAME ; void FmFileDialog::setSecondaryAction(class HbAction *) + ?secondaryAction@FmFileDialog@@ABEPAVHbAction@@XZ @ 21 NONAME ; class HbAction * FmFileDialog::secondaryAction(void) const + ?setPrimaryAction@FmFileDialog@@AAEXPAVHbAction@@@Z @ 22 NONAME ; void FmFileDialog::setPrimaryAction(class HbAction *) + ?primaryAction@FmFileDialog@@ABEPAVHbAction@@XZ @ 23 NONAME ; class HbAction * FmFileDialog::primaryAction(void) const + diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/fmfiledialog/eabi/fmfiledialogu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/filemanager/src/fmfiledialog/eabi/fmfiledialogu.def Tue Jul 06 14:06:28 2010 +0300 @@ -0,0 +1,27 @@ +EXPORTS + _ZN12FmFileDialog11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME + _ZN12FmFileDialog11qt_metacastEPKc @ 2 NONAME + _ZN12FmFileDialog15getOpenFileNameEP8HbWidgetRK7QStringS4_RK11QStringList6QFlagsINS_6OptionEE @ 3 NONAME + _ZN12FmFileDialog15getSaveFileNameEP8HbWidgetRK7QStringS4_RK11QStringList6QFlagsINS_6OptionEE @ 4 NONAME + _ZN12FmFileDialog16staticMetaObjectE @ 5 NONAME DATA 16 + _ZN12FmFileDialog19getStaticMetaObjectEv @ 6 NONAME + _ZN12FmFileDialog20getExistingDirectoryEP8HbWidgetRK7QStringS4_RK11QStringList6QFlagsINS_6OptionEE @ 7 NONAME + _ZN12FmFileDialog4execEv @ 8 NONAME + _ZN12FmFileDialogC1EP13QGraphicsItem @ 9 NONAME + _ZN12FmFileDialogC2EP13QGraphicsItem @ 10 NONAME + _ZN12FmFileDialogD0Ev @ 11 NONAME + _ZN12FmFileDialogD1Ev @ 12 NONAME + _ZN12FmFileDialogD2Ev @ 13 NONAME + _ZNK12FmFileDialog10metaObjectEv @ 14 NONAME + _ZTI12FmFileDialog @ 15 NONAME + _ZTV12FmFileDialog @ 16 NONAME + _ZThn16_N12FmFileDialogD0Ev @ 17 NONAME + _ZThn16_N12FmFileDialogD1Ev @ 18 NONAME + _ZThn8_N12FmFileDialogD0Ev @ 19 NONAME + _ZThn8_N12FmFileDialogD1Ev @ 20 NONAME + _ZN12FmFileDialog12dialogClosedEP8HbAction @ 21 NONAME + _ZN12FmFileDialog16setPrimaryActionEP8HbAction @ 22 NONAME + _ZN12FmFileDialog18setSecondaryActionEP8HbAction @ 23 NONAME + _ZNK12FmFileDialog13primaryActionEv @ 24 NONAME + _ZNK12FmFileDialog15secondaryActionEv @ 25 NONAME + diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/fmfiledialog/src/fmfiledialog_p.cpp --- a/filemanager/src/fmfiledialog/src/fmfiledialog_p.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/fmfiledialog/src/fmfiledialog_p.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -90,11 +90,13 @@ { // Create action for ok button and assign it to the primary action of popup mOkAction = new HbAction( primaryActionText, mFileDialog ); + mOkAction->setObjectName( "okAction" ); Q_ASSERT( mOkAction ); mFileDialog->setPrimaryAction( mOkAction ); // Create action for cancel button and assign it to the secondary action of popup mCancelAction = new HbAction( secondaryActionText, mFileDialog ); + mCancelAction->setObjectName( "cancelAction" ); Q_ASSERT( mCancelAction ); mFileDialog->setSecondaryAction( mCancelAction ); } @@ -144,6 +146,7 @@ void FmFileDialogPrivate::createHeadingWidget() { mHeadingWidget = new HbWidget( mFileDialog ); + mHeadingWidget->setObjectName( "headingWidget" ); QGraphicsLinearLayout *headingLayout = new QGraphicsLinearLayout; headingLayout->setOrientation(Qt::Horizontal); @@ -154,6 +157,7 @@ titleLayout->setOrientation(Qt::Vertical); mTitleLabel = new HbLabel(); + mTitleLabel->setObjectName( "titleLabel" ); if( mArgs.mTitle.isEmpty() ){ mTitleLabel->setPlainText( QString( FmPlaceholderString ) ); } else { @@ -161,9 +165,11 @@ } mCurrentPathLabel = new HbLabel( QString( FmPlaceholderString ) ); + mCurrentPathLabel->setObjectName( "currentPathLabel" ); mCurrentPathLabel->setElideMode(Qt::ElideRight); mUpButton = new HbPushButton; + mUpButton->setObjectName( "upButton" ); mUpButton->setIcon(HbIcon(backButtonIcon)); titleLayout->addItem( mTitleLabel ); @@ -187,6 +193,7 @@ void FmFileDialogPrivate::createContentWidget() { mContentWidget = new HbWidget( mFileDialog ); + mContentWidget->setObjectName( "contentWidget" ); mContentLayout = new QGraphicsLinearLayout; mContentLayout->setOrientation(Qt::Vertical); @@ -194,6 +201,7 @@ mContentWidget->setLayout( mContentLayout ); mFileWidget = new FmFileWidget( mContentWidget ); + mFileWidget->setObjectName( "fileWidget" ); mContentLayout->addItem( mFileWidget ); mFileDialog->setContentWidget( mContentWidget ); @@ -210,15 +218,18 @@ return; } HbWidget *bottomWidget = new HbWidget( mContentWidget ); + bottomWidget->setObjectName( "bottomWidget" ); mContentLayout->addItem( bottomWidget ); QGraphicsLinearLayout *bottomLayout = new QGraphicsLinearLayout; bottomLayout->setOrientation( Qt::Horizontal ); mFileNameTitleLabel = new HbLabel( mFileDialog->tr( "file name:" ), bottomWidget ); + mFileNameTitleLabel->setObjectName( "fileNameTitleLabel" ); bottomLayout->addItem( mFileNameTitleLabel ); mFileNameLineEdit = new HbLineEdit( bottomWidget ); + mFileNameLineEdit->setObjectName( "fileNameLineEdit" ); bottomLayout->addItem( mFileNameLineEdit ); bottomWidget->setLayout( bottomLayout ); @@ -256,10 +267,12 @@ } break; case SaveFileMode: - if( mFileWidget->currentPath().absoluteFilePath().isEmpty() ) { - mFileNameLineEdit->setReadOnly( true ); - } else { - mFileNameLineEdit->setReadOnly( false ); + if( mFileNameLineEdit ){ + if( mFileWidget->currentPath().absoluteFilePath().isEmpty() ) { + mFileNameLineEdit->setReadOnly( true ); + } else { + mFileNameLineEdit->setReadOnly( false ); + } } break; } diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/fmfiledialog/src/fmfilewidget.cpp --- a/filemanager/src/fmfiledialog/src/fmfilewidget.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/fmfiledialog/src/fmfilewidget.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -21,6 +21,7 @@ #include "fmdrivemodel.h" #include "fmdrivewatcher.h" #include "fmcommon.h" +#include "fmfileiconprovider.h" #include "hbstyle.h" #include "hbabstractitemview.h" @@ -28,7 +29,7 @@ #include #include -#include +#include #include #include @@ -43,7 +44,8 @@ FmFileWidget::~FmFileWidget() { setModel( 0 ); - delete mDirModel; + delete mFileSystemModel; + delete mFileIconProvider; delete mDriveModel; mDriveWatcher->cancelWatch(); @@ -57,8 +59,8 @@ if( !index.isValid() ) { return QFileInfo(); } - if( mCurrentModel == mDirModel ) { - return mDirModel->fileInfo( index ); + if( mCurrentModel == mFileSystemModel ) { + return mFileSystemModel->fileInfo( index ); } else { return QFileInfo(); } @@ -67,16 +69,18 @@ void FmFileWidget::setRootPath( const QString &pathName ) { FmLogger::log( "FmFileWidget::setRootPath start" ); - if( pathName.isEmpty() || !FmUtils::isPathAccessabel( pathName ) ) { + // If path is empty or can not access, set model as DriveModel + // Otherwise set model as FileSystemModel, means it will return to drive view if error occur. + if( ( pathName.isEmpty() ) || ( FmErrNone != FmUtils::isPathAccessabel( pathName ) ) ) { FmLogger::log( "FmFileWidget::setRootPath set drive model" ); setModel( mDriveModel ); FmLogger::log( "FmFileWidget::setRootPath set drive model end" ); emit pathChanged( QString() ); } else { FmLogger::log( "FmFileWidget::setRootPath set dir model end" ); - setModel( mDirModel ); + setModel( mFileSystemModel ); FmLogger::log( "FmFileWidget::setRootPath set dir model end" ); - mListView->setRootIndex( mDirModel->index( pathName ) ); + mListView->setRootIndex( mFileSystemModel->setRootPath( pathName ) ); FmLogger::log( "FmFileWidget::setRootPath set rootIndex" ); emit pathChanged( pathName ); } @@ -92,6 +96,7 @@ { FmLogger::log("FmFileWidget::on_list_activated start" ); if( mCurrentModel == mDriveModel ) { + //If currenty model is DriveModel, open drive and set path QString driveName = mDriveModel->driveName( mActivatedModelIndex ); QString checkedPath = FmUtils::checkDriveToFolderFilter( driveName ); if( checkedPath.isEmpty() ) { @@ -100,21 +105,21 @@ } FmLogger::log("FmFileWidget::on_list_activated setModel dir start" ); - setModel( mDirModel ); + setModel( mFileSystemModel ); FmLogger::log("FmFileWidget::on_list_activated setModel dir end" ); - mListView->setRootIndex( mDirModel->index( checkedPath ) ); + setRootPath( checkedPath ); FmLogger::log("FmFileWidget::on_list_activated setRootIndex" ); emit pathChanged( checkedPath ); FmLogger::log("FmFileWidget::on_list_activated finish emit pathChanged" ); } - else if( mCurrentModel == mDirModel ) { - if ( mDirModel->isDir( mActivatedModelIndex ) ) { + else if( mCurrentModel == mFileSystemModel ) { + //If currenty model is FileSystemModel, open path or emit file activate signal. + if ( mFileSystemModel->isDir( mActivatedModelIndex ) ) { FmLogger::log("FmFileWidget::on_list_activated start changeRootIndex" ); changeRootIndex( mActivatedModelIndex ); FmLogger::log("FmFileWidget::on_list_activated finish changeRootIndex" ); - FmLogger::log("FmFileWidget::on_list_activated finish emit fileActivated" ); } else { - QFileInfo fileInfo( mDirModel->filePath( mActivatedModelIndex ) ); + QFileInfo fileInfo( mFileSystemModel->filePath( mActivatedModelIndex ) ); if( fileInfo.isFile() ) { emit fileActivated( fileInfo.fileName() ); FmLogger::log("FmFileWidget::on_list_activated finish emit fileActivated" ); @@ -128,27 +133,26 @@ void FmFileWidget::setModelFilter( QDir::Filters filters ) { - mDirModel->setFilter( filters ); + mFileSystemModel->setFilter( filters ); } void FmFileWidget::setNameFilters( const QStringList &nameFilters ) { - mDirModel->setNameFilters( nameFilters ); + mFileSystemModel->setNameFilters( nameFilters ); } void FmFileWidget::changeRootIndex( const QModelIndex &index ) { FmLogger::log("FmFileWidget::changeRootIndex start" ); - if( mCurrentModel != mDirModel ) { - FmLogger::log("FmFileWidget::changeRootIndex end because model not equal dirmodel" ); + if( mCurrentModel != mFileSystemModel ) { + FmLogger::log("FmFileWidget::changeRootIndex end because model not equal mFileSystemModel" ); return; } - mDirModel->fetchMore(index); - mListView->setRootIndex( index ); - QFileInfo fileInfo = mDirModel->fileInfo( mListView->rootIndex() ); - QString string = fileInfo.absoluteFilePath(); - emit pathChanged( string ); + mFileSystemModel->fetchMore(index); + QString filePath = mFileSystemModel->fileInfo( index ).absoluteFilePath(); + // pathChanged signal will be emitted in setRootPath + setRootPath( filePath ); FmLogger::log("FmFileWidget::changeRootIndex end" ); } @@ -164,10 +168,13 @@ mDriveModel = new FmDriveModel( this, FmDriveModel::FillWithVolume | FmDriveModel::FillWithDefaultVolume | FmDriveModel::HideUnAvailableDrive ); - qDebug("constructed dirveModel"); + qDebug( QTime::currentTime().toString().toUtf8().data() ); - mDirModel = new QDirModel( this ); - qDebug("constructed dirModel"); + mFileSystemModel = new QFileSystemModel( this ); + mFileIconProvider = new FmFileIconProvider(); + mFileSystemModel->setIconProvider( mFileIconProvider ); + qDebug("constructed mFileSystemModel"); + qDebug( QTime::currentTime().toString().toUtf8().data() ); setModel( mDriveModel ); qDebug("setmodel"); @@ -200,7 +207,7 @@ ViewType viewType = DriveView; if( mCurrentModel == mDriveModel ) { viewType = DriveView; - } else if( mCurrentModel == mDirModel ) { + } else if( mCurrentModel == mFileSystemModel ) { viewType = DirView; } else { Q_ASSERT( false ); @@ -214,6 +221,8 @@ QString path( FmUtils::checkFolderToDriveFilter( currentPath().absoluteFilePath() ) ); QFileInfo fileInfo( path ); QString cdUpPath; + // path length>3 means currenty path is a sub folder, then get up level path and navigate to it + // Otherwise means current path is a top level drive path, Should navigate to drive view. So setRootPath with empty path string. if( path.length() > 3 ) { cdUpPath = fileInfo.dir().absolutePath(); } @@ -230,7 +239,7 @@ setModel( mDriveModel ); emit pathChanged( QString() ); } else if( currentViewType() == DirView ) { - if( !FmUtils::isPathAccessabel( currentPath().absoluteFilePath() ) ) { + if( FmErrNone != FmUtils::isPathAccessabel( currentPath().absoluteFilePath() ) ) { // path not available, set model to drive FmLogger::log( QString( "FmFileDialog_FmFileWidget::on_driveWatcher_driveAddedOrChanged path not availeable, set drivemodel:" + currentPath().absoluteFilePath() ) ); diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/fmfiledialog/src/fmfilewidget.h --- a/filemanager/src/fmfiledialog/src/fmfilewidget.h Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/fmfiledialog/src/fmfilewidget.h Tue Jul 06 14:06:28 2010 +0300 @@ -24,12 +24,14 @@ #include #include -class QDirModel; +class QFileSystemModel; class FmDriveModel; class FmDriveWatcher; class HbListView; class QGraphicsLinearLayout; +class FmFileIconProvider; + class FmFileWidget : public HbWidget { Q_OBJECT @@ -68,13 +70,15 @@ private: HbListView *mListView; QGraphicsLinearLayout *mLayout; - QDirModel *mDirModel; - FmDriveModel *mDriveModel; + QFileSystemModel *mFileSystemModel; + FmDriveModel *mDriveModel; QAbstractItemModel *mCurrentModel; FmDriveWatcher *mDriveWatcher; QModelIndex mActivatedModelIndex; + + FmFileIconProvider *mFileIconProvider; }; diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/inc/commonutils.pri --- a/filemanager/src/inc/commonutils.pri Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/inc/commonutils.pri Tue Jul 06 14:06:28 2010 +0300 @@ -17,11 +17,13 @@ INTERNAL_HEADERS += $$PWD/fmutils.h \ $$PWD/fmdrivemodel.h \ $$PWD/fmfileiconprovider.h \ - $$PWD/fmdrivewatcher/fmdrivewatcher.h + $$PWD/fmdrivewatcher/fmdrivewatcher.h \ + $$PWD/fmfiletyperecognizer.h INTERNAL_SOURCES += $$PWD/fmdrivemodel.cpp \ $$PWD/fmfileiconprovider.cpp \ - $$PWD/fmdrivewatcher/fmdrivewatcher.cpp + $$PWD/fmdrivewatcher/fmdrivewatcher.cpp \ + $$PWD/fmfiletyperecognizer.cpp symbian { INTERNAL_HEADERS += $$PWD/fms60utils.h \ diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/inc/fmdefine.h --- a/filemanager/src/inc/fmdefine.h Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/inc/fmdefine.h Tue Jul 06 14:06:28 2010 +0300 @@ -18,48 +18,55 @@ #define FMDEFINE_H // define for filemanager error -#define FmErrNone 0 -#define FmErrNotFound -1 -#define FmErrGeneral -2 -#define FmErrAlreadyExists -3 -#define FmErrAccessDenied -4 -#define FmErrCannotRemove -5 -#define FmErrCannotCopy -6 -#define FmErrDiskFull -7 -#define FmErrFileUsed -8 -#define FmErrFolderUsed -9 -#define FmErrTypeFormatFailed -10 -#define FmErrTypeFormatFailedUsed -11 -#define FmErrAlreadyStarted -12 -#define FmErrCancel -13 -#define FmErrWrongParam -14 -#define FmErrUnKnown -15 -#define FmErrIsNotFileOrFolder -16 -#define FmErrCannotMakeDir -17 -#define FmErrSrcPathDoNotExist -18 -#define FmErrDestPathDoNotExist -19 -#define FmErrCopyDestToSubFolderInSrc -20 -#define FmErrMoveDestToSubFolderInSrc -21 -#define FmErrNotSupported -22 -#define FmErrNotReady -23 -#define FmErrInUse -24 -#define FmErrPermissionDenied -25 -#define FmErrBadName -26 -#define FmErrPathNotFound -27 -#define FmErrRemoveDefaultFolder -28 -#define FmErrLocked -29 -#define FmErrCorrupt -30 -#define FmErrDisMounted -31 +#define FmErrNone 0 // No Error +#define FmErrNotFound -1 // General error for things requested is not found +#define FmErrGeneral -2 // General error +#define FmErrAlreadyExists -3 // General for already existed. for example if unlock a drive but it has already been unlocked +#define FmErrAccessDenied -4 // General for Access is denied, for example, format a drive but access is denied. +#define FmErrCannotRemove -5 // General error for can not performance remove +#define FmErrCannotCopy -6 // General error for can not performance copy +#define FmErrDiskFull -7 // Error for disk is full +#define FmErrFileUsed -8 // Error for file is in use +#define FmErrFolderUsed -9 // Error for folder is in use +#define FmErrTypeFormatFailed -10 // Error reported when format failed +#define FmErrTypeFormatFailedUsed -11 // Error reported when user try to format a drive but it is in use +#define FmErrAlreadyStarted -12 // General error for operation is already started +#define FmErrCancel -13 // General error for operation canceled +#define FmErrWrongParam -14 // General error for wrong parameter +#define FmErrUnKnown -15 // Unknown error +#define FmErrIsNotFileOrFolder -16 // Error for a path which is not a fild or folder. +#define FmErrCannotMakeDir -17 // Error for can not create directory. +#define FmErrSrcPathDoNotExist -18 // Error for source path is not exist. +#define FmErrDestPathDoNotExist -19 // Error for destination path is not exist. +#define FmErrCopyDestToSubFolderInSrc -20 // If user try to copy a folder to its sub folder, error will occur +#define FmErrMoveDestToSubFolderInSrc -21 // If user try to move a folder to its sub folder, error will occur +#define FmErrNotSupported -22 // feature not supported, for example, lock an drive which can not be locked +#define FmErrNotReady -23 // Error when drive is not ready( means drive is not present ) +#define FmErrInUse -24 // Error for drive is in use. +#define FmErrPermissionDenied -25 // Permission Denied +#define FmErrBadName -26 // Bad Drive or file/folder name, currently used when rename drive +#define FmErrPathNotFound -27 // Error for path is not found +#define FmErrRemoveDefaultFolder -28 // Error when user try to remove default folder, such as C:/data/images... +#define FmErrLocked -29 // Disk is locked +#define FmErrCorrupt -30 // Disk is corrupt +#define FmErrDisMounted -31 // e.g. If disk dis mounted while backuping. +#define FmErrDriveNotAvailable -32 // e.g. if user want to access MMC but it is not available +#define FmErrPathDenied -33 // if user want to access path but it is denied, e.g c:/private +#define FmErrDriveDenied -34 // if user want to access drive but it is denied, e.g D:/ +#define FmErrPathNotExist -35 // path not existed. #define FmEstimateUpperLimit 90 // available mem/backup size*100%=90%, User selectable continuation #define FmEstimateLowerLimit 10 // available mem/backup size*100%=10%, Backup will be interrupted #define FmPlaceholderString " " // Placeholder for HbLabel because layout will be wrong when HbLabel is empty -#define Drive_C QString( "C:" ) + QDir::separator() -#define Drive_D QString( "D:" ) + QDir::separator() -#define Drive_Z QString( "Z:" ) + QDir::separator() -#define Folder_C_Data QString( "C:" ) + QDir::separator() + QString( "Data" ) + QDir::separator() +#define Drive_C ( QString( "C:" ) + QDir::separator() ) +#define Drive_D ( QString( "D:" ) + QDir::separator() ) +#define Drive_Z ( QString( "Z:" ) + QDir::separator() ) +#define Folder_C_Data ( QString( "C:" ) + QDir::separator() + QString( "Data" ) + QDir::separator() ) + +// define contact data path for view details. +#define FmViewDetail_Contacts ( "\\private\\10003a73\\SQLite__Contacts.cdb" ) #define FmMaxLengthofDriveName 11 #define FmMaxLengthofDrivePassword 8 diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/inc/fmdrivemodel.cpp --- a/filemanager/src/inc/fmdrivemodel.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/inc/fmdrivemodel.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -22,6 +22,8 @@ #include #include +#include + FmDriveModel::FmDriveModel( QObject *parent, Options options, FmDriveListProvider *driveListProvider ) : QAbstractListModel( parent ), mOptions( options ), mDriveListProvider( driveListProvider ) @@ -108,10 +110,10 @@ return QVariant(); switch (section) { - case 0: return tr("Name"); - case 1: return tr("Size"); - case 2: return tr("Type"); - case 3: return tr("Date Modified"); + case 0: return hbTrId("Name"); + case 1: return hbTrId("Size"); + case 2: return hbTrId("Type"); + case 3: return hbTrId("Date Modified"); default: return QVariant(); } } diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/inc/fmdrivemodel.h --- a/filemanager/src/inc/fmdrivemodel.h Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/inc/fmdrivemodel.h Tue Jul 06 14:06:28 2010 +0300 @@ -20,9 +20,10 @@ #include #include -#include #include +class FmFileIconProvider; + /*! \class FmDriveListProvider \brief The class FmDriveListProvider provide drive list which is used in FmDriveModel @@ -71,7 +72,7 @@ private: QStringList mFindResult; - QFileIconProvider *mIconProvider; + FmFileIconProvider *mIconProvider; QStringList mDriveList; Options mOptions; diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/inc/fmfileiconprovider.cpp --- a/filemanager/src/inc/fmfileiconprovider.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/inc/fmfileiconprovider.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -16,58 +16,171 @@ */ #include "fmfileiconprovider.h" +#include "fmfiletyperecognizer.h" #include "fmutils.h" #include #include -#define mmcIcon ":image/qgn_prop_mmc_memc.svg" -#define mmcNoneIcon ":image/qgn_prop_fmgr_mmc_no_sub.svg" +#include "hbicon.h" + +//#define mmcIcon ":image/qgn_prop_mmc_memc.svg" +//#define mmcNoneIcon ":image/qgn_prop_fmgr_mmc_no_sub.svg" +//#define mmcLockedIcon ":image/qgn_prop_mmc_locked.svg" +//#define phoneMemoryIcon ":image/qgn_prop_phone_memc.svg" +//#define usbMemoryIcon ":image/qgn_prop_usb_memc.svg" +//#define massMemoryIcon ":image/qgn_prop_fmgr_ms.svg" + +#define phoneMemoryIcon "qtg_large_mobile" +#define massMemoryIcon "qtg_large_mass_storage" +#define mmcIcon "qtg_large_mmc" +#define mmcNoneIcon "qtg_large_mmc_removed" +#define usbMemoryIcon "qtg_large_usb_memory" + +//TODO: UI_Update: mmcl locked icon have not provided in icon spec +// Just use orignal custom-defined icon #define mmcLockedIcon ":image/qgn_prop_mmc_locked.svg" -#define phoneMemoryIcon ":image/qgn_prop_phone_memc.svg" -#define usbMemoryIcon ":image/qgn_prop_usb_memc.svg" -#define massMemoryIcon ":image/qgn_prop_fmgr_ms.svg" + + +#define folderIcon "qtg_large_folder" + +#define imageIcon "qtg_large_photos" +#define videoIcon "qtg_large_video" +#define toneIcon "qtg_large_tone" +#define playlistIcon "qtg_large_playlist" +#define textIcon "qtg_large_text" +#define sisxIcon "qtg_large_sisx" +#define javaIcon "qtg_large_java" +#define flashIcon "qtg_large_flash" +#define widgetIcon "qtg_large_widget" +#define weblinkIcon "qtg_large_web_link" +#define queryIcon "qtg_large_query" FmFileIconProvider::FmFileIconProvider() { - + mFileTypeRecognizer = new FmFileTypeRecognizer(); } FmFileIconProvider::~FmFileIconProvider() { + delete mFileTypeRecognizer; } - + QIcon FmFileIconProvider::icon(const QFileInfo &info) const { - QString filePath( info.path() ); - if( FmUtils::isDrive( filePath ) ) { - FmDriverInfo::DriveState driveState = FmUtils::queryDriverInfo( filePath ).driveState(); - if( driveState & FmDriverInfo::EDriveAvailable ){ - if( driveState & FmDriverInfo::EDriveRemovable ) { - if( driveState & FmDriverInfo::EDriveMassStorage ) { - // Mass Storage - return QIcon( massMemoryIcon ); - } else if( driveState & FmDriverInfo::EDriveUsbMemory ) { - // Usb Memory - return QIcon( usbMemoryIcon ); + QIcon retIcon; + + QString filePath( info.absoluteFilePath() ); + FmFileTypeRecognizer::FileType fileType = mFileTypeRecognizer->getType( filePath ); + switch( fileType ) + { + case FmFileTypeRecognizer::FileTypeDrive: + { + FmDriverInfo::DriveState driveState = FmUtils::queryDriverInfo( filePath ).driveState(); + if( driveState & FmDriverInfo::EDriveAvailable ){ + if( driveState & FmDriverInfo::EDriveRemovable ) { + if( driveState & FmDriverInfo::EDriveMassStorage ) { + // Mass Storage + retIcon = HbIcon( massMemoryIcon ).qicon(); + break; + } else if( driveState & FmDriverInfo::EDriveUsbMemory ) { + // Usb Memory + retIcon = HbIcon( usbMemoryIcon ).qicon(); + break; + } else{ + //Memory Card + retIcon = HbIcon( mmcIcon ).qicon(); + break; + } } else{ - //Memory Card - return QIcon( mmcIcon ); + //Phone Memory + retIcon = HbIcon( phoneMemoryIcon ).qicon(); + break; } - } else{ - //Phone Memory - return QIcon( phoneMemoryIcon ); + } else if( driveState & FmDriverInfo::EDriveLocked ) { + retIcon = HbIcon( mmcLockedIcon ).qicon(); + break; + } else if( driveState & FmDriverInfo::EDriveCorrupted ) { + retIcon = HbIcon( mmcNoneIcon ).qicon(); + break; + } else if( driveState & FmDriverInfo::EDriveNotPresent ){ + retIcon = HbIcon( mmcNoneIcon ).qicon(); + break; + } else { + retIcon = HbIcon( mmcNoneIcon ).qicon(); + break; + } + } + case FmFileTypeRecognizer::FileTypeFolder: + { + retIcon = HbIcon( folderIcon ).qicon(); + break; + } + case FmFileTypeRecognizer::FileTypeImage: + { + retIcon = HbIcon( imageIcon ).qicon(); + break; + } + case FmFileTypeRecognizer::FileTypeVideo: + { + retIcon = HbIcon( videoIcon ).qicon(); + break; + } + case FmFileTypeRecognizer::FileTypeTone: + { + retIcon = HbIcon( toneIcon ).qicon(); + break; + } + case FmFileTypeRecognizer::FileTypePlaylist: + { + retIcon = HbIcon( playlistIcon ).qicon(); + break; + } + case FmFileTypeRecognizer::FileTypeText: + { + retIcon = HbIcon( textIcon ).qicon(); + break; } - } else if( driveState & FmDriverInfo::EDriveLocked ) { - return QIcon( mmcLockedIcon ); - } else if( driveState & FmDriverInfo::EDriveCorrupted ) { - return QIcon( mmcNoneIcon ); - } else if( driveState & FmDriverInfo::EDriveNotPresent ){ - return QIcon( mmcNoneIcon ); - } else { - return QIcon( mmcNoneIcon ); + case FmFileTypeRecognizer::FileTypeSisx: + { + retIcon = HbIcon( sisxIcon ).qicon(); + break; + } + case FmFileTypeRecognizer::FileTypeJava: + { + retIcon = HbIcon( javaIcon ).qicon(); + break; + } + case FmFileTypeRecognizer::FileTypeFlash: + { + retIcon = HbIcon( flashIcon ).qicon(); + break; + } + case FmFileTypeRecognizer::FileTypeWidget: + { + retIcon = HbIcon( widgetIcon ).qicon(); + break; + } + case FmFileTypeRecognizer::FileTypeWebLink: + { + retIcon = HbIcon( weblinkIcon ).qicon(); + break; + } + case FmFileTypeRecognizer::FileTypeUnKnown: + { + // currently filemanger icon doc is not unified with icon name. + // for example, qtg_small_unknown qtg_large_query both means for unknown type + // but the two icon name is not the same. + retIcon = HbIcon( queryIcon ).qicon(); + break; + } } - } else { - return QFileIconProvider::icon( info ); + + // if cannot get icon, return icon from QFileIconProvider + // this will be mostly used in win32 platform, + // because path for HbIcon only existed in hb theme of symbian + if( retIcon.isNull() ) { + retIcon = QFileIconProvider::icon( info ); } + return retIcon; } diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/inc/fmfileiconprovider.h --- a/filemanager/src/inc/fmfileiconprovider.h Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/inc/fmfileiconprovider.h Tue Jul 06 14:06:28 2010 +0300 @@ -20,16 +20,21 @@ #include +class FmFileTypeRecognizer; + class FmFileIconProvider : public QFileIconProvider { public: FmFileIconProvider(); virtual ~FmFileIconProvider(); + // from QFileIconProvider virtual QIcon icon(const QFileInfo &info) const; private: + FmFileTypeRecognizer *mFileTypeRecognizer; + }; #endif diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/inc/fmfiletyperecognizer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/filemanager/src/inc/fmfiletyperecognizer.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -0,0 +1,140 @@ +/* + * 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 file type recognizer + */ + +#include "fmfiletyperecognizer.h" +#include "fmutils.h" +#include +#include + +FmFileTypeRecognizer::FmFileTypeRecognizer() +{ + QStringList fileExtensionList; + + fileExtensionList.append( QString( "bmp" ) ); + fileExtensionList.append( QString( "gif" ) ); + fileExtensionList.append( QString( "jpe" ) ); + fileExtensionList.append( QString( "jpeg" ) ); + fileExtensionList.append( QString( "jpg" ) ); + fileExtensionList.append( QString( "ota" ) ); + fileExtensionList.append( QString( "png" ) ); + fileExtensionList.append( QString( "tif" ) ); + fileExtensionList.append( QString( "tiff" ) ); + fileExtensionList.append( QString( "wbmp" ) ); + fileExtensionList.append( QString( "wmf" ) ); + fileExtensionList.append( QString( "jp2" ) ); + fileExtensionList.append( QString( "jpg2" ) ); + fileExtensionList.append( QString( "jp3" ) ); + fileExtensionList.append( QString( "ico" ) ); + fileExtensionList.append( QString( "vcf" ) ); + mFileTypeMap.insert( FileTypeImage, fileExtensionList ); + + fileExtensionList.clear(); + fileExtensionList.append( QString( "3gp" ) ); + fileExtensionList.append( QString( "mp4" ) ); + fileExtensionList.append( QString( "nim" ) ); + fileExtensionList.append( QString( "rm" ) ); + fileExtensionList.append( QString( "rv" ) ); + fileExtensionList.append( QString( "wmv" ) ); + fileExtensionList.append( QString( "3g2" ) ); + fileExtensionList.append( QString( "rmvb") ); + fileExtensionList.append( QString( "mkv" ) ); + mFileTypeMap.insert( FileTypeVideo, fileExtensionList ); + + fileExtensionList.clear(); + fileExtensionList.append( QString( "aac" ) ); + fileExtensionList.append( QString( "amr" ) ); + fileExtensionList.append( QString( "au" ) ); + fileExtensionList.append( QString( "awb" ) ); + fileExtensionList.append( QString( "mid" ) ); + fileExtensionList.append( QString( "mp3" ) ); + fileExtensionList.append( QString( "ra" ) ); + fileExtensionList.append( QString( "rmf" ) ); + fileExtensionList.append( QString( "rng" ) ); + fileExtensionList.append( QString( "snd" ) ); + fileExtensionList.append( QString( "wav" ) ); + fileExtensionList.append( QString( "wve" ) ); + fileExtensionList.append( QString( "wma" ) ); + fileExtensionList.append( QString( "m4a" ) ); + fileExtensionList.append( QString( "ott" ) ); + fileExtensionList.append( QString( "mxmf" ) ); + mFileTypeMap.insert( FileTypeTone, fileExtensionList ); + + fileExtensionList.clear(); + fileExtensionList.append( QString( "doc" ) ); + fileExtensionList.append( QString( "pdf" ) ); + fileExtensionList.append( QString( "pps" ) ); + fileExtensionList.append( QString( "ppt" ) ); + fileExtensionList.append( QString( "txt" ) ); + fileExtensionList.append( QString( "xls" ) ); + mFileTypeMap.insert( FileTypeText, fileExtensionList ); + + fileExtensionList.clear(); + fileExtensionList.append( QString( "sis" ) ); + fileExtensionList.append( QString( "sisx" ) ); + mFileTypeMap.insert( FileTypeSisx, fileExtensionList ); + + fileExtensionList.clear(); + fileExtensionList.append( QString( "jad" ) ); + fileExtensionList.append( QString( "jar" ) ); + mFileTypeMap.insert( FileTypeJava, fileExtensionList ); + + fileExtensionList.clear(); + fileExtensionList.append( QString( "swf" ) ); + mFileTypeMap.insert( FileTypeFlash, fileExtensionList ); + + // have not handle FileTypePlaylist + // have not handle FileTypeWidget + // have not handle FileTypeWebLink + + // make mFileExtensionMap( data map for extenstion ) from mFileTypeMap + // this map is used to speed up recognize + QMapIterator i( mFileTypeMap ); + while (i.hasNext()) { + i.next(); + foreach( const QString extension, i.value() ) { + mFileExtensionMap.insert( extension, i.key() ); + } + } + + +} + +FmFileTypeRecognizer::~FmFileTypeRecognizer() +{ + +} + +FmFileTypeRecognizer::FileType FmFileTypeRecognizer::getType( const QString& path ) const +{ + if( FmUtils::isDrive( path ) ) { + return FileTypeDrive; + } + + QFileInfo fileInfo(path); + if( fileInfo.isDir() ) { + return FileTypeFolder; + } + + //if can not find key, return default value: FileTypeUnKnown + return mFileExtensionMap.value( fileInfo.suffix().toLower(), FileTypeUnKnown ); +} + +const QStringList FmFileTypeRecognizer::getFileListFromFileType( const FmFileTypeRecognizer::FileType fileType ) const +{ + return mFileTypeMap.value( fileType, QStringList() ); +} diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/inc/fmfiletyperecognizer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/filemanager/src/inc/fmfiletyperecognizer.h Tue Jul 06 14:06:28 2010 +0300 @@ -0,0 +1,75 @@ +/* + * 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 file type recognizer + */ + +#ifndef FMFILERECOGNIZER_H +#define FMFILERECOGNIZER_H + +#include +#include +#include +#include + +/*! + \class FmFileTypeRecognizer + \brief The class FmFileTypeRecognizer used to recognize file type by path. + */ +class FmFileTypeRecognizer +{ +public: + enum FileType{ + FileTypeDrive, + FileTypeFolder, + FileTypeImage, + FileTypeVideo, + FileTypeTone, + FileTypePlaylist, + FileTypeText, + FileTypeSisx, + FileTypeJava, + FileTypeFlash, + FileTypeWidget, + FileTypeWebLink, + FileTypeUnKnown + }; + + +public: + FmFileTypeRecognizer(); + virtual ~FmFileTypeRecognizer(); + + /*! + Recognize file type, currently only judge file by its extension name. + */ + FmFileTypeRecognizer::FileType getType( const QString& path ) const ; + + /*! + Profide a list of extension name by designate the FileType. + */ + const QStringList getFileListFromFileType( const FmFileTypeRecognizer::FileType fileType ) const; + +private: + // used to store FileType, extension name list pare. + QMap mFileTypeMap; + + // used to store single extension name, FileType pare. + // this map comes from mFileTypeMap + QMap mFileExtensionMap; +}; + +#endif /* FMDRIVEDETAILSTYPE_H */ + diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/inc/fmutils.h --- a/filemanager/src/inc/fmutils.h Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/inc/fmutils.h Tue Jul 06 14:06:28 2010 +0300 @@ -94,7 +94,7 @@ static int setDrivePwd( const QString &driverName, const QString &oldPwd, const QString &newPwd); static void emptyPwd( QString &pwd ); static int renameDrive( const QString &driverName, const QString &newVolumeName); - static void ejectDrive( const QString &driverName ); + static int ejectDrive( const QString &driverName ); static QString getFileType( const QString &filePath ); static quint64 getDriveDetailsResult( const QString &folderPath, const QString &extension ); static bool isDriveC( const QString &driverName ); @@ -103,10 +103,10 @@ static QString fillPathWithSplash( const QString &filePath ); static QString removePathSplash( const QString &filePath ); static QString formatPath( const QString &path ); - static bool checkDriveFilter( const QString &driveName ); + static bool checkDriveAccessFilter( const QString &driveName ); static QString checkDriveToFolderFilter( const QString &path ); static QString checkFolderToDriveFilter( const QString &path ); - static bool isPathAccessabel( const QString &path ); + static int isPathAccessabel( const QString &path ); static bool isDriveAvailable( const QString &path ); static bool isPathEqual( const QString &pathFst, const QString &pathLast ); @@ -123,6 +123,15 @@ static int getMaxFileNameLength(); static bool checkMaxPathLength( const QString& path ); static bool checkFolderFileName( const QString& name ); + + /** + * check file or folder path is illegal or not. + * + * @param path file/folder path. + * @param errString if return false, errString will be set for error note. + * @return true for not illegal and false for illegal path. + */ + static bool checkNewFolderOrFile( const QString &path, QString &errString ); }; diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/inc/fmutils_s60.cpp --- a/filemanager/src/inc/fmutils_s60.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/inc/fmutils_s60.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -37,6 +37,8 @@ #include #include +#include + #include #include @@ -46,10 +48,12 @@ QString FmUtils::getDriveNameFromPath( const QString &path ) { - if( path.length() <3 ) { + // fillPathWithSplash make sure path length will be at least 3 if it is not empty. + QString checkedPath( fillPathWithSplash( path ) ); + if( checkedPath.length() < 3 ) { return QString(); } - return path.left( 3 ); + return checkedPath.left( 3 ); } QString FmUtils::getDriveLetterFromPath( const QString &path ) @@ -62,6 +66,9 @@ FmDriverInfo FmUtils::queryDriverInfo( const QString &driverName ) { + if( driverName.isEmpty() ) { + return FmDriverInfo( 0, 0, driverName, QString(), FmDriverInfo::EDriveNotPresent ); + } CCoeEnv *env = CCoeEnv::Static(); RFs& fs = env->FsSession(); @@ -207,6 +214,9 @@ int FmUtils::removeDrivePwd( const QString &driverName, const QString &Pwd ) { + if( driverName.isEmpty() ) { + return FmErrWrongParam; + } QString logString = "Drive name:" + driverName; FmLogger::log( logString ); logString = "Password:" + Pwd; @@ -245,6 +255,9 @@ int FmUtils::unlockDrive( const QString &driverName, const QString &Pwd ) { + if( driverName.isEmpty() ) { + return FmErrWrongParam; + } QString logString = "Drive name:" + driverName; FmLogger::log( logString ); logString = "Password:" + Pwd; @@ -287,6 +300,9 @@ int FmUtils::checkDrivePwd( const QString &driverName, const QString &pwd ) { + if( driverName.isEmpty() ) { + return FmErrWrongParam; + } QString logString = "checkDrivePwd Drive name:" + driverName; logString += " password:" + pwd; FmLogger::log( logString ); @@ -296,6 +312,9 @@ int FmUtils::setDrivePwd( const QString &driverName, const QString &oldPwd, const QString &newPwd) { + if( driverName.isEmpty() ) { + return FmErrWrongParam; + } QString logString = "setDrivePwd Drive name:" + driverName ; logString += " Old password:" + oldPwd; logString += " New password:" + newPwd; @@ -347,6 +366,9 @@ int FmUtils::renameDrive( const QString &driverName, const QString &newVolumeName) { + if( driverName.isEmpty() ) { + return FmErrWrongParam; + } foreach( const QChar &ch, newVolumeName ) { bool a = ch.isSpace(); @@ -382,8 +404,11 @@ } } -void FmUtils::ejectDrive( const QString &driverName ) +int FmUtils::ejectDrive( const QString &driverName ) { + if( driverName.isEmpty() ) { + return FmErrWrongParam; + } QString logString = "FmUtils::ejectDrive start"; FmLogger::log( logString ); @@ -398,6 +423,7 @@ KCoreAppUIsMmcRemovedWithoutEject, ECoreAppUIsEjectCommandUsedToDrive | ( drive << KDriveShift ) ); + return FmErrNone; } QString FmUtils::getFileType( const QString &filePath ) @@ -480,6 +506,9 @@ bool FmUtils::isDriveC( const QString &driverName ) { + if( driverName.isEmpty() ) { + return false; + } TInt drive = 0; drive = driverName[0].toUpper().toAscii() - 'A' + EDriveA; if( drive == EDriveC ){ @@ -503,6 +532,9 @@ void FmUtils::createDefaultFolders( const QString &driverName ) { + if( driverName.isEmpty() ) { + return; + } int err; TInt drive = 0; @@ -600,9 +632,12 @@ return newFilePath; } -// used to filter drive which need be hide. -bool FmUtils::checkDriveFilter( const QString &driveName ) +// filter un-accessable drive +bool FmUtils::checkDriveAccessFilter( const QString &driveName ) { + if( driveName.isEmpty() ) { + return false; + } FmDriverInfo driveInfo = queryDriverInfo( driveName ); if( ( driveInfo.driveState()& FmDriverInfo::EDriveRam ) || ( driveInfo.driveState()& FmDriverInfo::EDriveRom ) ) { @@ -646,39 +681,42 @@ } -bool FmUtils::isPathAccessabel( const QString &path ) +int FmUtils::isPathAccessabel( const QString &path ) { + // Used to check if path is accessable, very important feature + // and will return filemanager error. FmLogger::log( QString( "isPathAccessabel:" ) + path ); + if( path.isEmpty() ) { + return FmErrPathNotExist; + } if( path.length() <= 3 && !isDriveAvailable( path ) ) { //used to filter locked drive FmLogger::log( QString( "isPathAccessabel false: path is drive and not available" ) ); - return false; + return FmErrDriveNotAvailable; } QFileInfo fileInfo( path ); if( fileInfo.absoluteFilePath().contains( Drive_C, Qt::CaseInsensitive ) && !fileInfo.absoluteFilePath().contains( Folder_C_Data, Qt::CaseInsensitive ) ) { FmLogger::log( QString( "isPathAccessabel false: path contain C and not in data folder" ) ); - return false; + return FmErrPathDenied; } - if( fileInfo.absoluteFilePath().contains( Drive_D, Qt::CaseInsensitive ) ) { - FmLogger::log( QString( "isPathAccessabel false: path contain D" ) ); - return false; - } - if( fileInfo.absoluteFilePath().contains( Drive_Z, Qt::CaseInsensitive ) ) { - FmLogger::log( QString( "isPathAccessabel false: path contain Z" ) ); - return false; + if( !checkDriveAccessFilter( FmUtils::getDriveNameFromPath( fileInfo.absoluteFilePath() ) ) ){ + return FmErrDriveDenied; } if( !fileInfo.exists() ) { FmLogger::log( QString( "isPathAccessabel false: path not exist" ) ); - return false; + return FmErrPathNotExist; } - FmLogger::log( QString( "isPathAccessabel true" ) ); - return true; + FmLogger::log( QString( "isPathAccessabel FmErrNone" ) ); + return FmErrNone; } // only used to check drive, when MMC is not inserted, also return false bool FmUtils::isDriveAvailable( const QString &path ) { FmLogger::log( QString( "isDriveAvailable:" ) + path ); + if( path.isEmpty() ) { + return false; + } FmDriverInfo::DriveState driveState = queryDriverInfo( path ).driveState(); if( ( driveState & FmDriverInfo::EDriveAvailable ) ) { FmLogger::log( QString( "isDriveAvailable true" ) ); @@ -699,7 +737,7 @@ foreach( QFileInfo fileInfo, infoList ) { QString driveName = fileInfo.absolutePath(); - if( checkDriveFilter( driveName ) ) { + if( checkDriveAccessFilter( driveName ) ) { if( !isHideUnAvailableDrive ) { driveList.append( driveName ); } @@ -714,9 +752,12 @@ QString FmUtils::fillDriveVolume( QString driveName, bool isFillWithDefaultVolume ) { QString ret; + if( driveName.isEmpty() ) { + return ret; + } QString tempDriveName = fillPathWithSplash( driveName ); - ret = removePathSplash( driveName ); + QString checkedDriveName( removePathSplash( driveName ) ); FmDriverInfo driverInfo = FmUtils::queryDriverInfo( tempDriveName ); QString volumeName = driverInfo.volumeName(); @@ -726,19 +767,27 @@ if( driveState & FmDriverInfo::EDriveAvailable ){ if( driveState & FmDriverInfo::EDriveRemovable ) { if( driveState & FmDriverInfo::EDriveMassStorage ) { - volumeName.append( QObject::tr( "Mass Storage" ) ); + // Mass Storage + ret = hbTrId( "txt_fmgr_dblist_1_mass_storage" ).arg( checkedDriveName ); } else if( driveState & FmDriverInfo::EDriveUsbMemory ) { - volumeName.append( QObject::tr( "Usb Memory" ) ); + // USB Memory + ret = hbTrId( "txt_fmgr_dblist_1_usb_memory" ).arg( checkedDriveName ); } else{ - volumeName.append( QObject::tr( "Memory Card" ) ); + // Memory Card + ret = hbTrId( "txt_fmgr_dblist_1_memory_card" ).arg( checkedDriveName ); } } else{ - volumeName.append( QObject::tr( "Phone Memory" ) ); + // phone memory + ret = hbTrId( "txt_fmgr_dblist_1_device_memory" ).arg( checkedDriveName ); } - } + } } - - ret += QString( " " ) + volumeName; + + if( ret.isEmpty() ) { + // set ret as volumeName + // txt_fmgr_dblist_1_2 is not correct, can not use. + ret = hbTrId( "%1 %2" ).arg( checkedDriveName ).arg( volumeName ); + } return ret; } @@ -889,3 +938,20 @@ } return true; } + +bool FmUtils::checkNewFolderOrFile( const QString &path, QString &errString ) +{ + QFileInfo fileInfo( path ); + bool ret( true ); + if (!FmUtils::checkFolderFileName( fileInfo.fileName() ) ) { + errString = hbTrId( "Invalid file or folder name!" ); + ret = false; + } else if( !FmUtils::checkMaxPathLength( path ) ) { + errString = hbTrId( "the path you specified is too long!" ); + ret = false; + } else if (fileInfo.exists()) { + errString = hbTrId( "%1 already exist!" ).arg( fileInfo.fileName() ); + ret = false; + } + return ret; +} diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/src/inc/fmutils_win.cpp --- a/filemanager/src/inc/fmutils_win.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/src/inc/fmutils_win.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -25,6 +25,8 @@ #include #include +#include + #define BURCONFIGFILE "burconfig.xml" const int KMaxFileName=0x100; const int KMaxPath=0x100; @@ -76,13 +78,13 @@ state |= FmDriverInfo::EDriveRemovable; } #ifdef _DEBUG_DISABLE_DRIVE_D_TEST_DRIVEHIDE_ - if ( driverName.contains( "D", Qt::CaseInsensitive ) ) { + if ( driverName.contains( Drive_D, Qt::CaseInsensitive ) ) { state |= FmDriverInfo::EDriveNotPresent; } #endif #ifdef _DEBUG_LOCKED_DRIVE_Z - if ( driverName.contains( "Z", Qt::CaseInsensitive ) ) { + if ( driverName.contains( Drive_Z, Qt::CaseInsensitive ) ) { state |= FmDriverInfo::EDriveLocked; } #endif @@ -105,6 +107,7 @@ return QString::number( size / ( 1024.0 * 1024.0 * 1024.0 ), 'f', 1 ) + " GB"; } } + /* quint32 FmUtils::getDriverState( const QString &driverName ) { @@ -175,9 +178,10 @@ return 0; } -void FmUtils::ejectDrive( const QString &driverName ) +int FmUtils::ejectDrive( const QString &driverName ) { Q_UNUSED( driverName ); + return FmErrNone; } QString FmUtils::getFileType( const QString &filePath ) @@ -195,7 +199,7 @@ bool FmUtils::isDriveC( const QString &driverName ) { - if( driverName.contains("C",Qt::CaseInsensitive) ){ + if( driverName.contains(Drive_C,Qt::CaseInsensitive) ){ return true; } else{ @@ -249,10 +253,10 @@ return newFilePath; } -bool FmUtils::checkDriveFilter( const QString &driveName ) +bool FmUtils::checkDriveAccessFilter( const QString &driveName ) { #ifdef _DEBUG_HIDE_VIEWFOLDER_WINDOWS_ - if( driveName.contains( "D:" ) || driveName.contains( "Z:" ) ) { + if( driveName.contains( Drive_D, Qt::CaseInsensitive ) || driveName.contains( Drive_Z, Qt::CaseInsensitive ) ) { return false; } #endif @@ -301,10 +305,10 @@ } -bool FmUtils::isPathAccessabel( const QString &path ) +int FmUtils::isPathAccessabel( const QString &path ) { if(!isDriveAvailable( path ) ) { //used to filter locked drive - return false; + return FmErrDriveNotAvailable; } QFileInfo fileInfo( path ); @@ -322,19 +326,19 @@ } #endif if( !fileInfo.exists() ) { - return false; + return FmErrPathNotExist; } - return true; + return FmErrNone; } bool FmUtils::isDriveAvailable( const QString &path ) { #ifdef _DEBUG_DISABLE_DRIVE_D_TEST_DRIVEHIDE_ - if(path.contains("D:")) + if(path.contains(Drive_D, Qt::CaseInsensitive)) return false; #endif #ifdef _DEBUG_LOCKED_DRIVE_Z - if(path.contains("Z:")) + if(path.contains(Drive_Z, Qt::CaseInsensitive)) return false; #endif return true; @@ -346,7 +350,7 @@ foreach( QFileInfo fileInfo, infoList ) { QString driveName = fileInfo.absolutePath(); - if( checkDriveFilter( driveName ) ) { + if( checkDriveAccessFilter( driveName ) ) { if( !isHideUnAvailableDrive ) { driveList.append( driveName ); } @@ -363,29 +367,33 @@ QString ret; QString tempDriveName = fillPathWithSplash( driveName ); - ret = removePathSplash( driveName ); + QString checkedDriveName( removePathSplash( driveName ) ); FmDriverInfo driverInfo = FmUtils::queryDriverInfo( tempDriveName ); QString volumeName = driverInfo.volumeName(); if( volumeName.isEmpty() && isFillWithDefaultVolume ){ - FmDriverInfo::DriveState driveState = FmUtils::queryDriverInfo( tempDriveName ).FmDriverInfo::driveState(); - if( !( driveState & FmDriverInfo::EDriveNotPresent ) ){ + FmDriverInfo::DriveState driveState = queryDriverInfo( tempDriveName ).driveState(); + if( driveState & FmDriverInfo::EDriveAvailable ){ if( driveState & FmDriverInfo::EDriveRemovable ) { if( driveState & FmDriverInfo::EDriveMassStorage ) { - volumeName.append( QObject::tr( "Mass Storage" ) ); + // Mass Storage + ret = hbTrId( "txt_fmgr_dblist_1_mass_storage" ).arg( checkedDriveName ); + } else if( driveState & FmDriverInfo::EDriveUsbMemory ) { + // USB Memory + ret = hbTrId( "txt_fmgr_dblist_1_usb_memory" ).arg( checkedDriveName ); + } else{ + // Memory Card + ret = hbTrId( "txt_fmgr_dblist_1_memory_card" ).arg( checkedDriveName ); } - else{ - volumeName.append( QObject::tr( "Memory Card" ) ); - } - } - else{ - volumeName.append( QObject::tr( "Phone Memory" ) ); + } else{ + // phone memory + ret = hbTrId( "txt_fmgr_dblist_1_device_memory" ).arg( checkedDriveName ); } } + } else { + ret = hbTrId( "txt_fmgr_dblist_1_2" ).arg( checkedDriveName ).arg( volumeName ); } - - ret += QString( " " ) + volumeName; return ret; } @@ -478,4 +486,21 @@ return false; } return true; -} \ No newline at end of file +} + +bool FmUtils::checkNewFolderOrFile( const QString &path, QString &errString ) +{ + QFileInfo fileInfo( path ); + bool ret( true ); + if (!FmUtils::checkFolderFileName( fileInfo.fileName() ) ) { + errString = hbTrId( "Invalid file or folder name, try again!" ); + ret = false; + } else if( !FmUtils::checkMaxPathLength( path ) ) { + errString = hbTrId( "the path you specified is too long, try again!" ); + ret = false; + } else if (fileInfo.exists()) { + errString = hbTrId( "%1 already exist!" ).arg( fileInfo.fileName() ); + ret = false; + } + return ret; +} diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/tsrc/unit/unit_backuprestoresettings/src/unit_backuprestoresettings.cpp --- a/filemanager/tsrc/unit/unit_backuprestoresettings/src/unit_backuprestoresettings.cpp Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/tsrc/unit/unit_backuprestoresettings/src/unit_backuprestoresettings.cpp Tue Jul 06 14:06:28 2010 +0300 @@ -22,11 +22,18 @@ #include "fmbkupengine.h" #include +#include +#include +#include + class TestSettings: public QObject { Q_OBJECT private slots: + // init test strings those are used to verify string fetch feature of FmBackupSettings. + void initTestCase(); + void testTestSettingsContentAll(); void testTestSettingsContentOne(); void testTestSettingsContentTwo(); @@ -48,9 +55,71 @@ void cleanupTestCase(); // Finalize test data private: - FmBackupSettings *settings; + FmBackupSettings *settings; + QString mFileManagerBackupWeekdayMonday; + QString mFileManagerBackupWeekdayTuesday; + QString mFileManagerBackupWeekdayWednesday; + QString mFileManagerBackupWeekdayThursday; + QString mFileManagerBackupWeekdayFirday; + QString mFileManagerBackupWeekdaySaturday; + QString mFileManagerBackupWeekdaySunday; + + QString mFileManagerBackupScheduleNever; + QString mFileManagerBackupScheduleDaily; + QString mFileManagerBackupScheduleWeekly; + + QString mFileManagerBackupSettingsTitleContents; + QString mFileManagerBackupSettingsTitleScheduling; + QString mFileManagerBackupSettingsTitleWeekday; + QString mFileManagerBackupSettingsTitleTime; + QString mFileManagerBackupSettingsTitleTargetDrive; + + QString mFileManagerBackupSettingsContentAll; + QString mFileManagerBackupSettingsContentSettings; + QString mFileManagerBackupSettingsContentMessages; + QString mFileManagerBackupSettingsContentContacts; + QString mFileManagerBackupSettingsContentCalendar; + QString mFileManagerBackupSettingsContentBookmarks; + QString mFileManagerBackupSettingsContentUserFiles; }; +void TestSettings::initTestCase() +{ + // install translator + QTranslator translator; + QString lang = QLocale::system().name(); + QString path = "z:/resource/qt/translations/"; + translator.load( path + "filemanager_" + lang ); + QCoreApplication::installTranslator(&translator); + + // init localized string + mFileManagerBackupWeekdayMonday = hbTrId( "Monday" ); + mFileManagerBackupWeekdayTuesday = hbTrId( "Tuesday" ); + mFileManagerBackupWeekdayWednesday = hbTrId( "Wednesday" ); + mFileManagerBackupWeekdayThursday = hbTrId( "Thursday" ); + mFileManagerBackupWeekdayFirday = hbTrId( "Friday" ); + mFileManagerBackupWeekdaySaturday = hbTrId( "Saturday" ); + mFileManagerBackupWeekdaySunday = hbTrId( "Sunday" ); + + mFileManagerBackupScheduleNever = hbTrId( "Never" ); + mFileManagerBackupScheduleDaily = hbTrId( "Daily" ); + mFileManagerBackupScheduleWeekly = hbTrId( "Weekly" ); + + mFileManagerBackupSettingsTitleContents = hbTrId( "Backup Contents" ); + mFileManagerBackupSettingsTitleScheduling = hbTrId( "Backup scheduling" ); + mFileManagerBackupSettingsTitleWeekday = hbTrId( "Weekday" ); + mFileManagerBackupSettingsTitleTime = hbTrId( "Time" ); + mFileManagerBackupSettingsTitleTargetDrive = hbTrId( "Backup destination" ); + + mFileManagerBackupSettingsContentAll = hbTrId( "All" ); + mFileManagerBackupSettingsContentSettings = hbTrId( "Settings" ); + mFileManagerBackupSettingsContentMessages = hbTrId( "Messages" ); + mFileManagerBackupSettingsContentContacts = hbTrId( "Contacts" ); + mFileManagerBackupSettingsContentCalendar = hbTrId( "Calendar" ); + mFileManagerBackupSettingsContentBookmarks = hbTrId( "Bookmarks" ); + mFileManagerBackupSettingsContentUserFiles = hbTrId( "Files" ); +} + void TestSettings::cleanupTestCase() { QCoreApplication::processEvents(); @@ -89,27 +158,27 @@ { case FmBackupEntry::EContents: { - QVERIFY( entry->title() == constFileManagerBackupSettingsTitleContents ); + QVERIFY( entry->title() == mFileManagerBackupSettingsTitleContents ); break; } case FmBackupEntry::EScheduling: { - QVERIFY( entry->title() == constFileManagerBackupSettingsTitleScheduling ); + QVERIFY( entry->title() == mFileManagerBackupSettingsTitleScheduling ); break; } case FmBackupEntry::EWeekday: { - QVERIFY( entry->title() == constFileManagerBackupSettingsTitleWeekday ); + QVERIFY( entry->title() == mFileManagerBackupSettingsTitleWeekday ); break; } case FmBackupEntry::ETime: { - QVERIFY( entry->title() == constFileManagerBackupSettingsTitleTime ); + QVERIFY( entry->title() == mFileManagerBackupSettingsTitleTime ); break; } case FmBackupEntry::ETarget: { - QVERIFY( entry->title() == constFileManagerBackupSettingsTitleTargetDrive ); + QVERIFY( entry->title() == mFileManagerBackupSettingsTitleTargetDrive ); break; } @@ -188,13 +257,13 @@ QTest::addColumn("param"); QTest::addColumn("value"); - QTest::newRow("contentToString_0") << (quint32)FmBackupSettings::EFileManagerBackupContentAll << constFileManagerBackupSettingsContentAll; - QTest::newRow("contentToString_1") << (quint32)FmBackupSettings::EFileManagerBackupContentSettings << constFileManagerBackupSettingsContentSettings; - QTest::newRow("contentToString_2") << (quint32)FmBackupSettings::EFileManagerBackupContentMessages << constFileManagerBackupSettingsContentMessages; - QTest::newRow("contentToString_3") << (quint32)FmBackupSettings::EFileManagerBackupContentContacts << constFileManagerBackupSettingsContentContacts; - QTest::newRow("contentToString_4") << (quint32)FmBackupSettings::EFileManagerBackupContentCalendar << constFileManagerBackupSettingsContentCalendar; - QTest::newRow("contentToString_5") << (quint32)FmBackupSettings::EFileManagerBackupContentBookmarks << constFileManagerBackupSettingsContentBookmarks; - QTest::newRow("contentToString_6") << (quint32)FmBackupSettings::EFileManagerBackupContentUserFiles << constFileManagerBackupSettingsContentUserFiles; + QTest::newRow("contentToString_0") << (quint32)FmBackupSettings::EFileManagerBackupContentAll << mFileManagerBackupSettingsContentAll; + QTest::newRow("contentToString_1") << (quint32)FmBackupSettings::EFileManagerBackupContentSettings << mFileManagerBackupSettingsContentSettings; + QTest::newRow("contentToString_2") << (quint32)FmBackupSettings::EFileManagerBackupContentMessages << mFileManagerBackupSettingsContentMessages; + QTest::newRow("contentToString_3") << (quint32)FmBackupSettings::EFileManagerBackupContentContacts << mFileManagerBackupSettingsContentContacts; + QTest::newRow("contentToString_4") << (quint32)FmBackupSettings::EFileManagerBackupContentCalendar << mFileManagerBackupSettingsContentCalendar; + QTest::newRow("contentToString_5") << (quint32)FmBackupSettings::EFileManagerBackupContentBookmarks << mFileManagerBackupSettingsContentBookmarks; + QTest::newRow("contentToString_6") << (quint32)FmBackupSettings::EFileManagerBackupContentUserFiles << mFileManagerBackupSettingsContentUserFiles; } void TestSettings::testSchedulingToString() @@ -211,9 +280,9 @@ QTest::addColumn("param"); QTest::addColumn("value"); - QTest::newRow("schedulingToString_0") << (int)FmBackupSettings::EFileManagerBackupScheduleNever << constFileManagerBackupScheduleNever; - QTest::newRow("schedulingToString_1") << (int)FmBackupSettings::EFileManagerBackupScheduleDaily << constFileManagerBackupScheduleDaily; - QTest::newRow("schedulingToString_2") << (int)FmBackupSettings::EFileManagerBackupScheduleWeekly << constFileManagerBackupScheduleWeekly; + QTest::newRow("schedulingToString_0") << (int)FmBackupSettings::EFileManagerBackupScheduleNever << mFileManagerBackupScheduleNever; + QTest::newRow("schedulingToString_1") << (int)FmBackupSettings::EFileManagerBackupScheduleDaily << mFileManagerBackupScheduleDaily; + QTest::newRow("schedulingToString_2") << (int)FmBackupSettings::EFileManagerBackupScheduleWeekly << mFileManagerBackupScheduleWeekly; } void TestSettings::testWeekdayToString() @@ -230,13 +299,13 @@ QTest::addColumn("param"); QTest::addColumn("value"); - QTest::newRow("weekdayToString_0") << (int)FmBackupSettings::EFileManagerBackupWeekdayMonday << constFileManagerBackupWeekdayMonday; - QTest::newRow("weekdayToString_1") << (int)FmBackupSettings::EFileManagerBackupWeekdayTuesday << constFileManagerBackupWeekdayTuesday; - QTest::newRow("weekdayToString_2") << (int)FmBackupSettings::EFileManagerBackupWeekdayWednesday << constFileManagerBackupWeekdayWednesday; - QTest::newRow("weekdayToString_3") << (int)FmBackupSettings::EFileManagerBackupWeekdayThursday << constFileManagerBackupWeekdayThursday; - QTest::newRow("weekdayToString_4") << (int)FmBackupSettings::EFileManagerBackupWeekdayFriday << constFileManagerBackupWeekdayFirday; - QTest::newRow("weekdayToString_5") << (int)FmBackupSettings::EFileManagerBackupWeekdaySaturday << constFileManagerBackupWeekdaySaturday; - QTest::newRow("weekdayToString_6") << (int)FmBackupSettings::EFileManagerBackupWeekdaySunday << constFileManagerBackupWeekdaySunday; + QTest::newRow("weekdayToString_0") << (int)FmBackupSettings::EFileManagerBackupWeekdayMonday << mFileManagerBackupWeekdayMonday; + QTest::newRow("weekdayToString_1") << (int)FmBackupSettings::EFileManagerBackupWeekdayTuesday << mFileManagerBackupWeekdayTuesday; + QTest::newRow("weekdayToString_2") << (int)FmBackupSettings::EFileManagerBackupWeekdayWednesday << mFileManagerBackupWeekdayWednesday; + QTest::newRow("weekdayToString_3") << (int)FmBackupSettings::EFileManagerBackupWeekdayThursday << mFileManagerBackupWeekdayThursday; + QTest::newRow("weekdayToString_4") << (int)FmBackupSettings::EFileManagerBackupWeekdayFriday << mFileManagerBackupWeekdayFirday; + QTest::newRow("weekdayToString_5") << (int)FmBackupSettings::EFileManagerBackupWeekdaySaturday << mFileManagerBackupWeekdaySaturday; + QTest::newRow("weekdayToString_6") << (int)FmBackupSettings::EFileManagerBackupWeekdaySunday << mFileManagerBackupWeekdaySunday; } diff -r b3155376f2b4 -r 6e96d2143d46 filemanager/tsrc/unit/unit_backuprestoresettings/unit_backuprestoresettings.pro --- a/filemanager/tsrc/unit/unit_backuprestoresettings/unit_backuprestoresettings.pro Wed Jun 23 18:03:11 2010 +0300 +++ b/filemanager/tsrc/unit/unit_backuprestoresettings/unit_backuprestoresettings.pro Tue Jul 06 14:06:28 2010 +0300 @@ -17,12 +17,15 @@ QT += testlib CONFIG += qtestlib CONFIG += symbian_test +CONFIG += hb TEMPLATE = app TARGET = include ( ../../../src/inc/commoninc.pri ) +include ( ../../../src/common.pri ) DEPENDPATH += . INCLUDEPATH += . INCLUDEPATH += ../../../src/fmbkupenginewrapper/inc +INCLUDEPATH += ../../../src/inc TARGET.CAPABILITY = ALL -TCB # Input SOURCES += src/unit_backuprestoresettings.cpp