Remove dependence on Qt/STL support.

This commit is contained in:
Clinton Stimpson 2009-11-23 17:30:00 -05:00
parent 574902fef2
commit b3023d2587
1 changed files with 15 additions and 15 deletions

View File

@ -33,8 +33,8 @@ QMacInstallDialog::~QMacInstallDialog()
void QMacInstallDialog::DoInstall() void QMacInstallDialog::DoInstall()
{ {
QDir installDir(this->Internals->InstallPrefix->text()); QDir installDir(this->Internals->InstallPrefix->text());
std::string installTo = installDir.path().toStdString(); QString installTo = installDir.path();
if(!cmSystemTools::FileExists(installTo.c_str())) if(!cmSystemTools::FileExists(installTo.toAscii().data()))
{ {
QString message = tr("Build install does not exist, " QString message = tr("Build install does not exist, "
"should I create it?") "should I create it?")
@ -47,7 +47,7 @@ void QMacInstallDialog::DoInstall()
QMessageBox::Yes | QMessageBox::No); QMessageBox::Yes | QMessageBox::No);
if(btn == QMessageBox::Yes) if(btn == QMessageBox::Yes)
{ {
cmSystemTools::MakeDirectory(installTo.c_str()); cmSystemTools::MakeDirectory(installTo.toAscii().data());
} }
} }
QDir cmExecDir(QApplication::applicationDirPath()); QDir cmExecDir(QApplication::applicationDirPath());
@ -56,24 +56,24 @@ void QMacInstallDialog::DoInstall()
for (int i = 0; i < list.size(); ++i) for (int i = 0; i < list.size(); ++i)
{ {
QFileInfo fileInfo = list.at(i); QFileInfo fileInfo = list.at(i);
std::string filename = fileInfo.fileName().toStdString(); QString filename = fileInfo.fileName();
if(filename.size() && filename[0] == '.') if(filename.size() && filename[0] == '.')
{ {
continue; continue;
} }
std::string file = fileInfo.absoluteFilePath().toStdString(); QString file = fileInfo.absoluteFilePath();
std::string newName = installTo; QString newName = installTo;
newName += "/"; newName += "/";
newName += filename; newName += filename;
// Remove the old files // Remove the old files
if(cmSystemTools::FileExists(newName.c_str())) if(cmSystemTools::FileExists(newName.toAscii().data()))
{ {
std::cout << "rm [" << newName << "]\n"; std::cout << "rm [" << newName.toAscii().data() << "]\n";
if(!cmSystemTools::RemoveFile(newName.c_str())) if(!cmSystemTools::RemoveFile(newName.toAscii().data()))
{ {
QString message = tr("Failed to remove file " QString message = tr("Failed to remove file "
"installation may be incomplete: "); "installation may be incomplete: ");
message += newName.c_str(); message += newName.toAscii().data();
QString title = tr("Error Removing file"); QString title = tr("Error Removing file");
QMessageBox::StandardButton btn = QMessageBox::StandardButton btn =
QMessageBox::critical(this, title, message, QMessageBox::critical(this, title, message,
@ -84,14 +84,14 @@ void QMacInstallDialog::DoInstall()
} }
} }
} }
std::cout << "ln -s [" << file << "] ["; std::cout << "ln -s [" << file.toAscii().data() << "] [";
std::cout << newName << "]\n"; std::cout << newName.toAscii().data() << "]\n";
if(!cmSystemTools::CreateSymlink(file.c_str(), if(!cmSystemTools::CreateSymlink(file.toAscii().data(),
newName.c_str())) newName.toAscii().data()))
{ {
QString message = tr("Failed create symlink " QString message = tr("Failed create symlink "
"installation may be incomplete: "); "installation may be incomplete: ");
message += newName.c_str(); message += newName.toAscii().data();
QString title = tr("Error Creating Symlink"); QString title = tr("Error Creating Symlink");
QMessageBox::StandardButton btn = QMessageBox::StandardButton btn =
QMessageBox::critical(this, title, message, QMessageBox::critical(this, title, message,