diff --git a/common/lc_application.cpp b/common/lc_application.cpp index d72ab366..5b7babc5 100644 --- a/common/lc_application.cpp +++ b/common/lc_application.cpp @@ -341,11 +341,11 @@ bool lcApplication::Initialize(int argc, char* argv[], const char* LibraryInstal // Load project. if (ProjectName && gMainWindow->OpenProject(ProjectName)) { - if(ModelName) + if (ModelName) lcGetActiveProject()->SetActiveModel(QString::fromUtf8(ModelName)); - if(CameraName) - gMainWindow->GetActiveView()->SetCamera(QString::fromUtf8(CameraName)); + if (CameraName) + gMainWindow->GetActiveView()->SetCamera(CameraName); if (SaveImage) { diff --git a/common/project.cpp b/common/project.cpp index 9875da27..36cc0574 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -71,8 +71,10 @@ void Project::SetActiveModel(int ModelIndex) void Project::SetActiveModel(const QString& ModelName) { - for (int ModelIdx = 0; ModelIdx < mModels.GetSize(); ModelIdx++) { - if(ModelName.compare(mModels[ModelIdx]->GetName(), Qt::CaseInsensitive) == 0) { + for (int ModelIdx = 0; ModelIdx < mModels.GetSize(); ModelIdx++) + { + if (ModelName.compare(mModels[ModelIdx]->GetName(), Qt::CaseInsensitive) == 0) + { SetActiveModel(ModelIdx); return; } diff --git a/common/view.cpp b/common/view.cpp index 9042dba6..56056ac2 100644 --- a/common/view.cpp +++ b/common/view.cpp @@ -240,12 +240,14 @@ void View::SetCamera(lcCamera* Camera, bool ForceCopy) } } -void View::SetCamera(const QString& CameraName) +void View::SetCamera(const char* CameraName) { const lcArray& Cameras = mModel->GetCameras(); - for (int CameraIdx = 0; CameraIdx < Cameras.GetSize(); CameraIdx++) { - if(CameraName.compare(QString::fromUtf8(Cameras[CameraIdx]->m_strName), Qt::CaseInsensitive) == 0) { + for (int CameraIdx = 0; CameraIdx < Cameras.GetSize(); CameraIdx++) + { + if (qstricmp(CameraName, Cameras[CameraIdx]->m_strName) == 0) + { SetCameraIndex(CameraIdx); return; } diff --git a/common/view.h b/common/view.h index 9a3ed5d3..02d4d173 100644 --- a/common/view.h +++ b/common/view.h @@ -92,7 +92,7 @@ public: void RemoveCamera(); void SetCamera(lcCamera* Camera, bool ForceCopy); - void SetCamera(const QString& CameraName); + void SetCamera(const char* CameraName); void SetCameraIndex(int Index); void SetViewpoint(lcViewpoint Viewpoint); void SetDefaultCamera();