Changeset 840
- Timestamp:
- 08/19/08 11:00:04 (3 months ago)
- Location:
- mcbuilder/trunk
- Files:
-
- 4 modified
-
include/ProjectInfo.h (modified) (1 diff)
-
src/Builder.cpp (modified) (4 diffs)
-
src/MainWindow.cpp (modified) (2 diffs)
-
src/ProjectInfo.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mcbuilder/trunk/include/ProjectInfo.h
r833 r840 79 79 int tcpSockets() { return tcpSocketEdit->text().toInt(); } 80 80 int tcpServers() { return tcpServerEdit->text().toInt(); } 81 bool load( );81 bool load( QString projectPath ); 82 82 bool diffProjects( QString newProjectPath, bool saveUiToFile = false ); 83 84 public slots:85 bool loadAndShow();86 83 87 84 signals: -
mcbuilder/trunk/src/Builder.cpp
r839 r840 52 52 loadDependencies(LIBRARIES_DIR, currentProjectPath); // this loads up the list of libraries this project depends on 53 53 if(compareConfigFile(currentProjectPath)) 54 {55 54 createConfigFile(currentProjectPath); // create a config file based on the Properties for this project 56 qDebug("builder - creating/updating config file");57 }58 55 createMakefile(currentProjectPath); // create a Makefile for this project, given the dependencies 59 56 buildStep = BUILD; … … 65 62 start(makePath + "make"); 66 63 QString buildmsg("***************************************************************\n"); 67 buildmsg += " mcbuilder - building "+ dir.dirName() + "\n";64 buildmsg += tr(" mcbuilder - building ") + dir.dirName() + "\n"; 68 65 buildmsg += QDateTime::currentDateTime().toString(" MMM d, yyyy h:m ap") + "\n"; 69 66 buildmsg += "***************************************************************"; … … 76 73 void Builder::clean(QString projectName) 77 74 { 78 currentProjectPath = projectName; 79 QDir buildDir(ensureBuildDirExists(currentProjectPath)); 75 QDir buildDir(ensureBuildDirExists(projectName)); 80 76 setWorkingDirectory(buildDir.path()); 81 if(!buildDir.exists("Makefile")) 82 createMakefile(currentProjectPath); 77 if(compareConfigFile(projectName)) 78 createConfigFile(projectName); // create a config file based on the Properties for this project 79 createMakefile(currentProjectPath); 83 80 buildStep = CLEAN; 84 81 QStringList args = QStringList() << "clean"; … … 345 342 if(configFile.open(QIODevice::WriteOnly|QFile::Text)) 346 343 { 344 qDebug("builder - creating/updating config file"); 347 345 QTextStream tofile(&configFile); 348 346 tofile << "/*****************************************************************************************" << endl << endl; -
mcbuilder/trunk/src/MainWindow.cpp
r834 r840 528 528 setWindowTitle( projectName + "[*] - mcbuilder"); 529 529 updateRecentProjects(projectPath); 530 if(projInfo->diffProjects(projectPath)) 530 // diff projects before loading the new one in 531 bool clean = projInfo->diffProjects(projectPath); 532 projInfo->load(projectPath); // but load the new one in before we clean, so the proper config and Makefiles are created 533 if(clean) 531 534 builder->clean(projectPath); 532 projInfo->load();533 535 buildLog->clear(); 534 536 } … … 778 780 if(currentProject.isEmpty()) 779 781 return statusBar()->showMessage( tr("Open a project first, or create a new one from the File menu."), 3500 ); 780 if( !projInfo->load AndShow() )782 if( !projInfo->load(currentProject) ) 781 783 { 782 784 QDir dir(currentProject); 783 785 return statusBar()->showMessage( tr("Couldn't find/open project properties for ") + dir.dirName(), 3500 ); 784 786 } 787 else 788 projInfo->show(); 785 789 } 786 790 -
mcbuilder/trunk/src/ProjectInfo.cpp
r833 r840 61 61 62 62 /* 63 Read the project ProjectInfo from the project profile, load them into64 the ProjectInfo dialog and show it.65 */66 bool ProjectInfo::loadAndShow( )67 {68 load();69 show();70 return true;71 }72 73 /*74 63 Read the project's ProjectInfo from the project file 75 64 and load them into the UI. 76 65 */ 77 bool ProjectInfo::load() 78 { 79 QString proj = mainWindow->currentProjectPath(); 80 if(proj.isEmpty()) 66 bool ProjectInfo::load( QString projectPath ) 67 { 68 if(projectPath.isEmpty()) 81 69 return false; 82 QDir projectDir(proj); 83 QString projectName = projectDir.dirName(); 84 setWindowTitle(projectName + " - Project Info"); 70 QDir projectDir(projectPath); 71 setWindowTitle(projectDir.dirName() + " - Project Info"); 85 72 86 73 // read the ProjectInfo file 87 QFile file(projectFilePath(proj ));74 QFile file(projectFilePath(projectPath)); 88 75 if(file.open(QIODevice::ReadOnly|QFile::Text)) 89 76 {
