Ejemplo n.º 1
0
void CMMCStorageStatus::RunL()
{
#ifdef SYMBIAN_3_1
    TDriveInfo driveInfo;
    TDriveNumber driveLetter = EDriveE;  // Have to use hardcoded MMC drive letter for 3.1
    if (iFs.Drive(driveInfo, driveLetter) == KErrNone) {
        bool driveInserted = false;

        switch (driveInfo.iType) {
        case EMediaNotPresent:
            driveInserted = false;
            break;
        default:
            driveInserted = true;
            break;
        }

        TChar volumeChar;
        QString volume;
        if (RFs::DriveToChar(driveLetter, volumeChar) == KErrNone)
            volume = QChar(volumeChar).toAscii();

        foreach (MStorageStatusObserver *observer, m_observers)
            observer->storageStatusChanged(driveInserted, volume);
    }
#else // SYMBIAN_3_1
    CompareDriveLists(PopulateDriveList());
#endif // SYMBIAN_3_1
    startMonitoring();
}
Ejemplo n.º 2
0
QDriveWatcherEngine::QDriveWatcherEngine(QDriveWatcher *watcher)
    : CActive(EPriorityStandard),
      m_watcher(watcher)
{
    CActiveScheduler::Add(this);

    if (iFs.Connect() == KErrNone) {
#ifndef SYMBIAN_3_1
        m_previousDriveList.Copy(PopulateDriveList());
#endif
        startMonitoring();
    }
}
Ejemplo n.º 3
0
CMMCStorageStatus::CMMCStorageStatus() : CActive(EPriorityStandard),
m_previousDriveList(TDriveList())
{
TRACES ( qDebug() << "CMMCStorageStatus::CMMCStorageStatus++");
    CActiveScheduler::Add(this);
    if (iFs.Connect() == KErrNone && iFs.ShareProtected() == KErrNone) {
#ifndef SYMBIAN_3_1
        m_previousDriveList.Copy(PopulateDriveList());
#endif //SYMBIAN_3_1
        startMonitoring();
    }
TRACES ( qDebug() << "CMMCStorageStatus::CMMCStorageStatus--");
}
Ejemplo n.º 4
0
void QDriveWatcherEngine::RunL()
{
#ifdef SYMBIAN_3_1
    TDriveInfo driveInfo;
    TDriveNumber driveLetter = EDriveE;  // Have to use hardcoded MMC drive letter for 3.1
    if (iFs.Drive(driveInfo, driveLetter) == KErrNone) {
        bool driveInserted = driveInfo.iType != EMediaNotPresent;

        TChar volumeChar;
        QString volume;
        if (RFs::DriveToChar(driveLetter, volumeChar) == KErrNone)
            volume = QChar(volumeChar).toLatin1();

        foreach (MStorageStatusObserver *observer, m_observers)
            observer->storageStatusChanged(driveInserted, volume);
    }
#else
    CompareDriveLists(PopulateDriveList());
#endif
    startMonitoring();
}