QTfrontend/util/HWDataManager.cpp
changeset 6196 c16e84558f71
parent 6170 2b1748161278
child 6199 582e85254110
equal deleted inserted replaced
6195:6c9ada03602d 6196:c16e84558f71
    81 
    81 
    82 
    82 
    83 QString HWDataManager::findFileForRead(
    83 QString HWDataManager::findFileForRead(
    84                                 const QString & relativeDataFilePath) const
    84                                 const QString & relativeDataFilePath) const
    85 {
    85 {
    86     QString path = userData->absolutePath()+"/"+relativeDataFilePath;
    86     QString path;
    87 
    87 
    88     if (!QFile::exists(path))
    88     if (userData != NULL)
       
    89         path = userData->absolutePath()+"/"+relativeDataFilePath;
       
    90 
       
    91     if ((!path.isEmpty()) && (!QFile::exists(path)))
    89         path = defaultData->absolutePath()+"/"+relativeDataFilePath;
    92         path = defaultData->absolutePath()+"/"+relativeDataFilePath;
    90 
    93 
    91     return path;
    94     return path;
    92 }
    95 }
    93 
    96 
    94 
    97 
    95 QFile * HWDataManager::findFileForWrite(
    98 QString HWDataManager::findFileForWrite(
    96                                 const QString & relativeDataFilePath) const
    99                                 const QString & relativeDataFilePath) const
    97 {
   100 {
    98     return new QFile(userData->absolutePath()+"/"+relativeDataFilePath);
   101     if (userData != NULL)
       
   102         return userData->absolutePath()+"/"+relativeDataFilePath;
       
   103 
       
   104 
       
   105     return "";
    99 }
   106 }
   100 
   107