qtmobility/tools/icheck/main.cpp
changeset 4 90517678cc4f
parent 1 2b40d63a9c3d
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
    63         QString err = "";
    63         QString err = "";
    64         //Extract the file name and path from the arguments
    64         //Extract the file name and path from the arguments
    65         QString interfaceHeaderFile = argv[1];
    65         QString interfaceHeaderFile = argv[1];
    66         QString checkHeaderFile = argv[2];
    66         QString checkHeaderFile = argv[2];
    67 
    67 
    68         QString curpath = QDir::currentPath();
    68         const QString curpath = QDir::currentPath();
    69         //Create FileInfos for the header files
    69         //Create FileInfos for the header files
    70         QFileInfo iFileInfo(interfaceHeaderFile);
    70         QFileInfo iFileInfo(interfaceHeaderFile);
    71         if (iFileInfo.isDir() || !iFileInfo.exists()){
    71         if (iFileInfo.isDir() || !iFileInfo.exists()){
    72             if(iFileInfo.isDir())
    72             if(iFileInfo.isDir())
    73                 err = "Cannot compare a directory: " + interfaceHeaderFile;
    73                 err = "Cannot compare a directory: " + interfaceHeaderFile;
    74             else
    74             else
    75                 err = "File does not exist: " + interfaceHeaderFile;
    75                 err = "File does not exist: " + interfaceHeaderFile;
    76         }
    76         }
    77         if(err == ""){
    77         if(err.isEmpty()){
    78             QFileInfo chFileInfo(checkHeaderFile);
    78             QFileInfo chFileInfo(checkHeaderFile);
    79             if (chFileInfo.isDir() || !chFileInfo.exists()){
    79             if (chFileInfo.isDir() || !chFileInfo.exists()){
    80                 if(chFileInfo.isDir())
    80                 if(chFileInfo.isDir())
    81                     err = "Cannot compare a directory: " + checkHeaderFile;
    81                     err = "Cannot compare a directory: " + checkHeaderFile;
    82                 else
    82                 else
    83                     err = "File does not exist: " + checkHeaderFile;
    83                     err = "File does not exist: " + checkHeaderFile;
    84             }
    84             }
    85             if(err == ""){
    85             if(err.isEmpty()){
    86                 //Read other parameters
    86                 //Read other parameters
    87                 QString outputfile;
    87                 QString outputfile;
    88                 for(int i = 3; i < argc; i++)
    88                 for(int i = 3; i < argc; i++)
    89                 {
    89                 {
    90                     //Read output file
    90                     //Read output file
   132                 else
   132                 else
   133                     cout << "Interface is full defined.";
   133                     cout << "Interface is full defined.";
   134             }
   134             }
   135         }
   135         }
   136 
   136 
   137         if(err != "") //prit out error
   137         if(!err.isEmpty()) //prit out error
   138         {
   138         {
   139             cout << endl << "Error:" << endl;
   139             cout << endl << "Error:" << endl;
   140             cout << (const char *)err.toLatin1();
   140             cout << (const char *)err.toLatin1();
   141             ret = -2;
   141             ret = -2;
   142         }
   142         }