src/hbservers/hbsplashgenerator/hbsplashdirs_p.h
changeset 34 ed14f46c0e55
parent 5 627c4a0fd0e7
equal deleted inserted replaced
31:7516d6d86cf5 34:ed14f46c0e55
    25 
    25 
    26 #ifndef HBSPLASHDIRS_P_H
    26 #ifndef HBSPLASHDIRS_P_H
    27 #define HBSPLASHDIRS_P_H
    27 #define HBSPLASHDIRS_P_H
    28 
    28 
    29 #include <QStringList>
    29 #include <QStringList>
       
    30 #include "hbsplashdefs_p.h"
    30 
    31 
    31 #ifdef Q_OS_SYMBIAN
    32 #ifdef Q_OS_SYMBIAN
    32 #include <driveinfo.h>
    33 #include <driveinfo.h>
    33 #include <coemain.h>
    34 #include <coemain.h>
    34 #endif
    35 #endif
    35 
    36 
    36 inline QString hbsplash_output_dir()
    37 inline QString hbsplash_output_dir()
    37 {
    38 {
    38 #if defined(Q_OS_SYMBIAN)
    39 #if defined(Q_OS_SYMBIAN)
    39     QString path("c:/private/2002E68B");
    40     QString path("c:/private/2002E68B/spl");
    40     TInt driveType = DriveInfo::EDefaultMassStorage;
    41     TInt driveType = DriveInfo::EDefaultMassStorage;
    41     TInt drive;
    42     TInt drive;
    42     TChar driveLetter;
    43     TChar driveLetter;
    43     if (DriveInfo::GetDefaultDrive(driveType, drive) == KErrNone
    44     if (DriveInfo::GetDefaultDrive(driveType, drive) == KErrNone
    44             && DriveInfo::GetDefaultDrive(driveType, driveLetter) == KErrNone) {
    45             && DriveInfo::GetDefaultDrive(driveType, driveLetter) == KErrNone) {
    45         bool driveUsable = true;
    46         bool driveUsable = true;
    46         CCoeEnv *env = CCoeEnv::Static();
    47         CCoeEnv *env = CCoeEnv::Static();
    47         if (env) {
    48         if (env) {
    48             TUint driveStatus;
    49             TUint driveStatus;
    49             qDebug("[hbsplash] dir selection: trying drive %d %c", drive, (char) driveLetter);
    50             splDebug("[hbsplash] dir selection: trying drive %d %c", drive, (char) driveLetter);
    50             if (DriveInfo::GetDriveStatus(env->FsSession(), drive, driveStatus) == KErrNone) {
    51             if (DriveInfo::GetDriveStatus(env->FsSession(), drive, driveStatus) == KErrNone) {
    51                 qDebug("[hbsplash] drive status is %x", driveStatus);
    52                 splDebug("[hbsplash] drive status is %x", driveStatus);
    52                 // Check if the drive is really internal (devices without internal mass
    53                 // Check if the drive is really internal (devices without internal mass
    53                 // storage will return the memory card which is not what we want here).
    54                 // storage will return the memory card which is not what we want here).
    54                 if (!(driveStatus & DriveInfo::EDriveInternal)
    55                 if (!(driveStatus & DriveInfo::EDriveInternal)
    55                         || !(driveStatus & DriveInfo::EDrivePresent)
    56                         || !(driveStatus & DriveInfo::EDrivePresent)
    56                         || !(driveStatus & DriveInfo::EDriveFormatted)
    57                         || !(driveStatus & DriveInfo::EDriveFormatted)
    57                         || (driveStatus & DriveInfo::EDriveCorrupt)
    58                         || (driveStatus & DriveInfo::EDriveCorrupt)
    58                         || (driveStatus & DriveInfo::EDriveInUse)) {
    59                         || (driveStatus & DriveInfo::EDriveInUse)) {
    59                     qDebug("[hbsplash] drive not usable, skipping");
    60                     splDebug("[hbsplash] drive not usable, skipping");
    60                     driveUsable = false;
    61                     driveUsable = false;
    61                 }
    62                 }
    62             } else {
    63             } else {
    63                 qDebug("[hbsplash] GetDriveStatus failed, skipping");
    64                 splDebug("[hbsplash] GetDriveStatus failed, skipping");
    64                 driveUsable = false;
    65                 driveUsable = false;
    65             }
    66             }
    66         }
    67         }
    67         if (driveUsable) {
    68         if (driveUsable) {
    68             path[0] = driveLetter;
    69             path[0] = driveLetter;