Changeset eaddb04


Ignore:
Timestamp:
Apr 19, 2013 11:07:31 AM (15 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.1-release, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
519a2c9
Parents:
c7d9445
Message:

Make sure that EasyPBI checks/creates any of a PBI modules subdirectories as needed whenever a new file needs to be created.

Location:
src-qt4/EasyPBI
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/EasyPBI/modBuild.cpp

    r1620346 readdb04  
    431431bool ModBuild::writeMenu(){ 
    432432  //Get the path to the file 
    433   QString fileName = modulePath + "/xdg-menu/" + saveMenuFile; 
     433  QString dir = modulePath + "/xdg-menu/"; 
     434  createDir(dir); //make sure the xdg-menu directory exists 
     435  QString fileName = dir + saveMenuFile; 
    434436  //Create the XDG compliant menu entry 
    435437  QStringList contents; 
     
    517519bool ModBuild::writeDesktop(){ 
    518520  //Get the path to the file 
    519   QString fileName = modulePath + "/xdg-desktop/" + saveDesktopFile; 
     521  QString dir = modulePath + "/xdg-desktop/"; 
     522  createDir(dir); //make sure the xdg-desktop directory exists 
     523  QString fileName =  dir + saveDesktopFile; 
    520524  //Create the XDG compliant desktop entry 
    521525  QStringList contents; 
     
    595599  if(mimeStruct[2].isEmpty()){ return FALSE; } 
    596600  //Get the path to the file 
    597   QString fileName = modulePath + "/xdg-mime/" + saveMimeFile; 
     601  QString dir = modulePath + "/xdg-mime/"; 
     602  createDir(dir); //make sure the mime directory exists 
     603  QString fileName = dir + saveMimeFile; 
     604   
    598605  //Set a default mime-info if none given   
    599606  if(mimeStruct[0].isEmpty()){ 
     
    729736  //Create the full path to the location within the module   
    730737  QString newResourcePath = modulePath + "/resources/"; 
     738  createDir(newResourcePath); //make sure the resources directory exists 
    731739  if(isNewWrapper){  
    732740    newResourcePath.append("bin/");  
     
    812820   
    813821  return status; 
     822} 
     823 
     824bool ModBuild::createDir(QString dirPath){ 
     825  if(dirPath.endsWith("/")){ dirPath.chop(1); } 
     826  QDir dir(dirPath); 
     827  if(dir.exists()){ return TRUE; } 
     828  else{ return dir.mkdir(dirPath); } 
    814829} 
    815830 
  • src-qt4/EasyPBI/modBuild.h

    r1620346 readdb04  
    7070   
    7171  // --Static functions-- 
     72  static bool createDir(QString); 
    7273  static bool createFile(QString,QStringList); 
    7374  static QStringList readFile(QString); 
Note: See TracChangeset for help on using the changeset viewer.