[Lprof-devel] lprof/src/reference_inst_qt installreffile.cpp,1.14,1.15
Brought to you by:
hvengel
From: Hal E. <hv...@us...> - 2006-03-28 18:37:16
|
Update of /cvsroot/lprof/lprof/src/reference_inst_qt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21309/src/reference_inst_qt Modified Files: installreffile.cpp Log Message: Recode slotOK to eliminate c strings and other clean up. Index: installreffile.cpp =================================================================== RCS file: /cvsroot/lprof/lprof/src/reference_inst_qt/installreffile.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** installreffile.cpp 26 Mar 2006 21:55:48 -0000 1.14 --- installreffile.cpp 28 Mar 2006 18:37:01 -0000 1.15 *************** *** 90,95 **** void InstallRefFile::slotOK() { ! char ref_file[128]; ! char ref_temp[128]; // pull file names out of the dialog --- 90,95 ---- void InstallRefFile::slotOK() { ! QString ref_file; ! QString ref_temp; // pull file names out of the dialog *************** *** 97,120 **** // files.items.targetFile=TargetSelector->getFilename().mid(TargetSelector->Dir.length(), TargetSelector->getFilename().length()); files.items.templateFile=SelectTemplate->getFilename(); ! strcpy(ref_temp, dirs.ref_dir.local8Bit()); ! strcat(ref_temp, "/"); ! strcat(ref_temp, TargetSelector->getFilename().mid(TargetSelector->Dir.length(), TargetSelector->getFilename().length())); files.items.targetFile=ref_temp; // write new reference file to the reference file directory // Needs work to make it portable to Windows and Mac ! # ifdef __WIN32__ ! strcpy(ref_file, "copy \""); // Windows port ! # else ! strcpy(ref_file, "cp \""); ! # endif /* __WIN32__ */ // Inclose the file names in "" in case there are spaces in the file names ! strcat(ref_file,QDir::convertSeparators(TargetSelector->getFilename().local8Bit())); ! strcat(ref_file, "\" \""); ! strcat(ref_file,QDir::convertSeparators(files.items.targetFile.local8Bit())); ! strcat(ref_file, "\""); ! system(ref_file); // pass new reference file/template info back to main dialog files.put(files); --- 97,120 ---- // files.items.targetFile=TargetSelector->getFilename().mid(TargetSelector->Dir.length(), TargetSelector->getFilename().length()); files.items.templateFile=SelectTemplate->getFilename(); ! ref_temp = dirs.ref_dir + "/" + ! TargetSelector->getFilename().mid(TargetSelector->Dir.length(), ! TargetSelector->getFilename().length()); ! // will leave /'s in directory file name for QSettings files.items.targetFile=ref_temp; // write new reference file to the reference file directory // Needs work to make it portable to Windows and Mac ! # ifdef __WIN32__ ! ref_file = "copy \""; // Windows port ! # else ! ref_file = "cp \""; ! # endif /* __WIN32__ */ // Inclose the file names in "" in case there are spaces in the file names ! ref_file = QDir::convertSeparators(ref_file + TargetSelector->getFilename()) + ! "\" \"" + QDir::convertSeparators(files.items.targetFile) + "\""; ! // copy the reference file to ~/.lprof/target_refs ! system(ref_file.local8Bit()); // pass new reference file/template info back to main dialog files.put(files); |