Commit 3ed5dc88 authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot

Merge topic 'branded-source-cleanup'

86fae7ad pqAboutDialog: add missing parenthesis
6b643301 branded_paraview_initializer: remove legacy code
a587aba1 branded_paraview_initializer: use nullptr
84c42816 branded_paraview_initializer: remove trailing whitespace
6e84b6f9 branded_paraview_main: use vtksys for environment bits
78572da0 branded_paraview_main: use return codes from the stdlib
217d8e16 branded_paraview: fix brace placement
954d70f4 branded_paraview: remove excess comments
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Utkarsh Ayachit's avatarUtkarsh Ayachit <utkarsh.ayachit@kitware.com>
Merge-request: !2923
parents 0e9e78b6 86fae7ad
Pipeline #125349 failed with stage
in 0 seconds
......@@ -314,11 +314,6 @@ FUNCTION(build_paraview_client BPC_NAME)
pq${BPC_NAME}Initializer)
ENDIF ()
if (MINGW)
# needed for dupenv_s
target_link_libraries (${BPC_NAME} LINK_PRIVATE msvcr90)
endif ()
if (pv_exe_suffix)
install(TARGETS ${BPC_NAME}
RUNTIME DESTINATION "${BPC_INSTALL_LIBRARY_DIR}"
......
......@@ -58,23 +58,24 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//-----------------------------------------------------------------------------
pq@BPC_NAME@Initializer::pq@BPC_NAME@Initializer()
{
this->PVApp = NULL;
this->MainWindow = NULL;
this->Splash = NULL;
this->PVApp = nullptr;
this->MainWindow = nullptr;
this->Splash = nullptr;
}
//-----------------------------------------------------------------------------
pq@BPC_NAME@Initializer::~pq@BPC_NAME@Initializer()
{
delete this->Splash;
this->Splash = NULL;
this->Splash = nullptr;
delete this->MainWindow;
this->MainWindow = NULL;
this->MainWindow = nullptr;
delete this->PVApp;
this->PVApp = 0;
this->PVApp = nullptr;
}
//-----------------------------------------------------------------------------
pq@BPC_NAME@Initializer::Status pq@BPC_NAME@Initializer::Initialize(int argc, char* argv[])
{
......@@ -85,15 +86,15 @@ pq@BPC_NAME@Initializer::Status pq@BPC_NAME@Initializer::Initialize(int argc, ch
if (this->PVApp->getOptions()->GetUnknownArgument() ||
this->PVApp->getOptions()->GetErrorMessage())
{
{
return ExitFailure;
}
}
if (this->PVApp->getOptions()->GetHelpSelected() ||
this->PVApp->getOptions()->GetTellVersion())
{
{
return ExitSuccess;
}
}
#ifndef BUILD_SHARED_LIBS
@ui_resource_init@
......@@ -103,22 +104,15 @@ pq@BPC_NAME@Initializer::Status pq@BPC_NAME@Initializer::Initialize(int argc, ch
pqSettings *settings = this->PVApp->settings();
if (this->PVApp->getOptions()->GetDisableRegistry() == false &&
settings->value("GeneralSettings.ShowSplashScreen", true).toBool())
{
{
// Create and show the splash screen as the main window is being created.
QPixmap pixmap(BPC_SPLASH_RESOURCE);
this->Splash = new QSplashScreen(pixmap, Qt::WindowStaysOnTopHint);
this->Splash->setMask(pixmap.createMaskFromColor(QColor(Qt::transparent)));
this->Splash->show();
}
}
#endif
// Not sure why this is needed. Andy added this ages ago with comment saying
// needed for Mac apps. Need to check that it's indeed still required.
QDir dir(QApplication::applicationDirPath());
dir.cdUp();
dir.cd("Plugins");
QApplication::addLibraryPath(dir.absolutePath());
// Create main window.
this->MainWindow = new @BPC_PVMAIN_WINDOW@();
......@@ -127,10 +121,10 @@ pq@BPC_NAME@Initializer::Status pq@BPC_NAME@Initializer::Initialize(int argc, ch
QStringList plugin_list = plugin_string.split(';',QString::SkipEmptyParts);
QString plugin_xml = "<Plugins>";
foreach (const QString plugin_name, plugin_list)
{
{
plugin_xml.append(
QString("<Plugin name=\"%1\" auto_load=\"1\" />\n").arg(plugin_name));
}
}
plugin_xml.append("</Plugins>\n");
vtkPVPluginTracker::GetInstance()->LoadPluginConfigurationXMLFromString(
plugin_xml.toLatin1().data());
......@@ -140,10 +134,10 @@ pq@BPC_NAME@Initializer::Status pq@BPC_NAME@Initializer::Initialize(int argc, ch
plugin_list = plugin_string.split(';',QString::SkipEmptyParts);
plugin_xml = "<Plugins>";
foreach (const QString plugin_name, plugin_list)
{
{
plugin_xml.append(
QString("<Plugin name=\"%1\" auto_load=\"1\" />\n").arg(plugin_name));
}
}
plugin_xml.append("</Plugins>\n");
vtkPVPluginTracker::GetInstance()->LoadPluginConfigurationXMLFromString(
plugin_xml.toLatin1().data());
......@@ -155,9 +149,9 @@ pq@BPC_NAME@Initializer::Status pq@BPC_NAME@Initializer::Initialize(int argc, ch
QDir dir2(":/@BPC_NAME@/Configuration");
QStringList files = dir2.entryList(QDir::Files);
foreach (QString file, files)
{
{
this->PVApp->loadConfiguration(QString(":/@BPC_NAME@/Configuration/") + file);
}
}
#endif
#if @BPC_HAS_TITLE@
this->MainWindow->setWindowTitle("@BPC_TITLE@");
......@@ -177,9 +171,8 @@ pq@BPC_NAME@Initializer::Status pq@BPC_NAME@Initializer::Initialize(int argc, ch
// resumes hence these processEvents are fairly useless.
this->MainWindow->show();
if (this->Splash)
{
{
this->Splash->finish(this->MainWindow);
}
}
return RunApplication;
}
// ***************** DO NOT EDIT ***********************************
// ***************** DO NOT EDIT ***********************************
// This is a generated file.
// This is a generated file.
// It will be replaced next time you rebuild.
/*=========================================================================
......@@ -10,7 +10,7 @@
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
......@@ -44,11 +44,11 @@ class pq@BPC_NAME@Initializer
{
public:
enum Status
{
{
ExitSuccess,
ExitFailure,
RunApplication
};
};
pq@BPC_NAME@Initializer();
~pq@BPC_NAME@Initializer();
......
......@@ -32,9 +32,6 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
// ***************** DO NOT EDIT ***********************************
// This is a generated file.
// It will be replaced next time you rebuild.
#include <QApplication>
#include <QLocale>
......@@ -55,38 +52,22 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <clocale>
#include <stdlib.h>
namespace
{
// Return true when \a vname exists in the environment (empty or not).
static bool checkenv(const char* vname)
{
#if !defined(_WIN32) || defined(__CYGWIN__)
return getenv(vname) ? true : false;
#else
char* buf; //allocated or assigned by _dupenv_s
const bool valid = (_dupenv_s(&buf, NULL, vname) == 0) && (buf != NULL);
free(buf); //perfectly valid to free a NULL pointer
return valid;
#endif
}
}
int main(int argc, char* argv[])
{
// Here's the point to change default style, if you'd like e.g.
// QApplication::setStyle(QStyleFactory::create("plastique"));
// When playing tests, disable all effects.
if (checkenv("DART_TEST_FROM_DART") ||
checkenv("DASHBOARD_TEST_FROM_CTEST"))
{
if (vtksys::SystemTools::HasEnv("DART_TEST_FROM_DART") ||
vtksys::SystemTools::HasEnv("DASHBOARD_TEST_FROM_CTEST"))
{
QApplication::setDesktopSettingsAware(false);
QApplication::setEffectEnabled(Qt::UI_AnimateMenu, false);
QApplication::setEffectEnabled(Qt::UI_FadeMenu, false);
QApplication::setEffectEnabled(Qt::UI_AnimateCombo, false);
QApplication::setEffectEnabled(Qt::UI_AnimateTooltip, false);
QApplication::setEffectEnabled(Qt::UI_FadeTooltip, false);
}
}
QApplication::setApplicationName("@BPC_APPLICATION_NAME@");
QApplication::setApplicationVersion("@BPC_VERSION_MAJOR@.@BPC_VERSION_MINOR@.@BPC_VERSION_PATCH@");
......@@ -112,14 +93,12 @@ int main(int argc, char* argv[])
pq@BPC_NAME@Initializer pvInitializer;
pq@BPC_NAME@Initializer::Status status = pvInitializer.Initialize(argc, argv);
switch (status)
{
{
case pq@BPC_NAME@Initializer::ExitSuccess:
return 0;
return EXIT_SUCCESS;
case pq@BPC_NAME@Initializer::ExitFailure:
return 1;
return EXIT_FAILURE;
case pq@BPC_NAME@Initializer::RunApplication:
return qtapp.exec();
}
}
}
// ***************** DO NOT EDIT ***********************************
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment