2012-12-27 50 views

回答

0

它不是從你的問題不清楚,但它聽起來就像你正試圖以包括BAR文件茨艾倫文件。你不能這樣做。部署了BAR文件中的所有資產是由應用程序簽名和覆蓋不能改變(除了在模擬器或與一個無符號的BAR的顯影劑令牌的設備除外)。如果您需要在安裝後修改資產,請使用BAR文件部署初始版本並將其複製到數據目錄。其中一個示例程序(如果我沒有記錯,引用數據庫示例)會執行此操作。

0

如理查德說,這是直接從行情樣品應用

void CustomSqlDataSource::copyFileToDataFolder(const QString fileName) 
{ 
    // Since we need read and write access to the file, it has 
    // to be moved to a folder where we have access to it. First, 
    // we check if the file already exists (previously copied). 
    QString dataFolder = QDir::homePath(); 
    QString newFileName = dataFolder + "/" + fileName; 
    QFile newFile(newFileName); 


    if (!newFile.exists()) { 
     // If the file is not already in the data folder, we copy it from the 
     // assets folder (read only) to the data folder (read and write). 
     QString appFolder(QDir::homePath()); 
     appFolder.chop(4); 
     QString originalFileName = appFolder + "app/native/assets/" + fileName; 
     QFile originalFile(originalFileName); 

     if (originalFile.exists()) { 
      // Create sub folders if any creates the SQL folder for a file path like e.g. sql/quotesdb 
      QFileInfo fileInfo(newFileName); 
      QDir().mkpath (fileInfo.dir().path()); 

      if(!originalFile.copy(newFileName)) { 
       qDebug() << "Failed to copy file to path: " << newFileName; 
      } 
     } else { 
      qDebug() << "Failed to copy file data base file does not exists."; 
     } 
    } 

    mSourceInDataFolder = newFileName; 
}